Re: ath12k: handling of HE and EHT capabilities
From: Alexander Wilhelm
Date: Thu Mar 12 2026 - 09:03:39 EST
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