From: Aleksander Jan Bajkowski <olek2@wp.pl>
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 <olek2@wp.pl>
Subject: [PATCH iw,v2 2/3] iw: fix HE operation on Big Endian platforms
Date: Sat, 5 Apr 2025 20:48:06 +0200 [thread overview]
Message-ID: <20250405184807.701728-3-olek2@wp.pl> (raw)
In-Reply-To: <20250405184807.701728-1-olek2@wp.pl>
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 <olek2@wp.pl>
---
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");
--
2.39.5
next prev parent reply other threads:[~2025-04-05 18:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-05 18:48 [PATCH iw,v2 0/3] iw: fix HE and EHT information on Big Endian platformas Aleksander Jan Bajkowski
2025-04-05 18:48 ` [PATCH iw,v2 1/3] iw: fix HE capabilities on Big Endian platforms Aleksander Jan Bajkowski
2025-04-05 18:48 ` Aleksander Jan Bajkowski [this message]
2025-04-05 18:48 ` [PATCH iw,v2 3/3] iw: fix EHT " Aleksander Jan Bajkowski
2025-04-23 14:42 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250405184807.701728-3-olek2@wp.pl \
--to=olek2@wp.pl \
--cc=christopher.a.wills@intel.com \
--cc=ilan.peer@intel.com \
--cc=johannes@sipsolutions.net \
--cc=john@phrozen.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=slakkavalli@datto.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®