From nobody Tue Apr 8 14:01:28 2025 Received: from mx3.wp.pl (mx3.wp.pl [212.77.101.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9ED8C1A3147 for ; Sat, 5 Apr 2025 18:48:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.77.101.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743878904; cv=none; b=tqChqTz1CCa7iSIJIlATCMhseQ0gjLze8CELabjeii3MZqnY+y6dtiDpvM8xvpHPMDpuS4Y5t5VrVvDv3fFVO+HQRuzYzl2x/mtX4D9/ftL3GCCLh7mfH3mURQ/2RwPpYr3ccMbz1UBxbIkHNDPHIFLBT0DfgeVyXuXbAlCHD5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743878904; c=relaxed/simple; bh=Aw0Fjl2LGfjmnj6jsCLXEfIc+aXrL/Jx39Jr17fsb1g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SyTqhLQb8H3AJfMrpdjA3gH4fX8z708UVvNMutEejCTb+Z3Wulc4FkmmJpcmIIT+bJdqrrkD1VqcELclzuiGTB0EkHJXi9vcqXgDAQ95pp7cvcgBc7x5jzOifDvPx0T7ovHxOIASQsmHD0dX9+fI4k/PuA8zSqUWSzKfWqzOBPI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl; spf=pass smtp.mailfrom=wp.pl; dkim=pass (2048-bit key) header.d=wp.pl header.i=@wp.pl header.b=EkhOm7eb; arc=none smtp.client-ip=212.77.101.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wp.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wp.pl header.i=@wp.pl header.b="EkhOm7eb" Received: (wp-smtpd smtp.wp.pl 35058 invoked from network); 5 Apr 2025 20:48:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=20241105; t=1743878894; bh=/dtxDq+GKagSWsFC89cjsqL1xKgQwJW78+dbI6wLr5w=; h=From:To:Cc:Subject; b=EkhOm7ebbVZhmAgH8ueYuXTSFMmi6OsDxMKf/ZDYHMtelwqE+JerbeU9A0f8BGQUQ S5Y2DPahbGW9v1tgvrwMlDzngNH70RWpUL+vI/P99FrO+6vt/Pj0A0EuGR37k/7WRV 8EehL/hsAD4wnYIFAWhrF26N2Bzejyzu1bQJG7S9ztdDUatcgG8HwMrcgOQQaPbQZX cbpz5CI19C6fspHw8DggelehGMcQvkyFpl8aVV8sojV3w456S2RV6LkszUH057UFsl jJ3HpbzkMjG+ekobrSuAdZrwANwN2gBLiabQ09HlHyRgVetDkEXY05uu2VyPanYq8i PcVthNMCc1EEQ== Received: from 83.5.244.88.ipv4.supernova.orange.pl (HELO laptop-olek.home) (olek2@wp.pl@[83.5.244.88]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 5 Apr 2025 20:48:13 +0200 From: Aleksander Jan Bajkowski To: johannes@sipsolutions.net, ilan.peer@intel.com, christopher.a.wills@intel.com, slakkavalli@datto.com, john@phrozen.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Aleksander Jan Bajkowski Subject: [PATCH iw,v2 1/3] iw: fix HE capabilities on Big Endian platforms Date: Sat, 5 Apr 2025 20:48:05 +0200 Message-Id: <20250405184807.701728-2-olek2@wp.pl> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250405184807.701728-1-olek2@wp.pl> References: <20250405184807.701728-1-olek2@wp.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-WP-DKIM-Status: good (id: wp.pl) X-WP-MailID: 14c5875161ffd2af919c11b87cd50322 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000000 [wRPk] Content-Type: text/plain; charset="utf-8" IE fields are encoded in Little Endian and are not correctly printed on Big Endian platforms. Fixes: c741be9f6ca3 ("iw: print HE capabilities") Signed-off-by: Aleksander Jan Bajkowski --- util.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/util.c b/util.c index dc84886..6502788 100644 --- a/util.c +++ b/util.c @@ -1262,14 +1262,15 @@ static void __print_he_capa(const __u16 *mac_cap, =20 #define PRINT_HE_CAP(_var, _idx, _bit, _str) \ do { \ - if (_var[_idx] & BIT(_bit)) \ + if (le16toh(_var[_idx]) & BIT(_bit)) \ printf("%s\t\t\t" _str "\n", pre); \ } while (0) =20 #define PRINT_HE_CAP_MASK(_var, _idx, _shift, _mask, _str) \ do { \ - if ((_var[_idx] >> _shift) & _mask) \ - printf("%s\t\t\t" _str ": %d\n", pre, (_var[_idx] >> _shift) & _mask); \ + if ((le16toh(_var[_idx]) >> _shift) & _mask) \ + printf("%s\t\t\t" _str ": %d\n", pre, \ + (le16toh(_var[_idx]) >> _shift) & _mask); \ } while (0) =20 #define PRINT_HE_MAC_CAP(...) PRINT_HE_CAP(mac_cap, __VA_ARGS__) @@ -1280,7 +1281,7 @@ static void __print_he_capa(const __u16 *mac_cap, =20 printf("%s\t\tHE MAC Capabilities (0x", pre); for (i =3D 0; i < 3; i++) - printf("%04x", mac_cap[i]); + printf("%04x", le16toh(mac_cap[i])); printf("):\n"); =20 PRINT_HE_MAC_CAP(0, 0, "+HTC HE Supported"); @@ -1394,18 +1395,18 @@ static void __print_he_capa(const __u16 *mac_cap, char *bw[] =3D { "<=3D 80", "160", "80+80" }; int j; =20 - if ((phy_cap[0] & (phy_cap_support[i] << 8)) =3D=3D 0) + if ((le16toh(phy_cap[0]) & (phy_cap_support[i] << 8)) =3D=3D 0) continue; =20 /* Supports more, but overflow? Abort. */ - if ((i * 2 + 2) * sizeof(mcs_set[0]) >=3D mcs_len) + if ((i * 2 + 2) * sizeof(le16toh(mcs_set[0])) >=3D mcs_len) return; =20 for (j =3D 0; j < 2; j++) { int k; printf("%s\t\tHE %s MCS and NSS set %s MHz\n", pre, j ? "TX" : "RX", bw= [i]); for (k =3D 0; k < 8; k++) { - __u16 mcs =3D mcs_set[(i * 2) + j]; + __u16 mcs =3D le16toh(mcs_set[(i * 2) + j]); mcs >>=3D k * 2; mcs &=3D 0x3; printf("%s\t\t\t%d streams: ", pre, k + 1); @@ -1428,7 +1429,7 @@ static void __print_he_capa(const __u16 *mac_cap, ppet_len =3D 0; } =20 - if (ppet_len && (phy_cap[3] & BIT(15))) { + if (ppet_len && (le16toh(phy_cap[3]) & BIT(15))) { printf("%s\t\tPPE Threshold ", pre); for (i =3D 0; i < ppet_len; i++) if (ppet[i]) --=20 2.39.5 From nobody Tue Apr 8 14:01:28 2025 Received: from mx4.wp.pl (mx4.wp.pl [212.77.101.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2105B1C4A0A for ; Sat, 5 Apr 2025 18:48:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.77.101.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743878907; cv=none; b=MgLQwsXhRZGxLZUT/++TbYsq1AaXBgek6ojiHm0pMXFWDmuyCae46yJf+FytECyqcYnAWQkVVLW9DQlzcy8dXaRITp7M1dhgDCui7zDl65Owcj7D4PRe4JQZSvPrkcghy9cT+SceFSVP0XuSFQmDmf2xg/6Blj5hhAAAWfm11v0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743878907; c=relaxed/simple; bh=r7Z9lOOkSxpN+ucW+Gp2u+rGkC79BlG1EH70EKPgKrE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CoadVrkl+7w32QbuaEPgfo9qbo8yi7Rwu0qeOLdLgUTbWAIxQArUZvzxx1zhnw3gL3hf7sMRCCAXkAa3wZ4aYTU0diIeH5jKRuKWsBC5oze/QSDVhgzl1HSicxlhw6H2qzKxI1no0Y7wewtm5cTkSDZwZspUrgUQIlxZHVA+qUA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl; spf=pass smtp.mailfrom=wp.pl; dkim=pass (2048-bit key) header.d=wp.pl header.i=@wp.pl header.b=IY4eatyj; arc=none smtp.client-ip=212.77.101.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wp.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wp.pl header.i=@wp.pl header.b="IY4eatyj" Received: (wp-smtpd smtp.wp.pl 36002 invoked from network); 5 Apr 2025 20:48:16 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=20241105; t=1743878896; bh=8900mW7m6CxNPXhte/uesbW94QRwJGoXjpY9qylqeaI=; h=From:To:Cc:Subject; b=IY4eatyjNNyH/kBUrEcFC7/EebYKxVmHw34qA0CtJq6a3YAQ9723UNrXqBgrB9zui DHxv26QOxMo+KYgyRkk+CUUKfsPY3fTnbftf7FKc9WQdmM6odg/eUXmD5k+5F8ejVS U1ZdflSAB7gWBIGrPXz2OaqoPwyZJkSVvnNgnpDoUrvnJ/Yc4hHtrh0ARdGgzMhzBl 7KPo38/c8AFnUHDDCbxb5TZEGcu2T5EeMFC1lTCByDsC4L6KJkl4pBLWvvms9lpRBK a6ZiRNl7pC+KUokLAVRIxs6ipdapVWEBXtKicylbgIra8GEPM7ZW7RGlc/2XWANSqE bgh04St8JZCMA== Received: from 83.5.244.88.ipv4.supernova.orange.pl (HELO laptop-olek.home) (olek2@wp.pl@[83.5.244.88]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 5 Apr 2025 20:48:16 +0200 From: Aleksander Jan Bajkowski To: johannes@sipsolutions.net, ilan.peer@intel.com, christopher.a.wills@intel.com, slakkavalli@datto.com, john@phrozen.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Aleksander Jan Bajkowski Subject: [PATCH iw,v2 2/3] iw: fix HE operation on Big Endian platforms Date: Sat, 5 Apr 2025 20:48:06 +0200 Message-Id: <20250405184807.701728-3-olek2@wp.pl> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250405184807.701728-1-olek2@wp.pl> References: <20250405184807.701728-1-olek2@wp.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-WP-DKIM-Status: good (id: wp.pl) X-WP-MailID: 1fb8fe2d7877ab1a9e4aa322aa28f15f X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000001 [wbKh] Content-Type: text/plain; charset="utf-8" IE fields are encoded in Little Endian and are not correctly printed on Big Endian platforms. Fixes: 422419e06d55 ("scan: Add printing of HE Operation Element") Signed-off-by: Aleksander Jan Bajkowski --- util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util.c b/util.c index 6502788..1870393 100644 --- a/util.c +++ b/util.c @@ -1755,7 +1755,7 @@ void print_he_operation(const uint8_t *ie, int len) { uint8_t oper_parameters[3] =3D {ie[0], ie[1], ie[2] }; uint8_t bss_color =3D ie[3]; - uint16_t nss_mcs_set =3D *(uint16_t*)(&ie[4]); + uint16_t nss_mcs_set =3D le16toh(*(uint16_t *)(&ie[4])); uint8_t vht_oper_present =3D oper_parameters[1] & 0x40; uint8_t co_hosted_bss_present =3D oper_parameters[1] & 0x80; uint8_t uhb_operation_info_present =3D oper_parameters[2] & 0x02; @@ -1768,7 +1768,7 @@ void print_he_operation(const uint8_t *ie, int len) printf("\t\t\tTWT Required\n"); =20 printf("\t\t\tTXOP Duration RTS Threshold: %hu\n", - (*(uint16_t*)(oper_parameters)) >> 4 & 0x03ff); + le16toh((*(uint16_t *)(oper_parameters))) >> 4 & 0x03ff); if (oper_parameters[1] & 0x40) printf("\t\t\tVHT Operation Information Present\n"); =20 --=20 2.39.5 From nobody Tue Apr 8 14:01:28 2025 Received: from mx3.wp.pl (mx3.wp.pl [212.77.101.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D46B19D07E for ; Sat, 5 Apr 2025 18:48:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.77.101.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743878903; cv=none; b=TfZBBMwYVbxtgUnnWWD81Qt964Pr1bpjmnaz9M+DLQQY36HU2gh6/6Bye8fk6jIK7onrnIHUUWkPav8BTd1VX/7ccZnDTHyyteE/t/N4MtaSTpJkv/YuZqX9cgFjXA2i+hTGvPQY+6Uv7/kaTNWSLTRVhdZRAfk0X2HgbX0s1PA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743878903; c=relaxed/simple; bh=nxiecPsmoFgWBEWbqtYIWuBltuSENEpmnmMMU0Henmk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=U4d8tO/zW5iOLUoeR5aZ4T0n5rJaPIqxlHvAJTVUu8BO2UKlbWUuf09acpLOasj6dT4FbCuWDyngfR/ZsU2SGArA1+J9EC9Y0JNfeu0rs5de+Y9Nkg3UNMGKlHcS7c6H6DOJCe5e022YxvA1B7yPukMHrU4aajZB+8GVYH3AoJ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl; spf=pass smtp.mailfrom=wp.pl; dkim=pass (2048-bit key) header.d=wp.pl header.i=@wp.pl header.b=q7/Jvgi8; arc=none smtp.client-ip=212.77.101.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wp.pl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wp.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wp.pl header.i=@wp.pl header.b="q7/Jvgi8" Received: (wp-smtpd smtp.wp.pl 36638 invoked from network); 5 Apr 2025 20:48:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=20241105; t=1743878898; bh=WuK/7uUTFYCOAJEY3KIz03StC1UqnJ+Dxx7t0VFtJU8=; h=From:To:Cc:Subject; b=q7/Jvgi8Y7Ezq1Z094NzCc82b2pKr9dn8A5p72Lnhb52AqkDpB8FnwdxR4OYbd956 26/BivpEZ5yu7oeXYE8EQHGM/sDgjjdUA4QlYGDKcvUfw8jSJo7fSvWbnVukluJRAK gSDgvojikdfIM9MkDr82ZjIPS7Dt33VsU2SuzD2++wv3UMoILsp46i7MR33piCZpkU LW5u5JQUjHPUcPEOZHH1neNIW57E/xhxF4NtCwRRKiBynVi1tcS78eWoZz3HoxuF3F BaGQ4PLCStQvMpTSd34eMuqH1pvPfPVFp99FluKcbSru4U91vflfW/SXBYn7Bkp7Pb 7qsgnZJ5wwMhQ== Received: from 83.5.244.88.ipv4.supernova.orange.pl (HELO laptop-olek.home) (olek2@wp.pl@[83.5.244.88]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 5 Apr 2025 20:48:17 +0200 From: Aleksander Jan Bajkowski To: johannes@sipsolutions.net, ilan.peer@intel.com, christopher.a.wills@intel.com, slakkavalli@datto.com, john@phrozen.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Aleksander Jan Bajkowski Subject: [PATCH iw,v2 3/3] iw: fix EHT capabilities on Big Endian platforms Date: Sat, 5 Apr 2025 20:48:07 +0200 Message-Id: <20250405184807.701728-4-olek2@wp.pl> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250405184807.701728-1-olek2@wp.pl> References: <20250405184807.701728-1-olek2@wp.pl> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-WP-DKIM-Status: good (id: wp.pl) X-WP-MailID: e04155a1f1dd2da3e5f435d7b4bec152 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000000 [kaPE] Content-Type: text/plain; charset="utf-8" IE fields are encoded in Little Endian and are not correctly printed on Big Endian platforms. Fixes: 5a71b722270c ("iw: Print local EHT capabilities") Signed-off-by: Aleksander Jan Bajkowski --- util.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/util.c b/util.c index 1870393..f105e07 100644 --- a/util.c +++ b/util.c @@ -1538,21 +1538,24 @@ static void __print_eht_capa(int band, const char *pre =3D indent ? "\t" : ""; const char *mcs[] =3D { "0-7", "8-9", "10-11", "12-13"}; =20 - #define PRINT_EHT_CAP(_var, _idx, _bit, _str) \ + #define PRINT_EHT_MAC_CAP(_idx, _bit, _str) \ do { \ - if (_var[_idx] & BIT(_bit)) \ + if (le32toh(mac_cap[_idx]) & BIT(_bit)) \ printf("%s\t\t\t" _str "\n", pre); \ } while (0) =20 - #define PRINT_EHT_CAP_MASK(_var, _idx, _shift, _mask, _str) \ + #define PRINT_EHT_PHY_CAP(_idx, _bit, _str) \ do { \ - if ((_var[_idx] >> _shift) & _mask) \ - printf("%s\t\t\t" _str ": %d\n", pre, (_var[_idx] >> _shift) & _mask); \ + if (phy_cap[_idx] & BIT(_bit)) \ + printf("%s\t\t\t" _str "\n", pre); \ } while (0) =20 - #define PRINT_EHT_MAC_CAP(...) PRINT_EHT_CAP(mac_cap, __VA_ARGS__) - #define PRINT_EHT_PHY_CAP(...) PRINT_EHT_CAP(phy_cap, __VA_ARGS__) - #define PRINT_EHT_PHY_CAP_MASK(...) PRINT_EHT_CAP_MASK(phy_cap, __VA_ARGS= __) + #define PRINT_EHT_PHY_CAP_MASK(_idx, _shift, _mask, _str) \ + do { \ + if ((le32toh(phy_cap[_idx]) >> _shift) & _mask) \ + printf("%s\t\t\t" _str ": %d\n", pre, \ + (le32toh(phy_cap[_idx]) >> _shift) & _mask); \ + } while (0) =20 printf("%s\t\tEHT MAC Capabilities (0x", pre); for (i =3D 0; i < 2; i++) @@ -1617,13 +1620,13 @@ static void __print_eht_capa(int band, printf("%02x", ((__u8 *)mcs_set)[i]); printf("):\n"); =20 - if (!(he_phy_cap[0] & ((BIT(2) | BIT(3) | BIT(4)) << 8))){ + if (!(le16toh(he_phy_cap[0]) & ((BIT(2) | BIT(3) | BIT(4)) << 8))) { for (i =3D 0; i < 4; i++) printf("%s\t\tEHT bw=3D20 MHz, max NSS for MCS %s: Rx=3D%u, Tx=3D%u\n", pre, mcs[i], mcs_set[i] & 0xf, mcs_set[i] >> 4); } else { - if (he_phy_cap[0] & (BIT(2) << 8)) { + if (le16toh(he_phy_cap[0]) & (BIT(2) << 8)) { for (i =3D 0; i < 3; i++) printf("%s\t\tEHT bw <=3D 80 MHz, max NSS for MCS %s: Rx=3D%u, Tx=3D%u= \n", pre, mcs[i + 1], @@ -1631,7 +1634,7 @@ static void __print_eht_capa(int band, } mcs_set +=3D 3; =20 - if (he_phy_cap[0] & (BIT(3) << 8)) { + if (le16toh(he_phy_cap[0]) & (BIT(3) << 8)) { for (i =3D 0; i < 3; i++) printf("%s\t\tEHT bw=3D160 MHz, max NSS for MCS %s: Rx=3D%u, Tx=3D%u\n= ", pre, mcs[i + 1], @@ -1639,7 +1642,7 @@ static void __print_eht_capa(int band, } =20 mcs_set +=3D 3; - if (band =3D=3D NL80211_BAND_6GHZ && (phy_cap[0] & BIT(1))) { + if (band =3D=3D NL80211_BAND_6GHZ && (le32toh(phy_cap[0]) & BIT(1))) { for (i =3D 0; i < 3; i++) printf("%s\t\tEHT bw=3D320 MHz, max NSS for MCS %s: Rx=3D%u, Tx=3D%u\n= ", pre, mcs[i + 1], @@ -1647,7 +1650,7 @@ static void __print_eht_capa(int band, } } =20 - if (ppet && ppet_len && (phy_cap[1] & BIT(11))) { + if (ppet && ppet_len && (le32toh(phy_cap[1]) & BIT(11))) { printf("%s\t\tEHT PPE Thresholds ", pre); for (i =3D 0; i < ppet_len; i++) if (ppet[i]) --=20 2.39.5