wifi: iwlwifi: enable 320 MHz on slow PCIe links
authorJohannes Berg <johannes.berg@intel.com>
Wed, 5 Feb 2025 12:55:36 +0000 (14:55 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 11 Feb 2025 10:59:47 +0000 (11:59 +0100)
Despite not being able to sustain the full 320 MHz throughput
even at MCS 9, enable 320 MHz on slow PCIe links. This may in
some cases result in frames being dropped (on the air) by the
firmware if they cannot be delivered to the host, but it can
still be better to use 320 MHz.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205145347.1e5356a3b124.I1224023721aaeff8ebcaa47dff88613c7fd0533a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c

index 9f7e013252febc58c768405cba61b18478b08c81..76259ac261cb46905881c6f795aeb8be83f05e5b 100644 (file)
@@ -913,11 +913,8 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
 {
        bool is_ap = iftype_data->types_mask & (BIT(NL80211_IFTYPE_AP) |
                                                BIT(NL80211_IFTYPE_P2P_GO));
-       bool no_320;
-
-       no_320 = (!trans->trans_cfg->integrated &&
-                trans->pcie_link_speed < PCI_EXP_LNKSTA_CLS_8_0GB) ||
-                trans->reduced_cap_sku;
+       bool slow_pcie = (!trans->trans_cfg->integrated &&
+                         trans->pcie_link_speed < PCI_EXP_LNKSTA_CLS_8_0GB);
 
        if (!data->sku_cap_11be_enable || iwlwifi_mod_params.disable_11be)
                iftype_data->eht_cap.has_eht = false;
@@ -944,7 +941,7 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
                                       IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK);
                break;
        case NL80211_BAND_6GHZ:
-               if (!no_320) {
+               if (!trans->reduced_cap_sku) {
                        iftype_data->eht_cap.eht_cap_elem.phy_cap_info[0] |=
                                IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ;
                        iftype_data->eht_cap.eht_cap_elem.phy_cap_info[1] |=
@@ -986,6 +983,14 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
                                iftype_data->eht_cap.eht_cap_elem.phy_cap_info[4] |= 0x10;
                        }
                }
+
+               if (slow_pcie) {
+                       struct ieee80211_eht_mcs_nss_supp *mcs_nss =
+                               &iftype_data->eht_cap.eht_mcs_nss_supp;
+
+                       mcs_nss->bw._320.rx_tx_mcs11_max_nss = 0;
+                       mcs_nss->bw._320.rx_tx_mcs13_max_nss = 0;
+               }
        } else {
                struct ieee80211_he_mcs_nss_supp *he_mcs_nss_supp =
                        &iftype_data->he_cap.he_mcs_nss_supp;