]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: wlcore: enable the right set of ciphers
authorAndreas Kemnade <andreas@kemnade.info>
Thu, 4 Jun 2026 10:33:16 +0000 (12:33 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 4 Jun 2026 11:21:26 +0000 (13:21 +0200)
The firmware version number check for IGTK introduced in
commit c34dbc5900b0 ("wifi: wlcore: Add support for IGTK key")

lets the amount of ciphers decrease on every boot of a too old firmware and
that is practically happening. It also does not take into account other
chips than the wl18xx. On some wl128x, the following can be observed
when connecting via nm to a common ap:

[  484.113311] wlcore: WARNING could not set keys
[  484.117828] wlcore: ERROR Could not add or replace key
[  484.123016] wlan0: failed to set key (5, ff:ff:ff:ff:ff:ff) to hardware (-5)
[  484.123046] wlcore: Hardware recovery in progress. FW ver: Rev 7.3.10.0.142
[  484.139923] wlcore: pc: 0x0, hint_sts: 0x00000048 count: 1
[  484.145721] wlcore: down
[  484.148986] ieee80211 phy0: Hardware restart was requested
[  484.610473] wlcore: firmware booted (Rev 7.3.10.0.142)
[  484.633758] wlcore: Association completed.
[  484.690490] wlcore: ERROR command execute failure 14
[  484.690490] ------------[ cut here ]------------
[  484.700195] WARNING: drivers/net/wireless/ti/wlcore/main.c:872 at wl12xx_queue_recovery_work+0x64/0x74 [wlcore], CPU#0: kworker/0:0/892

This repeats endlessly.
Always disable IGTK on wl12xx and fix the decrementing mess.

Fixes: c34dbc5900b0 ("wifi: wlcore: Add support for IGTK key")
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20260604103316.377251-1-andreas@kemnade.info
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ti/wlcore/main.c

index 1c340a4a09308fbf987f0745610fa538a3b80e2b..be583ae331c03b02d1bcc63e23dd83dd0d56c223 100644 (file)
 #define WL1271_BOOT_RETRIES 3
 #define WL1271_WAKEUP_TIMEOUT 500
 
+static const u32 cipher_suites[] = {
+       WLAN_CIPHER_SUITE_WEP40,
+       WLAN_CIPHER_SUITE_WEP104,
+       WLAN_CIPHER_SUITE_TKIP,
+       WLAN_CIPHER_SUITE_CCMP,
+       WL1271_CIPHER_SUITE_GEM,
+       WLAN_CIPHER_SUITE_AES_CMAC,
+};
+
 static char *fwlog_param;
 static int fwlog_mem_blocks = -1;
 static int bug_on_recovery = -1;
@@ -2367,6 +2376,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
 
 static int wl12xx_init_fw(struct wl1271 *wl)
 {
+       struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev);
        int retries = WL1271_BOOT_RETRIES;
        bool booted = false;
        struct wiphy *wiphy = wl->hw->wiphy;
@@ -2421,8 +2431,9 @@ power_off:
 
        /* WLAN_CIPHER_SUITE_AES_CMAC must be last in cipher_suites;
           support only with firmware 8.9.1 and newer */
-       if (wl->chip.fw_ver[FW_VER_MAJOR] < 1)
-               wl->hw->wiphy->n_cipher_suites--;
+       if (wl->chip.fw_ver[FW_VER_MAJOR] < 1  ||
+           (!strncmp(pdev_data->family->name, "wl12", 4)))
+               wl->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites) - 1;
 
        /*
         * Now we know if 11a is supported (info from the NVS), so disable
@@ -6198,14 +6209,6 @@ static void wl1271_unregister_hw(struct wl1271 *wl)
 static int wl1271_init_ieee80211(struct wl1271 *wl)
 {
        int i;
-       static const u32 cipher_suites[] = {
-               WLAN_CIPHER_SUITE_WEP40,
-               WLAN_CIPHER_SUITE_WEP104,
-               WLAN_CIPHER_SUITE_TKIP,
-               WLAN_CIPHER_SUITE_CCMP,
-               WL1271_CIPHER_SUITE_GEM,
-               WLAN_CIPHER_SUITE_AES_CMAC,
-       };
 
        /* The tx descriptor buffer */
        wl->hw->extra_tx_headroom = sizeof(struct wl1271_tx_hw_descr);