diff mbox series

[2/2] wifi: wilc1000: remove AKM suite be32 conversion for external auth request

Message ID 20240215-nl80211_fix_akm_suites_endianness-v1-2-57e902632f9d@bootlin.com
State New
Headers show
Series wifi: nl80211/wilc1000: force WLAN_AKM_SUITE_SAE to big endian in NL80211_CMD_EXTERNAL_AUTH | expand

Commit Message

Alexis Lothoré Feb. 15, 2024, 2:13 p.m. UTC
The driver currently raises the following sparse warning:
[...] cfg80211.c:360:42: warning: incorrect type in assignment (different
base types)
[...] cfg80211.c:360:42:    expected unsigned int key_mgmt_suite
[...] cfg80211.c:360:42:    got restricted __be32 [usertype]
  CHECK   drivers/net/wireless/microchip/wilc1000/netdev.c

This conversion was needed because historically the external supplicant
(observed with wpa_supplicant) expects AKM suite as big endian in
NL80211_CMD_EXTERNAL_AUTH message when the AKM suite is WLAN_AKM_SUITE_SAE.
This is not needed anymore:
- new (to be released) versions of wpa_supplicant now reads it in host
  endian _while_ keeping compatibility for older drivers
- for new drivers used with current/old wpa_supplicant, this conversion has
  been added to nl80211 to force big endian when the AKM suite is
  WLAN_AKM_SUITE_SAE

Remove this not-needed-anymore conversion to fix the sparse warning.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308290615.lUTIgqUl-lkp@intel.com/
Tested-on: WILC1000 hwB SPI WILC_WIFI_FW_REL_16_1-13452
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 drivers/net/wireless/microchip/wilc1000/cfg80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Feb. 21, 2024, 6:54 p.m. UTC | #1
Alexis Lothoré <alexis.lothore@bootlin.com> wrote:

> The driver currently raises the following sparse warning:
> [...] cfg80211.c:360:42: warning: incorrect type in assignment (different
> base types)
> [...] cfg80211.c:360:42:    expected unsigned int key_mgmt_suite
> [...] cfg80211.c:360:42:    got restricted __be32 [usertype]
>   CHECK   drivers/net/wireless/microchip/wilc1000/netdev.c
> 
> This conversion was needed because historically the external supplicant
> (observed with wpa_supplicant) expects AKM suite as big endian in
> NL80211_CMD_EXTERNAL_AUTH message when the AKM suite is WLAN_AKM_SUITE_SAE.
> This is not needed anymore:
> - new (to be released) versions of wpa_supplicant now reads it in host
>   endian _while_ keeping compatibility for older drivers
> - for new drivers used with current/old wpa_supplicant, this conversion has
>   been added to nl80211 to force big endian when the AKM suite is
>   WLAN_AKM_SUITE_SAE
> 
> Remove this not-needed-anymore conversion to fix the sparse warning.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202308290615.lUTIgqUl-lkp@intel.com/
> Tested-on: WILC1000 hwB SPI WILC_WIFI_FW_REL_16_1-13452
> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>

Patch applied to wireless-next.git, thanks.

00413dd36414 wifi: wilc1000: remove AKM suite be32 conversion for external auth request
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
index f03fd15c0c97..cb564e2bad29 100644
--- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c
+++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
@@ -356,7 +356,7 @@  static int connect(struct wiphy *wiphy, struct net_device *dev,
 			memcpy(vif->auth.ssid.ssid, sme->ssid, sme->ssid_len);
 			vif->auth.ssid.ssid_len = sme->ssid_len;
 		}
-		vif->auth.key_mgmt_suite = cpu_to_be32(sme->crypto.akm_suites[0]);
+		vif->auth.key_mgmt_suite = sme->crypto.akm_suites[0];
 		ether_addr_copy(vif->auth.bssid, sme->bssid);
 		break;