From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795985275; b=aGr7bhLaDI/nt71kS3kOW7OxA/VnWeO035JvWSfmxrXJ+ZbjResGUvca6xAe4ts5btUy ODk8DZWDiMORE2MCoWIeh5qTLUCvXjf3Aa6FnXWcRddr1/D5q/eADe3sdQo/oRI8U7+T+ 1cpvWrrW7k0HuCMcnNYC6DnihjvTlZNZ371EW3Ndmsp0qYPpb97fipljN5fAorrjPrPQu 7rt0lSNttdIBNtMTvfsbufaibgnDlTXBGPIKxDJGiBPDctzL8HutehTPYrV1QauiUiGHx KViqnHOMDwskfKapvFFODxn3PzAhiYoWYniIqsxjLPhlV+eidnQT4VhRsTE5YO9aLxQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795985275; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=2Vawt4m7tXYMKufy4OVk62/r6JevXuPhKwngKa1uxSo=; b=qmfN6/+VIkI8F5oHnAQIklJFM5uwbG6B9kg33yCgcf/Xlzzm8aK+MonXfZTAu7IFPkln cjH1crmC7iHBXasq9eLxAMTTg8tOPavrAkcpXrY5P+lBR2jPwj0lvsMyM1zvp+euKCay4 /Aigsfa05/PCV03BYi7SnscDSG+rpB7/qWAX9UZlIF9d0FSksVfuw+OyCyKKk9QLKrNlN fgljD+CinJAbN44ZRweCMkXb/tAZMOPRU4vQsBWq1kTEasmKIXdqtagHTs6QmHr71Swrv r2BK+R0Eha2KTB3rCzSCUxIkRhxBLCXjyPdRRbnWfKUooE+HRhdSw5oX8/RztoiCFFg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SWLI4HE7; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31655606A331 for ; Sun, 29 Nov 2026 20:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=SWLI4HE7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 706EC1F00899; Sun, 29 Nov 2026 20:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795985275; bh=2Vawt4m7tXYMKufy4OVk62/r6JevXuPhKwngKa1uxSo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=SWLI4HE7mKe4z5mmCW+lsUI57nFkiVv8Fn6Nicco6cqsjk8h8IGOnnBLPM0mgCsyL YyY+W78Nr/oX2UYwf/oaca4CI/jCO9ANkq6Hs0liPAFye1jTYtiex6YD6EzKodEDWF Cb1Tggowk5df9fTGh1HN6ARRMZnJg7bQ/cSLaFAWBcheewociI07K7l4S/7WIRKd++ znFKZM1C4rTDwRDhg5vKw0Zhxv/TS3e0uKyg8H/W4Akn8Z+at8kXvrMZGyTvcu8Vk9 mJqXUeBhctINx68lAfjqc6Eryh3s8ezLLArknYpeUzics9UwP8URN0l5gpf/SA2ISi aV+6YAHyxKiGQ== Date: Sun, 29 Nov 2026 21:47:52 +0100 From: Lorenzo Bianconi To: Felix Fietkau Cc: linux-wireless@vger.kernel.org Subject: Re: [PATCH mt76-next 10/20] wifi: mt76: mt7925: read the EHT capabilities of a station as LE Message-ID: References: <20261129193131.3367661-1-nbd@nbd.name> <20261129193131.3367661-10-nbd@nbd.name> X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MpVeBLIw4taklQLk" Content-Disposition: inline In-Reply-To: <20261129193131.3367661-10-nbd@nbd.name> --MpVeBLIw4taklQLk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > mt7925_mcu_sta_eht_tlv() reads the EHT MAC and PHY capability bytes as > host integers. On a big-endian host the firmware thus gets these bytes > in reverse order. The casts also assume an alignment that the u8 arrays > do not guarantee. >=20 > Read both fields with the unaligned little-endian helpers. >=20 > Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for = mt7925 chips") > Signed-off-by: Felix Fietkau Reviewed-by: Lorenzo Bianconi > --- > drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/ne= t/wireless/mediatek/mt76/mt7925/mcu.c > index 5eb6a2047045..86b01c522a55 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c > @@ -1965,8 +1965,8 @@ mt7925_mcu_sta_eht_tlv(struct sk_buff *skb, struct = ieee80211_link_sta *link_sta) > =20 > eht =3D (struct sta_rec_eht *)tlv; > eht->tid_bitmap =3D 0xff; > - eht->mac_cap =3D cpu_to_le16(*(u16 *)elem->mac_cap_info); > - eht->phy_cap =3D cpu_to_le64(*(u64 *)elem->phy_cap_info); > + eht->mac_cap =3D cpu_to_le16(get_unaligned_le16(elem->mac_cap_info)); > + eht->phy_cap =3D cpu_to_le64(get_unaligned_le64(elem->phy_cap_info)); > eht->phy_cap_ext =3D cpu_to_le64(elem->phy_cap_info[8]); > =20 > if (link_sta->bandwidth =3D=3D IEEE80211_STA_RX_BW_20) > --=20 > 2.47.3 >=20 >=20 --MpVeBLIw4taklQLk Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCawyPeAAKCRA6cBh0uS2t rPf+AQCJ7RxVN/X5QYz0ZWa8Y/7Ws8j/rqPpox3fGTsYlOG6aQD8CpCeNwod2ElS /bGXMIu2OUBV4E8vEEe8qTucNbUnhAw= =xzLR -----END PGP SIGNATURE----- --MpVeBLIw4taklQLk--