wifi: iwlwifi: updates - 2023-10-11
cover wifi: iwlwifi: updates - 2023-10-11
From: Gregory Greenman <[email protected]>
Hi,
This patch set includes iwlwifi patches intended for v6.7.
It contains:
* Version 3 of ROC
* MLO fixes and improvements
* cleanups and bugfixes, including a fix for W=1 compilation warning
Thanks,
Gregory
Alon Giladi (1):
wifi: iwlwifi: send EDT table to FW
Emmanuel Grumbach (3):
wifi: iwlwifi: mvm: don't add dummy phy context
wifi: iwlwifi: mvm: fold the ref++ into iwl_mvm_phy_ctxt_add
wifi: iwlwifi: mvm: fix the PHY context resolution for p2p device
Gregory Greenman (1):
wifi: iwlwifi: fw: increase fw_version string size
Haim Dreyfuss (1):
wifi: iwlwifi: mvm: extend alive timeout to 2 seconds
Ilan Peer (2):
wifi: iwlwifi: mvm: Fix unreachable code path
wifi: iwlwifi: mvm: Fix key flags for IGTK on AP interface
Johannes Berg (3):
wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API
wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta()
wifi: iwlwifi: mvm: remove TDLS stations from FW
Matt Chen (1):
wifi: iwlmvm: fw: Add new OEM vendor to tas approved list
Miri Korenblit (2):
wifi: iwlwifi: mvm: cleanup MLO and non-MLO unification code
wifi: iwlwifi: add support for activating UNII-1 in WW via BIOS
Mukesh Sisodiya (1):
wifi: iwlwifi: add new RF support for wifi7
Shaul Triebitz (1):
wifi: iwlwifi: mvm: implement ROC version 3
drivers/net/wireless/intel/iwlwifi/fw/acpi.h | 3 +- .../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 10 +- .../wireless/intel/iwlwifi/fw/api/nvm-reg.h | 44 ++- .../intel/iwlwifi/fw/api/time-event.h | 57 ++++ drivers/net/wireless/intel/iwlwifi/fw/img.h | 4 +- drivers/net/wireless/intel/iwlwifi/iwl-csr.h | 3 +- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 14 +- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 56 ++-- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 1 + .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 283 +++++++++++------- .../net/wireless/intel/iwlwifi/mvm/mld-key.c | 7 +- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 41 +-- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 5 + .../net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | 69 ++--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 12 +- .../wireless/intel/iwlwifi/mvm/time-event.c | 57 +++- .../wireless/intel/iwlwifi/mvm/time-event.h | 8 + drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 18 +- 19 files changed, 442 insertions(+), 252 deletions(-)
Signature · 1 line
2.38.1
PATCH 2/16 wifi: iwlwifi: add new RF support for wifi7
From: Mukesh Sisodiya <[email protected]>
Add the support for new RF based on step-id.
--- drivers/net/wireless/intel/iwlwifi/iwl-csr.h | 3 ++- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-csr.h +2 -1
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* -* Copyright (C) 2005-2014, 2018-2022 Intel Corporation +* Copyright (C) 2005-2014, 2018-2023 Intel Corporation * Copyright (C) 2013-2014 Intel Mobile Communications GmbH * Copyright (C) 2016 Intel Deutschland GmbH */
@@ -313,6 +313,7 @@ enum {SILICON_C_STEP ,SILICON_D_STEP ,SILICON_E_STEP , +SILICON_TC_STEP =0xe , SILICON_Z_STEP = 0xf, };
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +11 -3
@@ -162,6 +162,8 @@ static inline char iwl_drv_get_step(int step) {if (step ==SILICON_Z_STEP )return 'z' ; +if (step ==SILICON_TC_STEP ) +return 'a' ;return 'a' + step; }
@@ -178,6 +180,8 @@ const char *iwl_drv_get_fwname_pre(struct iwl_trans *trans, char *buf) mac_step =iwl_drv_get_step (trans->hw_rev_step); + rf_step =iwl_drv_get_step (CSR_HW_RFID_STEP (trans->hw_rf_id)); +switch (CSR_HW_RFID_TYPE (trans->hw_rf_id)) {case IWL_CFG_RF_TYPE_HR1 :case IWL_CFG_RF_TYPE_HR2 :
@@ -196,7 +200,13 @@ const char *iwl_drv_get_fwname_pre(struct iwl_trans *trans, char *buf) rf ="fm" ;break ;case IWL_CFG_RF_TYPE_WH : - rf ="wh" ; +if (SILICON_Z_STEP == +CSR_HW_RFID_STEP (trans->hw_rf_id)) { + rf ="whtc" ; + rf_step ='a' ; + }else { + rf ="wh" ; + }break ;default :return "unknown-rf" ;
@@ -204,8 +214,6 @@ const char *iwl_drv_get_fwname_pre(struct iwl_trans *trans, char *buf) cdb =CSR_HW_RFID_IS_CDB (trans->hw_rf_id) ?"4" :"" ; - rf_step =iwl_drv_get_step (CSR_HW_RFID_STEP (trans->hw_rf_id)); - scnprintf(buf, FW_NAME_PRE_BUFSIZE, "iwlwifi-%s-%c0-%s%s-%c0", trans->cfg->fw_name_mac, mac_step,
Signature · 1 line
2.38.1
PATCH 3/16 wifi: iwlwifi: mvm: Fix unreachable code path
In reply to [email protected]From: Ilan Peer <[email protected]>
Fix unreachable code path that was introduced in the P2P Device linking refactoring.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +0 -5
@@ -1637,11 +1637,6 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, goto out_unlock; -if (mvm->bf_allowed_vif == mvmvif) { - mvm->bf_allowed_vif =NULL ; - vif->driver_flags &= ~(IEEE80211_VIF_BEACON_FILTER | -IEEE80211_VIF_SUPPORTS_CQM_RSSI ); - } out_remove_mac: mvmvif->deflink.phy_ctxt =NULL ;iwl_mvm_mac_ctxt_remove (mvm, vif);
Signature · 1 line
2.38.1
PATCH 4/16 wifi: iwlmvm: fw: Add new OEM vendor to tas approved list
In reply to [email protected]From: Matt Chen <[email protected]>
Add new oem/odm pair to tas approved vendors list when specified by platform.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +6 -0
@@ -1101,6 +1101,12 @@ static const struct dmi_system_id dmi_tas_approved_list[] = {DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), }, }, + { .ident = "GOOGLE-HP", + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Google" ), +DMI_MATCH (DMI_BOARD_VENDOR ,"HP" ), + }, + }, { .ident = "MSI", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International Co., Ltd."),
Signature · 1 line
2.38.1
PATCH 6/16 wifi: iwlwifi: send EDT table to FW
In reply to [email protected]From: Alon Giladi <[email protected]>
Read the EDT (Energy detection threshold) optimization configuration table from BIOS using DSM Function and send it to FW.
--- drivers/net/wireless/intel/iwlwifi/fw/acpi.h | 3 +- .../wireless/intel/iwlwifi/fw/api/nvm-reg.h | 35 +++++++++++++++++-- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 17 +++++++-- 3 files changed, 50 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/acpi.h +2 -1
@@ -138,7 +138,8 @@ enum iwl_dsm_funcs_rev_0 {DSM_FUNC_11AX_ENABLEMENT =6 ,DSM_FUNC_ENABLE_UNII4_CHAN =7 ,DSM_FUNC_ACTIVATE_CHANNEL =8 , -DSM_FUNC_FORCE_DISABLE_CHANNELS =9 +DSM_FUNC_FORCE_DISABLE_CHANNELS =9 , + DSM_FUNC_ENERGY_DETECTION_THRESHOLD = 10, }; enum iwl_dsm_values_srd {
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h +33 -2
@@ -21,8 +21,9 @@ enum iwl_regulatory_and_nvm_subcmd_ids {* &struct iwl_lari_config_change_cmd_v2, * &struct iwl_lari_config_change_cmd_v3, * &struct iwl_lari_config_change_cmd_v4, -* &struct iwl_lari_config_change_cmd_v5 or -* &struct iwl_lari_config_change_cmd_v6 +* &struct iwl_lari_config_change_cmd_v5, +* &struct iwl_lari_config_change_cmd_v6 or +* &struct iwl_lari_config_change_cmd_v7 */ LARI_CONFIG_CHANGE = 0x1,
@@ -602,6 +603,36 @@ struct iwl_lari_config_change_cmd_v6 {__le32 force_disable_channels_bitmap; } __packed;/* LARI_CHANGE_CONF_CMD_S_VER_6 */ +/** +* struct iwl_lari_config_change_cmd_v7 - change LARI configuration +* @config_bitmap: Bitmap of the config commands. Each bit will trigger a +* different predefined FW config operation. +* @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets. +* @oem_11ax_allow_bitmap: Bitmap of 11ax allowed MCCs. There are two bits +* per country, one to indicate whether to override and the other to +* indicate the value to use. +* @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits +* per country, one to indicate whether to override and the other to +* indicate allow/disallow unii4 channels. +* @chan_state_active_bitmap: Bitmap for overriding channel state to active. +* Each bit represents a country or region to activate, according to the +* BIOS definitions. +* @force_disable_channels_bitmap: Bitmap of disabled bands/channels. +* Each bit represents a set of channels in a specific band that should be +* disabled +* @edt_bitmap: Bitmap of energy detection threshold table. +* Disable/enable the EDT optimization method for different band. +*/ +struct iwl_lari_config_change_cmd_v7 { +__le32 config_bitmap; +__le32 oem_uhb_allow_bitmap; +__le32 oem_11ax_allow_bitmap; +__le32 oem_unii4_allow_bitmap; +__le32 chan_state_active_bitmap; +__le32 force_disable_channels_bitmap; +__le32 edt_bitmap; +} __packed;/* LARI_CHANGE_CONF_CMD_S_VER_7 */ +/** * struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete * @status: PNVM image loading status
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +15 -2
@@ -1232,7 +1232,7 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm) {int ret;u32 value; -struct iwl_lari_config_change_cmd_v6 cmd = {}; +struct iwl_lari_config_change_cmd_v7 cmd = {}; cmd.config_bitmap =iwl_acpi_get_lari_config_bitmap (&mvm->fwrt);
@@ -1265,18 +1265,28 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)if (!ret) cmd.force_disable_channels_bitmap =cpu_to_le32 (value); + ret =iwl_acpi_get_dsm_u32 (mvm->fwrt.dev,0 , +DSM_FUNC_ENERGY_DETECTION_THRESHOLD , + &iwl_guid, &value); +if (!ret) + cmd.edt_bitmap =cpu_to_le32 (value); +if (cmd.config_bitmap || cmd.oem_uhb_allow_bitmap || cmd.oem_11ax_allow_bitmap || cmd.oem_unii4_allow_bitmap || cmd.chan_state_active_bitmap || - cmd.force_disable_channels_bitmap) { + cmd.force_disable_channels_bitmap || + cmd.edt_bitmap) {size_t cmd_size;u8 cmd_ver =iwl_fw_lookup_cmd_ver (mvm->fw,WIDE_ID (REGULATORY_AND_NVM_GROUP ,LARI_CONFIG_CHANGE ),1 );switch (cmd_ver) { +case 7 : + cmd_size =sizeof (struct iwl_lari_config_change_cmd_v7 ); +break ;case 6 : cmd_size =sizeof (struct iwl_lari_config_change_cmd_v6 );break ;
@@ -1310,6 +1320,9 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)"sending LARI_CONFIG_CHANGE, oem_uhb_allow_bitmap=0x%x, force_disable_channels_bitmap=0x%x\n" ,le32_to_cpu (cmd.oem_uhb_allow_bitmap), le32_to_cpu(cmd.force_disable_channels_bitmap)); +IWL_DEBUG_RADIO (mvm, +"sending LARI_CONFIG_CHANGE, edt_bitmap=0x%x\n" , +le32_to_cpu (cmd.edt_bitmap)); ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(REGULATORY_AND_NVM_GROUP, LARI_CONFIG_CHANGE),
Signature · 1 line
2.38.1
PATCH 7/16 wifi: iwlwifi: mvm: implement ROC version 3
In reply to [email protected]From: Shaul Triebitz <[email protected]>
Define the new API for ROC command and notification. Use ROC version 3 command and notificaiton for hotspot.
--- .../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 10 +- .../intel/iwlwifi/fw/api/time-event.h | 57 ++++++++ .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 131 ++++++++++++++---- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 5 + .../wireless/intel/iwlwifi/mvm/time-event.c | 50 ++++++- .../wireless/intel/iwlwifi/mvm/time-event.h | 8 ++ 6 files changed, 229 insertions(+), 32 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h +9 -1
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* -* Copyright (C) 2012-2014, 2018-2019, 2021-2022 Intel Corporation +* Copyright (C) 2012-2014, 2018-2019, 2021-2023 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */
@@ -57,6 +57,14 @@ enum iwl_mac_conf_subcmd_ids {* @STA_DISABLE_TX_CMD: &struct iwl_mvm_sta_disable_tx_cmd */ STA_DISABLE_TX_CMD =0xD , +/** +* @ROC_CMD: &struct iwl_roc_req +*/ +ROC_CMD =0xE , +/** +* @ROC_NOTIF: &struct iwl_roc_notif +*/ + ROC_NOTIF = 0xF8,/** * @SESSION_PROTECTION_NOTIF: &struct iwl_mvm_session_prot_notif */
drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h +57 -0
63 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +102 -29
173 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +5 -0
@@ -426,6 +426,9 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {WNM_80211V_TIMING_MEASUREMENT_CONFIRM_NOTIFICATION , iwl_mvm_time_sync_msmt_confirm_event,RX_HANDLER_SYNC , struct iwl_time_msmt_cfm_notify), +RX_HANDLER_GRP (MAC_CONF_GROUP ,ROC_NOTIF , + iwl_mvm_rx_roc_notif,RX_HANDLER_SYNC , + struct iwl_roc_notif), };#undef RX_HANDLER#undef RX_HANDLER_GRP
@@ -549,6 +552,8 @@ static const struct iwl_hcmd_names iwl_mvm_mac_conf_names[] = {HCMD_NAME (AUX_STA_CMD ),HCMD_NAME (STA_REMOVE_CMD ),HCMD_NAME (STA_DISABLE_TX_CMD ), +HCMD_NAME (ROC_CMD ), +HCMD_NAME (ROC_NOTIF ),HCMD_NAME (SESSION_PROTECTION_NOTIF ), HCMD_NAME(CHANNEL_SWITCH_START_NOTIF), };
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +48 -2
68 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/time-event.h +8 -0
@@ -100,6 +100,14 @@ void iwl_mvm_stop_session_protection(struct iwl_mvm *mvm,void iwl_mvm_rx_time_event_notif (struct iwl_mvm *mvm,struct iwl_rx_cmd_buffer *rxb); +/** +* iwl_mvm_rx_roc_notif - handles %DISCOVERY_ROC_NTF. +* @mvm: the mvm component +* @rxb: RX buffer +*/ +void iwl_mvm_rx_roc_notif (struct iwl_mvm *mvm, +struct iwl_rx_cmd_buffer *rxb); +/** * iwl_mvm_start_p2p_roc - start remain on channel for p2p device functionality * @mvm: the mvm component
Signature · 1 line
2.38.1
PATCH 8/16 wifi: iwlwifi: mvm: cleanup MLO and non-MLO unification code
In reply to [email protected]From: Miri Korenblit <[email protected]>
bss_info_changed() callback of mac80211 was originally in both MLD and non-MLD API. Therefore, we extracted the common part to a function which receives a callback structure with the mode-specific (non-MLO\MLO) ops. Eventually, for MLO API, bss_info_changed() callback was split into 2 callbacks:link_info_changed() and vif_cfg_changed() so it is no longer in use for MLO, only for non-MLO.
Remove the code that uses the mode-specific callback structure.
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 21 +--------- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 39 ++----------------- 2 files changed, 6 insertions(+), 54 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +2 -19
@@ -3036,22 +3036,6 @@ static void iwl_mvm_bss_info_changed(struct ieee80211_hw *hw,struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, u64 changes) -{ - static const struct iwl_mvm_bss_info_changed_ops callbacks = { - .bss_info_changed_sta = iwl_mvm_bss_info_changed_station, - .bss_info_changed_ap_ibss = iwl_mvm_bss_info_changed_ap_ibss, - }; - -iwl_mvm_bss_info_changed_common (hw, vif, bss_conf, &callbacks, - changes); -} - -void -iwl_mvm_bss_info_changed_common (struct ieee80211_hw *hw, -struct ieee80211_vif *vif, -struct ieee80211_bss_conf *bss_conf, -const struct iwl_mvm_bss_info_changed_ops *callbacks, -u64 changes) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
@@ -3062,12 +3046,11 @@ iwl_mvm_bss_info_changed_common(struct ieee80211_hw *hw,switch (vif->type) {case NL80211_IFTYPE_STATION : - callbacks->bss_info_changed_sta (mvm, vif, bss_conf, changes); +iwl_mvm_bss_info_changed_station (mvm, vif, bss_conf, changes);break ;case NL80211_IFTYPE_AP :case NL80211_IFTYPE_ADHOC : - callbacks->bss_info_changed_ap_ibss (mvm, vif, bss_conf, - changes); +iwl_mvm_bss_info_changed_ap_ibss (mvm, vif, bss_conf, changes);break ;case NL80211_IFTYPE_MONITOR :if (changes &BSS_CHANGED_MU_GROUPS )
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +4 -35
@@ -1921,41 +1921,10 @@ void iwl_mvm_stop_ap_ibss_common(struct iwl_mvm *mvm, struct ieee80211_vif *vif);/* BSS Info */ -/** -* struct iwl_mvm_bss_info_changed_ops - callbacks for the bss_info_changed() -* -* Since the only difference between both MLD and -* non-MLD versions of bss_info_changed() is these function calls, -* each version will send its specific function calls to -* %iwl_mvm_bss_info_changed_common(). -* -* @bss_info_changed_sta: pointer to the function that handles changes -* in bss_info in sta mode -* @bss_info_changed_ap_ibss: pointer to the function that handles changes -* in bss_info in ap and ibss modes -*/ -struct iwl_mvm_bss_info_changed_ops { -void (*bss_info_changed_sta)(struct iwl_mvm *mvm, -struct ieee80211_vif *vif, -struct ieee80211_bss_conf *bss_conf, -u64 changes); -void (*bss_info_changed_ap_ibss)(struct iwl_mvm *mvm, -struct ieee80211_vif *vif, -struct ieee80211_bss_conf *bss_conf, -u64 changes); -}; - -void -iwl_mvm_bss_info_changed_common (struct ieee80211_hw *hw, -struct ieee80211_vif *vif, -struct ieee80211_bss_conf *bss_conf, -const struct iwl_mvm_bss_info_changed_ops *callbacks, -u64 changes); -void -iwl_mvm_bss_info_changed_station_common (struct iwl_mvm *mvm, -struct ieee80211_vif *vif, -struct ieee80211_bss_conf *link_conf, -u64 changes); +void iwl_mvm_bss_info_changed_station_common (struct iwl_mvm *mvm, +struct ieee80211_vif *vif, +struct ieee80211_bss_conf *link_conf, +u64 changes);void iwl_mvm_bss_info_changed_station_assoc (struct iwl_mvm *mvm,struct ieee80211_vif *vif,u64 changes);
Signature · 1 line
2.38.1
PATCH 9/16 wifi: iwlwifi: mvm: don't add dummy phy context
In reply to [email protected]From: Emmanuel Grumbach <[email protected]>
From its very first stages of development, iwlmvm added all the PHY context immediately upon firmware boot. Then, all we needed to do is to modify the contexts. This was fine if the addition of a PHY context that we don't need is free. This was true until now. Newer devices will run calibrations upon the addition of a PHY context.
Change the way we work with PHY context in iwlmvm. Fortunately, we already have all the ref counting in place so that it is not very hard to do.
Also, since we now remove the PHY context before the link is removed (but after it has been de-activated of course), it'll confuse the firmware if we put the late phy_id into the LINK command that removes the link. Change this to put an invalid phy_id just like we do when we add a link that has no PHY context yet.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 17 ------- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 1 + .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 19 ++++--- .../net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | 49 +++++-------------- 4 files changed, 27 insertions(+), 59 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +0 -17
@@ -1535,8 +1535,6 @@ static int iwl_mvm_load_rt_fw(struct iwl_mvm *mvm)int iwl_mvm_up (struct iwl_mvm *mvm) {int ret, i; -struct ieee80211_channel *chan; -struct cfg80211_chan_def chandef;struct ieee80211_supported_band *sband =NULL ;lockdep_assert_held (&mvm->mutex);
@@ -1661,21 +1659,6 @@ int iwl_mvm_up(struct iwl_mvm *mvm) goto error; } - chan = &sband->channels[0 ]; - -cfg80211_chandef_create (&chandef, chan,NL80211_CHAN_NO_HT ); -for (i =0 ; i <NUM_PHY_CTX ; i++) { -/* -* The channel used here isn't relevant as it's -* going to be overwritten in the other flows. -* For now use the first channel we have. -*/ - ret =iwl_mvm_phy_ctxt_add (mvm, &mvm->phy_ctxts[i], - &chandef,1 ,1 ); -if (ret) - goto error; - } -if (iwl_mvm_is_tt_in_fw (mvm)) {/* in order to give the responsibility of ct-kill and * TX backoff to FW we need to send empty temperature reporting
drivers/net/wireless/intel/iwlwifi/mvm/link.c +1 -0
@@ -252,6 +252,7 @@ int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,iwl_mvm_release_fw_link_id (mvm, link_info->fw_link_id); link_info->fw_link_id =IWL_MVM_FW_LINK_ID_INVALID ; cmd.spec_link_id = link_conf->link_id; + cmd.phy_id =cpu_to_le32 (FW_CTXT_INVALID ); ret =iwl_mvm_link_cmd_send (mvm, &cmd,FW_CTXT_ACTION_REMOVE );
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +13 -6
@@ -4693,6 +4693,9 @@ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, } } +/* Configure the PHY context */ +cfg80211_chandef_create (&chandef, channel,NL80211_CHAN_NO_HT ); +/* If the currently used PHY context is configured with a matching * channel use it */
@@ -4707,12 +4710,16 @@ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, } mvmvif->deflink.phy_ctxt = phy_ctxt; + ret =iwl_mvm_phy_ctxt_add (mvm, phy_ctxt, &chandef,1 ,1 ); +if (ret) { +IWL_ERR (mvm,"Failed to change PHY context\n" ); + goto out_unlock; + } +iwl_mvm_phy_ctxt_ref (mvm, mvmvif->deflink.phy_ctxt); + goto link_and_start_p2p_roc; } -/* Configure the PHY context */ -cfg80211_chandef_create (&chandef, channel,NL80211_CHAN_NO_HT ); - ret =iwl_mvm_phy_ctxt_changed (mvm, phy_ctxt, &chandef,1 ,1 );if (ret) {
@@ -4797,9 +4804,9 @@ static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm, goto out; } - ret =iwl_mvm_phy_ctxt_changed (mvm, phy_ctxt, def, - ctx->rx_chains_static, - ctx->rx_chains_dynamic); + ret =iwl_mvm_phy_ctxt_add (mvm, phy_ctxt, def, + ctx->rx_chains_static, + ctx->rx_chains_dynamic);if (ret) {IWL_ERR (mvm,"Failed to add PHY context\n" ); goto out;
drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c +13 -36
67 lines not on this page · raw message
Signature · 1 line
2.38.1
PATCH 10/16 wifi: iwlwifi: mvm: fold the ref++ into iwl_mvm_phy_ctxt_add
In reply to [email protected]From: Emmanuel Grumbach <[email protected]>
When we want to add a phy_ctxt, we need to increase the ref. Note that all the WARN_ONs are already in place:
* We check that we don't add a context with ref != 0
* We check that we don't modify a context with ref = 0
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 -- .../net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | 20 ++++++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +0 -2
@@ -4716,7 +4716,6 @@ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, goto out_unlock; } -iwl_mvm_phy_ctxt_ref (mvm, mvmvif->deflink.phy_ctxt); goto link_and_start_p2p_roc; }
@@ -4812,7 +4811,6 @@ static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm, goto out; } -iwl_mvm_phy_ctxt_ref (mvm, phy_ctxt); *phy_ctxt_id = phy_ctxt->id; out:return ret;
drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c +17 -3
@@ -265,6 +265,8 @@ int iwl_mvm_phy_ctxt_add(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,struct cfg80211_chan_def *chandef, u8 chains_static, u8 chains_dynamic) { + int ret; +WARN_ON (!test_bit (IWL_MVM_STATUS_IN_HW_RESTART , &mvm->status) && ctxt->ref);lockdep_assert_held (&mvm->mutex);
@@ -273,9 +275,16 @@ int iwl_mvm_phy_ctxt_add(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt, ctxt->width = chandef->width; ctxt->center_freq1 = chandef->center_freq1; -return iwl_mvm_phy_ctxt_apply (mvm, ctxt, chandef, - chains_static, chains_dynamic, -FW_CTXT_ACTION_ADD ); + ret =iwl_mvm_phy_ctxt_apply (mvm, ctxt, chandef, + chains_static, chains_dynamic, +FW_CTXT_ACTION_ADD ); + +if (ret) +return ret; + + ctxt->ref++; + +return 0 ; }/*
@@ -285,6 +294,11 @@ int iwl_mvm_phy_ctxt_add(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,void iwl_mvm_phy_ctxt_ref (struct iwl_mvm *mvm,struct iwl_mvm_phy_ctxt *ctxt) {lockdep_assert_held (&mvm->mutex); + +/* If we were taking the first ref, we should have +* called iwl_mvm_phy_ctxt_add. +*/ +WARN_ON (!ctxt->ref); ctxt->ref++; }
Signature · 1 line
2.38.1
PATCH 11/16 wifi: iwlwifi: mvm: fix the PHY context resolution for p2p device
In reply to [email protected]From: Emmanuel Grumbach <[email protected]>
We seem to have an issue in case we had a BSS and a P2P device on channel 1 and then, the P2P device gets an ROC on channel 6. We would change the channel of the PHY context to channel 6 even if the BSS was using that same PHY context.
Revamp that code and don't try to change a PHY context, it doesn't mean much for the firmware anyway. Just remove it and allocate a new one. This makes the logic easier to follow.
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 101 +++++++++--------- 1 file changed, 49 insertions(+), 52 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +49 -52
@@ -4634,6 +4634,52 @@ static int iwl_mvm_roc_station(struct iwl_mvm *mvm,return ret; } +static int iwl_mvm_p2p_find_phy_ctxt (struct iwl_mvm *mvm, +struct ieee80211_vif *vif, +struct ieee80211_channel *channel) +{ +struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); +struct cfg80211_chan_def chandef; +int i; + +lockdep_assert_held (&mvm->mutex); + +if (mvmvif->deflink.phy_ctxt && + channel == mvmvif->deflink.phy_ctxt->channel) +return 0 ; + +/* Try using a PHY context that is already in use */ +for (i =0 ; i <NUM_PHY_CTX ; i++) { +struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[i]; + +if (!phy_ctxt->ref || mvmvif->deflink.phy_ctxt == phy_ctxt) +continue ; + +if (channel == phy_ctxt->channel) { +if (mvmvif->deflink.phy_ctxt) +iwl_mvm_phy_ctxt_unref (mvm, + mvmvif->deflink.phy_ctxt); + + mvmvif->deflink.phy_ctxt = phy_ctxt; +iwl_mvm_phy_ctxt_ref (mvm, mvmvif->deflink.phy_ctxt); +return 0 ; + } + } + +/* We already have a phy_ctxt, but it's not on the right channel */ +if (mvmvif->deflink.phy_ctxt) +iwl_mvm_phy_ctxt_unref (mvm, mvmvif->deflink.phy_ctxt); + + mvmvif->deflink.phy_ctxt =iwl_mvm_get_free_phy_ctxt (mvm); +if (!mvmvif->deflink.phy_ctxt) +return -ENOSPC ; + +cfg80211_chandef_create (&chandef, channel,NL80211_CHAN_NO_HT ); + +return iwl_mvm_phy_ctxt_add (mvm, mvmvif->deflink.phy_ctxt, + &chandef,1 ,1 ); +} +/* Execute the common part for MLD and non-MLD modes */ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_channel *channel, int duration,
@@ -4641,11 +4687,8 @@ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, const struct iwl_mvm_roc_ops *ops) {struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw); -struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); -struct cfg80211_chan_def chandef; -struct iwl_mvm_phy_ctxt *phy_ctxt; -int ret, i;u32 lmac_id; +int ret;IWL_DEBUG_MAC80211 (mvm,"enter (%d, %d, %d)\n" , channel->hw_value, duration, type);
@@ -4676,57 +4719,11 @@ int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, goto out_unlock; } -/* Try using a PHY context that is already in use */ -for (i =0 ; i <NUM_PHY_CTX ; i++) { - phy_ctxt = &mvm->phy_ctxts[i]; -if (!phy_ctxt->ref || mvmvif->deflink.phy_ctxt == phy_ctxt) -continue ; - -if (channel == phy_ctxt->channel) { -if (mvmvif->deflink.phy_ctxt) -iwl_mvm_phy_ctxt_unref (mvm, - mvmvif->deflink.phy_ctxt); - - mvmvif->deflink.phy_ctxt = phy_ctxt; -iwl_mvm_phy_ctxt_ref (mvm, mvmvif->deflink.phy_ctxt); - goto link_and_start_p2p_roc; - } - } -/* Configure the PHY context */ -cfg80211_chandef_create (&chandef, channel,NL80211_CHAN_NO_HT ); - -/* If the currently used PHY context is configured with a matching -* channel use it -*/ -if (mvmvif->deflink.phy_ctxt) { -if (channel == mvmvif->deflink.phy_ctxt->channel) - goto link_and_start_p2p_roc; - }else { - phy_ctxt =iwl_mvm_get_free_phy_ctxt (mvm); -if (!phy_ctxt) { - ret = -ENOSPC ; - goto out_unlock; - } - - mvmvif->deflink.phy_ctxt = phy_ctxt; - ret =iwl_mvm_phy_ctxt_add (mvm, phy_ctxt, &chandef,1 ,1 ); -if (ret) { -IWL_ERR (mvm,"Failed to change PHY context\n" ); - goto out_unlock; - } - - goto link_and_start_p2p_roc; - } - - ret =iwl_mvm_phy_ctxt_changed (mvm, phy_ctxt, &chandef, -1 ,1 ); -if (ret) { -IWL_ERR (mvm,"Failed to change PHY context\n" ); + ret =iwl_mvm_p2p_find_phy_ctxt (mvm, vif, channel); +if (ret) goto out_unlock; - } -link_and_start_p2p_roc: ret = ops->link (mvm, vif);if (ret) goto out_unlock;
Signature · 1 line
2.38.1
PATCH 12/16 wifi: iwlwifi: mvm: extend alive timeout to 2 seconds
In reply to [email protected]From: Haim Dreyfuss <[email protected]>
There are devices that need longer time to get the alive notification.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +1 -1
@@ -23,7 +23,7 @@#include "iwl-nvm-parse.h" #include "time-sync.h" -#define MVM_UCODE_ALIVE_TIMEOUT (HZ) +#define MVM_UCODE_ALIVE_TIMEOUT (2 * HZ)#define MVM_UCODE_CALIB_TIMEOUT (2 * HZ)#define IWL_TAS_US_MCC 0x5553
Signature · 1 line
2.38.1
PATCH 13/16 wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API
In reply to [email protected]From: Johannes Berg <[email protected]>
This API is type unsafe and needs an extra parameter to know what kind of station was passed, so it has two, but really it only needs two values. Just pass the values instead of doing this type-unsafe dance, which will also make it better to use for multi-link.
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 6 ++++-- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 9 ++++++--- .../wireless/intel/iwlwifi/mvm/time-event.c | 7 ++++--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 18 ++---------------- 6 files changed, 18 insertions(+), 26 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +4 -2
@@ -5674,7 +5674,8 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, }if (drop) { -if (iwl_mvm_flush_sta (mvm, mvmsta, false)) +if (iwl_mvm_flush_sta (mvm, mvmsta->deflink.sta_id, + mvmsta->tfd_queue_msk))IWL_ERR (mvm,"flush request fail\n" ); }else {if (iwl_mvm_has_new_tx_api (mvm))
@@ -5711,7 +5712,8 @@ void iwl_mvm_mac_flush_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif, mvmsta =iwl_mvm_sta_from_mac80211 (sta); -if (iwl_mvm_flush_sta (mvm, mvmsta, false)) +if (iwl_mvm_flush_sta (mvm, mvmsta->deflink.sta_id, + mvmsta->tfd_queue_msk))IWL_ERR (mvm,"flush request fail\n" ); }mutex_unlock (&mvm->mutex);
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +1 -1
@@ -347,7 +347,7 @@ static int iwl_mvm_mld_rm_int_sta(struct iwl_mvm *mvm,return -EINVAL ;if (flush) -iwl_mvm_flush_sta (mvm, int_sta, true); +iwl_mvm_flush_sta (mvm, int_sta->sta_id, int_sta->tfd_queue_msk);iwl_mvm_mld_disable_txq (mvm,BIT (int_sta->sta_id), queuptr, tid);
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +1 -1
@@ -1674,7 +1674,7 @@ const char *iwl_mvm_get_tx_fail_reason(u32 status);static inline const char *iwl_mvm_get_tx_fail_reason (u32 status) {return "" ; }#endif int iwl_mvm_flush_tx_path (struct iwl_mvm *mvm,u32 tfd_msk); -int iwl_mvm_flush_sta (struct iwl_mvm *mvm,void *sta,bool internal); +int iwl_mvm_flush_sta (struct iwl_mvm *mvm,u32 sta_id,u32 tfd_queue_mask);int iwl_mvm_flush_sta_tids (struct iwl_mvm *mvm,u32 sta_id,u16 tids);/* Utils to extract sta related data */
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +6 -3
@@ -2098,7 +2098,8 @@ int iwl_mvm_rm_sta(struct iwl_mvm *mvm,return ret;/* flush its queues here since we are freeing mvm_sta */ - ret =iwl_mvm_flush_sta (mvm, mvm_sta, false); + ret =iwl_mvm_flush_sta (mvm, mvm_sta->deflink.sta_id, + mvm_sta->tfd_queue_msk);if (ret)return ret;if (iwl_mvm_has_new_tx_api (mvm)) {
@@ -2409,7 +2410,8 @@ void iwl_mvm_free_bcast_sta_queues(struct iwl_mvm *mvm,lockdep_assert_held (&mvm->mutex); -iwl_mvm_flush_sta (mvm, &mvmvif->deflink.bcast_sta, true); +iwl_mvm_flush_sta (mvm, mvmvif->deflink.bcast_sta.sta_id, + mvmvif->deflink.bcast_sta.tfd_queue_msk);switch (vif->type) {case NL80211_IFTYPE_AP :
@@ -2665,7 +2667,8 @@ int iwl_mvm_rm_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)lockdep_assert_held (&mvm->mutex); -iwl_mvm_flush_sta (mvm, &mvmvif->deflink.mcast_sta, true); +iwl_mvm_flush_sta (mvm, mvmvif->deflink.mcast_sta.sta_id, + mvmvif->deflink.mcast_sta.tfd_queue_msk);iwl_mvm_disable_txq (mvm,NULL , mvmvif->deflink.mcast_sta.sta_id, &mvmvif->deflink.cab_queue,0 );
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +4 -3
@@ -81,8 +81,8 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk)struct ieee80211_vif *vif = mvm->p2p_device_vif; mvmvif =iwl_mvm_vif_from_mac80211 (vif); -iwl_mvm_flush_sta (mvm, &mvmvif->deflink.bcast_sta, - true); +iwl_mvm_flush_sta (mvm, mvmvif->deflink.bcast_sta.sta_id, + mvmvif->deflink.bcast_sta.tfd_queue_msk);if (mvm->mld_api_is_used) { iwl_mvm_mld_rm_bcast_sta(mvm, vif,
@@ -113,7 +113,8 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk)*/ if (test_and_clear_bit (IWL_MVM_STATUS_ROC_AUX_RUNNING , &mvm->status)) {/* do the same in case of hot spot 2.0 */ -iwl_mvm_flush_sta (mvm, &mvm->aux_sta, true); +iwl_mvm_flush_sta (mvm, mvm->aux_sta.sta_id, + mvm->aux_sta.tfd_queue_msk);if (mvm->mld_api_is_used) {iwl_mvm_mld_rm_aux_sta (mvm);
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +2 -16
@@ -2317,24 +2317,10 @@ int iwl_mvm_flush_sta_tids(struct iwl_mvm *mvm, u32 sta_id, u16 tids)return ret; } -int iwl_mvm_flush_sta (struct iwl_mvm *mvm,void *sta,bool internal) +int iwl_mvm_flush_sta (struct iwl_mvm *mvm,u32 sta_id,u32 tfd_queue_mask) { -u32 sta_id, tfd_queue_msk; - -if (internal) { -struct iwl_mvm_int_sta *int_sta = sta; - - sta_id = int_sta->sta_id; - tfd_queue_msk = int_sta->tfd_queue_msk; - }else { -struct iwl_mvm_sta *mvm_sta = sta; - - sta_id = mvm_sta->deflink.sta_id; - tfd_queue_msk = mvm_sta->tfd_queue_msk; - } -if (iwl_mvm_has_new_tx_api (mvm))return iwl_mvm_flush_sta_tids (mvm, sta_id,0xffff ); -return iwl_mvm_flush_tx_path (mvm, tfd_queue_msk); +return iwl_mvm_flush_tx_path (mvm, tfd_queue_mask); }
Signature · 1 line
2.38.1
PATCH 14/16 wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta()
In reply to [email protected]From: Johannes Berg <[email protected]>
When I implemented iwl_mvm_mac_flush_sta() I completely botched it; it basically always happens after the iwl_mvm_sta_pre_rcu_remove() call, and that already clears mvm->fw_id_to_mac_id[] entries, so we cannot rely on those at iwl_mvm_mac_flush_sta() time. This means it never did anything.
Fix this by just going through the station IDs and now with the new API for iwl_mvm_flush_sta(), call those.
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +9 -11
@@ -5697,22 +5697,20 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,void iwl_mvm_mac_flush_sta (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_sta *sta) { +struct iwl_mvm_sta *mvmsta =iwl_mvm_sta_from_mac80211 (sta);struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw); -int i; +struct iwl_mvm_link_sta *mvm_link_sta; +struct ieee80211_link_sta *link_sta; +int link_id;mutex_lock (&mvm->mutex); -for (i =0 ; i < mvm->fw->ucode_capa.num_stations; i++) { -struct iwl_mvm_sta *mvmsta; -struct ieee80211_sta *tmp; - - tmp =rcu_dereference_protected (mvm->fw_id_to_mac_id[i], -lockdep_is_held (&mvm->mutex)); -if (tmp != sta) +for_each_sta_active_link (vif, sta, link_sta, link_id) { + mvm_link_sta =rcu_dereference_protected (mvmsta->link[link_id], +lockdep_is_held (&mvm->mutex)); +if (!mvm_link_sta)continue ; - mvmsta =iwl_mvm_sta_from_mac80211 (sta); - -if (iwl_mvm_flush_sta (mvm, mvmsta->deflink.sta_id, +if (iwl_mvm_flush_sta (mvm, mvm_link_sta->sta_id, mvmsta->tfd_queue_msk))IWL_ERR (mvm,"flush request fail\n" ); }
Signature · 1 line
2.38.1
PATCH 15/16 wifi: iwlwifi: mvm: remove TDLS stations from FW
In reply to [email protected]From: Johannes Berg <[email protected]>
When we remove TDLS stations, we need to remove them from FW immediately, even while associated. Some previous refactoring here lost the sta ID condition, add it back.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +2 -1
@@ -2060,7 +2060,8 @@ bool iwl_mvm_sta_del(struct iwl_mvm *mvm, struct ieee80211_vif *vif, *status =IWL_MVM_QUEUE_FREE ; } -if (vif->type ==NL80211_IFTYPE_STATION ) { +if (vif->type ==NL80211_IFTYPE_STATION && + mvm_link->ap_sta_id == sta_id) {/* if associated - we can't remove the AP STA now */ if (vif->cfg.assoc)return true;
Signature · 1 line
2.38.1
PATCH 16/16 wifi: iwlwifi: add support for activating UNII-1 in WW via BIOS
In reply to [email protected]From: Miri Korenblit <[email protected]>
There is a requirement from OEMs to support a new bit in DSM function 8, which will indicate that this device is an indoor one, and that it should activate UNII-1 (5.2GHz) sub band in the World Wide Geo Profile. Add support for this by reading this bit from BIOS and sending it to the FW.
--- .../net/wireless/intel/iwlwifi/fw/api/nvm-reg.h | 17 +++++++++++++---- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 14 +++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h +13 -4
@@ -605,6 +605,7 @@ struct iwl_lari_config_change_cmd_v6 {/** * struct iwl_lari_config_change_cmd_v7 - change LARI configuration +* This structure is used also for lari cmd version 8. * @config_bitmap: Bitmap of the config commands. Each bit will trigger a * different predefined FW config operation. * @oem_uhb_allow_bitmap: Bitmap of UHB enabled MCC sets.
@@ -614,9 +615,12 @@ struct iwl_lari_config_change_cmd_v6 {* @oem_unii4_allow_bitmap: Bitmap of unii4 allowed MCCs.There are two bits * per country, one to indicate whether to override and the other to * indicate allow/disallow unii4 channels. -* @chan_state_active_bitmap: Bitmap for overriding channel state to active. -* Each bit represents a country or region to activate, according to the -* BIOS definitions. +* @chan_state_active_bitmap: Bitmap to enable different bands per country +* or region. +* Each bit represents a country or region, and a band to activate +* according to the BIOS definitions. +* For LARI cmd version 7 - bits 0:3 are supported. +* For LARI cmd version 8 - bits 0:4 are supported. * @force_disable_channels_bitmap: Bitmap of disabled bands/channels. * Each bit represents a set of channels in a specific band that should be * disabled
@@ -631,7 +635,12 @@ struct iwl_lari_config_change_cmd_v7 {__le32 chan_state_active_bitmap;__le32 force_disable_channels_bitmap;__le32 edt_bitmap; -} __packed;/* LARI_CHANGE_CONF_CMD_S_VER_7 */ +} __packed; +/* LARI_CHANGE_CONF_CMD_S_VER_7 */ +/* LARI_CHANGE_CONF_CMD_S_VER_8 */ + +/* Activate UNII-1 (5.2GHz) for World Wide */ +#define ACTIVATE_5G2_IN_WW_MASK BIT(4)/** * struct iwl_pnvm_init_complete_ntfy - PNVM initialization complete
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +9 -5
@@ -1233,6 +1233,9 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)int ret;u32 value;struct iwl_lari_config_change_cmd_v7 cmd = {}; +u8 cmd_ver =iwl_fw_lookup_cmd_ver (mvm->fw, +WIDE_ID (REGULATORY_AND_NVM_GROUP , +LARI_CONFIG_CHANGE ),1 ); cmd.config_bitmap =iwl_acpi_get_lari_config_bitmap (&mvm->fwrt);
@@ -1250,8 +1253,11 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm) ret =iwl_acpi_get_dsm_u32 (mvm->fwrt.dev,0 ,DSM_FUNC_ACTIVATE_CHANNEL , &iwl_guid, &value); -if (!ret) +if (!ret) { +if (cmd_ver <8 ) + value &= ~ACTIVATE_5G2_IN_WW_MASK ; cmd.chan_state_active_bitmap =cpu_to_le32 (value); + } ret = iwl_acpi_get_dsm_u32(mvm->fwrt.dev, 0, DSM_FUNC_ENABLE_6E,
@@ -1279,11 +1285,9 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm) cmd.force_disable_channels_bitmap || cmd.edt_bitmap) {size_t cmd_size; -u8 cmd_ver =iwl_fw_lookup_cmd_ver (mvm->fw, -WIDE_ID (REGULATORY_AND_NVM_GROUP , -LARI_CONFIG_CHANGE ), -1 ); +switch (cmd_ver) { +case 8 :case 7 : cmd_size =sizeof (struct iwl_lari_config_change_cmd_v7 );break ;
Signature · 1 line
2.38.1
PATCH 1/16 wifi: iwlwifi: fw: increase fw_version string size
In reply to [email protected]From: Gregory Greenman <[email protected]>
In reality 64 bytes are enough to hold fw version string, but some compilers can complain (with W=1) that output may be truncated when building this string with snprintf. Increase the size to avoid this sort of warnings.
--- drivers/net/wireless/intel/iwlwifi/fw/img.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/img.h +2 -2
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* -* Copyright (C) 2005-2014, 2018-2021 Intel Corporation +* Copyright (C) 2005-2014, 2018-2023 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016 Intel Deutschland GmbH */
@@ -198,7 +198,7 @@ struct iwl_dump_exclude {struct iwl_fw {u32 ucode_ver; -char fw_version[64 ]; +char fw_version[128 ];/* ucode images */ struct fw_img img[IWL_UCODE_TYPE_MAX ];
Signature · 1 line
2.38.1
PATCH 5/16 wifi: iwlwifi: mvm: Fix key flags for IGTK on AP interface
In reply to [email protected]From: Ilan Peer <[email protected]>
When an IGTK is installed for an AP interface, there is no station associated with it. However, the MFP flag must be set for the installed key as otherwise the FW wouldn't use it.
Fix the security key flag to set the MFP flag also when the AP is an AP interface and the key index matches that of an IGTK.
--- drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +6 -1
@@ -96,7 +96,12 @@ u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm,if (!sta && vif->type ==NL80211_IFTYPE_STATION ) sta = mvmvif->ap_sta; -if (!IS_ERR_OR_NULL (sta) && sta->mfp) +/* Set the MFP flag also for an AP interface where the key is an IGTK +* key as in such a case the station would always be NULL +*/ +if ((!IS_ERR_OR_NULL (sta) && sta->mfp) || + (vif->type ==NL80211_IFTYPE_AP && + (keyconf->keyidx ==4 || keyconf->keyidx ==5 ))) flags |=IWL_SEC_KEY_FLAG_MFP ;return flags;
Signature · 1 line
2.38.1