From: Alexander Wilhelm <alexander.wilhelm@westermo.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Jeff Johnson <jjohnson@kernel.org>,
ath12k@lists.infradead.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: ath12k: handling of HE and EHT capabilities
Date: Thu, 12 Mar 2026 14:00:15 +0100 [thread overview]
Message-ID: <abK42BnlaPi9J9YC@FUE-ALEWI-WINX> (raw)
In-Reply-To: <e8960517faf04ed4f1bf331e23a95c477113309f.camel@sipsolutions.net>
On Thu, Mar 12, 2026 at 01:10:21PM +0100, Johannes Berg wrote:
> Wait ...
>
> > > I don’t see this in the function. For example, the MAC capabilities are a
> > > `u16 *` in CPU endianness, which is simply memcpy’d from the parsed
> > > `NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC`. Later, they are treated as `u16 *`,
> > > as shown in the following code:
> > >
> > > printf("%s\t\tHE MAC Capabilities (0x", pre);
> > > for (i = 0; i < 3; i++)
> > > printf("%04x", mac_cap[i]);
> > > printf("):\n");
>
> That's incorrect for sure. But iw code now actually reads
>
> printf("%s\t\tHE MAC Capabilities (0x", pre);
> for (i = 0; i < 3; i++)
> printf("%04x", le16toh(mac_cap[i]));
> printf("):\n");
>
>
> which is correct. HE PHY capabilities are printed as
>
> printf("%s\t\tHE PHY Capabilities: (0x", pre);
> for (i = 0; i < 11; i++)
> printf("%02x", ((__u8 *)phy_cap)[i + 1]);
>
> in my version of the code, and it seems to me the +1 is incorrect either
> way?
>
> > printf("%s\t\tEHT MAC Capabilities (0x", pre);
> > for (i = 0; i < 2; i++)
> > printf("%02x", mac_cap[i]);
>
> This was also correct, not incorrect as I stated, since mac_cap is u8 *,
> and EHT PHY capabilities are cast to u8 * first.
>
> Maybe your iw is just really old?
Sorry, my fault. I'm using `OpenWrt v24.10.5` with `iw` version 6.9. The
latest master has the `le16toh` implemented. With my `ath12k` fix the PHY
capabilities and the respecitve descriptions are fine now. But I still
cannot get MAC capabilities correct. I'll analyze it further.
Best regards
Alexander wilhelm
next prev parent reply other threads:[~2026-03-12 13:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 9:02 ath12k: handling of HE and EHT capabilities Alexander Wilhelm
2026-03-12 9:37 ` Johannes Berg
2026-03-12 10:53 ` Alexander Wilhelm
2026-03-12 11:05 ` Johannes Berg
2026-03-12 12:10 ` Johannes Berg
2026-03-12 13:00 ` Alexander Wilhelm [this message]
2026-03-13 7:45 ` Alexander Wilhelm
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=abK42BnlaPi9J9YC@FUE-ALEWI-WINX \
--to=alexander.wilhelm@westermo.com \
--cc=ath12k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/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