iwlwifi: updates intended for v5.18 2022-01-30
cover iwlwifi: updates intended for v5.18 2022-01-30
From: Luca Coelho <[email protected]>
Hi,
Here's the third set of patches intended for v5.18. It's the usual development, new features, cleanups and bugfixes.
The changes are:
* A bunch of fixes for W=1 and W=3 warnings;
* Add support for a couple of new devices;
* Fix a potential buffer underflow;
* Some other small fixes, clean-ups and improvements.
As usual, I'm pushing this to a pending branch, for kbuild bot, and will send a pull-request later.
Please review.
Cheers,
Luca.
Abhishek Naik (1):
iwlwifi: nvm: Correct HE capability
Andrei Otcheretianski (1):
iwlwifi: pcie: make sure iwl_rx_packet_payload_len() will not
underflow
Johannes Berg (6):
iwlwifi: fw: make dump_start callback void
iwlwifi: move symbols into a separate namespace
iwlwifi: dbg-tlv: clean up iwl_dbg_tlv_update_drams()
iwlwifi: avoid variable shadowing
iwlwifi: make some functions friendly to sparse
iwlwifi: mei: avoid -Wpointer-arith and -Wcast-qual warnings
Luca Coelho (2):
iwlwifi: read and print OTP minor version
iwlwifi: remove unused DC2DC_CONFIG_CMD definitions
Mike Golant (1):
iwlwifi: add support for BZ-U and BZ-L HW
Miri Korenblit (1):
iwlwifi: mvm: use debug print instead of WARN_ON()
drivers/net/wireless/intel/iwlwifi/dvm/main.c | 1 + .../wireless/intel/iwlwifi/fw/api/commands.h | 8 ----- .../wireless/intel/iwlwifi/fw/api/config.h | 33 ------------------- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 5 ++- drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 -- .../net/wireless/intel/iwlwifi/fw/runtime.h | 2 +- .../net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 33 +++++++++++-------- drivers/net/wireless/intel/iwlwifi/iwl-drv.h | 2 +- drivers/net/wireless/intel/iwlwifi/iwl-io.c | 18 +++++----- .../wireless/intel/iwlwifi/iwl-nvm-parse.c | 11 +++++-- drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 2 ++ drivers/net/wireless/intel/iwlwifi/mei/main.c | 4 +-- drivers/net/wireless/intel/iwlwifi/mei/net.c | 4 +-- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 6 ++-- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 6 ++-- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 2 -- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 ++ drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 +- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 6 ++-- drivers/net/wireless/intel/iwlwifi/queue/tx.h | 10 +++--- 20 files changed, 66 insertions(+), 93 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/12 iwlwifi: add support for BZ-U and BZ-L HW
From: Mike Golant <[email protected]>
Add support for BZ-U and BZ-L HW
with GF, GF4, MR, FM and FM4 RF modules
--- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +2 -0
@@ -503,6 +503,8 @@ static const struct pci_device_id iwl_hw_card_ids[] = { /* Bz devices */ {IWL_PCI_DEVICE(0x2727, PCI_ANY_ID, iwl_bz_trans_cfg)}, + {IWL_PCI_DEVICE(0xA840, PCI_ANY_ID, iwl_bz_trans_cfg)}, + {IWL_PCI_DEVICE(0x7740, PCI_ANY_ID, iwl_bz_trans_cfg)}, #endif /* CONFIG_IWLMVM */ {0}
Signature · 1 line
2.34.1
PATCH 2/12 iwlwifi: read and print OTP minor version
In reply to Luca CoelhoFrom: Luca Coelho <[email protected]>
Sometimes it can be useful to know the OTP minor version, so read it from the register and print it out.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 4 +++- drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +3 -1
@@ -1080,7 +1080,9 @@ static int iwl_set_hw_address(struct iwl_trans *trans,return -EINVAL ; } -IWL_INFO (trans,"base HW address: %pM\n" , data->hw_addr); +if (!trans->csme_own) +IWL_INFO (trans,"base HW address: %pM, OTP minor version: 0x%x\n" , + data->hw_addr,iwl_read_prph (trans,REG_OTP_MINOR ));return 0 ; }
drivers/net/wireless/intel/iwlwifi/iwl-prph.h +2 -0
@@ -491,4 +491,6 @@ enum {#define HBUS_TIMEOUT 0xA5A5A5A1#define WFPM_DPHY_OFF 0xDF10FF +#define REG_OTP_MINOR 0xA0333C +#endif /* __iwl_prph_h__ */
Signature · 1 line
2.34.1
PATCH 3/12 iwlwifi: mvm: use debug print instead of WARN_ON()
In reply to Luca CoelhoFrom: Miri Korenblit <[email protected]>
In MCC_UPDATE_CMD we get from the FW the number of entries in the channel info array. We used to WARN_ON if this parameter is greater than we expected. Since this is not really a driver bug, and since it might happen in some valid cases too, we shouldn't use a warning here.
Fix this by replacing the WARN_ON with a debug print.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +5 -1
@@ -1387,8 +1387,12 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, nvm_chan = iwl_nvm_channels; } -if (WARN_ON (num_of_ch > max_num_ch)) +if (num_of_ch > max_num_ch) { +IWL_DEBUG_DEV (dev,IWL_DL_LAR , +"Num of channels (%d) is greater than expected. Truncating to %d\n" , + num_of_ch, max_num_ch); num_of_ch = max_num_ch; + }if (WARN_ON_ONCE (num_of_ch >NL80211_MAX_SUPP_REG_RULES ))return ERR_PTR (-EINVAL );
Signature · 1 line
2.34.1
PATCH 4/12 iwlwifi: pcie: make sure iwl_rx_packet_payload_len() will not underflow
In reply to Luca CoelhoFrom: Andrei Otcheretianski <[email protected]>
If the device is malfunctioning and reports too short rx descriptor length, iwl_rx_packet_payload_len() will underflow, eventually resulting in accessing memory out of bounds and other bad things. Prevent this.
--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +1 -1
@@ -1317,7 +1317,7 @@ static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans, offset +=ALIGN (len,FH_RSCSR_FRAME_ALIGN );/* check that what the device tells us made sense */ -if (offset > max_len) +if (len <sizeof (*pkt) || offset > max_len)break ;trace_iwlwifi_dev_rx (trans->dev, trans, pkt, len);
Signature · 1 line
2.34.1
PATCH 5/12 iwlwifi: fw: make dump_start callback void
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
We never return errors there, so just make it void.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 5 ++--- drivers/net/wireless/intel/iwlwifi/fw/runtime.h | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +2 -3
@@ -2939,9 +2939,8 @@ void iwl_fw_error_dump_wk(struct work_struct *work)/* assumes the op mode mutex is locked in dump_start since * iwl_fw_dbg_collect_sync can't run in parallel */ -if (fwrt->ops && fwrt->ops->dump_start && - fwrt->ops->dump_start (fwrt->ops_ctx)) -return ; +if (fwrt->ops && fwrt->ops->dump_start) + fwrt->ops->dump_start (fwrt->ops_ctx);iwl_fw_dbg_collect_sync (fwrt, wks->idx);
drivers/net/wireless/intel/iwlwifi/fw/runtime.h +1 -1
@@ -16,7 +16,7 @@#include "fw/acpi.h" struct iwl_fw_runtime_ops { -int (*dump_start)(void *ctx); +void (*dump_start)(void *ctx);void (*dump_end)(void *ctx);bool (*fw_running)(void *ctx);int (*send_hcmd)(void *ctx,struct iwl_host_cmd *host_cmd);
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +1 -3
@@ -639,13 +639,11 @@ static void iwl_mvm_tx_unblock_dwork(struct work_struct *work)mutex_unlock (&mvm->mutex); } -static int iwl_mvm_fwrt_dump_start (void *ctx) +static void iwl_mvm_fwrt_dump_start (void *ctx) {struct iwl_mvm *mvm = ctx;mutex_lock (&mvm->mutex); - -return 0 ; }static void iwl_mvm_fwrt_dump_end (void *ctx)
Signature · 1 line
2.34.1
PATCH 6/12 iwlwifi: move symbols into a separate namespace
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
Nobody other than iwlwifi itself should be accessing the symbols that it exports, so make that clear by moving them into a separate new namespace ("IWLWIFI").
--- drivers/net/wireless/intel/iwlwifi/dvm/main.c | 1 + drivers/net/wireless/intel/iwlwifi/iwl-drv.h | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/dvm/main.c +1 -0
@@ -48,6 +48,7 @@#define DRV_DESCRIPTION "Intel(R) Wireless WiFi Link AGN driver for Linux"MODULE_DESCRIPTION (DRV_DESCRIPTION );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (IWLWIFI );/* Please keep this array *SORTED* by hex value. * Access is done through binary search.
drivers/net/wireless/intel/iwlwifi/iwl-drv.h +1 -1
@@ -84,7 +84,7 @@ void iwl_drv_stop(struct iwl_drv *drv);* everything is built-in, then we can avoid that. */ #ifdef CONFIG_IWLWIFI_OPMODE_MODULAR -#define IWL_EXPORT_SYMBOL (sym) EXPORT_SYMBOL_GPL(sym) +#define IWL_EXPORT_SYMBOL (sym) EXPORT_SYMBOL_NS_GPL(sym, IWLWIFI)#else #define IWL_EXPORT_SYMBOL (sym)#endif
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +1 -0
@@ -32,6 +32,7 @@#define DRV_DESCRIPTION "The new Intel(R) wireless AGN driver for Linux"MODULE_DESCRIPTION (DRV_DESCRIPTION );MODULE_LICENSE ("GPL" ); +MODULE_IMPORT_NS (IWLWIFI );static const struct iwl_op_mode_ops iwl_mvm_ops;static const struct iwl_op_mode_ops iwl_mvm_ops_mq;
Signature · 1 line
2.34.1
PATCH 7/12 iwlwifi: dbg-tlv: clean up iwl_dbg_tlv_update_drams()
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
This function puts a fairly large structure unnecessarily on the stack, and also has a few other very strange things, clean it up a bit.
--- .../net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +18 -11
@@ -769,33 +769,40 @@ static int iwl_dbg_tlv_update_dram(struct iwl_fw_runtime *fwrt,static void iwl_dbg_tlv_update_drams (struct iwl_fw_runtime *fwrt) { -int ret, i, dram_alloc =0 ; -struct iwl_dram_info dram_info; +int ret, i; +bool dram_alloc = false;struct iwl_dram_data *frags = &fwrt->trans->dbg.fw_mon_ini[IWL_FW_INI_ALLOCATION_ID_DBGC1 ].frags[0 ]; +struct iwl_dram_info *dram_info; + +if (!frags || !frags->block) +return ; + + dram_info = frags->block;if (!fw_has_capa (&fwrt->fw->ucode_capa,IWL_UCODE_TLV_CAPA_DRAM_FRAG_SUPPORT ))return ; - dram_info.first_word =cpu_to_le32 (DRAM_INFO_FIRST_MAGIC_WORD ); - dram_info.second_word =cpu_to_le32 (DRAM_INFO_SECOND_MAGIC_WORD ); + dram_info->first_word =cpu_to_le32 (DRAM_INFO_FIRST_MAGIC_WORD ); + dram_info->second_word =cpu_to_le32 (DRAM_INFO_SECOND_MAGIC_WORD );for (i =IWL_FW_INI_ALLOCATION_ID_DBGC1 ; i <=IWL_FW_INI_ALLOCATION_ID_DBGC3 ; i++) { - ret =iwl_dbg_tlv_update_dram (fwrt, i, &dram_info); + ret =iwl_dbg_tlv_update_dram (fwrt, i, dram_info);if (!ret) - dram_alloc++; + dram_alloc = true;else IWL_WARN (fwrt,"WRT: Failed to set DRAM buffer for alloc id %d, ret=%d\n" , i, ret); } -if (dram_alloc) { -memcpy (frags->block, &dram_info,sizeof (dram_info)); -IWL_DEBUG_FW (fwrt,"block data after %016x\n" , - *((int *)fwrt->trans->dbg.fw_mon_ini[1 ].frags[0 ].block)); - } + +if (dram_alloc) +IWL_DEBUG_FW (fwrt,"block data after %08x\n" , + dram_info->first_word); +else +memset (frags->block,0 ,sizeof (*dram_info)); } static void iwl_dbg_tlv_send_hcmds(struct iwl_fw_runtime *fwrt,
Signature · 1 line
2.34.1
PATCH 8/12 iwlwifi: remove unused DC2DC_CONFIG_CMD definitions
In reply to Luca CoelhoFrom: Luca Coelho <[email protected]>
We haven't used this command for a long time, if ever, so we can remove all related definitions.
--- .../wireless/intel/iwlwifi/fw/api/commands.h | 8 ----- .../wireless/intel/iwlwifi/fw/api/config.h | 33 ------------------- drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 -- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 - 4 files changed, 44 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/commands.h +0 -8
@@ -322,14 +322,6 @@ enum iwl_legacy_cmds {*/ REPLY_THERMAL_MNG_BACKOFF = 0x7e, -/** -* @DC2DC_CONFIG_CMD: -* Set/Get DC2DC frequency tune -* Command is &struct iwl_dc2dc_config_cmd, -* response is &struct iwl_dc2dc_config_resp -*/ - DC2DC_CONFIG_CMD = 0x83, -/** * @NVM_ACCESS_CMD: using &struct iwl_nvm_access_cmd */
drivers/net/wireless/intel/iwlwifi/fw/api/config.h +0 -33
@@ -114,37 +114,4 @@ enum iwl_dc2dc_config_id { DCDC_FREQ_TUNE_SET = 0x2, }; /* MARKER_ID_API_E_VER_1 */ -/** -* struct iwl_dc2dc_config_cmd - configure dc2dc values -* -* (DC2DC_CONFIG_CMD = 0x83) -* -* Set/Get & configure dc2dc values. -* The command always returns the current dc2dc values. -* -* @flags: set/get dc2dc -* @enable_low_power_mode: not used. -* @dc2dc_freq_tune0: frequency divider - digital domain -* @dc2dc_freq_tune1: frequency divider - analog domain -*/ -struct iwl_dc2dc_config_cmd { -__le32 flags; -__le32 enable_low_power_mode;/* not used */ -__le32 dc2dc_freq_tune0; -__le32 dc2dc_freq_tune1; -} __packed;/* DC2DC_CONFIG_CMD_API_S_VER_1 */ - -/** -* struct iwl_dc2dc_config_resp - response for iwl_dc2dc_config_cmd -* -* Current dc2dc values returned by the FW. -* -* @dc2dc_freq_tune0: frequency divider - digital domain -* @dc2dc_freq_tune1: frequency divider - analog domain -*/ -struct iwl_dc2dc_config_resp { -__le32 dc2dc_freq_tune0; -__le32 dc2dc_freq_tune1; -} __packed;/* DC2DC_CONFIG_RESP_API_S_VER_1 */ -#endif /* __iwl_fw_api_config_h__ */
drivers/net/wireless/intel/iwlwifi/fw/file.h +0 -2
@@ -312,7 +312,6 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;* @IWL_UCODE_TLV_CAPA_TDLS_CHANNEL_SWITCH: supports TDLS channel switching * @IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG: Consolidated D3-D0 image * @IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT: supports Hot Spot Command -* @IWL_UCODE_TLV_CAPA_DC2DC_SUPPORT: supports DC2DC Command * @IWL_UCODE_TLV_CAPA_CSUM_SUPPORT: supports TCP Checksum Offload * @IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS: support radio and beacon statistics * @IWL_UCODE_TLV_CAPA_P2P_SCM_UAPSD: supports U-APSD on p2p interface when it
@@ -388,7 +387,6 @@ enum iwl_ucode_tlv_capa {IWL_UCODE_TLV_CAPA_TDLS_CHANNEL_SWITCH = (__force iwl_ucode_tlv_capa_t )13 ,IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG = (__force iwl_ucode_tlv_capa_t )17 ,IWL_UCODE_TLV_CAPA_HOTSPOT_SUPPORT = (__force iwl_ucode_tlv_capa_t )18 , -IWL_UCODE_TLV_CAPA_DC2DC_CONFIG_SUPPORT = (__force iwl_ucode_tlv_capa_t )19 ,IWL_UCODE_TLV_CAPA_CSUM_SUPPORT = (__force iwl_ucode_tlv_capa_t )21 ,IWL_UCODE_TLV_CAPA_RADIO_BEACON_STATS = (__force iwl_ucode_tlv_capa_t )22 , IWL_UCODE_TLV_CAPA_P2P_SCM_UAPSD = (__force iwl_ucode_tlv_capa_t)26,
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +0 -1
@@ -449,7 +449,6 @@ static const struct iwl_hcmd_names iwl_mvm_legacy_names[] = {HCMD_NAME (POWER_TABLE_CMD ),HCMD_NAME (PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION ),HCMD_NAME (REPLY_THERMAL_MNG_BACKOFF ), -HCMD_NAME (DC2DC_CONFIG_CMD ),HCMD_NAME (NVM_ACCESS_CMD ),HCMD_NAME (BEACON_NOTIFICATION ), HCMD_NAME(BEACON_TEMPLATE_CMD),
Signature · 1 line
2.34.1
PATCH 9/12 iwlwifi: avoid variable shadowing
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
Change a few places to not shadow variables.
--- drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 4 ++-- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 6 +++--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 2 -- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 6 +++--- drivers/net/wireless/intel/iwlwifi/queue/tx.h | 10 +++++----- 5 files changed, 13 insertions(+), 15 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +2 -2
@@ -825,11 +825,11 @@ static void iwl_dbg_tlv_send_hcmds(struct iwl_fw_runtime *fwrt, }static void iwl_dbg_tlv_apply_config (struct iwl_fw_runtime *fwrt, -struct list_head *config_list) +struct list_head *conf_list) {struct iwl_dbg_tlv_node *node; -list_for_each_entry (node, config_list, list) { +list_for_each_entry (node, conf_list, list) {struct iwl_fw_ini_conf_set_tlv *config_list = (void *)node->tlv.data;u32 count, address, value;u32 len = (le32_to_cpu (node->tlv.length) -sizeof (*config_list)) /8 ;
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +3 -3
@@ -1041,12 +1041,12 @@ static bool iwl_mvm_remove_inactive_tids(struct iwl_mvm *mvm,* Remove the ones that did. */ for_each_set_bit (tid, &tid_bitmap,IWL_MAX_TID_COUNT +1 ) { -u16 tid_bitmap; +u16 q_tid_bitmap; mvmsta->tid_data[tid].txq_id =IWL_MVM_INVALID_QUEUE ; mvm->queue_info[queue].tid_bitmap &= ~BIT (tid); - tid_bitmap = mvm->queue_info[queue].tid_bitmap; + q_tid_bitmap = mvm->queue_info[queue].tid_bitmap;/* * We need to take into account a situation in which a TXQ was
@@ -1059,7 +1059,7 @@ static bool iwl_mvm_remove_inactive_tids(struct iwl_mvm *mvm,* Mark this queue in the right bitmap, we'll send the command * to the firmware later. */ -if (!(tid_bitmap &BIT (mvm->queue_info[queue].txq_tid))) +if (!(q_tid_bitmap &BIT (mvm->queue_info[queue].txq_tid)))set_bit (queue, changetid_queues); IWL_DEBUG_TX_QUEUES(mvm,
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +0 -2
@@ -1603,8 +1603,6 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, seq_ctl =le16_to_cpu (hdr->seq_ctrl);if (unlikely (!seq_ctl)) { -struct ieee80211_hdr *hdr = (void *)skb->data; -/* * If it is an NDP, we can't update next_reclaim since * its sequence control is 0. Note that for that same
drivers/net/wireless/intel/iwlwifi/queue/tx.c +3 -3
@@ -1307,10 +1307,10 @@ static inline dma_addr_t iwl_txq_gen1_tfd_tb_get_addr(struct iwl_trans *trans,dma_addr_t hi_len;if (trans->trans_cfg->use_tfh) { -struct iwl_tfh_tfd *tfd = _tfd; -struct iwl_tfh_tb *tb = &tfd->tbs[idx]; +struct iwl_tfh_tfd *tfh_tfd = _tfd; +struct iwl_tfh_tb *tfh_tb = &tfh_tfd->tbs[idx]; -return (dma_addr_t)(le64_to_cpu (tb->addr)); +return (dma_addr_t)(le64_to_cpu (tfh_tb->addr)); } tfd = _tfd;
drivers/net/wireless/intel/iwlwifi/queue/tx.h +5 -5
@@ -137,9 +137,9 @@ static inline u8 iwl_txq_gen1_tfd_get_num_tbs(struct iwl_trans *trans,struct iwl_tfd *tfd;if (trans->trans_cfg->use_tfh) { -struct iwl_tfh_tfd *tfd = _tfd; +struct iwl_tfh_tfd *tfh_tfd = _tfd; -return le16_to_cpu (tfd->num_tbs) &0x1f ; +return le16_to_cpu (tfh_tfd->num_tbs) &0x1f ; } tfd = (struct iwl_tfd *)_tfd;
@@ -153,10 +153,10 @@ static inline u16 iwl_txq_gen1_tfd_tb_get_len(struct iwl_trans *trans,struct iwl_tfd_tb *tb;if (trans->trans_cfg->use_tfh) { -struct iwl_tfh_tfd *tfd = _tfd; -struct iwl_tfh_tb *tb = &tfd->tbs[idx]; +struct iwl_tfh_tfd *tfh_tfd = _tfd; +struct iwl_tfh_tb *tfh_tb = &tfh_tfd->tbs[idx]; -return le16_to_cpu (tb->tb_len); +return le16_to_cpu (tfh_tb->tb_len); } tfd = (struct iwl_tfd *)_tfd;
Signature · 1 line
2.34.1
PATCH 10/12 iwlwifi: make some functions friendly to sparse
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
Somehow, sparse cannot track the cond_lock() here properly, but if we return directly from the inner basic block then it doesn't complain. Refactor the code a bit to make it not complain.
--- drivers/net/wireless/intel/iwlwifi/iwl-io.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-io.c +10 -8
@@ -65,14 +65,14 @@ IWL_EXPORT_SYMBOL(iwl_poll_bit);u32 iwl_read_direct32 (struct iwl_trans *trans,u32 reg) { -u32 value =0x5a5a5a5a ; -if (iwl_trans_grab_nic_access (trans)) { - value =iwl_read32 (trans, reg); +u32 value =iwl_read32 (trans, reg); +iwl_trans_release_nic_access (trans); +return value; } -return value; +return 0x5a5a5a5a ; }IWL_EXPORT_SYMBOL (iwl_read_direct32);
@@ -135,13 +135,15 @@ IWL_EXPORT_SYMBOL(iwl_write_prph64_no_grab);u32 iwl_read_prph (struct iwl_trans *trans,u32 ofs) { -u32 val =0x5a5a5a5a ; -if (iwl_trans_grab_nic_access (trans)) { - val =iwl_read_prph_no_grab (trans, ofs); +u32 val =iwl_read_prph_no_grab (trans, ofs); +iwl_trans_release_nic_access (trans); + +return val; } -return val; + +return 0x5a5a5a5a ; }IWL_EXPORT_SYMBOL (iwl_read_prph);
Signature · 1 line
2.34.1
PATCH 11/12 iwlwifi: mei: avoid -Wpointer-arith and -Wcast-qual warnings
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
These cause extra warnings (at least with W=3), avoid them.
--- drivers/net/wireless/intel/iwlwifi/mei/main.c | 4 ++-- drivers/net/wireless/intel/iwlwifi/mei/net.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mei/main.c +2 -2
@@ -312,7 +312,7 @@ static ssize_t iwl_mei_write_cyclic_buf(struct mei_cl_device *cldev,memcpy (q_head + wr, hdr, tx_sz); }else {memcpy (q_head + wr, hdr, q_sz - wr); -memcpy (q_head, (u8 *)hdr + q_sz - wr, tx_sz - (q_sz - wr)); +memcpy (q_head, (const u8 *)hdr + q_sz - wr, tx_sz - (q_sz - wr)); }WRITE_ONCE (notif_q->wr_ptr,cpu_to_le32 ((wr + tx_sz) % q_sz));
@@ -432,7 +432,7 @@ void iwl_mei_add_data_to_ring(struct sk_buff *skb, bool cb_tx)u32 q_sz;u32 rd;u32 wr; -void *q_head; +u8 *q_head;if (!iwl_mei_global_cldev)return ;
drivers/net/wireless/intel/iwlwifi/mei/net.c +2 -2
@@ -102,8 +102,8 @@ static bool iwl_mei_rx_filter_arp(struct sk_buff *skb,* src IP address - 4 bytes * target MAC addess - 6 bytes */ - target_ip = (void *)((u8 *)(arp +1 ) + -ETH_ALEN +sizeof (__be32) +ETH_ALEN ); + target_ip = (const void *)((const u8 *)(arp +1 ) + +ETH_ALEN +sizeof (__be32) +ETH_ALEN );/* * ARP request is forwarded to ME only if IP address match in the
Signature · 1 line
2.34.1
PATCH 12/12 iwlwifi: nvm: Correct HE capability
In reply to Luca CoelhoFrom: Abhishek Naik <[email protected]>
The HE PHY capability - Tx 1024-QAM < 242-tone RU support was not handled for Ms RFs, add the relevant code for it.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +1 -0
@@ -784,6 +784,7 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,switch (CSR_HW_RFID_TYPE (trans->hw_rf_id)) {case IWL_CFG_RF_TYPE_GF :case IWL_CFG_RF_TYPE_MR : +case IWL_CFG_RF_TYPE_MS : iftype_data->he_cap.he_cap_elem.phy_cap_info[9 ] |=IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU ;if (!is_ap)
Signature · 1 line
2.34.1
kernel test robot
build botRe: [PATCH 12/12] iwlwifi: nvm: Correct HE capability
Thank you for the patch! Yet something to improve:
Hi Luca,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.17-rc2 next-20220128]
[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]
url: https://github.com/0day-ci/linux/commits/Luca-Coelho/iwlwifi-updates-intended-for-v5-18-2022-01-30/20220130-175511 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f8c7e4ede46fe63ff10000669652648aab09d112 config: microblaze-randconfig-r033-20220130 (https://download.01.org/0day-ci/archive/20220131/202201311149.Srfwgzez-lkp(a)intel.com/config) compiler: microblaze-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/ac5ced0e583f75e19be7396060676562e3dd9cab
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Luca-Coelho/iwlwifi-updates-intended-for-v5-18-2022-01-30/20220130-175511
git checkout ac5ced0e583f75e19be7396060676562e3dd9cab
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/net/wireless/intel/iwlwifi/
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>):
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c: In function 'iwl_nvm_fixup_sband_iftd':
>> drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c:787:14: error: 'IWL_CFG_RF_TYPE_MS' undeclared (first use in this function); did you mean 'IWL_CFG_RF_TYPE_MR'?
787 | case IWL_CFG_RF_TYPE_MS:
| ^~~~~~~~~~~~~~~~~~
| IWL_CFG_RF_TYPE_MR drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c:787:14: note: each undeclared identifier is reported only once for each function it appears in
vim +787 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
739
740 static void
741 iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
742 struct ieee80211_supported_band *sband,
743 struct ieee80211_sband_iftype_data *iftype_data,
744 u8 tx_chains, u8 rx_chains,
745 const struct iwl_fw *fw)
746 {
747 bool is_ap = iftype_data->types_mask & BIT(NL80211_IFTYPE_AP);
748
749 /* Advertise an A-MPDU exponent extension based on
750 * operating band
751 */
752 if (sband->band != NL80211_BAND_2GHZ)
753 iftype_data->he_cap.he_cap_elem.mac_cap_info[3] |=
754 IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_1;
755 else
756 iftype_data->he_cap.he_cap_elem.mac_cap_info[3] |=
757 IEEE80211_HE_MAC_CAP3_MAX_AMPDU_LEN_EXP_EXT_3;
758
759 if (is_ap && iwlwifi_mod_params.nvm_file)
760 iftype_data->he_cap.he_cap_elem.phy_cap_info[0] |=
761 IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G;
762
763 if ((tx_chains & rx_chains) == ANT_AB) {
764 iftype_data->he_cap.he_cap_elem.phy_cap_info[2] |=
765 IEEE80211_HE_PHY_CAP2_STBC_TX_UNDER_80MHZ;
766 iftype_data->he_cap.he_cap_elem.phy_cap_info[5] |=
767 IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_2 |
768 IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2;
769 if (!is_ap)
770 iftype_data->he_cap.he_cap_elem.phy_cap_info[7] |=
771 IEEE80211_HE_PHY_CAP7_MAX_NC_2;
772 } else if (!is_ap) {
773 /* If not 2x2, we need to indicate 1x1 in the
774 * Midamble RX Max NSTS - but not for AP mode
775 */
776 iftype_data->he_cap.he_cap_elem.phy_cap_info[1] &=
777 ~IEEE80211_HE_PHY_CAP1_MIDAMBLE_RX_TX_MAX_NSTS;
778 iftype_data->he_cap.he_cap_elem.phy_cap_info[2] &=
779 ~IEEE80211_HE_PHY_CAP2_MIDAMBLE_RX_TX_MAX_NSTS;
780 iftype_data->he_cap.he_cap_elem.phy_cap_info[7] |=
781 IEEE80211_HE_PHY_CAP7_MAX_NC_1;
782 }
783
784 switch (CSR_HW_RFID_TYPE(trans->hw_rf_id)) {
785 case IWL_CFG_RF_TYPE_GF:
786 case IWL_CFG_RF_TYPE_MR:
> 787 case IWL_CFG_RF_TYPE_MS:
788 iftype_data->he_cap.he_cap_elem.phy_cap_info[9] |=
789 IEEE80211_HE_PHY_CAP9_TX_1024_QAM_LESS_THAN_242_TONE_RU;
790 if (!is_ap)
791 iftype_data->he_cap.he_cap_elem.phy_cap_info[9] |=
792 IEEE80211_HE_PHY_CAP9_RX_1024_QAM_LESS_THAN_242_TONE_RU;
793 break;
794 }
795
796 if (fw_has_capa(&fw->ucode_capa, IWL_UCODE_TLV_CAPA_BROADCAST_TWT))
797 iftype_data->he_cap.he_cap_elem.mac_cap_info[2] |=
798 IEEE80211_HE_MAC_CAP2_BCAST_TWT;
799
800 if (trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_22000 &&
801 !is_ap) {
802 iftype_data->vendor_elems.data = iwl_vendor_caps;
803 iftype_data->vendor_elems.len = ARRAY_SIZE(iwl_vendor_caps);
804 }
805 }
806
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org