wifi: iwlwifi: updates - 2023-10-04
cover wifi: iwlwifi: updates - 2023-10-04
From: Gregory Greenman <[email protected]>
Hi,
This patch set includes iwlwifi patches intended for v6.7.
It contains:
* several debug (and debugfs) improvements
* small MLO features
* cleanups and bugfixes
Thanks,
Gregory
Ayala Beker (1):
wifi: iwlwifi: mvm: advertise support for SCS traffic description
Ilan Peer (3):
wifi: iwlwifi: mvm: Add basic link selection logic
wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface
wifi: iwlwifi: mvm: Correctly set link configuration
Johannes Berg (3):
wifi: iwlwifi: mvm: rework debugfs handling
wifi: iwlwifi: mvm: fix SB CFG check
wifi: iwlwifi: mei: return error from register when not built
Miri Korenblit (4):
wifi: iwlwifi: Extract common prph mac/phy regions data dump logic
wifi: iwlwifi: add support for new ini region types
wifi: iwlwifi: mvm: add a per-link debugfs
wifi: iwlwifi: abort scan when rfkill on but device enabled
Mukesh Sisodiya (2):
wifi: iwlwifi: fw: Fix debugfs command sending
wifi: iwlwifi: fix the rf step and flavor bits range
Rotem Saado (1):
wifi: iwlwifi: yoyo: swap cdb and jacket bits values
iallouch (1):
wifi: iwlwifi: mvm: add start mac ctdp sum calculation debugfs handler
.../wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 34 ++- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 124 ++++++++-- .../net/wireless/intel/iwlwifi/fw/debugfs.c | 6 +- drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 + .../wireless/intel/iwlwifi/iwl-nvm-parse.c | 3 +- drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 14 +- .../net/wireless/intel/iwlwifi/mei/iwl-mei.h | 4 +- .../wireless/intel/iwlwifi/mvm/constants.h | 1 + .../wireless/intel/iwlwifi/mvm/debugfs-vif.c | 76 ++++-- .../net/wireless/intel/iwlwifi/mvm/debugfs.c | 44 +++- .../net/wireless/intel/iwlwifi/mvm/debugfs.h | 1 + drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 22 +- .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 8 +- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 166 +++++-------- .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 231 ++++++++++++------ drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 22 +- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +- .../wireless/intel/iwlwifi/mvm/time-event.c | 24 +- 19 files changed, 533 insertions(+), 253 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/15 wifi: iwlwifi: Extract common prph mac/phy regions data dump logic
From: Miri Korenblit <[email protected]>
YoYo (debug data collection mechanism) is introducing 2 new types of regions: prph mac/phy ranges.
These types will have a common logic of reading the data from the device as the mac/phy prph has. Put it in a separate function so it can be reused.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 52 ++++++++++++++------- 1 file changed, 35 insertions(+), 17 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +35 -17
@@ -1021,22 +1021,18 @@ struct iwl_dump_ini_region_data {struct iwl_fwrt_dump_data *dump_data; }; -static int -iwl_dump_ini_prph_mac_iter (struct iwl_fw_runtime *fwrt, -struct iwl_dump_ini_region_data *reg_data, -void *range_ptr,u32 range_len,int idx) +static int iwl_dump_ini_prph_mac_iter_common (struct iwl_fw_runtime *fwrt, +void *range_ptr,u32 addr, +__le32 size) { -struct iwl_fw_ini_region_tlv *reg = (void *)reg_data->reg_tlv->data;struct iwl_fw_ini_error_dump_range *range = range_ptr;__le32 *val = range->data;u32 prph_val; -u32 addr =le32_to_cpu (reg->addrs[idx]) + -le32_to_cpu (reg->dev_addr.offset);int i; range->internal_base_addr =cpu_to_le32 (addr); - range->range_data_size = reg->dev_addr.size; -for (i =0 ; i <le32_to_cpu (reg->dev_addr.size); i +=4 ) { + range->range_data_size = size; +for (i =0 ; i <le32_to_cpu (size); i +=4 ) { prph_val =iwl_read_prph (fwrt->trans, addr + i);if (iwl_trans_is_hw_error_value (prph_val))return -EBUSY ;
@@ -1047,38 +1043,47 @@ iwl_dump_ini_prph_mac_iter(struct iwl_fw_runtime *fwrt, }static int -iwl_dump_ini_prph_phy_iter (struct iwl_fw_runtime *fwrt, +iwl_dump_ini_prph_mac_iter (struct iwl_fw_runtime *fwrt,struct iwl_dump_ini_region_data *reg_data,void *range_ptr,u32 range_len,int idx) {struct iwl_fw_ini_region_tlv *reg = (void *)reg_data->reg_tlv->data; +u32 addr =le32_to_cpu (reg->addrs[idx]) + +le32_to_cpu (reg->dev_addr.offset); + +return iwl_dump_ini_prph_mac_iter_common (fwrt, range_ptr, addr, + reg->dev_addr.size); +} + +static int iwl_dump_ini_prph_phy_iter_common (struct iwl_fw_runtime *fwrt, +void *range_ptr,u32 addr, +__le32 size,__le32 offset) +{struct iwl_fw_ini_error_dump_range *range = range_ptr;__le32 *val = range->data;u32 indirect_wr_addr =WMAL_INDRCT_RD_CMD1 ;u32 indirect_rd_addr =WMAL_MRSPF_1 ;u32 prph_val; -u32 addr =le32_to_cpu (reg->addrs[idx]);u32 dphy_state;u32 dphy_addr;int i; range->internal_base_addr =cpu_to_le32 (addr); - range->range_data_size = reg->dev_addr.size; + range->range_data_size = size;if (fwrt->trans->trans_cfg->device_family <IWL_DEVICE_FAMILY_AX210 ) indirect_wr_addr =WMAL_INDRCT_CMD1 ; - indirect_wr_addr +=le32_to_cpu (reg->dev_addr.offset); - indirect_rd_addr +=le32_to_cpu (reg->dev_addr.offset); + indirect_wr_addr +=le32_to_cpu (offset); + indirect_rd_addr +=le32_to_cpu (offset);if (!iwl_trans_grab_nic_access (fwrt->trans))return -EBUSY ; - dphy_addr = (reg->dev_addr.offset) ?WFPM_LMAC2_PS_CTL_RW : -WFPM_LMAC1_PS_CTL_RW ; + dphy_addr = (offset) ?WFPM_LMAC2_PS_CTL_RW :WFPM_LMAC1_PS_CTL_RW ; dphy_state =iwl_read_umac_prph_no_grab (fwrt->trans, dphy_addr); -for (i =0 ; i <le32_to_cpu (reg->dev_addr.size); i +=4 ) { +for (i =0 ; i <le32_to_cpu (size); i +=4 ) {if (dphy_state ==HBUS_TIMEOUT || (dphy_state &WFPM_PS_CTL_RW_PHYRF_PD_FSM_CURSTATE_MSK ) !=WFPM_PHYRF_STATE_ON ) {
@@ -1097,6 +1102,19 @@ iwl_dump_ini_prph_phy_iter(struct iwl_fw_runtime *fwrt,return sizeof (*range) +le32_to_cpu (range->range_data_size); } +static int +iwl_dump_ini_prph_phy_iter (struct iwl_fw_runtime *fwrt, +struct iwl_dump_ini_region_data *reg_data, +void *range_ptr,u32 range_len,int idx) +{ +struct iwl_fw_ini_region_tlv *reg = (void *)reg_data->reg_tlv->data; +u32 addr =le32_to_cpu (reg->addrs[idx]); + +return iwl_dump_ini_prph_phy_iter_common (fwrt, range_ptr, addr, + reg->dev_addr.size, + reg->dev_addr.offset); +} +static int iwl_dump_ini_csr_iter (struct iwl_fw_runtime *fwrt,struct iwl_dump_ini_region_data *reg_data,void *range_ptr,u32 range_len,int idx)
Signature · 1 line
2.38.1
PATCH 2/15 wifi: iwlwifi: add support for new ini region types
In reply to [email protected]From: Miri Korenblit <[email protected]>
YoYo introduces 2 new region types: prph mac and phy blocks. The data in this regions consists of a list of (base address, size) pairs.
This way we can set a block of consecutive registers by the base address and the size, instead of a list of registers. Add support for parsing and dumping these new region types
--- .../wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 34 ++++++++- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 72 ++++++++++++++++++- drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 + 3 files changed, 106 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h +33 -1
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* -* Copyright (C) 2018-2022 Intel Corporation +* Copyright (C) 2018-2023 Intel Corporation */ #ifndef __iwl_fw_dbg_tlv_h__#define __iwl_fw_dbg_tlv_h__
@@ -42,6 +42,30 @@ struct iwl_fw_ini_header {/* followed by the data */ } __packed;/* FW_TLV_DEBUG_HEADER_S_VER_1 */ +/** +* struct iwl_fw_ini_addr_size - Base address and size that defines +* a chunk of memory +* +* @addr: the base address (fixed size - 4 bytes) +* @size: the size to read +*/ +struct iwl_fw_ini_addr_size { +__le32 addr; +__le32 size; +} __packed;/* FW_TLV_DEBUG_ADDR_SIZE_VER_1 */ + +/** +* struct iwl_fw_ini_region_dev_addr_range - Configuration to read +* device address range +* +* @offset: offset to add to the base address of each chunk +* The addrs[] array will be treated as an array of &iwl_fw_ini_addr_size - +* an array of (addr, size) pairs. +*/ +struct iwl_fw_ini_region_dev_addr_range { +__le32 offset; +} __packed;/* FW_TLV_DEBUG_DEVICE_ADDR_RANGE_API_S_VER_1 */ +/** * struct iwl_fw_ini_region_dev_addr - Configuration to read device addresses *
@@ -135,6 +159,9 @@ struct iwl_fw_ini_region_internal_buffer {* &IWL_FW_INI_REGION_PAGING, &IWL_FW_INI_REGION_CSR, * &IWL_FW_INI_REGION_DRAM_IMR and &IWL_FW_INI_REGION_PCI_IOSF_CONFIG * &IWL_FW_INI_REGION_DBGI_SRAM, &FW_TLV_DEBUG_REGION_TYPE_DBGI_SRAM, +* @dev_addr_range: device address range configuration. Used by +* &IWL_FW_INI_REGION_PERIPHERY_MAC_RANGE and +* &IWL_FW_INI_REGION_PERIPHERY_PHY_RANGE * @fifos: fifos configuration. Used by &IWL_FW_INI_REGION_TXF and * &IWL_FW_INI_REGION_RXF * @err_table: error table configuration. Used by
@@ -157,6 +184,7 @@ struct iwl_fw_ini_region_tlv {u8 name[IWL_FW_INI_MAX_NAME ];union {struct iwl_fw_ini_region_dev_addr dev_addr; +struct iwl_fw_ini_region_dev_addr_range dev_addr_range;struct iwl_fw_ini_region_fifos fifos;struct iwl_fw_ini_region_err_table err_table;struct iwl_fw_ini_region_internal_buffer internal_buffer;
@@ -362,6 +390,8 @@ enum iwl_fw_ini_buffer_location {* @IWL_FW_INI_REGION_PCI_IOSF_CONFIG: PCI/IOSF config * @IWL_FW_INI_REGION_SPECIAL_DEVICE_MEMORY: special device memory * @IWL_FW_INI_REGION_DBGI_SRAM: periphery registers of DBGI SRAM +* @IWL_FW_INI_REGION_PERIPHERY_MAC_RANGE: a range of periphery registers of MAC +* @IWL_FW_INI_REGION_PERIPHERY_PHY_RANGE: a range of periphery registers of PHY * @IWL_FW_INI_REGION_NUM: number of region types */ enum iwl_fw_ini_region_type {
@@ -384,6 +414,8 @@ enum iwl_fw_ini_region_type {IWL_FW_INI_REGION_PCI_IOSF_CONFIG ,IWL_FW_INI_REGION_SPECIAL_DEVICE_MEMORY ,IWL_FW_INI_REGION_DBGI_SRAM , +IWL_FW_INI_REGION_PERIPHERY_MAC_RANGE , +IWL_FW_INI_REGION_PERIPHERY_PHY_RANGE , IWL_FW_INI_REGION_NUM };/* FW_TLV_DEBUG_REGION_TYPE_API_E */
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +71 -1
108 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/fw/file.h +2 -0
@@ -975,4 +975,6 @@ static inline size_t _iwl_tlv_array_len(const struct iwl_ucode_tlv *tlv,_iwl_tlv_array_len ((_tlv_ptr),sizeof (*(_struct_ptr)), \ sizeof(_struct_ptr->_memb[0])) +#define iwl_tlv_array_len_with_size (_tlv_ptr, _struct_ptr, _size) \ + _iwl_tlv_array_len((_tlv_ptr), sizeof(*(_struct_ptr)), _size)#endif /* __iwl_fw_file_h__ */
Signature · 1 line
2.38.1
PATCH 3/15 wifi: iwlwifi: yoyo: swap cdb and jacket bits values
In reply to [email protected]From: Rotem Saado <[email protected]>
The bits are wrong, the jacket bit should be 5 and cdb bit 4. Fix it.
--- drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-prph.h +2 -2
@@ -348,8 +348,8 @@#define RFIC_REG_RD 0xAD0470#define WFPM_CTRL_REG 0xA03030#define WFPM_OTP_CFG1_ADDR 0x00a03098 -#define WFPM_OTP_CFG1_IS_JACKET_BIT BIT(4) -#define WFPM_OTP_CFG1_IS_CDB_BIT BIT(5) +#define WFPM_OTP_CFG1_IS_JACKET_BIT BIT(5) +#define WFPM_OTP_CFG1_IS_CDB_BIT BIT(4)#define WFPM_OTP_BZ_BNJ_JACKET_BIT 5#define WFPM_OTP_BZ_BNJ_CDB_BIT 4#define WFPM_OTP_CFG1_IS_JACKET (_val) (((_val) & 0x00000020) >> WFPM_OTP_BZ_BNJ_JACKET_BIT)
Signature · 1 line
2.38.1
PATCH 4/15 wifi: iwlwifi: mvm: rework debugfs handling
In reply to [email protected]From: Johannes Berg <[email protected]>
mac80211 added a new callback to add a vif debugfs. Implement it instead of adding the debugfs directly, which will make it properly preserved over switching the vif from non-MLD/MLD and back.
This requires some rework so that we still have the symlink but trust mac80211 to add/remove the debugfs.
--- .../wireless/intel/iwlwifi/mvm/debugfs-vif.c | 32 +++++++++---------- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 7 ++-- .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 5 +-- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 9 +++--- 4 files changed, 27 insertions(+), 26 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +15 -17
@@ -699,19 +699,11 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(rx_phyinfo, 10);MVM_DEBUGFS_READ_WRITE_FILE_OPS (quota_min,32 );MVM_DEBUGFS_READ_FILE_OPS (os_device_timediff); - -void iwl_mvm_vif_dbgfs_register (struct iwl_mvm *mvm,struct ieee80211_vif *vif) +void iwl_mvm_vif_add_debugfs (struct ieee80211_hw *hw,struct ieee80211_vif *vif) { +struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw);struct dentry *dbgfs_dir = vif->debugfs_dir;struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); -char buf[100 ]; - -/* -* Check if debugfs directory already exist before creating it. -* This may happen when, for example, resetting hw or suspend-resume -*/ -if (!dbgfs_dir || mvmvif->dbgfs_dir) -return ; mvmvif->dbgfs_dir =debugfs_create_dir ("iwlmvm" , dbgfs_dir);if (IS_ERR_OR_NULL (mvmvif->dbgfs_dir)) {
@@ -737,6 +729,17 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif)if (vif->type ==NL80211_IFTYPE_STATION && !vif->p2p && mvmvif == mvm->bf_allowed_vif)MVM_DEBUGFS_ADD_FILE_VIF (bf_params, mvmvif->dbgfs_dir,0600 ); +} + +void iwl_mvm_vif_dbgfs_add_link (struct iwl_mvm *mvm,struct ieee80211_vif *vif) +{ +struct dentry *dbgfs_dir = vif->debugfs_dir; +struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); +char buf[100 ]; + +/* this will happen in monitor mode */ +if (!dbgfs_dir) +return ;/* * Create symlink for convenience pointing to interface specific
@@ -745,21 +748,16 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif)* find * netdev:wlan0 -> ../../../ieee80211/phy0/netdev:wlan0/iwlmvm/ */ -snprintf (buf,100 ,"../../../%pd3/%pd" , - dbgfs_dir, - mvmvif->dbgfs_dir); +snprintf (buf,100 ,"../../../%pd3/iwlmvm" , dbgfs_dir); mvmvif->dbgfs_slink =debugfs_create_symlink (dbgfs_dir->d_name.name, mvm->debugfs_dir, buf); } -void iwl_mvm_vif_dbgfs_clean (struct iwl_mvm *mvm,struct ieee80211_vif *vif) +void iwl_mvm_vif_dbgfs_rm_link (struct iwl_mvm *mvm,struct ieee80211_vif *vif) {struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif);debugfs_remove (mvmvif->dbgfs_slink); mvmvif->dbgfs_slink =NULL ; - -debugfs_remove_recursive (mvmvif->dbgfs_dir); - mvmvif->dbgfs_dir =NULL ; }
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +4 -3
@@ -1580,7 +1580,7 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,*/ if (vif->type ==NL80211_IFTYPE_AP || vif->type ==NL80211_IFTYPE_ADHOC ) { -iwl_mvm_vif_dbgfs_register (mvm, vif); +iwl_mvm_vif_dbgfs_add_link (mvm, vif); ret =0 ; goto out; }
@@ -1644,7 +1644,7 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,iwl_mvm_chandef_get_primary_80 (&vif->bss_conf.chandef); } -iwl_mvm_vif_dbgfs_register (mvm, vif); +iwl_mvm_vif_dbgfs_add_link (mvm, vif); if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && vif->type == NL80211_IFTYPE_STATION && !vif->p2p &&
@@ -1732,7 +1732,7 @@ static bool iwl_mvm_mac_remove_interface_common(struct ieee80211_hw *hw,if (vif->bss_conf.ftm_responder)memset (&mvm->ftm_resp_stats,0 ,sizeof (mvm->ftm_resp_stats)); -iwl_mvm_vif_dbgfs_clean (mvm, vif); +iwl_mvm_vif_dbgfs_rm_link (mvm, vif);/* * For AP/GO interface, the tear down of the resources allocated to the
@@ -6324,6 +6324,7 @@ const struct ieee80211_ops iwl_mvm_hw_ops = { .can_aggregate_in_amsdu = iwl_mvm_mac_can_aggregate, #ifdef CONFIG_IWLWIFI_DEBUGFS + .vif_add_debugfs = iwl_mvm_vif_add_debugfs, .link_sta_add_debugfs = iwl_mvm_link_sta_add_debugfs, #endif .set_hw_timestamp = iwl_mvm_set_hw_timestamp,
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +3 -2
@@ -107,7 +107,7 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw,ieee80211_hw_set (mvm->hw,RX_INCLUDES_FCS ); } -iwl_mvm_vif_dbgfs_register (mvm, vif); +iwl_mvm_vif_dbgfs_add_link (mvm, vif); if (!test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status) && vif->type == NL80211_IFTYPE_STATION && !vif->p2p &&
@@ -168,7 +168,7 @@ static void iwl_mvm_mld_mac_remove_interface(struct ieee80211_hw *hw,if (vif->bss_conf.ftm_responder)memset (&mvm->ftm_resp_stats,0 ,sizeof (mvm->ftm_resp_stats)); -iwl_mvm_vif_dbgfs_clean (mvm, vif); +iwl_mvm_vif_dbgfs_rm_link (mvm, vif);/* For AP/GO interface, the tear down of the resources allocated to the * interface is be handled as part of the stop_ap flow.
@@ -1204,6 +1204,7 @@ const struct ieee80211_ops iwl_mvm_mld_hw_ops = { .abort_pmsr = iwl_mvm_abort_pmsr, #ifdef CONFIG_IWLWIFI_DEBUGFS + .vif_add_debugfs = iwl_mvm_vif_add_debugfs, .link_sta_add_debugfs = iwl_mvm_link_sta_add_debugfs, #endif .set_hw_timestamp = iwl_mvm_set_hw_timestamp,
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +5 -4
@@ -2048,18 +2048,19 @@ void iwl_mvm_rx_umac_scan_iter_complete_notif(struct iwl_mvm *mvm,/* MVM debugfs */ #ifdef CONFIG_IWLWIFI_DEBUGFS void iwl_mvm_dbgfs_register (struct iwl_mvm *mvm); -void iwl_mvm_vif_dbgfs_register (struct iwl_mvm *mvm,struct ieee80211_vif *vif); -void iwl_mvm_vif_dbgfs_clean (struct iwl_mvm *mvm,struct ieee80211_vif *vif); +void iwl_mvm_vif_add_debugfs (struct ieee80211_hw *hw,struct ieee80211_vif *vif); +void iwl_mvm_vif_dbgfs_add_link (struct iwl_mvm *mvm,struct ieee80211_vif *vif); +void iwl_mvm_vif_dbgfs_rm_link (struct iwl_mvm *mvm,struct ieee80211_vif *vif);#else static inline void iwl_mvm_dbgfs_register (struct iwl_mvm *mvm) { }static inline void -iwl_mvm_vif_dbgfs_register (struct iwl_mvm *mvm,struct ieee80211_vif *vif) +iwl_mvm_vif_dbgfs_add_link (struct iwl_mvm *mvm,struct ieee80211_vif *vif) { }static inline void -iwl_mvm_vif_dbgfs_clean (struct iwl_mvm *mvm,struct ieee80211_vif *vif) +iwl_mvm_vif_dbgfs_rm_link (struct iwl_mvm *mvm,struct ieee80211_vif *vif) { }#endif /* CONFIG_IWLWIFI_DEBUGFS */
Signature · 1 line
2.38.1
kernel test robot
build botRe: [PATCH 04/15] wifi: iwlwifi: mvm: rework debugfs handling
kernel test robot noticed the following build errors:
Hi,
kernel test robot noticed the following build errors:
[auto build test ERROR on next-20231004]
[also build test ERROR on v6.6-rc4]
[cannot apply to linus/master v6.6-rc4 v6.6-rc3 v6.6-rc2] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/gregory-greenman-intel-com/wifi-iwlwifi-Extract-common-prph-mac-phy-regions-data-dump-logic/20231004-173940 base: next-20231004 patch link: https://lore.kernel.org/r/20231004123422.818810e242e6.I805a28f9fbef5c52a3a575d04e7a6a909ecf9078%40changeid patch subject: [PATCH 04/15] wifi: iwlwifi: mvm: rework debugfs handling config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231005/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231005/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c:1212:10: error: 'const struct ieee80211_ops' has no member named 'vif_add_debugfs'; did you mean 'link_add_debugfs'?
1212 | .vif_add_debugfs = iwl_mvm_vif_add_debugfs,
| ^~~~~~~~~~~~~~~
| link_add_debugfs
>> drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c:1212:28: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] 1212 | .vif_add_debugfs = iwl_mvm_vif_add_debugfs,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c:1212:28: note: (near initialization for 'iwl_mvm_mld_hw_ops')
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c:1212:28: error: initialization of 'int (*)(struct ieee80211_hw *, struct ieee80211_low_level_stats *)' from incompatible pointer type 'void (*)(struct ieee80211_hw *, struct ieee80211_vif *)' [-Werror=incompatible-pointer-types] drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c:1212:28: note: (near initialization for 'iwl_mvm_mld_hw_ops.get_stats')
cc1: some warnings being treated as errors
--
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:6312:10: error: 'const struct ieee80211_ops' has no member named 'vif_add_debugfs'; did you mean 'link_add_debugfs'?
6312 | .vif_add_debugfs = iwl_mvm_vif_add_debugfs,
| ^~~~~~~~~~~~~~~
| link_add_debugfs
>> drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:6312:28: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init] 6312 | .vif_add_debugfs = iwl_mvm_vif_add_debugfs,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:6312:28: note: (near initialization for 'iwl_mvm_hw_ops')
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:6312:28: error: initialization of 'void (*)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_chan_def *)' from incompatible pointer type 'void (*)(struct ieee80211_hw *, struct ieee80211_vif *)' [-Werror=incompatible-pointer-types] drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:6312:28: note: (near initialization for 'iwl_mvm_hw_ops.channel_switch_beacon')
cc1: some warnings being treated as errors
vim +1212 drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
1123
1124 const struct ieee80211_ops iwl_mvm_mld_hw_ops = {
1125 .tx = iwl_mvm_mac_tx,
1126 .wake_tx_queue = iwl_mvm_mac_wake_tx_queue,
1127 .ampdu_action = iwl_mvm_mac_ampdu_action,
1128 .get_antenna = iwl_mvm_op_get_antenna,
1129 .set_antenna = iwl_mvm_op_set_antenna,
1130 .start = iwl_mvm_mac_start,
1131 .reconfig_complete = iwl_mvm_mac_reconfig_complete,
1132 .stop = iwl_mvm_mac_stop,
1133 .add_interface = iwl_mvm_mld_mac_add_interface,
1134 .remove_interface = iwl_mvm_mld_mac_remove_interface,
1135 .config = iwl_mvm_mac_config,
1136 .prepare_multicast = iwl_mvm_prepare_multicast,
1137 .configure_filter = iwl_mvm_configure_filter,
1138 .config_iface_filter = iwl_mvm_mld_config_iface_filter,
1139 .link_info_changed = iwl_mvm_mld_link_info_changed,
1140 .vif_cfg_changed = iwl_mvm_mld_vif_cfg_changed,
1141 .hw_scan = iwl_mvm_mac_hw_scan,
1142 .cancel_hw_scan = iwl_mvm_mac_cancel_hw_scan,
1143 .sta_pre_rcu_remove = iwl_mvm_sta_pre_rcu_remove,
1144 .sta_state = iwl_mvm_mld_mac_sta_state,
1145 .sta_notify = iwl_mvm_mac_sta_notify,
1146 .allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames,
1147 .release_buffered_frames = iwl_mvm_mac_release_buffered_frames,
1148 .set_rts_threshold = iwl_mvm_mac_set_rts_threshold,
1149 .sta_rc_update = iwl_mvm_sta_rc_update,
1150 .conf_tx = iwl_mvm_mld_mac_conf_tx,
1151 .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx,
1152 .mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx,
1153 .mgd_protect_tdls_discover = iwl_mvm_mac_mgd_protect_tdls_discover,
1154 .flush = iwl_mvm_mac_flush,
1155 .flush_sta = iwl_mvm_mac_flush_sta,
1156 .sched_scan_start = iwl_mvm_mac_sched_scan_start,
1157 .sched_scan_stop = iwl_mvm_mac_sched_scan_stop,
1158 .set_key = iwl_mvm_mac_set_key,
1159 .update_tkip_key = iwl_mvm_mac_update_tkip_key,
1160 .remain_on_channel = iwl_mvm_mld_roc,
1161 .cancel_remain_on_channel = iwl_mvm_cancel_roc,
1162 .add_chanctx = iwl_mvm_add_chanctx,
1163 .remove_chanctx = iwl_mvm_remove_chanctx,
1164 .change_chanctx = iwl_mvm_change_chanctx,
1165 .assign_vif_chanctx = iwl_mvm_mld_assign_vif_chanctx,
1166 .unassign_vif_chanctx = iwl_mvm_mld_unassign_vif_chanctx,
1167 .switch_vif_chanctx = iwl_mvm_mld_switch_vif_chanctx,
1168
1169 .start_ap = iwl_mvm_mld_start_ap,
1170 .stop_ap = iwl_mvm_mld_stop_ap,
1171 .join_ibss = iwl_mvm_mld_start_ibss,
1172 .leave_ibss = iwl_mvm_mld_stop_ibss,
1173
1174 .tx_last_beacon = iwl_mvm_tx_last_beacon,
1175
1176 .set_tim = iwl_mvm_set_tim,
1177
1178 .channel_switch = iwl_mvm_channel_switch,
1179 .pre_channel_switch = iwl_mvm_pre_channel_switch,
1180 .post_channel_switch = iwl_mvm_post_channel_switch,
1181 .abort_channel_switch = iwl_mvm_abort_channel_switch,
1182 .channel_switch_rx_beacon = iwl_mvm_channel_switch_rx_beacon,
1183
1184 .tdls_channel_switch = iwl_mvm_tdls_channel_switch,
1185 .tdls_cancel_channel_switch = iwl_mvm_tdls_cancel_channel_switch,
1186 .tdls_recv_channel_switch = iwl_mvm_tdls_recv_channel_switch,
1187
1188 .event_callback = iwl_mvm_mac_event_callback,
1189
1190 .sync_rx_queues = iwl_mvm_sync_rx_queues,
1191
1192 CFG80211_TESTMODE_CMD(iwl_mvm_mac_testmode_cmd)
1193
1194 #ifdef CONFIG_PM_SLEEP
1195 /* look at d3.c */
1196 .suspend = iwl_mvm_suspend,
1197 .resume = iwl_mvm_resume,
1198 .set_wakeup = iwl_mvm_set_wakeup,
1199 .set_rekey_data = iwl_mvm_set_rekey_data,
1200 #if IS_ENABLED(CONFIG_IPV6)
1201 .ipv6_addr_change = iwl_mvm_ipv6_addr_change,
1202 #endif
1203 .set_default_unicast_key = iwl_mvm_set_default_unicast_key,
1204 #endif
1205 .get_survey = iwl_mvm_mac_get_survey,
1206 .sta_statistics = iwl_mvm_mac_sta_statistics,
1207 .get_ftm_responder_stats = iwl_mvm_mac_get_ftm_responder_stats,
1208 .start_pmsr = iwl_mvm_start_pmsr,
1209 .abort_pmsr = iwl_mvm_abort_pmsr,
1210
1211 #ifdef CONFIG_IWLWIFI_DEBUGFS
> 1212 .vif_add_debugfs = iwl_mvm_vif_add_debugfs,
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH 5/15 wifi: iwlwifi: mvm: add a per-link debugfs
In reply to [email protected]From: Miri Korenblit <[email protected]>
Add a per-link debugfs entry in iwlmvm level so we can read/write link related parameters.
Do it by implementing the link_add_debugfs API introduced by mac80211.
Each entry will have a path like this:
.../netdev:wlan0/link-X/iwlmvm/<file_name>
for each link X.
For non-MLD vifs this callback is called when the original vif debugfs dir is also created, so handle that case by not creating the 'iwlmvm' directory again.
Note that we don't have to worry about the cleaning the iwlmvm/* directory as it is already done by mac80211 when removing the link (or netdev).
--- .../wireless/intel/iwlwifi/mvm/debugfs-vif.c | 46 +++++++++++++++++++ .../net/wireless/intel/iwlwifi/mvm/debugfs.h | 1 + .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 1 + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 4 ++ 4 files changed, 52 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +46 -0
@@ -761,3 +761,49 @@ void iwl_mvm_vif_dbgfs_rm_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif)debugfs_remove (mvmvif->dbgfs_slink); mvmvif->dbgfs_slink =NULL ; } + +#define MVM_DEBUGFS_WRITE_LINK_FILE_OPS (name, bufsz) \ + _MVM_DEBUGFS_WRITE_FILE_OPS(link_##name, bufsz, \ + struct ieee80211_bss_conf) +#define MVM_DEBUGFS_READ_WRITE_LINK_FILE_OPS (name, bufsz) \ + _MVM_DEBUGFS_READ_WRITE_FILE_OPS(link_##name, bufsz, \ + struct ieee80211_bss_conf) +#define MVM_DEBUGFS_ADD_LINK_FILE (name, parent, mode) \ + debugfs_create_file(#name, mode, parent, link_conf, \ + &iwl_dbgfs_link_##name##_ops) + +static void iwl_mvm_debugfs_add_link_files (struct ieee80211_vif *vif, +struct ieee80211_bss_conf *link_conf, +struct dentry *mvm_dir) +{ +/* Add per-link files here*/ +} + +void iwl_mvm_link_add_debugfs (struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct ieee80211_bss_conf *link_conf, +struct dentry *dir) +{ +struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); +struct iwl_mvm *mvm = mvmvif->mvm; +unsigned int link_id = link_conf->link_id; +struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id]; +struct dentry *mvm_dir; + +if (WARN_ON (!link_info) || !dir) +return ; + +if (dir == vif->debugfs_dir) { +WARN_ON (!mvmvif->dbgfs_dir); + mvm_dir = mvmvif->dbgfs_dir; + }else { + mvm_dir =debugfs_create_dir ("iwlmvm" , dir); +if (IS_ERR_OR_NULL (mvm_dir)) { +IWL_ERR (mvm,"Failed to create debugfs directory under %pd\n" , + dir); +return ; + } + } + +iwl_mvm_debugfs_add_link_files (vif, link_conf, mvm_dir); +}
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.h +1 -0
@@ -1,5 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* +* Copyright (C) 2023 Intel Corporation * Copyright (C) 2012-2014 Intel Corporation * Copyright (C) 2013-2014 Intel Mobile Communications GmbH */
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +1 -0
@@ -1205,6 +1205,7 @@ const struct ieee80211_ops iwl_mvm_mld_hw_ops = {#ifdef CONFIG_IWLWIFI_DEBUGFS .vif_add_debugfs = iwl_mvm_vif_add_debugfs, + .link_add_debugfs = iwl_mvm_link_add_debugfs, .link_sta_add_debugfs = iwl_mvm_link_sta_add_debugfs, #endif .set_hw_timestamp = iwl_mvm_set_hw_timestamp,
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +4 -0
@@ -2406,6 +2406,10 @@ void iwl_mvm_link_sta_add_debugfs(struct ieee80211_hw *hw,struct ieee80211_vif *vif, struct ieee80211_link_sta *link_sta, struct dentry *dir); +void iwl_mvm_link_add_debugfs (struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct ieee80211_bss_conf *link_conf, +struct dentry *dir);#endif /* new MLD related APIs */
Signature · 1 line
2.38.1
PATCH 6/15 wifi: iwlwifi: mvm: fix SB CFG check
In reply to [email protected]From: Johannes Berg <[email protected]>
We shouldn't check the 0x10 bit here, since the register holds different values (not just bit masks.). Check for the exact value where this is needed only.
--- drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-prph.h +1 -1
@@ -382,7 +382,7 @@ enum {#define PREG_PRPH_WPROT_22000 0xA04D00#define SB_MODIFY_CFG_FLAG 0xA03088 -#define SB_CFG_RESIDES_IN_OTP_MASK 0x10 +#define SB_CFG_RESIDES_IN_ROM 0x80#define SB_CPU_1_STATUS 0xA01E30#define SB_CPU_2_STATUS 0xA01E34#define UMAG_SB_CPU_1_STATUS 0xA038C0
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +1 -1
@@ -596,7 +596,7 @@ static int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm)if (mvm->trans->trans_cfg->device_family ==IWL_DEVICE_FAMILY_AX210 ) { sb_cfg =iwl_read_umac_prph (mvm->trans,SB_MODIFY_CFG_FLAG );/* if needed, we'll reset this on our way out later */ - mvm->pldr_sync = !(sb_cfg &SB_CFG_RESIDES_IN_OTP_MASK ); + mvm->pldr_sync = sb_cfg ==SB_CFG_RESIDES_IN_ROM ;if (mvm->pldr_sync &&iwl_mei_pldr_req ())return -EBUSY ; }
Signature · 1 line
2.38.1
PATCH 7/15 wifi: iwlwifi: mei: return error from register when not built
In reply to [email protected]From: Johannes Berg <[email protected]>
When MEI isn't built, it seems like successfully registering would be wrong. Change this to an error so that in the rest of the driver, mei_registered won't be true.
--- drivers/net/wireless/intel/iwlwifi/mei/iwl-mei.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mei/iwl-mei.h +2 -2
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0-only */ /* -* Copyright (C) 2021 - 2022 Intel Corporation +* Copyright (C) 2021-2023 Intel Corporation */ #ifndef __iwl_mei_h__
@@ -493,7 +493,7 @@ static inline void iwl_mei_set_power_limit(__le16 *power_limit)static inline int iwl_mei_register (void *priv,const struct iwl_mei_ops *ops) -{return 0 ; } +{return -EOPNOTSUPP ; }static inline void iwl_mei_start_unregister (void ) {}
Signature · 1 line
2.38.1
PATCH 8/15 wifi: iwlwifi: mvm: Add basic link selection logic
In reply to [email protected]From: Ilan Peer <[email protected]>
Add simple logic that would allow using EMLSR in case there are multiple valid links:
- In case the connection establishment has just been completed try to find a valid link pair for EMLSR functionality where one of the links in the pair is the current active link.
- In case the valid links changed after connection was already established, try to find a valid link pair for EMLSR functionality, in case the EMSLR is not active yet.
If a valid link pair is found call mac80211 to asynchronously set the new link pair, otherwise continue using the current active links.
--- .../wireless/intel/iwlwifi/mvm/constants.h | 1 + .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 7 + .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 123 ++++++++++++++++++ drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 + 4 files changed, 133 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/constants.h +1 -0
@@ -119,5 +119,6 @@#define IWL_MVM_DISABLE_AP_FILS false#define IWL_MVM_6GHZ_PASSIVE_SCAN_TIMEOUT 3000/* in seconds */ #define IWL_MVM_6GHZ_PASSIVE_SCAN_ASSOC_TIMEOUT 60/* in seconds */ +#define IWL_MVM_AUTO_EML_ENABLE true#endif /* __MVM_CONSTANTS_H */
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +7 -0
@@ -3803,6 +3803,13 @@ iwl_mvm_sta_state_assoc_to_authorized(struct iwl_mvm *mvm, callbacks->mac_ctxt_changed (mvm, vif, false);iwl_mvm_mei_host_associated (mvm, vif, mvm_sta); + +/* when client is authorized (AP station marked as such), +* try to enable more links +*/ +if (vif->type ==NL80211_IFTYPE_STATION && + !test_bit (IWL_MVM_STATUS_IN_HW_RESTART , &mvm->status)) +iwl_mvm_mld_select_links (mvm, vif, false); } mvm_sta->authorized = true;
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +123 -0
135 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +2 -0
@@ -2764,4 +2764,6 @@ int iwl_mvm_set_hw_timestamp(struct ieee80211_hw *hw,int iwl_mvm_update_mu_groups (struct iwl_mvm *mvm,struct ieee80211_vif *vif);bool iwl_mvm_enable_fils (struct iwl_mvm *mvm,struct ieee80211_chanctx_conf *ctx); +void iwl_mvm_mld_select_links (struct iwl_mvm *mvm,struct ieee80211_vif *vif, +bool valid_links_changed);#endif /* __IWL_MVM_H__ */
Signature · 1 line
2.38.1
PATCH 9/15 wifi: iwlwifi: abort scan when rfkill on but device enabled
In reply to [email protected]From: Miri Korenblit <[email protected]>
In RFKILL we first set the RFKILL bit, then we abort scan (if one exists) by waiting for the notification from FW
and notifying mac80211. And then we stop the device.
But in case we have a scan ongoing in the period of time between rfkill on and before the device is stopped - we will not wait for the FW notification because of the iwl_mvm_is_radio_killed() condition, and then the scan_status and uid_status are misconfigured, (scan_status is cleared but uid_status not)
and when the notification suddenly arrives (before stopping the device) we will get into the assert about scan_status and uid_status mismatch. Fix this by waiting for FW notif when rfkill is on but the device isn't disabled yet.
--- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +1 -1
@@ -3408,7 +3408,7 @@ int iwl_mvm_scan_stop(struct iwl_mvm *mvm, int type, bool notify)if (!(mvm->scan_status & type))return 0 ; -if (iwl_mvm_is_radio_killed (mvm)) { +if (!test_bit (STATUS_DEVICE_ENABLED , &mvm->trans->status)) { ret =0 ; goto out; }
Signature · 1 line
2.38.1
PATCH 10/15 wifi: iwlwifi: mvm: add start mac ctdp sum calculation debugfs handler
In reply to [email protected]From: iallouch <[email protected]>
mac_ctdp_sum contains the power consumption, appears in power save report, and is used for debugging and collection of statistics.
Add a debugfs handler to start this calculation, iff ctdp command is supported in the firmware.
While on it, add an option to force start/stop this calculation, which is safe from the firmware API side.
--- .../net/wireless/intel/iwlwifi/mvm/debugfs.c | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +43 -1
@@ -50,8 +50,18 @@ static ssize_t iwl_dbgfs_stop_ctdp_write(struct iwl_mvm *mvm, char *buf, size_t count, loff_t *ppos) { int ret; +bool force; -if (!iwl_mvm_is_ctdp_supported (mvm)) +if (!kstrtobool (buf, &force)) +IWL_DEBUG_INFO (mvm, +"force start is %d [0=disabled, 1=enabled]\n" , + force); + +/* we allow skipping cap support check and force stop ctdp +* statistics collection and with guerantee that it is +* safe to use. +*/ +if (!force && !iwl_mvm_is_ctdp_supported (mvm))return -EOPNOTSUPP ; if (!iwl_mvm_firmware_running(mvm) ||
@@ -65,6 +75,36 @@ static ssize_t iwl_dbgfs_stop_ctdp_write(struct iwl_mvm *mvm, char *buf,return ret ?: count; } +static ssize_t iwl_dbgfs_start_ctdp_write (struct iwl_mvm *mvm, +char *buf,size_t count, +loff_t *ppos) +{ +int ret; +bool force; + +if (!kstrtobool (buf, &force)) +IWL_DEBUG_INFO (mvm, +"force start is %d [0=disabled, 1=enabled]\n" , + force); + +/* we allow skipping cap support check and force enable ctdp +* for statistics collection and with guerantee that it is +* safe to use. +*/ +if (!force && !iwl_mvm_is_ctdp_supported (mvm)) +return -EOPNOTSUPP ; + +if (!iwl_mvm_firmware_running (mvm) || + mvm->fwrt.cur_fw_img !=IWL_UCODE_REGULAR ) +return -EIO ; + +mutex_lock (&mvm->mutex); + ret =iwl_mvm_ctdp_command (mvm,CTDP_CMD_OPERATION_START ,0 ); +mutex_unlock (&mvm->mutex); + +return ret ?: count; +} +static ssize_t iwl_dbgfs_force_ctkill_write (struct iwl_mvm *mvm,char *buf,size_t count,loff_t *ppos) {
@@ -1998,6 +2038,7 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(prph_reg, 64);/* Device wide debugfs entries */ MVM_DEBUGFS_READ_FILE_OPS (ctdp_budget);MVM_DEBUGFS_WRITE_FILE_OPS (stop_ctdp,8 ); +MVM_DEBUGFS_WRITE_FILE_OPS (start_ctdp,8 );MVM_DEBUGFS_WRITE_FILE_OPS (force_ctkill,8 );MVM_DEBUGFS_WRITE_FILE_OPS (tx_flush,16 );MVM_DEBUGFS_WRITE_FILE_OPS (sta_drain,8 );
@@ -2210,6 +2251,7 @@ void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm)MVM_DEBUGFS_ADD_FILE (nic_temp, mvm->debugfs_dir,0400 );MVM_DEBUGFS_ADD_FILE (ctdp_budget, mvm->debugfs_dir,0400 );MVM_DEBUGFS_ADD_FILE (stop_ctdp, mvm->debugfs_dir,0200 ); +MVM_DEBUGFS_ADD_FILE (start_ctdp, mvm->debugfs_dir,0200 );MVM_DEBUGFS_ADD_FILE (force_ctkill, mvm->debugfs_dir,0200 );MVM_DEBUGFS_ADD_FILE (stations, mvm->debugfs_dir,0400 );MVM_DEBUGFS_ADD_FILE (bt_notif, mvm->debugfs_dir,0400 );
Signature · 1 line
2.38.1
PATCH 11/15 wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface
In reply to [email protected]From: Ilan Peer <[email protected]>
It is not necessary to keep the P2P Device bound/linked to a PHY context when there is no active ROC.
Modify the P2P Device flows so the binding/linking would be done only while ROC is active. With this change the switch_phy_ctxt() is no longer needed so remove it.
--- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 9 +- .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 8 +- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 152 ++++++------------ .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 100 ++++-------- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 7 +- .../wireless/intel/iwlwifi/mvm/time-event.c | 24 ++- 6 files changed, 111 insertions(+), 189 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/link.c +2 -7
@@ -53,7 +53,6 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,unsigned int link_id = link_conf->link_id;struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id];struct iwl_link_config_cmd cmd = {}; -struct iwl_mvm_phy_ctxt *phyctxt;if (WARN_ON_ONCE (!link_info))return -EINVAL ;
@@ -77,12 +76,8 @@ 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) - cmd.phy_id =cpu_to_le32 (phyctxt->id); -else - cmd.phy_id =cpu_to_le32 (FW_CTXT_INVALID ); +WARN_ON_ONCE (link_info->phy_ctxt); + cmd.phy_id =cpu_to_le32 (FW_CTXT_INVALID );memcpy (cmd.local_link_addr, link_conf->addr,ETH_ALEN );
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +4 -4
@@ -286,6 +286,10 @@ int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif)INIT_LIST_HEAD (&mvmvif->time_event_data.list); mvmvif->time_event_data.id =TE_MAX ; + mvmvif->deflink.bcast_sta.sta_id =IWL_MVM_INVALID_STA ; + mvmvif->deflink.mcast_sta.sta_id =IWL_MVM_INVALID_STA ; + mvmvif->deflink.ap_sta_id =IWL_MVM_INVALID_STA ; +/* No need to allocate data queues to P2P Device MAC and NAN.*/ if (vif->type ==NL80211_IFTYPE_P2P_DEVICE )return 0 ;
@@ -300,10 +304,6 @@ int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif) mvmvif->deflink.cab_queue =IWL_MVM_DQA_GCAST_QUEUE ; } - mvmvif->deflink.bcast_sta.sta_id =IWL_MVM_INVALID_STA ; - mvmvif->deflink.mcast_sta.sta_id =IWL_MVM_INVALID_STA ; - mvmvif->deflink.ap_sta_id =IWL_MVM_INVALID_STA ; -for (i =0 ; i <NUM_IWL_MVM_SMPS_REQ ; i++) mvmvif->deflink.smps_requests[i] =IEEE80211_SMPS_AUTOMATIC ;
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +48 -104
229 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +32 -68
149 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +3 -4
@@ -1971,13 +1971,12 @@ void iwl_mvm_bss_info_changed_station_assoc(struct iwl_mvm *mvm,* * @add_aux_sta_for_hs20: pointer to the function that adds an aux sta * for Hot Spot 2.0 -* @switch_phy_ctxt: pointer to the function that switches a vif from one -* phy_ctx to another +* @link: For a P2P Device interface, pointer to a function that links the +* MAC/Link to the PHY context */ struct iwl_mvm_roc_ops {int (*add_aux_sta_for_hs20)(struct iwl_mvm *mvm,u32 lmac_id); -int (*switch_phy_ctxt)(struct iwl_mvm *mvm,struct ieee80211_vif *vif, -struct iwl_mvm_phy_ctxt *new_phy_ctxt); +int (*link)(struct iwl_mvm *mvm,struct ieee80211_vif *vif); }; int iwl_mvm_roc_common(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +22 -2
@@ -78,9 +78,29 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk)*/ if (!WARN_ON (!mvm->p2p_device_vif)) { - mvmvif =iwl_mvm_vif_from_mac80211 (mvm->p2p_device_vif); +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); + +if (mvm->mld_api_is_used) { +iwl_mvm_mld_rm_bcast_sta (mvm, vif, + &vif->bss_conf); + +iwl_mvm_link_changed (mvm, vif, &vif->bss_conf, +LINK_CONTEXT_MODIFY_ACTIVE , + false); + }else { +iwl_mvm_rm_p2p_bcast_sta (mvm, vif); +iwl_mvm_binding_remove_vif (mvm, vif); + } + +/* Do not remove the PHY context as removing and adding +* a PHY context has timing overheads. Leaving it +* configured in FW would be useful in case the next ROC +* is with the same channel. +*/ } }
@@ -880,8 +900,8 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm,if (!le32_to_cpu (notif->status) || !le32_to_cpu (notif->start)) {/* End TE, notify mac80211 */ mvmvif->time_event_data.id =SESSION_PROTECT_CONF_MAX_ID ; -ieee80211_remain_on_channel_expired (mvm->hw);iwl_mvm_p2p_roc_finished (mvm); +ieee80211_remain_on_channel_expired (mvm->hw); }else if (le32_to_cpu (notif->start)) {if (WARN_ON (mvmvif->time_event_data.id !=le32_to_cpu (notif->conf_id)))
Signature · 1 line
2.38.1
PATCH 12/15 wifi: iwlwifi: mvm: advertise support for SCS traffic description
In reply to [email protected]From: Ayala Beker <[email protected]>
This doesn't require any special implementation from our device, just allows transmission of SCS request frame containing a QoS characteristics sub element.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +2 -1
@@ -671,7 +671,8 @@ static const struct ieee80211_sband_iftype_data iwl_he_eht_capa[] = {IEEE80211_EHT_MAC_CAP0_EPCS_PRIO_ACCESS |IEEE80211_EHT_MAC_CAP0_OM_CONTROL |IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE1 | - IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE2, +IEEE80211_EHT_MAC_CAP0_TRIG_TXOP_SHARING_MODE2 | + IEEE80211_EHT_MAC_CAP0_SCS_TRAFFIC_DESC, .phy_cap_info[0 ] =IEEE80211_EHT_PHY_CAP0_242_TONE_RU_GT20MHZ | IEEE80211_EHT_PHY_CAP0_NDP_4_EHT_LFT_32_GI |
Signature · 1 line
2.38.1
PATCH 13/15 wifi: iwlwifi: fw: Fix debugfs command sending
In reply to [email protected]From: Mukesh Sisodiya <[email protected]>
During debugfs command handling transport function is used directly, this bypasses the locking used by runtime operation function and leads to a kernel warning when two commands are
sent in parallel.
Fix it by using runtime operations function when sending debugfs command.
--- drivers/net/wireless/intel/iwlwifi/fw/debugfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/fw/debugfs.c +5 -1
@@ -141,7 +141,11 @@ static int iwl_dbgfs_enabled_severities_write(struct iwl_fw_runtime *fwrt, event_cfg.enabled_severities =cpu_to_le32 (enabled_severities); - ret =iwl_trans_send_cmd (fwrt->trans, &hcmd); +if (fwrt->ops && fwrt->ops->send_hcmd) + ret = fwrt->ops->send_hcmd (fwrt->ops_ctx, &hcmd); +else + ret = -EPERM ; +IWL_INFO (fwrt,"sent host event cfg with enabled_severities: %u, ret: %d\n" , enabled_severities, ret);
Signature · 1 line
2.38.1
PATCH 14/15 wifi: iwlwifi: fix the rf step and flavor bits range
In reply to [email protected]From: Mukesh Sisodiya <[email protected]>
The macros used to get the RF step and flavour are using wrong bit range. Update the bit range for both macros.
--- drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-prph.h +4 -4
@@ -423,14 +423,14 @@ enum {* reserved: bits 12-18 * slave_exist: bit 19 * dash: bits 20-23 -* step: bits 24-26 -* flavor: bits 27-31 +* step: bits 24-27 +* flavor: bits 28-31 */ #define REG_CRF_ID_TYPE (val) (((val) & 0x00000FFF) >> 0)#define REG_CRF_ID_SLAVE (val) (((val) & 0x00080000) >> 19)#define REG_CRF_ID_DASH (val) (((val) & 0x00F00000) >> 20) -#define REG_CRF_ID_STEP (val) (((val) & 0x07000000) >> 24) -#define REG_CRF_ID_FLAVOR (val) (((val) & 0xF8000000) >> 27) +#define REG_CRF_ID_STEP (val) (((val) & 0x0F000000) >> 24) +#define REG_CRF_ID_FLAVOR (val) (((val) & 0xF0000000) >> 28)#define UREG_CHICK (0xA05C00)#define UREG_CHICK_MSI_ENABLE BIT(24)
Signature · 1 line
2.38.1
PATCH 15/15 wifi: iwlwifi: mvm: Correctly set link configuration
In reply to [email protected]From: Ilan Peer <[email protected]>
In case the link puncturing is changed such that the channel is no longer punctured, configure the FW correctly indicating the EHT parameters changed (with a 0 punctured map).
Allow EHT parameters configuration only when the link really supports EHT.
--- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 13 ++++++++----- .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/link.c +8 -5
@@ -189,11 +189,14 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, flags_mask |=LINK_FLG_MU_EDCA_CW ; } -if (link_conf->eht_puncturing && !iwlwifi_mod_params.disable_11be) - cmd.puncture_mask =cpu_to_le16 (link_conf->eht_puncturing); -else -/* This flag can be set only if the MAC has eht support */ - changes &= ~LINK_CONTEXT_MODIFY_EHT_PARAMS ; +if (changes &LINK_CONTEXT_MODIFY_EHT_PARAMS ) { +if (iwlwifi_mod_params.disable_11be || + !link_conf->eht_support) + changes &= ~LINK_CONTEXT_MODIFY_EHT_PARAMS ; +else + cmd.puncture_mask = +cpu_to_le16 (link_conf->eht_puncturing); + } cmd.bss_color = link_conf->he_bss_color.color;
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +1 -1
@@ -744,7 +744,7 @@ iwl_mvm_mld_link_info_changed_station(struct iwl_mvm *mvm, }/* Update EHT Puncturing info */ -if (changes &BSS_CHANGED_EHT_PUNCTURING && vif->cfg.assoc && has_eht) +if (changes &BSS_CHANGED_EHT_PUNCTURING && vif->cfg.assoc) link_changes |=LINK_CONTEXT_MODIFY_EHT_PARAMS ;if (link_changes) {
Signature · 1 line
2.38.1