fw_capabilities is an unsigned long bitmap filled with __set_bit(). ath6kl_init_get_fwcaps() reads it as bytes, which reports the wrong capabilities on big-endian hosts. Use test_bit() to check each capability. With 64BIT_RATES, MAP_LP_ENDPOINT and NO_IP_CHECKSUM set, a big-endian MIPS host printed "rssi-scan-thold,tx-err-notify" instead. With this patch it prints all three (tested on a QCA9563 with backports 6.18.55). Fixes: e72c27464cce ("ath6kl: print firmware capabilities") Signed-off-by: Josef Schlehofer --- drivers/net/wireless/ath/ath6kl/init.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index 6481da4c1..b91d96cb2 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c @@ -1660,18 +1660,11 @@ static const char *ath6kl_init_get_fw_capa_name(unsigned int id) static void ath6kl_init_get_fwcaps(struct ath6kl *ar, char *buf, size_t buf_len) { - u8 *data = (u8 *) ar->fw_capabilities; size_t trunc_len, len = 0; - int i, index, bit; + int i; char *trunc = "..."; for (i = 0; i < ATH6KL_FW_CAPABILITY_MAX; i++) { - index = i / 8; - bit = i % 8; - - if (index >= sizeof(ar->fw_capabilities) * 4) - break; - if (buf_len - len < 4) { ath6kl_warn("firmware capability buffer too small!\n"); @@ -1682,7 +1675,7 @@ static void ath6kl_init_get_fwcaps(struct ath6kl *ar, char *buf, size_t buf_len) return; } - if (data[index] & (1 << bit)) { + if (test_bit(i, ar->fw_capabilities)) { len += scnprintf(buf + len, buf_len - len, "%s,", ath6kl_init_get_fw_capa_name(i)); } -- 2.54.0 (Apple Git-157)