wifi: iwlwifi: updates intended for v6.5 2023-05-24
cover wifi: iwlwifi: updates intended for v6.5 2023-05-24
From: Gregory Greenman <[email protected]>
Hi,
This patch set includes iwlwifi patches intended for v6.5. It primarily focus on the following areas:
* continuation of MLO work
* bugfixes
* cleanups
Thanks,
Gregory
Abhishek Naik (1):
wifi: iwlwifi: update response for mcc_update command
Alon Giladi (1):
wifi: iwlwifi: support PPAG in China for older FW cmd version
Ariel Malamud (1):
wifi: iwlwifi: fw: Add new ODM vendor to ppag approved list
Avraham Stern (1):
wifi: iwlwifi: mvm: support PASN for MLO
Emmanuel Grumbach (1):
wifi: iwlwifi: mvm: update the FW apis for LINK and MAC commands
Golan Ben Ami (1):
wifi: iwlwifi: cfg: freeze 22500 devices FW API
Gregory Greenman (2):
wifi: iwlwifi: mvm: adjust csa notifications and commands to MLO
wifi: iwlwifi: disable RX STBC when a device doesn't support it
Haim Dreyfuss (1):
wifi: iwlwifi: don't silently ignore missing suspend or resume ops
Johannes Berg (3):
wifi: iwlwifi: mvm: make internal callback structs const
wifi: iwlwifi: mvm: dissolve iwl_mvm_mac_add_interface_common()
wifi: iwlwifi: mvm: remove useless code
Miri Korenblit (1):
wifi: iwlwifi: mvm: Make iwl_mvm_diversity_iter() MLO aware
Yedidya Benshimol (1):
wifi: iwlwifi: mvm: use link ID in missed beacon notification
.../net/wireless/intel/iwlwifi/cfg/22000.c | 20 +-- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 16 ++- .../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 59 ++++++-- .../net/wireless/intel/iwlwifi/fw/api/mac.h | 22 ++- .../wireless/intel/iwlwifi/fw/api/nvm-reg.h | 35 ++++- drivers/net/wireless/intel/iwlwifi/fw/file.h | 1 + .../wireless/intel/iwlwifi/iwl-nvm-parse.c | 127 ++++++++++++------ .../wireless/intel/iwlwifi/iwl-nvm-parse.h | 4 +- .../net/wireless/intel/iwlwifi/iwl-trans.h | 4 +- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 3 + drivers/net/wireless/intel/iwlwifi/mvm/link.c | 6 + .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 94 +++++++++---- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 122 ++++++++--------- .../net/wireless/intel/iwlwifi/mvm/mld-key.c | 27 ++-- .../net/wireless/intel/iwlwifi/mvm/mld-mac.c | 10 +- .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 6 +- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 10 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 33 ++++- drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 58 ++++++-- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 50 ++++--- drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 11 +- .../net/wireless/intel/iwlwifi/mvm/utils.c | 20 +-- 22 files changed, 506 insertions(+), 232 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/14 wifi: iwlwifi: cfg: freeze 22500 devices FW API
From: Golan Ben Ami <[email protected]>
FW version is now frozen for 22500 devices. Don't
allow newer versions in the driver.
--- .../net/wireless/intel/iwlwifi/cfg/22000.c | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/net/wireless/intel/iwlwifi/cfg/22000.c +11 -9
@@ -11,6 +11,7 @@/* Highest firmware API version supported */ #define IWL_22000_UCODE_API_MAX 78 +#define IWL_22500_UCODE_API_MAX 77/* Lowest firmware API version supported */ #define IWL_22000_UCODE_API_MIN 39
@@ -222,7 +223,6 @@ static const struct iwl_ht_params iwl_gl_a_ht_params = { };#define IWL_DEVICE_22000_COMMON \ - .ucode_api_max = IWL_22000_UCODE_API_MAX, \ .ucode_api_min = IWL_22000_UCODE_API_MIN, \ .led_mode = IWL_LED_RF_STATE, \ .nvm_hw_section_num = 10, \
@@ -261,6 +261,7 @@ static const struct iwl_ht_params iwl_gl_a_ht_params = {#define IWL_DEVICE_22500 \ IWL_DEVICE_22000_COMMON, \ + .ucode_api_max = IWL_22500_UCODE_API_MAX, \ .trans.device_family = IWL_DEVICE_FAMILY_22000, \ .trans.base_params = &iwl_22000_base_params, \ .gp2_reg_addr = 0xa02c68, \
@@ -277,6 +278,7 @@ static const struct iwl_ht_params iwl_gl_a_ht_params = {#define IWL_DEVICE_AX210 \ IWL_DEVICE_22000_COMMON, \ + .ucode_api_max = IWL_22000_UCODE_API_MAX, \ .trans.umac_prph_offset = 0x300000, \ .trans.device_family = IWL_DEVICE_FAMILY_AX210, \ .trans.base_params = &iwl_ax210_base_params, \
@@ -1178,14 +1180,14 @@ const struct iwl_cfg iwl_cfg_bnj_b0_fm_b0 = { .features = IWL_TX_CSUM_NETIF_FLAGS_BZ | NETIF_F_RXCSUM, .num_rbds = IWL_NUM_RBDS_AX210_HE, }; -MODULE_FIRMWARE (IWL_QU_B_HR_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); -MODULE_FIRMWARE (IWL_QNJ_B_HR_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); -MODULE_FIRMWARE (IWL_QU_C_HR_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); -MODULE_FIRMWARE (IWL_QU_B_JF_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); -MODULE_FIRMWARE (IWL_QUZ_A_HR_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); -MODULE_FIRMWARE (IWL_QUZ_A_JF_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); -MODULE_FIRMWARE (IWL_QNJ_B_JF_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); -MODULE_FIRMWARE (IWL_CC_A_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_QU_B_HR_B_MODULE_FIRMWARE (IWL_22500_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_QNJ_B_HR_B_MODULE_FIRMWARE (IWL_22500_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_QU_C_HR_B_MODULE_FIRMWARE (IWL_22500_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_QU_B_JF_B_MODULE_FIRMWARE (IWL_22500_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_QUZ_A_HR_B_MODULE_FIRMWARE (IWL_22500_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_QUZ_A_JF_B_MODULE_FIRMWARE (IWL_22500_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_QNJ_B_JF_B_MODULE_FIRMWARE (IWL_22500_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_CC_A_MODULE_FIRMWARE (IWL_22500_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_SO_A_JF_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_SO_A_HR_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_SO_A_GF_A_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));
Signature · 1 line
2.38.1
PATCH 2/14 wifi: iwlwifi: mvm: use link ID in missed beacon notification
In reply to [email protected]From: Yedidya Benshimol <[email protected]>
This new version of missed beacon notification uses link_id instead of mac_id. Also add an option to use link id for retrieving vif.
--- .../net/wireless/intel/iwlwifi/fw/api/mac.h | 22 ++++++++++++-- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 3 ++ drivers/net/wireless/intel/iwlwifi/mvm/link.c | 5 ++++ .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 29 +++++++++++++++---- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 15 ++++++++++ 5 files changed, 66 insertions(+), 8 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/mac.h +20 -2
@@ -353,7 +353,7 @@ struct iwl_nonqos_seq_query_cmd { } __packed;/* NON_QOS_TX_COUNTER_GET_SET_API_S_VER_1 */ /** -* struct iwl_missed_beacons_notif - information on missed beacons +* struct iwl_missed_beacons_notif_ver_3 - information on missed beacons * ( MISSED_BEACONS_NOTIFICATION = 0xa2 ) * @mac_id: interface ID * @consec_missed_beacons_since_last_rx: number of consecutive missed
@@ -362,7 +362,7 @@ struct iwl_nonqos_seq_query_cmd {* @num_expected_beacons: number of expected beacons * @num_recvd_beacons: number of received beacons */ -struct iwl_missed_beacons_notif { +struct iwl_missed_beacons_notif_ver_3 {__le32 mac_id;__le32 consec_missed_beacons_since_last_rx;__le32 consec_missed_beacons;
@@ -370,6 +370,24 @@ struct iwl_missed_beacons_notif {__le32 num_recvd_beacons; } __packed;/* MISSED_BEACON_NTFY_API_S_VER_3 */ +/** +* struct iwl_missed_beacons_notif - information on missed beacons +* ( MISSED_BEACONS_NOTIFICATION = 0xa2 ) +* @link_id: fw link ID +* @consec_missed_beacons_since_last_rx: number of consecutive missed +* beacons since last RX. +* @consec_missed_beacons: number of consecutive missed beacons +* @num_expected_beacons: number of expected beacons +* @num_recvd_beacons: number of received beacons +*/ +struct iwl_missed_beacons_notif { +__le32 link_id; +__le32 consec_missed_beacons_since_last_rx; +__le32 consec_missed_beacons; +__le32 num_expected_beacons; +__le32 num_recvd_beacons; +} __packed;/* MISSED_BEACON_NTFY_API_S_VER_4 */ +/** * struct iwl_he_backoff_conf - used for backoff configuration * Per each trigger-based AC, (set by MU EDCA Parameter set info-element)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +3 -0
@@ -1591,6 +1591,9 @@ int iwl_mvm_up(struct iwl_mvm *mvm)RCU_INIT_POINTER (mvm->fw_id_to_link_sta[i],NULL ); } +for (i =0 ; i <IWL_MVM_FW_MAX_LINK_ID +1 ; i++) +RCU_INIT_POINTER (mvm->link_id_to_link_conf[i],NULL ); +memset (&mvm->fw_link_ids_map,0 ,sizeof (mvm->fw_link_ids_map)); mvm->tdls_cs.peer.sta_id =IWL_MVM_INVALID_STA ;
drivers/net/wireless/intel/iwlwifi/mvm/link.c +5 -0
@@ -63,6 +63,9 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, mvmvif);if (link_info->fw_link_id ==IWL_MVM_FW_LINK_ID_INVALID )return -EINVAL ; + +rcu_assign_pointer (mvm->link_id_to_link_conf[link_info->fw_link_id], + link_conf); }/* Update SF - Disable if needed. if this fails, SF might still be on
@@ -260,6 +263,8 @@ int iwl_mvm_remove_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID))return -EINVAL ; +RCU_INIT_POINTER (mvm->link_id_to_link_conf[link_info->fw_link_id], +NULL ); cmd.link_id =cpu_to_le32 (link_info->fw_link_id);iwl_mvm_release_fw_link_id (mvm, link_info->fw_link_id); link_info->fw_link_id =IWL_MVM_FW_LINK_ID_INVALID ;
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +23 -6
@@ -1555,21 +1555,38 @@ void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm,u32 stop_trig_missed_bcon, stop_trig_missed_bcon_since_rx;u32 rx_missed_bcon, rx_missed_bcon_since_rx;struct ieee80211_vif *vif; -u32 id =le32_to_cpu (mb->mac_id); +/* Id can be mac/link id depending on the notification version */ +u32 id =le32_to_cpu (mb->link_id);union iwl_dbg_tlv_tp_data tp_data = { .fw_pkt = pkt };u32 mac_type; +u8 notif_ver =iwl_fw_lookup_notif_ver (mvm->fw,LEGACY_GROUP , +MISSED_BEACONS_NOTIFICATION , +0 ); + +rcu_read_lock (); + +/* before version four the ID in the notification refers to mac ID */ +if (notif_ver <4 ) { + vif =iwl_mvm_rcu_dereference_vif_id (mvm, id, true); + }else { +struct ieee80211_bss_conf *bss_conf = +iwl_mvm_rcu_fw_link_id_to_link_conf (mvm, id, true); + +if (!bss_conf) + goto out; + + vif = bss_conf->vif; + }IWL_DEBUG_INFO (mvm, -"missed bcn mac_id=%u, consecutive=%u (%u, %u, %u)\n" , -le32_to_cpu (mb->mac_id), +"missed bcn %s_id=%u, consecutive=%u (%u, %u, %u)\n" , + notif_ver <4 ?"mac" :"link" , + id,le32_to_cpu (mb->consec_missed_beacons),le32_to_cpu (mb->consec_missed_beacons_since_last_rx),le32_to_cpu (mb->num_recvd_beacons),le32_to_cpu (mb->num_expected_beacons)); -rcu_read_lock (); - - vif =iwl_mvm_rcu_dereference_vif_id (mvm, id, true);if (!vif) goto out;
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +15 -0
@@ -1003,6 +1003,8 @@ struct iwl_mvm {struct ieee80211_vif __rcu *vif_id_to_mac[NUM_MAC_INDEX_DRIVER ]; +struct ieee80211_bss_conf __rcu *link_id_to_link_conf[IWL_MVM_FW_MAX_LINK_ID +1 ]; +/* -1 for always, 0 for never, >0 for that many times */ s8 fw_restart;u8 *error_recovery_buf;
@@ -1302,6 +1304,19 @@ iwl_mvm_rcu_dereference_vif_id(struct iwl_mvm *mvm, u8 vif_id, bool rcu) lockdep_is_held(&mvm->mutex)); } +static inline struct ieee80211_bss_conf * +iwl_mvm_rcu_fw_link_id_to_link_conf (struct iwl_mvm *mvm,u8 link_id,bool rcu) +{ +if (WARN_ON (link_id >=ARRAY_SIZE (mvm->link_id_to_link_conf))) +return NULL ; + +if (rcu) +return rcu_dereference (mvm->link_id_to_link_conf[link_id]); + +return rcu_dereference_protected (mvm->link_id_to_link_conf[link_id], +lockdep_is_held (&mvm->mutex)); +} +static inline bool iwl_mvm_is_adaptive_dwell_supported (struct iwl_mvm *mvm) { return fw_has_api(&mvm->fw->ucode_capa,
Signature · 1 line
2.38.1
PATCH 3/14 wifi: iwlwifi: mvm: make internal callback structs const
In reply to [email protected]From: Johannes Berg <[email protected]>
There's no need for these to be writable, so they can be const (and static).
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 28 +++++++++---------- .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 6 ++-- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 6 ++-- drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +14 -14
@@ -3054,7 +3054,7 @@ static void iwl_mvm_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_bss_conf *bss_conf, u64 changes) { -struct iwl_mvm_bss_info_changed_ops callbacks = { +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, };
@@ -3067,7 +3067,7 @@ void iwl_mvm_bss_info_changed_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, - struct iwl_mvm_bss_info_changed_ops *callbacks, + const struct iwl_mvm_bss_info_changed_ops *callbacks, u64 changes) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
@@ -3564,7 +3564,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, enum ieee80211_sta_state old_state, enum ieee80211_sta_state new_state) { - struct iwl_mvm_sta_state_ops callbacks = { +static const struct iwl_mvm_sta_state_ops callbacks = { .add_sta = iwl_mvm_add_sta, .update_sta = iwl_mvm_update_sta, .rm_sta = iwl_mvm_rm_sta,
@@ -3672,7 +3672,7 @@ static int iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta, - struct iwl_mvm_sta_state_ops *callbacks) + const struct iwl_mvm_sta_state_ops *callbacks) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);unsigned int i;
@@ -3721,7 +3721,7 @@ iwl_mvm_sta_state_auth_to_assoc(struct ieee80211_hw *hw,struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta, - struct iwl_mvm_sta_state_ops *callbacks) + const struct iwl_mvm_sta_state_ops *callbacks) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);struct iwl_mvm_sta *mvm_sta =iwl_mvm_sta_from_mac80211 (sta);
@@ -3778,7 +3778,7 @@ static int iwl_mvm_sta_state_assoc_to_authorized(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta, - struct iwl_mvm_sta_state_ops *callbacks) + const struct iwl_mvm_sta_state_ops *callbacks) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);struct iwl_mvm_sta *mvm_sta =iwl_mvm_sta_from_mac80211 (sta);
@@ -3813,7 +3813,7 @@ static int iwl_mvm_sta_state_authorized_to_assoc(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta, - struct iwl_mvm_sta_state_ops *callbacks) + const struct iwl_mvm_sta_state_ops *callbacks) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);struct iwl_mvm_sta *mvmsta =iwl_mvm_sta_from_mac80211 (sta);
@@ -3851,7 +3851,7 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw,struct ieee80211_sta *sta, enum ieee80211_sta_state old_state, enum ieee80211_sta_state new_state, - struct iwl_mvm_sta_state_ops *callbacks) + const struct iwl_mvm_sta_state_ops *callbacks) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif);
@@ -4578,7 +4578,7 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw, int duration, enum ieee80211_roc_type type) { -struct iwl_mvm_roc_ops ops = { +static const struct iwl_mvm_roc_ops ops = { .add_aux_sta_for_hs20 = iwl_mvm_add_aux_sta_for_hs20, .switch_phy_ctxt = iwl_mvm_roc_switch_binding, };
@@ -4590,7 +4590,7 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw,int iwl_mvm_roc_common (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_channel *channel,int duration,enum ieee80211_roc_type type, -struct iwl_mvm_roc_ops *ops) +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);
@@ -5097,7 +5097,7 @@ static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw,static int iwl_mvm_switch_vif_chanctx_swap (struct iwl_mvm *mvm,struct ieee80211_vif_chanctx_switch *vifs, -struct iwl_mvm_switch_vif_chanctx_ops *ops) +const struct iwl_mvm_switch_vif_chanctx_ops *ops) {int ret;
@@ -5156,7 +5156,7 @@ iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm,static int iwl_mvm_switch_vif_chanctx_reassign (struct iwl_mvm *mvm,struct ieee80211_vif_chanctx_switch *vifs, -struct iwl_mvm_switch_vif_chanctx_ops *ops) +const struct iwl_mvm_switch_vif_chanctx_ops *ops) {int ret;
@@ -5199,7 +5199,7 @@ iwl_mvm_switch_vif_chanctx_common(struct ieee80211_hw *hw,struct ieee80211_vif_chanctx_switch *vifs, int n_vifs, enum ieee80211_chanctx_switch_mode mode, - struct iwl_mvm_switch_vif_chanctx_ops *ops) + const struct iwl_mvm_switch_vif_chanctx_ops *ops) { struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);int ret;
@@ -5228,7 +5228,7 @@ static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw, int n_vifs, enum ieee80211_chanctx_switch_mode mode) { -struct iwl_mvm_switch_vif_chanctx_ops ops = { +static const struct iwl_mvm_switch_vif_chanctx_ops ops = { .__assign_vif_chanctx = __iwl_mvm_assign_vif_chanctx, .__unassign_vif_chanctx = __iwl_mvm_unassign_vif_chanctx, };
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +3 -3
@@ -492,7 +492,7 @@ static int iwl_mvm_mld_mac_sta_state(struct ieee80211_hw *hw, enum ieee80211_sta_state old_state, enum ieee80211_sta_state new_state) { - struct iwl_mvm_sta_state_ops callbacks = { +static const struct iwl_mvm_sta_state_ops callbacks = { .add_sta = iwl_mvm_mld_add_sta, .update_sta = iwl_mvm_mld_update_sta, .rm_sta = iwl_mvm_mld_rm_sta,
@@ -779,7 +779,7 @@ iwl_mvm_mld_switch_vif_chanctx(struct ieee80211_hw *hw, int n_vifs, enum ieee80211_chanctx_switch_mode mode) { -struct iwl_mvm_switch_vif_chanctx_ops ops = { +static const struct iwl_mvm_switch_vif_chanctx_ops ops = { .__assign_vif_chanctx = __iwl_mvm_mld_assign_vif_chanctx, .__unassign_vif_chanctx = __iwl_mvm_mld_unassign_vif_chanctx, };
@@ -871,7 +871,7 @@ static int iwl_mvm_mld_roc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_channel *channel, int duration, enum ieee80211_roc_type type) { - struct iwl_mvm_roc_ops ops = { + static const struct iwl_mvm_roc_ops ops = { .add_aux_sta_for_hs20 = iwl_mvm_mld_add_aux_sta, .switch_phy_ctxt = iwl_mvm_link_switch_phy_ctx, };
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +3 -3
@@ -1888,7 +1888,7 @@ void iwl_mvm_bss_info_changed_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, - struct iwl_mvm_bss_info_changed_ops *callbacks, + const struct iwl_mvm_bss_info_changed_ops *callbacks, u64 changes); void iwl_mvm_bss_info_changed_station_common(struct iwl_mvm *mvm,
@@ -1922,7 +1922,7 @@ struct iwl_mvm_roc_ops {int iwl_mvm_roc_common (struct ieee80211_hw *hw,struct ieee80211_vif *vif,struct ieee80211_channel *channel,int duration,enum ieee80211_roc_type type, -struct iwl_mvm_roc_ops *ops); +const struct iwl_mvm_roc_ops *ops);int iwl_mvm_cancel_roc (struct ieee80211_hw *hw,struct ieee80211_vif *vif);/*Session Protection */
@@ -2420,7 +2420,7 @@ iwl_mvm_switch_vif_chanctx_common(struct ieee80211_hw *hw,struct ieee80211_vif_chanctx_switch *vifs, int n_vifs, enum ieee80211_chanctx_switch_mode mode, - struct iwl_mvm_switch_vif_chanctx_ops *ops); + const struct iwl_mvm_switch_vif_chanctx_ops *ops);/* Channel info utils */ static inline bool iwl_mvm_has_ultra_hb_channel (struct iwl_mvm *mvm)
drivers/net/wireless/intel/iwlwifi/mvm/sta.h +1 -1
@@ -616,7 +616,7 @@ int iwl_mvm_mac_sta_state_common(struct ieee80211_hw *hw,struct ieee80211_sta *sta, enum ieee80211_sta_state old_state, enum ieee80211_sta_state new_state, - struct iwl_mvm_sta_state_ops *callbacks); + const struct iwl_mvm_sta_state_ops *callbacks);/* New MLD STA related APIs */ /* STA */
Signature · 1 line
2.38.1
PATCH 4/14 wifi: iwlwifi: mvm: dissolve iwl_mvm_mac_add_interface_common()
In reply to [email protected]From: Johannes Berg <[email protected]>
This wasn't really common anymore, so dissolve it, it has a pretty strange calling convention that's confusing.
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 90 ++++++++----------- 1 file changed, 37 insertions(+), 53 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +37 -53
@@ -1478,21 +1478,37 @@ iwl_mvm_chandef_get_primary_80(struct cfg80211_chan_def *chandef)return (control_start - data_start) /80 ; } -/* -* Returns true if addding the interface is done -* (either with success or failure) -* -* FIXME: remove this again and merge it in -*/ -static bool iwl_mvm_mac_add_interface_common (struct iwl_mvm *mvm, -struct ieee80211_hw *hw, -struct ieee80211_vif *vif, -int *ret) +static int iwl_mvm_alloc_bcast_mcast_sta (struct iwl_mvm *mvm, +struct ieee80211_vif *vif) {struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); +int ret;lockdep_assert_held (&mvm->mutex); + ret =iwl_mvm_alloc_bcast_sta (mvm, vif); +if (ret) { +IWL_ERR (mvm,"Failed to allocate bcast sta\n" ); +return ret; + } + +/* Only queue for this station is the mcast queue, +* which shouldn't be in TFD mask anyway +*/ +return iwl_mvm_allocate_int_sta (mvm, &mvmvif->deflink.mcast_sta,0 , + vif->type, +IWL_STA_MULTICAST ); +} + +static int iwl_mvm_mac_add_interface (struct ieee80211_hw *hw, +struct ieee80211_vif *vif) +{ +struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw); +struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); +int ret; + +mutex_lock (&mvm->mutex); + mvmvif->mvm = mvm;/* the first link always points to the default one */
@@ -1510,12 +1526,18 @@ static bool iwl_mvm_mac_add_interface_common(struct iwl_mvm *mvm, mvmvif->deflink.beacon_stats.num_beacons;/* Allocate resources for the MAC context, and add it to the fw */ - *ret =iwl_mvm_mac_ctxt_init (mvm, vif); -if (*ret) -return true; + ret =iwl_mvm_mac_ctxt_init (mvm, vif); +if (ret) + goto out;rcu_assign_pointer (mvm->vif_id_to_mac[mvmvif->id], vif); +/* Currently not much to do for NAN */ +if (vif->type ==NL80211_IFTYPE_NAN ) { + ret =0 ; + goto out; + } +/* * The AP binding flow can be done only after the beacon * template is configured (which happens only in the mac80211
@@ -1530,50 +1552,12 @@ static bool iwl_mvm_mac_add_interface_common(struct iwl_mvm *mvm,if (vif->type ==NL80211_IFTYPE_AP || vif->type ==NL80211_IFTYPE_ADHOC ) {iwl_mvm_vif_dbgfs_register (mvm, vif); -return true; + ret =0 ; + goto out; } mvmvif->features |= hw->netdev_features; -return false; -} - -static int iwl_mvm_alloc_bcast_mcast_sta (struct iwl_mvm *mvm, -struct ieee80211_vif *vif) -{ -struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); -int ret; - -lockdep_assert_held (&mvm->mutex); - - ret =iwl_mvm_alloc_bcast_sta (mvm, vif); -if (ret) { -IWL_ERR (mvm,"Failed to allocate bcast sta\n" ); -return ret; - } - -/* -* Only queue for this station is the mcast queue, -* which shouldn't be in TFD mask anyway -*/ -return iwl_mvm_allocate_int_sta (mvm, &mvmvif->deflink.mcast_sta,0 , - vif->type, -IWL_STA_MULTICAST ); -} - -static int iwl_mvm_mac_add_interface (struct ieee80211_hw *hw, -struct ieee80211_vif *vif) -{ -struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw); -struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); -int ret; - -mutex_lock (&mvm->mutex); - -/* Common for MLD and non-MLD API */ -if (iwl_mvm_mac_add_interface_common (mvm, hw, vif, &ret)) - goto out; - ret =iwl_mvm_mac_ctxt_add (mvm, vif);if (ret) goto out_unlock;
Signature · 1 line
2.38.1
PATCH 5/14 wifi: iwlwifi: mvm: support PASN for MLO
In reply to [email protected]From: Avraham Stern <[email protected]>
When adding a PASN station, the non MLD API was used. This results in assert when operating as MLD. Fix it to use the MLD API when operating as MLD. For now, the default link is used for the added station.
--- .../net/wireless/intel/iwlwifi/mvm/mld-key.c | 27 ++++++++----- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 10 ++--- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 6 +++ drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 39 +++++++++++++++---- drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 5 +++ 5 files changed, 65 insertions(+), 22 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +17 -10
@@ -51,10 +51,10 @@ static u32 iwl_mvm_get_sec_sta_mask(struct iwl_mvm *mvm,return iwl_mvm_sta_fw_id_mask (mvm, sta, keyconf->link_id); } -static u32 iwl_mvm_get_sec_flags (struct iwl_mvm *mvm, -struct ieee80211_vif *vif, -struct ieee80211_sta *sta, -struct ieee80211_key_conf *keyconf) +u32 iwl_mvm_get_sec_flags (struct iwl_mvm *mvm, +struct ieee80211_vif *vif, +struct ieee80211_sta *sta, +struct ieee80211_key_conf *keyconf) {struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif);u32 flags =0 ;
@@ -164,13 +164,9 @@ static int __iwl_mvm_sec_key_del(struct iwl_mvm *mvm, u32 sta_mask,return iwl_mvm_send_cmd_pdu (mvm, cmd_id, flags,sizeof (cmd), &cmd); } -int iwl_mvm_sec_key_add (struct iwl_mvm *mvm, -struct ieee80211_vif *vif, -struct ieee80211_sta *sta, -struct ieee80211_key_conf *keyconf) +int iwl_mvm_mld_send_key (struct iwl_mvm *mvm,u32 sta_mask,u32 key_flags, +struct ieee80211_key_conf *keyconf) { -u32 sta_mask =iwl_mvm_get_sec_sta_mask (mvm, vif, sta, keyconf); -u32 key_flags =iwl_mvm_get_sec_flags (mvm, vif, sta, keyconf);u32 cmd_id =WIDE_ID (DATA_PATH_GROUP ,SEC_KEY_CMD );struct iwl_sec_key_cmd cmd = { .action =cpu_to_le32 (FW_CTXT_ACTION_ADD ),
@@ -223,6 +219,17 @@ int iwl_mvm_sec_key_add(struct iwl_mvm *mvm,return ret; } +int iwl_mvm_sec_key_add (struct iwl_mvm *mvm, +struct ieee80211_vif *vif, +struct ieee80211_sta *sta, +struct ieee80211_key_conf *keyconf) +{ +u32 sta_mask =iwl_mvm_get_sec_sta_mask (mvm, vif, sta, keyconf); +u32 key_flags =iwl_mvm_get_sec_flags (mvm, vif, sta, keyconf); + +return iwl_mvm_mld_send_key (mvm, sta_mask, key_flags, keyconf); +} + static int _iwl_mvm_sec_key_del(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta,
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +5 -5
@@ -128,11 +128,11 @@ static int iwl_mvm_add_aux_sta_to_fw(struct iwl_mvm *mvm,/* * Adds an internal sta to the FW table with its queues */ -static int iwl_mvm_mld_add_int_sta_with_queue (struct iwl_mvm *mvm, -struct iwl_mvm_int_sta *sta, -const u8 *addr,int link_id, -u16 *queue,u8 tid, -unsigned int *_wdg_timeout) +int iwl_mvm_mld_add_int_sta_with_queue (struct iwl_mvm *mvm, +struct iwl_mvm_int_sta *sta, +const u8 *addr,int link_id, +u16 *queue,u8 tid, +unsigned int *_wdg_timeout) {int ret, txq; unsigned int wdg_timeout = _wdg_timeout ? *_wdg_timeout :
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +6 -0
@@ -2361,6 +2361,12 @@ int iwl_mvm_mld_update_sta_keys(struct iwl_mvm *mvm,struct ieee80211_sta *sta, u32 old_sta_mask, u32 new_sta_mask); +int iwl_mvm_mld_send_key (struct iwl_mvm *mvm,u32 sta_mask,u32 key_flags, +struct ieee80211_key_conf *keyconf); +u32 iwl_mvm_get_sec_flags (struct iwl_mvm *mvm, +struct ieee80211_vif *vif, +struct ieee80211_sta *sta, +struct ieee80211_key_conf *keyconf);int iwl_rfi_send_config_cmd (struct iwl_mvm *mvm,struct iwl_rfi_lut_entry *rfi_table);
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +32 -7
@@ -4301,16 +4301,27 @@ int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,u16 queue;struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif);struct ieee80211_key_conf *keyconf; +unsigned int wdg_timeout = +iwl_mvm_get_wd_timeout (mvm, vif, false, false); +bool mld =iwl_mvm_has_mld_api (mvm->fw); +u32 type = mld ?STATION_TYPE_PEER :IWL_STA_LINK ; ret =iwl_mvm_allocate_int_sta (mvm, sta,0 , -NL80211_IFTYPE_UNSPECIFIED , -IWL_STA_LINK ); +NL80211_IFTYPE_UNSPECIFIED , type);if (ret)return ret; - ret =iwl_mvm_add_int_sta_with_queue (mvm, mvmvif->id, mvmvif->color, - addr, sta, &queue, -IWL_MVM_TX_FIFO_BE ); +if (mld) + ret =iwl_mvm_mld_add_int_sta_with_queue (mvm, sta, addr, + mvmvif->deflink.fw_link_id, + &queue, +IWL_MAX_TID_COUNT , + &wdg_timeout); +else + ret =iwl_mvm_add_int_sta_with_queue (mvm, mvmvif->id, + mvmvif->color, addr, sta, + &queue, +IWL_MVM_TX_FIFO_BE );if (ret) goto out;
@@ -4323,9 +4334,23 @@ int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, keyconf->cipher = cipher;memcpy (keyconf->key, key, key_len); keyconf->keylen = key_len; + keyconf->flags =IEEE80211_KEY_FLAG_PAIRWISE ; + +if (mld) { +/* The MFP flag is set according to the station mfp field. Since +* we don't have a station, set it manually. +*/ +u32 key_flags = +iwl_mvm_get_sec_flags (mvm, vif,NULL , keyconf) | +IWL_SEC_KEY_FLAG_MFP ; +u32 sta_mask =BIT (sta->sta_id); + + ret =iwl_mvm_mld_send_key (mvm, sta_mask, key_flags, keyconf); + }else { + ret =iwl_mvm_send_sta_key (mvm, sta->sta_id, keyconf, false, +0 ,NULL ,0 ,0 , true); + } - ret =iwl_mvm_send_sta_key (mvm, sta->sta_id, keyconf, false, -0 ,NULL ,0 ,0 , true);kfree (keyconf);return 0 ; out:
drivers/net/wireless/intel/iwlwifi/mvm/sta.h +5 -0
@@ -646,6 +646,11 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm, u16 old_links, u16 new_links);u32 iwl_mvm_sta_fw_id_mask (struct iwl_mvm *mvm,struct ieee80211_sta *sta,int filter_link_id); +int iwl_mvm_mld_add_int_sta_with_queue (struct iwl_mvm *mvm, +struct iwl_mvm_int_sta *sta, +const u8 *addr,int link_id, +u16 *queue,u8 tid, +unsigned int *_wdg_timeout);/* Queues */ void iwl_mvm_mld_modify_all_sta_disable_tx(struct iwl_mvm *mvm,
Signature · 1 line
2.38.1
PATCH 6/14 wifi: iwlwifi: don't silently ignore missing suspend or resume ops
In reply to [email protected]From: Haim Dreyfuss <[email protected]>
In case the driver doesn't implement suspend or resume operations on the transport layer, notify the driver's upper layer. Otherwise, we might access d3_status uninitialized.
--- drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-trans.h +2 -2
@@ -1160,7 +1160,7 @@ static inline int iwl_trans_d3_suspend(struct iwl_trans *trans, bool test, {might_sleep ();if (!trans->ops->d3_suspend) -return 0 ; +return -EOPNOTSUPP ;return trans->ops->d3_suspend (trans, test, reset); }
@@ -1171,7 +1171,7 @@ static inline int iwl_trans_d3_resume(struct iwl_trans *trans, {might_sleep ();if (!trans->ops->d3_resume) -return 0 ; +return -EOPNOTSUPP ;return trans->ops->d3_resume (trans, status, test, reset); }
Signature · 1 line
2.38.1
PATCH 7/14 wifi: iwlwifi: mvm: Make iwl_mvm_diversity_iter() MLO aware
In reply to [email protected]From: Miri Korenblit <[email protected]>
This function is MLO related, so it should iterate over all the links, and not only on deflink.
--- .../net/wireless/intel/iwlwifi/mvm/utils.c | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/utils.c +12 -8
@@ -413,16 +413,20 @@ static void iwl_mvm_diversity_iter(void *_data, u8 *mac, {struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif);struct iwl_mvm_diversity_iter_data *data = _data; -int i; +int i, link_id; -if (mvmvif->deflink.phy_ctxt != data->ctxt) -return ; +for_each_mvm_vif_valid_link (mvmvif, link_id) { +struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id]; -for (i =0 ; i <NUM_IWL_MVM_SMPS_REQ ; i++) { -if (mvmvif->deflink.smps_requests[i] ==IEEE80211_SMPS_STATIC || - mvmvif->deflink.smps_requests[i] ==IEEE80211_SMPS_DYNAMIC ) { - data->result = false; -break ; +if (link_info->phy_ctxt != data->ctxt) +continue ; + +for (i =0 ; i <NUM_IWL_MVM_SMPS_REQ ; i++) { +if (link_info->smps_requests[i] ==IEEE80211_SMPS_STATIC || + link_info->smps_requests[i] ==IEEE80211_SMPS_DYNAMIC ) { + data->result = false; +break ; + } } } }
Signature · 1 line
2.38.1
PATCH 8/14 wifi: iwlwifi: mvm: update the FW apis for LINK and MAC commands
In reply to [email protected]From: Emmanuel Grumbach <[email protected]>
The firmware added new fields to be able to pass the link_id as the AP knows it and the esr_transition_timeout.
For now, pass only the link_id since we don't have access to the esr_transition_timeout yet.
--- .../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 29 ++++++++++++++----- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 1 + .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 14 ++++----- .../net/wireless/intel/iwlwifi/mvm/mld-mac.c | 10 +++---- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 4 +-- 5 files changed, 37 insertions(+), 21 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h +22 -7
@@ -211,17 +211,30 @@ struct iwl_mac_low_latency_cmd {* struct iwl_mac_client_data - configuration data for client MAC context * * @is_assoc: 1 for associated state, 0 otherwise +* @esr_transition_timeout: the timeout required by the AP for the +* eSR transition. +* Available only from version 2 of the command. +* This values comes from the EMLSR transition delay in the EML +* Capabilities subfield. +* @reserved: alignment * @assoc_id: unique ID assigned by the AP during association +* @reserved1: alignment * @data_policy: see &enum iwl_mac_data_policy +* @reserved2: alignment * @ctwin: client traffic window in TU (period after TBTT when GO is present). * 0 indicates that there is no CT window. */ struct iwl_mac_client_data { -__le32 is_assoc; -__le32 assoc_id; -__le32 data_policy; +u8 is_assoc; +u8 esr_transition_timeout; +__le16 reserved; + +__le16 assoc_id; +__le16 reserved1; +__le16 data_policy; +__le16 reserved2;__le32 ctwin; -} __packed;/* MAC_CONTEXT_CONFIG_CLIENT_DATA_API_S_VER_1 */ +} __packed;/* MAC_CONTEXT_CONFIG_CLIENT_DATA_API_S_VER_2 */ /** * struct iwl_mac_p2p_dev_data - configuration data for P2P device MAC context
@@ -292,12 +305,12 @@ struct iwl_mac_config_cmd {__le16 he_ap_support;__le32 eht_support;__le32 nic_not_ack_enabled; -/* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_1 */ +/* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_2 */ union {struct iwl_mac_client_data client;struct iwl_mac_p2p_dev_data p2p_dev; }; -} __packed;/* MAC_CONTEXT_CONFIG_CMD_API_S_VER_1 */ +} __packed;/* MAC_CONTEXT_CONFIG_CMD_API_S_VER_2 */ /** * enum iwl_link_ctx_modify_flags - indicate to the fw what fields are being
@@ -430,6 +443,7 @@ enum iwl_link_ctx_flags {* @reserved_for_ref_bssid_addr: reserved * @bssid_index: index of the associated VAP * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame +* @spec_link_id: link_id as the AP knows it * @reserved: alignment * @ibss_bssid_addr: bssid for ibss * @reserved_for_ibss_bssid_addr: reserved
@@ -469,7 +483,8 @@ struct iwl_link_config_cmd {__le16 reserved_for_ref_bssid_addr;u8 bssid_index;u8 bss_color; -u8 reserved[2 ]; +u8 spec_link_id; +u8 reserved;u8 ibss_bssid_addr[6 ];__le16 reserved_for_ibss_bssid_addr;__le32 reserved1[8 ];
drivers/net/wireless/intel/iwlwifi/mvm/link.c +1 -0
@@ -76,6 +76,7 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, cmd.link_id =cpu_to_le32 (link_info->fw_link_id); cmd.mac_id =cpu_to_le32 (mvmvif->id); + cmd.spec_link_id = link_conf->link_id;/* P2P-Device already has a valid PHY context during add */ phyctxt = link_info->phy_ctxt;if (phyctxt)
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +7 -7
@@ -629,17 +629,17 @@ __le32 iwl_mvm_mac_ctxt_cmd_p2p_sta_get_oppps_ctwin(struct iwl_mvm *mvm, IEEE80211_P2P_OPPPS_CTWINDOW_MASK); } -__le32 iwl_mvm_mac_ctxt_cmd_sta_get_twt_policy (struct iwl_mvm *mvm, -struct ieee80211_vif *vif) +u32 iwl_mvm_mac_ctxt_cmd_sta_get_twt_policy (struct iwl_mvm *mvm, +struct ieee80211_vif *vif) { -__le32 twt_policy =cpu_to_le32 (0 ); +u32 twt_policy =0 ;if (vif->bss_conf.twt_requester &&IWL_MVM_USE_TWT ) - twt_policy |=cpu_to_le32 (TWT_SUPPORTED ); + twt_policy |=TWT_SUPPORTED ;if (vif->bss_conf.twt_protected) - twt_policy |=cpu_to_le32 (PROTECTED_TWT_SUPPORTED ); + twt_policy |=PROTECTED_TWT_SUPPORTED ;if (vif->bss_conf.twt_broadcast) - twt_policy |=cpu_to_le32 (BROADCAST_TWT_SUPPORTED ); + twt_policy |=BROADCAST_TWT_SUPPORTED ;return twt_policy; }
@@ -711,7 +711,7 @@ static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm,if (vif->bss_conf.he_support && !iwlwifi_mod_params.disable_11ax) { cmd.filter_flags |=cpu_to_le32 (MAC_FILTER_IN_11AX ); ctxt_sta->data_policy |= -iwl_mvm_mac_ctxt_cmd_sta_get_twt_policy (mvm, vif); +cpu_to_le32 (iwl_mvm_mac_ctxt_cmd_sta_get_twt_policy (mvm, vif)); }
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c +5 -5
@@ -115,16 +115,16 @@ static int iwl_mvm_mld_mac_ctxt_cmd_sta(struct iwl_mvm *mvm,if (vif->cfg.assoc && !force_assoc_off) {struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); - cmd.client.is_assoc =cpu_to_le32 (1 ); + cmd.client.is_assoc =1 ;if (!mvmvif->authorized &&fw_has_capa (&mvm->fw->ucode_capa,IWL_UCODE_TLV_CAPA_COEX_HIGH_PRIO )) cmd.client.data_policy |= -cpu_to_le32 (COEX_HIGH_PRIORITY_ENABLE ); +cpu_to_le16 (COEX_HIGH_PRIORITY_ENABLE ); }else { - cmd.client.is_assoc =cpu_to_le32 (0 ); + cmd.client.is_assoc =0 ;/* Allow beacons to pass through as long as we are not * associated, or we do not have dtim period information.
@@ -132,14 +132,14 @@ static int iwl_mvm_mld_mac_ctxt_cmd_sta(struct iwl_mvm *mvm, cmd.filter_flags |=cpu_to_le32 (MAC_CFG_FILTER_ACCEPT_BEACON ); } - cmd.client.assoc_id =cpu_to_le32 (vif->cfg.aid); + cmd.client.assoc_id =cpu_to_le16 (vif->cfg.aid);if (vif->probe_req_reg && vif->cfg.assoc && vif->p2p) cmd.filter_flags |=cpu_to_le32 (MAC_CFG_FILTER_ACCEPT_PROBE_REQ );if (vif->bss_conf.he_support && !iwlwifi_mod_params.disable_11ax) cmd.client.data_policy |= -iwl_mvm_mac_ctxt_cmd_sta_get_twt_policy (mvm, vif); +cpu_to_le16 (iwl_mvm_mac_ctxt_cmd_sta_get_twt_policy (mvm, vif));return iwl_mvm_mld_mac_ctxt_send_cmd (mvm, &cmd); }
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +2 -2
@@ -1789,8 +1789,8 @@ void iwl_mvm_mac_ctxt_cmd_ap_set_filter_flags(struct iwl_mvm *mvm,int iwl_mvm_get_mac_type (struct ieee80211_vif *vif);__le32 iwl_mvm_mac_ctxt_cmd_p2p_sta_get_oppps_ctwin (struct iwl_mvm *mvm,struct ieee80211_vif *vif); -__le32 iwl_mvm_mac_ctxt_cmd_sta_get_twt_policy (struct iwl_mvm *mvm, -struct ieee80211_vif *vif); +u32 iwl_mvm_mac_ctxt_cmd_sta_get_twt_policy (struct iwl_mvm *mvm, +struct ieee80211_vif *vif);int iwl_mvm_mld_mac_ctxt_add (struct iwl_mvm *mvm,struct ieee80211_vif *vif);int iwl_mvm_mld_mac_ctxt_changed (struct iwl_mvm *mvm,struct ieee80211_vif *vif,bool force_assoc_off);
Signature · 1 line
2.38.1
PATCH 9/14 wifi: iwlwifi: mvm: adjust csa notifications and commands to MLO
In reply to [email protected]From: Gregory Greenman <[email protected]>
In the following notifications and commands mac_id was replaced with link_id:
* CANCEL_CHANNEL_SWITCH_CMD
* CHANNEL_SWITCH_START_NOTIF
* CHANNEL_SWITCH_ERROR_NOTIF
The logic around was not changed, so only adjust handling mac/link id.
--- .../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 30 +++++++++-- .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 51 ++++++++++++++----- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 4 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 4 +- 4 files changed, 68 insertions(+), 21 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h +25 -5
@@ -140,33 +140,53 @@ struct iwl_missed_vap_notif {* * @id_and_color: ID and color of the MAC */ -struct iwl_channel_switch_start_notif { +struct iwl_channel_switch_start_notif_v1 {__le32 id_and_color; } __packed;/* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */ +/** +* struct iwl_channel_switch_start_notif - Channel switch start notification +* +* @link_id: FW link id +*/ +struct iwl_channel_switch_start_notif { +__le32 link_id; +} __packed;/* CHANNEL_SWITCH_START_NTFY_API_S_VER_3 */ +#define CS_ERR_COUNT_ERROR BIT(0)#define CS_ERR_LONG_DELAY_AFTER_CS BIT(1)#define CS_ERR_LONG_TX_BLOCK BIT(2)#define CS_ERR_TX_BLOCK_TIMER_EXPIRED BIT(3)/** -* struct iwl_channel_switch_error_notif - Channel switch error notification +* struct iwl_channel_switch_error_notif_v1 - Channel switch error notification * * @mac_id: the mac for which the ucode sends the notification for * @csa_err_mask: mask of channel switch error that can occur */ -struct iwl_channel_switch_error_notif { +struct iwl_channel_switch_error_notif_v1 {__le32 mac_id;__le32 csa_err_mask; } __packed;/* CHANNEL_SWITCH_ERROR_NTFY_API_S_VER_1 */ +/** +* struct iwl_channel_switch_error_notif - Channel switch error notification +* +* @link_id: FW link id +* @csa_err_mask: mask of channel switch error that can occur +*/ +struct iwl_channel_switch_error_notif { +__le32 link_id; +__le32 csa_err_mask; +} __packed;/* CHANNEL_SWITCH_ERROR_NTFY_API_S_VER_2 */ +/** * struct iwl_cancel_channel_switch_cmd - Cancel Channel Switch command * -* @mac_id: the mac that should cancel the channel switch +* @id: the id of the link or mac that should cancel the channel switch */ struct iwl_cancel_channel_switch_cmd { -__le32 mac_id; +__le32 id; } __packed;/* MAC_CANCEL_CHANNEL_SWITCH_S_VER_1 */ /**
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +38 -13
86 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +2 -2
@@ -4360,10 +4360,10 @@ int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,void iwl_mvm_cancel_channel_switch (struct iwl_mvm *mvm,struct ieee80211_vif *vif, -u32 mac_id) +u32 id) {struct iwl_cancel_channel_switch_cmd cancel_channel_switch_cmd = { - .mac_id =cpu_to_le32 (mac_id), + .id =cpu_to_le32 (id), };int ret;
drivers/net/wireless/intel/iwlwifi/mvm/sta.h +3 -1
@@ -365,6 +365,7 @@ struct iwl_mvm_link_sta {* and from Tx response flow, it needs a spinlock. * @tid_data: per tid data + mgmt. Look at %iwl_mvm_tid_data. * @tid_to_baid: a simple map of TID to baid +* @vif: a vif pointer * @reserved_queue: the queue reserved for this STA for DQA purposes * Every STA has is given one reserved queue to allow it to operate. If no * such queue can be guaranteed, the STA addition will fail.
@@ -378,6 +379,7 @@ struct iwl_mvm_link_sta {* debugfs. If it's set to 0, it means that it is it's not set via * debugfs. * @agg_tids: bitmap of tids whose status is operational aggregated (IWL_AGG_ON) +* @sleeping: sta sleep transitions in power management * @sleep_tx_count: the number of frames that we told the firmware to let out * even when that station is asleep. This is useful in case the queue * gets empty before all the frames were sent, which can happen when
@@ -580,7 +582,7 @@ int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, u8 *key, u32 key_len);void iwl_mvm_cancel_channel_switch (struct iwl_mvm *mvm,struct ieee80211_vif *vif, -u32 mac_id); +u32 id);/* Queues */ int iwl_mvm_tvqm_enable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
Signature · 1 line
2.38.1
PATCH 10/14 wifi: iwlwifi: fw: Add new ODM vendor to ppag approved list
In reply to [email protected]From: Ariel Malamud <[email protected]>
Add new oem/odm pair to ppag approved vendors list when specified by platform.
--- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/wireless/intel/iwlwifi/fw/acpi.c +6 -0
@@ -41,6 +41,12 @@ static const struct dmi_system_id dmi_ppag_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"), + }, + }, {} };
Signature · 1 line
2.38.1
PATCH 11/14 wifi: iwlwifi: disable RX STBC when a device doesn't support it
In reply to [email protected]From: Gregory Greenman <[email protected]>
Some devices, like step A0 of GL FM device doesn't support RX STBC for VHT/HE. Add a workaround to remove it from capabilities in this case.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +10 -0
@@ -464,6 +464,9 @@ static void iwl_init_vht_hw_capab(struct iwl_trans *trans,IEEE80211_VHT_MAX_AMPDU_1024K <<IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT ; +if (!trans->cfg->ht_params->stbc) + vht_cap->cap &= ~IEEE80211_VHT_CAP_RXSTBC_MASK ; +if (data->vht160_supported) vht_cap->cap |=IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ |IEEE80211_VHT_CAP_SHORT_GI_160 ;
@@ -986,6 +989,13 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans, iftype_data->vendor_elems.data = iwl_vendor_caps; iftype_data->vendor_elems.len =ARRAY_SIZE (iwl_vendor_caps); } + +if (!trans->cfg->ht_params->stbc) { + iftype_data->he_cap.he_cap_elem.phy_cap_info[2 ] &= + ~IEEE80211_HE_PHY_CAP2_STBC_RX_UNDER_80MHZ ; + iftype_data->he_cap.he_cap_elem.phy_cap_info[7 ] &= + ~IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ ; + } } static void iwl_init_he_hw_capab(struct iwl_trans *trans,
Signature · 1 line
2.38.1
PATCH 12/14 wifi: iwlwifi: mvm: remove useless code
In reply to [email protected]From: Johannes Berg <[email protected]>
Setting the station to -EBUSY was originally done under this lock, and the comment still refers to it. But this no longer happens because that was removed when DQA was removed. Remove the leftover code as well.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +0 -7
@@ -2070,13 +2070,6 @@ bool iwl_mvm_sta_del(struct iwl_mvm *mvm, struct ieee80211_vif *vif,cancel_delayed_work (&mvm->tdls_cs.dwork); } -/* -* Make sure that the tx response code sees the station as -EBUSY and -* calls the drain worker. -*/ -spin_lock_bh (&mvm_sta->lock); -spin_unlock_bh (&mvm_sta->lock); -return false; }
Signature · 1 line
2.38.1
PATCH 13/14 wifi: iwlwifi: support PPAG in China for older FW cmd version
In reply to [email protected]From: Alon Giladi <[email protected]>
Allows the China bit in the ppag flags to turn on also when FW cmd version is 1 (if FW has the capability).
--- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 10 +++++++++- drivers/net/wireless/intel/iwlwifi/fw/file.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/fw/acpi.c +9 -1
@@ -1155,7 +1155,15 @@ int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *cIWL_DEBUG_RADIO (fwrt,"PPAG table rev is %d but FW supports v1, sending truncated table\n" , fwrt->ppag_ver); - cmd->v1.flags &=cpu_to_le32 (IWL_PPAG_ETSI_MASK ); +if (!fw_has_capa (&fwrt->fw->ucode_capa, +IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT )) { + cmd->v1.flags &=cpu_to_le32 (IWL_PPAG_ETSI_MASK ); +IWL_DEBUG_RADIO (fwrt, +"FW doesn't support ppag China bit\n" ); + }else { +IWL_DEBUG_RADIO (fwrt, +"FW supports ppag China bit\n" ); + } } }else if (cmd_ver >=2 && cmd_ver <=4 ) { num_sub_bands =IWL_NUM_SUB_BANDS_V2 ;
drivers/net/wireless/intel/iwlwifi/fw/file.h +1 -0
@@ -462,6 +462,7 @@ enum iwl_ucode_tlv_capa {IWL_UCODE_TLV_CAPA_BIGTK_TX_SUPPORT = (__force iwl_ucode_tlv_capa_t )109 ,IWL_UCODE_TLV_CAPA_MLD_API_SUPPORT = (__force iwl_ucode_tlv_capa_t )110 ,IWL_UCODE_TLV_CAPA_SCAN_DONT_TOGGLE_ANT = (__force iwl_ucode_tlv_capa_t )111 , +IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT = (__force iwl_ucode_tlv_capa_t )112 , #ifdef __CHECKER__/* sparse says it cannot increment the previous enum member */
Signature · 1 line
2.38.1
PATCH 14/14 wifi: iwlwifi: update response for mcc_update command
In reply to [email protected]From: Abhishek Naik <[email protected]>
Add support for the MCC update response version 8. Versions 5-6 are already covered by the existing flags conversion, and 7 isn't used.
The capabilities field in iwl_mcc_update_resp is 32 bits wide now, and the flags moved, so some more changes are needed.
While at it, convert the flags to bool (to avoid having to deal with BIT(16) specially etc.) and use the struct_size() macro for the memory allocation.
--- .../wireless/intel/iwlwifi/fw/api/nvm-reg.h | 35 +++++- .../wireless/intel/iwlwifi/iwl-nvm-parse.c | 117 ++++++++++++------ .../wireless/intel/iwlwifi/iwl-nvm-parse.h | 4 +- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 58 ++++++--- 6 files changed, 161 insertions(+), 59 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h +33 -2
@@ -317,7 +317,7 @@ struct iwl_mcc_update_resp_v3 { } __packed;/* LAR_UPDATE_MCC_CMD_RESP_S_VER_3 */ /** -* struct iwl_mcc_update_resp - response to MCC_UPDATE_CMD. +* struct iwl_mcc_update_resp_v4 - response to MCC_UPDATE_CMD. * Contains the new channel control profile map, if changed, and the new MCC * (mobile country code). * The new MCC may be different than what was requested in MCC_UPDATE_CMD.
@@ -333,7 +333,7 @@ struct iwl_mcc_update_resp_v3 {* @channels: channel control data map, DWORD for each channel. Only the first * 16bits are used. */ -struct iwl_mcc_update_resp { +struct iwl_mcc_update_resp_v4 {__le32 status;__le16 mcc;__le16 cap;
@@ -345,6 +345,37 @@ struct iwl_mcc_update_resp {__le32 channels[]; } __packed;/* LAR_UPDATE_MCC_CMD_RESP_S_VER_4 */ +/** +* struct iwl_mcc_update_resp_v8 - response to MCC_UPDATE_CMD. +* Contains the new channel control profile map, if changed, and the new MCC +* (mobile country code). +* The new MCC may be different than what was requested in MCC_UPDATE_CMD. +* @status: see &enum iwl_mcc_update_status +* @mcc: the new applied MCC +* @padding: padding for 2 bytes. +* @cap: capabilities for all channels which matches the MCC +* @time: time elapsed from the MCC test start (in units of 30 seconds) +* @geo_info: geographic specific profile information +* see &enum iwl_geo_information. +* @source_id: the MCC source, see iwl_mcc_source +* @reserved: for four bytes alignment. +* @n_channels: number of channels in @channels_data. +* @channels: channel control data map, DWORD for each channel. Only the first +* 16bits are used. +*/ +struct iwl_mcc_update_resp_v8 { +__le32 status; +__le16 mcc; +u8 padding[2 ]; +__le32 cap; +__le16 time; +__le16 geo_info; +u8 source_id; +u8 reserved[3 ]; +__le32 n_channels; +__le32 channels[]; +} __packed;/* LAR_UPDATE_MCC_CMD_RESP_S_VER_8 */ +/** * struct iwl_mcc_chub_notif - chub notifies of mcc change * (MCC_CHUB_UPDATE_CMD = 0xc9)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +79 -38
170 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h +2 -2
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* -* Copyright (C) 2005-2015, 2018-2021 Intel Corporation +* Copyright (C) 2005-2015, 2018-2022 Intel Corporation * Copyright (C) 2016-2017 Intel Deutschland GmbH */ #ifndef __iwl_nvm_parse_h__
@@ -50,7 +50,7 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,struct ieee80211_regdomain *iwl_parse_nvm_mcc_info (struct device *dev,const struct iwl_cfg *cfg,int num_of_ch,__le32 *channels,u16 fw_mcc, -u16 geo_info,u16 cap,u8 resp_ver); +u16 geo_info,u32 cap,u8 resp_ver);/** * struct iwl_nvm_section - describes an NVM section in memory.
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +2 -2
@@ -108,7 +108,7 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy,struct ieee80211_regdomain *regd =NULL ;struct ieee80211_hw *hw =wiphy_to_ieee80211_hw (wiphy);struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw); -struct iwl_mcc_update_resp *resp; +struct iwl_mcc_update_resp_v8 *resp;u8 resp_ver;IWL_DEBUG_LAR (mvm,"Getting regdomain data for %s from FW\n" , alpha2);
@@ -138,7 +138,7 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy, resp->channels,__le16_to_cpu (resp->mcc),__le16_to_cpu (resp->geo_info), - __le16_to_cpu(resp->cap), resp_ver); + le32_to_cpu(resp->cap), resp_ver);/* Store the return source id */ src_id = resp->source_id;if (IS_ERR_OR_NULL (regd)) {
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +1 -1
@@ -2219,7 +2219,7 @@ static inline void iwl_mvm_vendor_cmds_register(struct iwl_mvm *mvm) {}#endif /* Location Aware Regulatory */ -struct iwl_mcc_update_resp * +struct iwl_mcc_update_resp_v8 *iwl_mvm_update_mcc (struct iwl_mvm *mvm,const char *alpha2,enum iwl_mcc_source src_id);int iwl_mvm_init_mcc (struct iwl_mvm *mvm);
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c +44 -14
97 lines not on this page · raw message
Signature · 1 line
2.38.1