wifi: iwlwifi: updates intended for v6.6 2023-08-16
cover wifi: iwlwifi: updates intended for v6.6 2023-08-16
From: Gregory Greenman <[email protected]>
Hi,
This patch set includes iwlwifi patches intended for v6.6.
It contains a few small cleanups and bugfixes along with patches which clean up pcie and tx datapath.
Thanks,
Gregory
Gregory Greenman (1):
wifi: iwlwifi: add Razer to ppag approved list
Johannes Berg (10):
wifi: iwlwifi: mvm: advertise MLO only if EHT is enabled
wifi: iwlwifi: api: fix a small upper/lower-case typo
wifi: iwlwifi: remove WARN from read_mem32()
wifi: iwlwifi: pcie: clean up gen1/gen2 TFD unmap
wifi: iwlwifi: remove 'def_rx_queue' struct member
wifi: iwlwifi: pcie: move gen1 TB handling to header
wifi: iwlwifi: queue: move iwl_txq_gen2_set_tb() up
wifi: iwlwifi: pcie: point invalid TFDs to invalid data
wifi: iwlwifi: mvm: enable HE TX/RX <242 tone RU on new RFs
wifi: iwlwifi: mvm: support flush on AP interfaces
Mukesh Sisodiya (1):
wifi: iwlwifi: remove memory check for LMAC error address
drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 5 + .../net/wireless/intel/iwlwifi/fw/api/debug.h | 9 +- drivers/net/wireless/intel/iwlwifi/fw/dump.c | 3 +- drivers/net/wireless/intel/iwlwifi/iwl-fh.h | 2 + .../wireless/intel/iwlwifi/iwl-nvm-parse.c | 2 + .../net/wireless/intel/iwlwifi/iwl-trans.h | 7 +- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 11 +- .../wireless/intel/iwlwifi/pcie/internal.h | 4 +- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 +- .../net/wireless/intel/iwlwifi/pcie/trans.c | 31 +++- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 24 +-- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 142 ++++++++++-------- drivers/net/wireless/intel/iwlwifi/queue/tx.h | 26 ++-- 13 files changed, 156 insertions(+), 112 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/12 wifi: iwlwifi: mvm: advertise MLO only if EHT is enabled
From: Johannes Berg <[email protected]>
If 11ax/EHT is disabled, then we shouldn't advertise MLO support either.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +3 -2
@@ -315,8 +315,9 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)ieee80211_hw_set (hw,STA_MMPDU_TXQ );/* Set this early since we need to have it for the check below */ -if (mvm->mld_api_is_used && - mvm->trans->trans_cfg->device_family >=IWL_DEVICE_FAMILY_BZ ) +if (mvm->mld_api_is_used && mvm->nvm_data->sku_cap_11be_enable && + !iwlwifi_mod_params.disable_11ax && + !iwlwifi_mod_params.disable_11be) hw->wiphy->flags |=WIPHY_FLAG_SUPPORTS_MLO ;/* With MLD FW API, it tracks timing by itself,
Signature · 1 line
2.38.1
PATCH 2/12 wifi: iwlwifi: api: fix a small upper/lower-case typo
In reply to [email protected]From: Johannes Berg <[email protected]>
The structure name in the docs should be given in all lower case matching the actual C declaration.
--- drivers/net/wireless/intel/iwlwifi/fw/api/debug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/debug.h +2 -2
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* -* Copyright (C) 2005-2014, 2018-2022 Intel Corporation +* Copyright (C) 2005-2014, 2018-2023 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */
@@ -377,7 +377,7 @@ struct iwl_buf_alloc_cmd {#define DRAM_INFO_SECOND_MAGIC_WORD 0x89ABCDEF/** -* struct iwL_dram_info - DRAM fragments allocation struct +* struct iwl_dram_info - DRAM fragments allocation struct * * Driver will fill in the first 1K(+) of the pointed DRAM fragment *
Signature · 1 line
2.38.1
PATCH 3/12 wifi: iwlwifi: remove WARN from read_mem32()
In reply to [email protected]From: Johannes Berg <[email protected]>
There's no reason to warn here, it's not an internal consistency issue, we even use this to check if the device is dead, and if it read_mem() returns an error that's either because grab NIC access or memory allocation failed, both of which are already noisy.
Just remove the warning entirely.
--- 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
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* -* Copyright (C) 2005-2014, 2018-2022 Intel Corporation +* Copyright (C) 2005-2014, 2018-2023 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */
@@ -1490,7 +1490,7 @@ static inline u32 iwl_trans_read_mem32(struct iwl_trans *trans, u32 addr) {u32 value; -if (WARN_ON (iwl_trans_read_mem (trans, addr, &value,1 ))) +if (iwl_trans_read_mem (trans, addr, &value,1 ))return 0xa5a5a5a5 ;return value;
Signature · 1 line
2.38.1
PATCH 4/12 wifi: iwlwifi: pcie: clean up gen1/gen2 TFD unmap
In reply to [email protected]From: Johannes Berg <[email protected]>
This is a bit messy right now, there are functions for both, but then gen1 function can actually deal with both gen1 and gen2, due to the confusion about use_tfh/gen2 cleaned up in the previous patch.
Fix the common paths to call the right functions and remove handling of gen2 from the gen1 function.
--- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 6 +++- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 33 ++++++------------- drivers/net/wireless/intel/iwlwifi/queue/tx.h | 11 +------ 3 files changed, 16 insertions(+), 34 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/tx.c +5 -1
@@ -1203,7 +1203,11 @@ void iwl_pcie_hcmd_complete(struct iwl_trans *trans, group_id = cmd->hdr.group_id; cmd_id =WIDE_ID (group_id, cmd->hdr.cmd); -iwl_txq_gen1_tfd_unmap (trans, meta, txq, index); +if (trans->trans_cfg->gen2) +iwl_txq_gen2_tfd_unmap (trans, meta, +iwl_txq_get_tfd (trans, txq, index)); +else +iwl_txq_gen1_tfd_unmap (trans, meta, txq, index);/* Input error checking is done when commands are added to queue. */ if (meta->flags &CMD_WANT_SKB ) {
drivers/net/wireless/intel/iwlwifi/queue/tx.c +10 -23
@@ -1340,22 +1340,12 @@ int iwl_txq_gen2_init(struct iwl_trans *trans, int txq_id, int queue_size) }static inline dma_addr_t iwl_txq_gen1_tfd_tb_get_addr (struct iwl_trans *trans, -void *_tfd,u8 idx) +struct iwl_tfd *tfd,u8 idx) { -struct iwl_tfd *tfd; -struct iwl_tfd_tb *tb; +struct iwl_tfd_tb *tb = &tfd->tbs[idx];dma_addr_t addr;dma_addr_t hi_len; -if (trans->trans_cfg->gen2) { -struct iwl_tfh_tfd *tfh_tfd = _tfd; -struct iwl_tfh_tb *tfh_tb = &tfh_tfd->tbs[idx]; - -return (dma_addr_t)(le64_to_cpu (tfh_tb->addr)); - } - - tfd = _tfd; - tb = &tfd->tbs[idx]; addr =get_unaligned_le32 (&tb->lo);if (sizeof (dma_addr_t) <=sizeof (u32))
@@ -1376,7 +1366,7 @@ void iwl_txq_gen1_tfd_unmap(struct iwl_trans *trans, struct iwl_txq *txq, int index) { int i, num_tbs; -void *tfd =iwl_txq_get_tfd (trans, txq, index); +struct iwl_tfd *tfd =iwl_txq_get_tfd (trans, txq, index);/* Sanity check on number of chunks */ num_tbs =iwl_txq_gen1_tfd_get_num_tbs (trans, tfd);
@@ -1408,15 +1398,7 @@ void iwl_txq_gen1_tfd_unmap(struct iwl_trans *trans, meta->tbs =0 ; -if (trans->trans_cfg->gen2) { -struct iwl_tfh_tfd *tfd_fh = (void *)tfd; - - tfd_fh->num_tbs =0 ; - }else { -struct iwl_tfd *tfd_fh = (void *)tfd; - - tfd_fh->num_tbs =0 ; - } + tfd->num_tbs =0 ; }#define IWL_TX_CRC_SIZE 4
@@ -1520,7 +1502,12 @@ void iwl_txq_free_tfd(struct iwl_trans *trans, struct iwl_txq *txq)/* We have only q->n_window txq->entries, but we use * TFD_QUEUE_SIZE_MAX tfds */ -iwl_txq_gen1_tfd_unmap (trans, &txq->entries[idx].meta, txq, rd_ptr); +if (trans->trans_cfg->gen2) +iwl_txq_gen2_tfd_unmap (trans, &txq->entries[idx].meta, +iwl_txq_get_tfd (trans, txq, rd_ptr)); +else +iwl_txq_gen1_tfd_unmap (trans, &txq->entries[idx].meta, + txq, rd_ptr);/* free SKB */ skb = txq->entries[idx].skb;
drivers/net/wireless/intel/iwlwifi/queue/tx.h +1 -10
@@ -131,17 +131,8 @@ struct iwl_tso_hdr_page *get_page_hdr(struct iwl_trans *trans, size_t len, struct sk_buff *skb);#endif static inline u8 iwl_txq_gen1_tfd_get_num_tbs (struct iwl_trans *trans, -void *_tfd) +struct iwl_tfd *tfd) { -struct iwl_tfd *tfd; - -if (trans->trans_cfg->gen2) { -struct iwl_tfh_tfd *tfh_tfd = _tfd; - -return le16_to_cpu (tfh_tfd->num_tbs) &0x1f ; - } - - tfd = (struct iwl_tfd *)_tfd;return tfd->num_tbs &0x1f ; }
Signature · 1 line
2.38.1
PATCH 5/12 wifi: iwlwifi: remove 'def_rx_queue' struct member
In reply to [email protected]From: Johannes Berg <[email protected]>
This is only ever initialized to zero, use a new define for the default RX queue instead.
--- drivers/net/wireless/intel/iwlwifi/iwl-fh.h | 2 ++ drivers/net/wireless/intel/iwlwifi/pcie/internal.h | 4 +--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 +- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-fh.h +2 -0
@@ -565,6 +565,8 @@ static inline unsigned int FH_MEM_CBBC_QUEUE(struct iwl_trans *trans,#define RX_QUEUE_MASK 255#define RX_QUEUE_SIZE_LOG 8 +#define IWL_DEFAULT_RX_QUEUE 0 +/** * struct iwl_rb_status - reserve buffer status * host memory mapped FH registers
drivers/net/wireless/intel/iwlwifi/pcie/internal.h +1 -3
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* -* Copyright (C) 2003-2015, 2018-2022 Intel Corporation +* Copyright (C) 2003-2015, 2018-2023 Intel Corporation * Copyright (C) 2013-2015 Intel Mobile Communications GmbH * Copyright (C) 2016-2017 Intel Deutschland GmbH */
@@ -315,7 +315,6 @@ enum iwl_pcie_imr_status {* @ucode_write_complete: indicates that the ucode has been copied. * @ucode_write_waitq: wait queue for uCode load * @cmd_queue - command queue number -* @def_rx_queue - default rx queue number * @rx_buf_size: Rx buffer size * @scd_set_active: should the transport configure the SCD for HCMD queue * @rx_page_order: page order for receive buffer size
@@ -398,7 +397,6 @@ struct iwl_trans_pcie {wait_queue_head_t ucode_write_waitq;wait_queue_head_t sx_waitq; -u8 def_rx_queue;u8 n_no_reclaim_cmds;u8 no_reclaim_cmds[MAX_NO_RECLAIM_CMDS ];u16 num_rx_bufs;
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +1 -1
@@ -1373,7 +1373,7 @@ static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans, } } -if (rxq->id == trans_pcie->def_rx_queue) +if (rxq->id ==IWL_DEFAULT_RX_QUEUE )iwl_op_mode_rx (trans->op_mode, &rxq->napi, &rxcb);else
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +0 -2
@@ -3617,8 +3617,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, PCIE_LINK_STATE_CLKPM); } - trans_pcie->def_rx_queue =0 ; -pci_set_master (pdev); addr_size = trans->txqs.tfd.addr_size;
Signature · 1 line
2.38.1
PATCH 6/12 wifi: iwlwifi: pcie: move gen1 TB handling to header
In reply to [email protected]From: Johannes Berg <[email protected]>
We will need this in another place soon in reclaim and init, so add this function to the queue header file instead.
--- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 18 +----------------- drivers/net/wireless/intel/iwlwifi/queue/tx.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/tx.c +1 -17
@@ -132,22 +132,6 @@ void iwl_pcie_txq_check_wrptrs(struct iwl_trans *trans) } } -static inline void iwl_pcie_tfd_set_tb (struct iwl_trans *trans,void *tfd, -u8 idx,dma_addr_t addr,u16 len) -{ -struct iwl_tfd *tfd_fh = (void *)tfd; -struct iwl_tfd_tb *tb = &tfd_fh->tbs[idx]; - -u16 hi_n_len = len <<4 ; - -put_unaligned_le32 (addr, &tb->lo); - hi_n_len |=iwl_get_dma_hi_addr (addr); - - tb->hi_n_len =cpu_to_le16 (hi_n_len); - - tfd_fh->num_tbs = idx +1 ; -} -static int iwl_pcie_txq_build_tfd (struct iwl_trans *trans,struct iwl_txq *txq,dma_addr_t addr,u16 len,bool reset) {
@@ -172,7 +156,7 @@ static int iwl_pcie_txq_build_tfd(struct iwl_trans *trans, struct iwl_txq *txq, "Unaligned address = %llx\n", (unsigned long long)addr))return -EINVAL ; -iwl_pcie_tfd_set_tb (trans, tfd, num_tbs, addr, len); +iwl_pcie_gen1_tfd_set_tb (trans, tfd, num_tbs, addr, len);return num_tbs; }
drivers/net/wireless/intel/iwlwifi/queue/tx.h +15 -0
@@ -155,6 +155,21 @@ static inline u16 iwl_txq_gen1_tfd_tb_get_len(struct iwl_trans *trans,return le16_to_cpu (tb->hi_n_len) >>4 ; } +static inline void iwl_pcie_gen1_tfd_set_tb (struct iwl_trans *trans, +struct iwl_tfd *tfd, +u8 idx,dma_addr_t addr,u16 len) +{ +struct iwl_tfd_tb *tb = &tfd->tbs[idx]; +u16 hi_n_len = len <<4 ; + +put_unaligned_le32 (addr, &tb->lo); + hi_n_len |=iwl_get_dma_hi_addr (addr); + + tb->hi_n_len =cpu_to_le16 (hi_n_len); + + tfd->num_tbs = idx +1 ; +} +void iwl_txq_gen1_tfd_unmap (struct iwl_trans *trans,struct iwl_cmd_meta *meta,struct iwl_txq *txq,int index);
Signature · 1 line
2.38.1
PATCH 7/12 wifi: iwlwifi: queue: move iwl_txq_gen2_set_tb() up
In reply to [email protected]From: Johannes Berg <[email protected]>
We need this earlier in the file next, move it up to have an easier to read change, since this moves other things in the diff git generates by default.
--- drivers/net/wireless/intel/iwlwifi/queue/tx.c | 71 +++++++++---------- 1 file changed, 35 insertions(+), 36 deletions(-)
drivers/net/wireless/intel/iwlwifi/queue/tx.c +35 -36
@@ -84,6 +84,41 @@ static u8 iwl_txq_gen2_get_num_tbs(struct iwl_trans *trans,return le16_to_cpu (tfd->num_tbs) &0x1f ; } +int iwl_txq_gen2_set_tb (struct iwl_trans *trans,struct iwl_tfh_tfd *tfd, +dma_addr_t addr,u16 len) +{ +int idx =iwl_txq_gen2_get_num_tbs (trans, tfd); +struct iwl_tfh_tb *tb; + +/* Only WARN here so we know about the issue, but we mess up our +* unmap path because not every place currently checks for errors +* returned from this function - it can only return an error if +* there's no more space, and so when we know there is enough we +* don't always check ... +*/ +WARN (iwl_txq_crosses_4g_boundary (addr, len), +"possible DMA problem with iova:0x%llx, len:%d\n" , + (unsigned long long )addr, len); + +if (WARN_ON (idx >=IWL_TFH_NUM_TBS )) +return -EINVAL ; + tb = &tfd->tbs[idx]; + +/* Each TFD can point to a maximum max_tbs Tx buffers */ +if (le16_to_cpu (tfd->num_tbs) >= trans->txqs.tfd.max_tbs) { +IWL_ERR (trans,"Error can not send more than %d chunks\n" , + trans->txqs.tfd.max_tbs); +return -EINVAL ; + } + +put_unaligned_le64 (addr, &tb->addr); + tb->tb_len =cpu_to_le16 (len); + + tfd->num_tbs =cpu_to_le16 (idx +1 ); + +return idx; +} +void iwl_txq_gen2_tfd_unmap (struct iwl_trans *trans,struct iwl_cmd_meta *meta,struct iwl_tfh_tfd *tfd) {
@@ -142,42 +177,6 @@ void iwl_txq_gen2_free_tfd(struct iwl_trans *trans, struct iwl_txq *txq) } } -int iwl_txq_gen2_set_tb (struct iwl_trans *trans,struct iwl_tfh_tfd *tfd, -dma_addr_t addr,u16 len) -{ -int idx =iwl_txq_gen2_get_num_tbs (trans, tfd); -struct iwl_tfh_tb *tb; - -/* -* Only WARN here so we know about the issue, but we mess up our -* unmap path because not every place currently checks for errors -* returned from this function - it can only return an error if -* there's no more space, and so when we know there is enough we -* don't always check ... -*/ -WARN (iwl_txq_crosses_4g_boundary (addr, len), -"possible DMA problem with iova:0x%llx, len:%d\n" , - (unsigned long long )addr, len); - -if (WARN_ON (idx >=IWL_TFH_NUM_TBS )) -return -EINVAL ; - tb = &tfd->tbs[idx]; - -/* Each TFD can point to a maximum max_tbs Tx buffers */ -if (le16_to_cpu (tfd->num_tbs) >= trans->txqs.tfd.max_tbs) { -IWL_ERR (trans,"Error can not send more than %d chunks\n" , - trans->txqs.tfd.max_tbs); -return -EINVAL ; - } - -put_unaligned_le64 (addr, &tb->addr); - tb->tb_len =cpu_to_le16 (len); - - tfd->num_tbs =cpu_to_le16 (idx +1 ); - -return idx; -} -static struct page *get_workaround_page (struct iwl_trans *trans,struct sk_buff *skb) {
Signature · 1 line
2.38.1
PATCH 8/12 wifi: iwlwifi: pcie: point invalid TFDs to invalid data
In reply to [email protected]From: Johannes Berg <[email protected]>
There are occasionally bugs which cause the device to try to use a TFD that it wasn't supposed to, and these are very hard to diagnose. Fill all unused TFDs with a debug command that immediately causes an error to be detected in these cases.
--- .../net/wireless/intel/iwlwifi/fw/api/debug.h | 5 +++ .../net/wireless/intel/iwlwifi/iwl-trans.h | 3 ++ .../net/wireless/intel/iwlwifi/pcie/trans.c | 29 ++++++++++++++ drivers/net/wireless/intel/iwlwifi/queue/tx.c | 40 ++++++++++++++++--- 4 files changed, 71 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/debug.h +5 -0
@@ -29,6 +29,11 @@ enum iwl_debug_cmds {* &struct iwl_dbg_host_event_cfg_cmd */ HOST_EVENT_CFG =0x3 , +/** +* @INVALID_WR_PTR_CMD: invalid write pointer, set in the TFD +* when it's not in use +*/ + INVALID_WR_PTR_CMD = 0x6,/** * @DBGC_SUSPEND_RESUME: * DBGC suspend/resume commad. Uses a single dword as data:
drivers/net/wireless/intel/iwlwifi/iwl-trans.h +3 -0
@@ -1069,6 +1069,7 @@ struct iwl_trans_txqs {* @mbx_addr_1_step: step address data 1 * @pcie_link_speed: current PCIe link speed (%PCI_EXP_LNKSTA_CLS_*), * only valid for discrete (not integrated) NICs +* @invalid_tx_cmd: invalid TX command buffer */ struct iwl_trans {bool csme_own;
@@ -1133,6 +1134,8 @@ struct iwl_trans {u8 pcie_link_speed; +struct iwl_dma_ptr invalid_tx_cmd; +/* pointer to trans specific struct */ /*Ensure that this pointer will always be aligned to sizeof pointer */ char trans_specific[]__aligned(sizeof(void *)) ;
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +29 -0
@@ -2018,6 +2018,30 @@ void iwl_trans_pcie_free_pnvm_dram_regions(struct iwl_dram_regions *dram_regionsmemset (desc_dram,0 ,sizeof (*desc_dram)); } +static void iwl_pcie_free_invalid_tx_cmd (struct iwl_trans *trans) +{ +iwl_pcie_free_dma_ptr (trans, &trans->invalid_tx_cmd); +} + +static int iwl_pcie_alloc_invalid_tx_cmd (struct iwl_trans *trans) +{ +struct iwl_cmd_header_wide bad_cmd = { + .cmd =INVALID_WR_PTR_CMD , + .group_id =DEBUG_GROUP , + .sequence =cpu_to_le16 (0xffff ), + .length =cpu_to_le16 (0 ), + .version =0 , + }; +int ret; + + ret =iwl_pcie_alloc_dma_ptr (trans, &trans->invalid_tx_cmd, +sizeof (bad_cmd)); +if (ret) +return ret; +memcpy (trans->invalid_tx_cmd.addr, &bad_cmd,sizeof (bad_cmd)); +return 0 ; +} +void iwl_trans_pcie_free (struct iwl_trans *trans) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);
@@ -2048,6 +2072,8 @@ void iwl_trans_pcie_free(struct iwl_trans *trans)iwl_pcie_free_ict (trans); } +iwl_pcie_free_invalid_tx_cmd (trans); +iwl_pcie_free_fw_monitor (trans); iwl_trans_pcie_free_pnvm_dram_regions(&trans_pcie->pnvm_data,
@@ -3684,6 +3710,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,init_waitqueue_head (&trans_pcie->sx_waitq); + ret =iwl_pcie_alloc_invalid_tx_cmd (trans); +if (ret) + goto out_no_pci;if (trans_pcie->msix_enabled) { ret =iwl_pcie_init_msix_handler (pdev, trans_pcie);
drivers/net/wireless/intel/iwlwifi/queue/tx.c +34 -6
@@ -10,6 +10,7 @@#include "fw/api/commands.h" #include "fw/api/tx.h" #include "fw/api/datapath.h" +#include "fw/api/debug.h" #include "queue/tx.h" #include "iwl-fh.h" #include "iwl-scd.h"
@@ -119,6 +120,15 @@ int iwl_txq_gen2_set_tb(struct iwl_trans *trans, struct iwl_tfh_tfd *tfd,return idx; } +static void iwl_txq_set_tfd_invalid_gen2 (struct iwl_trans *trans, +struct iwl_tfh_tfd *tfd) +{ + tfd->num_tbs =0 ; + +iwl_txq_gen2_set_tb (trans, tfd, trans->invalid_tx_cmd.dma, + trans->invalid_tx_cmd.size); +} +void iwl_txq_gen2_tfd_unmap (struct iwl_trans *trans,struct iwl_cmd_meta *meta,struct iwl_tfh_tfd *tfd) {
@@ -146,7 +156,7 @@ void iwl_txq_gen2_tfd_unmap(struct iwl_trans *trans, struct iwl_cmd_meta *meta, DMA_TO_DEVICE); } - tfd->num_tbs =0 ; +iwl_txq_set_tfd_invalid_gen2 (trans, tfd); }void iwl_txq_gen2_free_tfd (struct iwl_trans *trans,struct iwl_txq *txq)
@@ -1025,11 +1035,21 @@ static void iwl_txq_stuck_timer(struct timer_list *t)iwl_force_nmi (trans); } +static void iwl_txq_set_tfd_invalid_gen1 (struct iwl_trans *trans, +struct iwl_tfd *tfd) +{ + tfd->num_tbs =0 ; + +iwl_pcie_gen1_tfd_set_tb (trans, tfd,0 , trans->invalid_tx_cmd.dma, + trans->invalid_tx_cmd.size); +} +int iwl_txq_alloc (struct iwl_trans *trans,struct iwl_txq *txq,int slots_num,bool cmd_queue) { -size_t tfd_sz = trans->txqs.tfd.size * - trans->trans_cfg->base_params->max_tfd_queue_size; +size_t num_entries = trans->trans_cfg->gen2 ? + slots_num : trans->trans_cfg->base_params->max_tfd_queue_size; +size_t tfd_sz;size_t tb0_buf_sz;int i;
@@ -1039,8 +1059,7 @@ int iwl_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq, int slots_num,if (WARN_ON (txq->entries || txq->tfds))return -EINVAL ; -if (trans->trans_cfg->gen2) - tfd_sz = trans->txqs.tfd.size * slots_num; + tfd_sz = trans->txqs.tfd.size * num_entries;timer_setup (&txq->stuck_timer, iwl_txq_stuck_timer,0 ); txq->trans = trans;
@@ -1080,6 +1099,15 @@ int iwl_txq_alloc(struct iwl_trans *trans, struct iwl_txq *txq, int slots_num,if (!txq->first_tb_bufs) goto err_free_tfds; +for (i =0 ; i < num_entries; i++) { +void *tfd =iwl_txq_get_tfd (trans, txq, i); + +if (trans->trans_cfg->gen2) +iwl_txq_set_tfd_invalid_gen2 (trans, tfd); +else +iwl_txq_set_tfd_invalid_gen1 (trans, tfd); + } +return 0 ; err_free_tfds:dma_free_coherent (trans->dev, tfd_sz, txq->tfds, txq->dma_addr);
@@ -1397,7 +1425,7 @@ void iwl_txq_gen1_tfd_unmap(struct iwl_trans *trans, meta->tbs =0 ; - tfd->num_tbs =0 ; +iwl_txq_set_tfd_invalid_gen1 (trans, tfd); }#define IWL_TX_CRC_SIZE 4
Signature · 1 line
2.38.1
PATCH 9/12 wifi: iwlwifi: add Razer to ppag approved list
In reply to [email protected]From: Gregory Greenman <[email protected]>
Add a new vendor (Razer) to PPAG approved list.
--- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/intel/iwlwifi/fw/acpi.c +5 -0
@@ -69,6 +69,11 @@ static const struct dmi_system_id dmi_ppag_approved_list[] = { DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), }, }, + { .ident = "RAZER", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Razer"), + }, + }, {} };
Signature · 1 line
2.38.1
PATCH 10/12 wifi: iwlwifi: mvm: enable HE TX/RX <242 tone RU on new RFs
In reply to [email protected]From: Johannes Berg <[email protected]>
Two new RFs were added in the code, but we forgot to add them to the list here that enables HE TX/RX 1024 QAM less than 242 tone RU.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +2 -0
@@ -990,6 +990,8 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,case IWL_CFG_RF_TYPE_GF :case IWL_CFG_RF_TYPE_MR :case IWL_CFG_RF_TYPE_MS : +case IWL_CFG_RF_TYPE_FM : +case IWL_CFG_RF_TYPE_WH : 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.38.1
PATCH 11/12 wifi: iwlwifi: mvm: support flush on AP interfaces
In reply to [email protected]From: Johannes Berg <[email protected]>
Support TX flush on AP interfaces so that we will do a proper flush for frames on the queue before keys are removed.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +0 -6
@@ -5605,9 +5605,6 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,return ; } -if (vif->type !=NL80211_IFTYPE_STATION ) -return ; -/* Make sure we're done with the deferred traffic before flushing */ flush_work (&mvm->add_stream_wk);
@@ -5631,9 +5628,6 @@ void iwl_mvm_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ap_sta_done = true; } -/* make sure only TDLS peers or the AP are flushed */ -WARN_ON_ONCE (sta != mvmvif->ap_sta && !sta->tdls); -if (drop) {if (iwl_mvm_flush_sta (mvm, mvmsta, false))IWL_ERR (mvm,"flush request fail\n" );
Signature · 1 line
2.38.1
PATCH 12/12 wifi: iwlwifi: remove memory check for LMAC error address
In reply to [email protected]From: Mukesh Sisodiya <[email protected]>
LMAC error table address was checked against UMAC error table minimum address defined. Because of that, the LMAC error table was not read, since both addresses belong to different ranges. As addresses are updated from FW alive message and should be correct, this check is not needed.
Still keep the check for address 0 to avoid NULL address read.
--- drivers/net/wireless/intel/iwlwifi/fw/dump.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dump.c +1 -2
@@ -182,8 +182,7 @@ static void iwl_fwrt_dump_lmac_error_log(struct iwl_fw_runtime *fwrt, u8 lmac_nu base = fwrt->fw->inst_errlog_ptr; } -if ((fwrt->trans->trans_cfg->device_family >=IWL_DEVICE_FAMILY_BZ && !base) || - (fwrt->trans->trans_cfg->device_family <IWL_DEVICE_FAMILY_BZ && base <0x400000 )) { +if (!base) { IWL_ERR(fwrt, "Not valid error log pointer 0x%08X for %s uCode\n", base,
Signature · 1 line
2.38.1