From patchwork Sat Apr 5 18:48:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksander Jan Bajkowski X-Patchwork-Id: 878608 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 A02F01A3168 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=1743878903; cv=none; b=RhmrlVYGvK4Zn3v/tCgv163sBVsv1hYhKZOvlpS5yfQlRvTwb5HbhKQWaK12xTziiw5fpAnK8qjmZvTa3NlYj72HjQRoKeD+Veff81TzoAHCgHUPursmOuX9xkGyX8bp3iOLc4SEo6nqH3ONWHhADZ8b1AbAm0uuGG723ULBubs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743878903; c=relaxed/simple; bh=Aw0Fjl2LGfjmnj6jsCLXEfIc+aXrL/Jx39Jr17fsb1g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gF5jQpTpVL1UDkclsrKqPDWOaaKeGeMPbYy6i4LwgNkaU8EoPQZRZAl/zaeF2hcpXCs8AOGolbqCMsuwuxc8wismT1wOgDV5gGoFez7+xiHBZltka8NKfVnWuZtKLw+uDK2+jJduU3rJtOC667m+G6SaA/H6ZBqxnPtuY/giuqk= 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-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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] 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, #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) #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) #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, printf("%s\t\tHE MAC Capabilities (0x", pre); for (i = 0; i < 3; i++) - printf("%04x", mac_cap[i]); + printf("%04x", le16toh(mac_cap[i])); printf("):\n"); PRINT_HE_MAC_CAP(0, 0, "+HTC HE Supported"); @@ -1394,18 +1395,18 @@ static void __print_he_capa(const __u16 *mac_cap, char *bw[] = { "<= 80", "160", "80+80" }; int j; - if ((phy_cap[0] & (phy_cap_support[i] << 8)) == 0) + if ((le16toh(phy_cap[0]) & (phy_cap_support[i] << 8)) == 0) continue; /* Supports more, but overflow? Abort. */ - if ((i * 2 + 2) * sizeof(mcs_set[0]) >= mcs_len) + if ((i * 2 + 2) * sizeof(le16toh(mcs_set[0])) >= mcs_len) return; for (j = 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 = 0; k < 8; k++) { - __u16 mcs = mcs_set[(i * 2) + j]; + __u16 mcs = le16toh(mcs_set[(i * 2) + j]); mcs >>= k * 2; mcs &= 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 = 0; } - 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 = 0; i < ppet_len; i++) if (ppet[i]) From patchwork Sat Apr 5 18:48:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksander Jan Bajkowski X-Patchwork-Id: 878703 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 2D18417A303 for ; Sat, 5 Apr 2025 18:48:18 +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=1743878901; cv=none; b=tmGNrPoJbWEgMumEl1aeVJHi82sge7kdk0zVTWbnzENktF6pbWLalcUGsAte0BnOnIRN9M1eY34Hcw+NJLH8TvcAEkv3qqZFXPHjS8qgJRXgH9W9LiGAc1FBoJz/bHZJCXKo3JDo52ahsh6DBb7b1pBXsjy0V+Sl78SVkwHYS+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743878901; c=relaxed/simple; bh=r7Z9lOOkSxpN+ucW+Gp2u+rGkC79BlG1EH70EKPgKrE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=n8n39Ib1RO4wzLatH+3mz30TPjOsOUYrZ0mtP/xz56xdN7u/k0p8zRqC0Qp0uJMrqBlzRYyyKi9qzcG72QustOyG5OwmJM08F6roKlE36CTBq9ElBtUtPq3mYCKgHmh3H0OUO1D0NNpHPDmLLLS6rxHX5EUKRrXdoWB7B8QUz+Y= 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.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="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-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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] 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] = {ie[0], ie[1], ie[2] }; uint8_t bss_color = ie[3]; - uint16_t nss_mcs_set = *(uint16_t*)(&ie[4]); + uint16_t nss_mcs_set = le16toh(*(uint16_t *)(&ie[4])); uint8_t vht_oper_present = oper_parameters[1] & 0x40; uint8_t co_hosted_bss_present = oper_parameters[1] & 0x80; uint8_t uhb_operation_info_present = oper_parameters[2] & 0x02; @@ -1768,7 +1768,7 @@ void print_he_operation(const uint8_t *ie, int len) printf("\t\t\tTWT Required\n"); 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"); From patchwork Sat Apr 5 18:48:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksander Jan Bajkowski X-Patchwork-Id: 878702 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 0D42019ADBA 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-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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] 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 = indent ? "\t" : ""; const char *mcs[] = { "0-7", "8-9", "10-11", "12-13"}; - #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) - #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) - #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) printf("%s\t\tEHT MAC Capabilities (0x", pre); for (i = 0; i < 2; i++) @@ -1617,13 +1620,13 @@ static void __print_eht_capa(int band, printf("%02x", ((__u8 *)mcs_set)[i]); printf("):\n"); - 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 = 0; i < 4; i++) printf("%s\t\tEHT bw=20 MHz, max NSS for MCS %s: Rx=%u, Tx=%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 = 0; i < 3; i++) printf("%s\t\tEHT bw <= 80 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n", pre, mcs[i + 1], @@ -1631,7 +1634,7 @@ static void __print_eht_capa(int band, } mcs_set += 3; - if (he_phy_cap[0] & (BIT(3) << 8)) { + if (le16toh(he_phy_cap[0]) & (BIT(3) << 8)) { for (i = 0; i < 3; i++) printf("%s\t\tEHT bw=160 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n", pre, mcs[i + 1], @@ -1639,7 +1642,7 @@ static void __print_eht_capa(int band, } mcs_set += 3; - if (band == NL80211_BAND_6GHZ && (phy_cap[0] & BIT(1))) { + if (band == NL80211_BAND_6GHZ && (le32toh(phy_cap[0]) & BIT(1))) { for (i = 0; i < 3; i++) printf("%s\t\tEHT bw=320 MHz, max NSS for MCS %s: Rx=%u, Tx=%u\n", pre, mcs[i + 1], @@ -1647,7 +1650,7 @@ static void __print_eht_capa(int band, } } - 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 = 0; i < ppet_len; i++) if (ppet[i])