iwlwifi: updates intended for v5.1 2019-02-07
cover iwlwifi: updates intended for v5.1 2019-02-07
From: Luca Coelho <[email protected]>
Hi,
Here's the seventh set of patches intended for v5.1. It's the usual development, new features, cleanups and bugfixes.
The changes are:
* Work on the new debugging infrastructure continues;
* FTM (Fine Timing Measurement) initiator and responder implementation;
* Support for a new device family started;
* Bump supported FW API to 45;
* General bugfixes;
* Other cleanups;
As usual, I'm pushing this to a pending branch, for kbuild bot, and will send a pull-request later.
Please review.
Cheers,
Luca.
Avraham Stern (1):
iwlwifi: mvm: Fix possible NULL pointer dereference
Ido Yariv (1):
iwlwifi: mvm: don't require WOWLAN images when unified
Johannes Berg (3):
iwlwifi: mvm: support FTM responder
iwlwifi: mvm: support FTM initiator
iwlwifi: mvm: clean up NO_PSDU case
Luca Coelho (1):
iwlwifi: bump FW API to 45 for 9000 and 22000 series
Mordechay Goodstein (1):
iwlwifi: add FW recovery flow
Sara Sharon (4):
iwlwifi: pcie: fix emergency path
iwlwifi: dvm: don't use IWL_DL_FW_ERRORS
iwlwifi: pcie: add TPT oriented prints
iwlwifi: mvm: support beacon IE injection
Shahar S Matityahu (4):
iwlwifi: dbg_ini: implement monitor sram memory dump
iwlwifi: dbg_ini: implement monitor dram memory dump
iwlwifi: receive umac and lmac error table addresses from TLVs
iwlwifi: dbg_ini: rewrite trigger flow and align to FW API changes
Shaul Triebitz (2):
iwlwifi: introduce device family AX210
iwlwifi: do not fail on large amount of channels
.../net/wireless/intel/iwlwifi/cfg/22000.c | 49 +- drivers/net/wireless/intel/iwlwifi/cfg/9000.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/main.c | 14 +- .../net/wireless/intel/iwlwifi/fw/api/alive.h | 48 +- .../wireless/intel/iwlwifi/fw/api/commands.h | 5 + .../wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 11 +- .../wireless/intel/iwlwifi/fw/api/location.h | 10 +- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 221 +++++++-- drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 27 +- .../wireless/intel/iwlwifi/fw/error-dump.h | 16 +- drivers/net/wireless/intel/iwlwifi/fw/file.h | 12 + drivers/net/wireless/intel/iwlwifi/fw/img.h | 12 +- .../net/wireless/intel/iwlwifi/fw/runtime.h | 12 + .../net/wireless/intel/iwlwifi/iwl-config.h | 7 + drivers/net/wireless/intel/iwlwifi/iwl-csr.h | 5 + .../net/wireless/intel/iwlwifi/iwl-debug.h | 5 +- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 49 ++ .../wireless/intel/iwlwifi/iwl-nvm-parse.c | 6 +- .../net/wireless/intel/iwlwifi/iwl-trans.h | 10 + .../net/wireless/intel/iwlwifi/mvm/Makefile | 1 + .../wireless/intel/iwlwifi/mvm/constants.h | 3 + drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 2 +- .../net/wireless/intel/iwlwifi/mvm/debugfs.c | 106 ++++ .../intel/iwlwifi/mvm/ftm-initiator.c | 459 ++++++++++++++++++ .../intel/iwlwifi/mvm/ftm-responder.c | 244 ++++++++++ drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 77 ++- .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 22 +- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 154 +++++- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 41 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 27 ++ drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 7 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 3 +- .../wireless/intel/iwlwifi/mvm/time-event.c | 2 +- .../net/wireless/intel/iwlwifi/mvm/utils.c | 12 +- .../intel/iwlwifi/pcie/ctxt-info-gen3.c | 13 +- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 8 + drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 42 +- .../wireless/intel/iwlwifi/pcie/trans-gen2.c | 7 +- .../net/wireless/intel/iwlwifi/pcie/trans.c | 17 +- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 12 +- include/linux/ieee80211.h | 2 + 41 files changed, 1629 insertions(+), 153 deletions(-) create mode 100644 drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c create mode 100644 drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
Signature · 1 line
2.20.1
PATCH 1/17 iwlwifi: bump FW API to 45 for 9000 and 22000 series
From: Luca Coelho <[email protected]>
Start supporting API version 45 where applicable.
--- drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 2 +- drivers/net/wireless/intel/iwlwifi/cfg/9000.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/cfg/22000.c +1 -1
@@ -56,7 +56,7 @@#include "iwl-config.h" /* Highest firmware API version supported */ -#define IWL_22000_UCODE_API_MAX 44 +#define IWL_22000_UCODE_API_MAX 45/* Lowest firmware API version supported */ #define IWL_22000_UCODE_API_MIN 39
drivers/net/wireless/intel/iwlwifi/cfg/9000.c +1 -1
@@ -57,7 +57,7 @@#include "fw/file.h" /* Highest firmware API version supported */ -#define IWL9000_UCODE_API_MAX 44 +#define IWL9000_UCODE_API_MAX 45/* Lowest firmware API version supported */ #define IWL9000_UCODE_API_MIN 30
Signature · 1 line
2.20.1
PATCH 2/17 iwlwifi: pcie: fix emergency path
In reply to Luca CoelhoFrom: Sara Sharon <[email protected]>
Allocator swaps the pending requests with 0 when it starts working. This means that relying on it n RX path to decide if to move to emergency is not always a good idea, since it may be zero, but there are still a lot of unallocated RBs in the system. Change allocator to decrement the pending requests on real time. It is more expensive since it accesses the atomic variable more times, but it gives the RX path a better idea of the system's status.
--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +8 -3
@@ -538,7 +538,7 @@ static void iwl_pcie_rx_allocator(struct iwl_trans *trans)struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);struct iwl_rb_allocator *rba = &trans_pcie->rba;struct list_head local_empty; -int pending =atomic_xchg (&rba->req_pending,0 ); +int pending =atomic_read (&rba->req_pending);IWL_DEBUG_RX (trans,"Pending allocation requests = %d\n" , pending);
@@ -593,11 +593,13 @@ static void iwl_pcie_rx_allocator(struct iwl_trans *trans) i++; } +atomic_dec (&rba->req_pending); pending--; +if (!pending) { - pending =atomic_xchg (&rba->req_pending,0 ); + pending =atomic_read (&rba->req_pending);IWL_DEBUG_RX (trans, -"Pending allocation requests = %d\n" , +"Got more pending allocation requests = %d\n" , pending); }
@@ -609,12 +611,15 @@ static void iwl_pcie_rx_allocator(struct iwl_trans *trans)spin_unlock (&rba->lock);atomic_inc (&rba->req_ready); + }spin_lock (&rba->lock);/* return unused rbds to the allocator empty list */ list_splice_tail (&local_empty, &rba->rbd_empty);spin_unlock (&rba->lock); + +IWL_DEBUG_RX (trans,"%s, exit.\n" , __func__); }/*
Signature · 1 line
2.20.1
PATCH 3/17 iwlwifi: dvm: don't use IWL_DL_FW_ERRORS
In reply to Luca CoelhoFrom: Sara Sharon <[email protected]>
Use IWL_DL_FW instead. This will free a bit for more needed prints in newer devices.
--- drivers/net/wireless/intel/iwlwifi/dvm/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/dvm/main.c +7 -7
@@ -1881,7 +1881,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,return pos; } -if (!(iwl_have_debug_level (IWL_DL_FW_ERRORS )) && !full_log) +if (!(iwl_have_debug_level (IWL_DL_FW )) && !full_log) size = (size >DEFAULT_DUMP_EVENT_LOG_ENTRIES ) ?DEFAULT_DUMP_EVENT_LOG_ENTRIES : size; IWL_ERR(priv, "Start IWL Event Log Dump: display last %u entries\n",
@@ -1897,7 +1897,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,if (!*buf)return -ENOMEM ; } -if (iwl_have_debug_level (IWL_DL_FW_ERRORS ) || full_log) { +if (iwl_have_debug_level (IWL_DL_FW ) || full_log) {/* * if uCode has wrapped back to top of log, * start at the oldest entry,
@@ -1927,7 +1927,7 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)unsigned int reload_msec;unsigned long reload_jiffies; -if (iwl_have_debug_level (IWL_DL_FW_ERRORS )) +if (iwl_have_debug_level (IWL_DL_FW ))iwl_print_rx_config_cmd (priv,IWL_RXON_CTX_BSS );/* uCode is no longer loaded. */
@@ -1965,12 +1965,12 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)if (!test_bit (STATUS_EXIT_PENDING , &priv->status)) {if (iwlwifi_mod_params.fw_restart) { -IWL_DEBUG_FW_ERRORS (priv, -"Restarting adapter due to uCode error.\n" ); +IWL_DEBUG_FW (priv, +"Restarting adapter due to uCode error.\n" );queue_work (priv->workqueue, &priv->restart); }else -IWL_DEBUG_FW_ERRORS (priv, -"Detected FW error, but not restarting\n" ); +IWL_DEBUG_FW (priv, +"Detected FW error, but not restarting\n" ); } }
Signature · 1 line
2.20.1
PATCH 4/17 iwlwifi: pcie: add TPT oriented prints
In reply to Luca CoelhoFrom: Sara Sharon <[email protected]>
Currently there is no way to debug RX/TX paths using prints without harming tpt. Add prints to debug RX allocation path. We can still get 1.9 gbps with those on.
--- .../net/wireless/intel/iwlwifi/iwl-debug.h | 5 +++-- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 20 +++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-debug.h +3 -2
@@ -1,6 +1,7 @@/****************************************************************************** * * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. +* Copyright (C) 2018 Intel Corporation * * Portions of this file are derived from the ipw3945 project. *
@@ -159,7 +160,7 @@ do { \/* 0x000F0000 - 0x00010000 */ #define IWL_DL_FW 0x00010000#define IWL_DL_RF_KILL 0x00020000 -#define IWL_DL_FW_ERRORS 0x00040000 +#define IWL_DL_TPT 0x00040000/* 0x00F00000 - 0x00100000 */ #define IWL_DL_RATE 0x00100000#define IWL_DL_CALIB 0x00200000
@@ -193,7 +194,6 @@ do { \ #define IWL_DEBUG_CALIB(p, f, a...) IWL_DEBUG(p, IWL_DL_CALIB, f, ## a) #define IWL_DEBUG_FW(p, f, a...) IWL_DEBUG(p, IWL_DL_FW, f, ## a) #define IWL_DEBUG_RF_KILL(p, f, a...) IWL_DEBUG(p, IWL_DL_RF_KILL, f, ## a) -#define IWL_DEBUG_FW_ERRORS(p, f, a...) IWL_DEBUG(p, IWL_DL_FW_ERRORS, f, ## a) #define IWL_DEBUG_DROP(p, f, a...) IWL_DEBUG(p, IWL_DL_DROP, f, ## a) #define IWL_DEBUG_DROP_LIMIT(p, f, a...) \ IWL_DEBUG_LIMIT(p, IWL_DL_DROP, f, ## a)
@@ -215,6 +215,7 @@ do { \ #define IWL_DEBUG_DEV_RADIO(p, f, a...) IWL_DEBUG_DEV(p, IWL_DL_RADIO, f, ## a) #define IWL_DEBUG_POWER(p, f, a...) IWL_DEBUG(p, IWL_DL_POWER, f, ## a) #define IWL_DEBUG_11H(p, f, a...) IWL_DEBUG(p, IWL_DL_11H, f, ## a) +#define IWL_DEBUG_TPT(p, f, a...) IWL_DEBUG(p, IWL_DL_TPT, f, ## a) #define IWL_DEBUG_RPM(p, f, a...) IWL_DEBUG(p, IWL_DL_RPM, f, ## a) #define IWL_DEBUG_LAR(p, f, a...) IWL_DEBUG(p, IWL_DL_LAR, f, ## a)
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +14 -6
@@ -540,7 +540,7 @@ static void iwl_pcie_rx_allocator(struct iwl_trans *trans)struct list_head local_empty;int pending =atomic_read (&rba->req_pending); -IWL_DEBUG_RX (trans,"Pending allocation requests = %d\n" , pending); +IWL_DEBUG_TPT (trans,"Pending allocation requests = %d\n" , pending);/* If we were scheduled - there is at least one request */ spin_lock (&rba->lock);
@@ -598,9 +598,10 @@ static void iwl_pcie_rx_allocator(struct iwl_trans *trans)if (!pending) { pending =atomic_read (&rba->req_pending); -IWL_DEBUG_RX (trans, -"Got more pending allocation requests = %d\n" , - pending); +if (pending) +IWL_DEBUG_TPT (trans, +"Got more pending allocation requests = %d\n" , + pending); }spin_lock (&rba->lock);
@@ -619,7 +620,7 @@ static void iwl_pcie_rx_allocator(struct iwl_trans *trans)list_splice_tail (&local_empty, &rba->rbd_empty);spin_unlock (&rba->lock); -IWL_DEBUG_RX (trans,"%s, exit.\n" , __func__); +IWL_DEBUG_TPT (trans,"%s, exit.\n" , __func__); }/*
@@ -1429,6 +1430,9 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans, int queue) !emergency)) {iwl_pcie_rx_move_to_allocator (rxq, rba); emergency = true; +IWL_DEBUG_TPT (trans, +"RX path is in emergency. Pending allocations %d\n" , + rb_pending_alloc); }IWL_DEBUG_RX (trans,"Q %d: HW = %d, SW = %d\n" , rxq->id, r, i);
@@ -1458,8 +1462,12 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans, int queue) count++;if (count ==8 ) { count =0 ; -if (rb_pending_alloc < rxq->queue_size /3 ) +if (rb_pending_alloc < rxq->queue_size /3 ) { +IWL_DEBUG_TPT (trans, +"RX path exited emergency. Pending allocations %d\n" , + rb_pending_alloc); emergency = false; + } rxq->read = i;spin_unlock (&rxq->lock);
Signature · 1 line
2.20.1
PATCH 5/17 iwlwifi: dbg_ini: implement monitor sram memory dump
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
Implement monitor sram memory dump in the new dump mechanism.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 23 +++++++++++++++----- drivers/net/wireless/intel/iwlwifi/iwl-csr.h | 1 + 2 files changed, 18 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +17 -6
@@ -1284,6 +1284,7 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt,case IWL_FW_INI_REGION_PERIPHERY_MAC :case IWL_FW_INI_REGION_PERIPHERY_PHY :case IWL_FW_INI_REGION_PERIPHERY_AUX : +case IWL_FW_INI_REGION_INTERNAL_BUFFER :case IWL_FW_INI_REGION_CSR : size += hdr_len + dump_header_len + range_header_len * iwl_dump_ini_mem_ranges(fwrt, reg) +
@@ -1312,7 +1313,6 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt, }case IWL_FW_INI_REGION_DRAM_BUFFER :/* Transport takes care of DRAM dumping */ -case IWL_FW_INI_REGION_INTERNAL_BUFFER :case IWL_FW_INI_REGION_DRAM_IMR :/* Undefined yet */ default :
@@ -1346,6 +1346,7 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt, type =le32_to_cpu (reg->region_type);switch (type) {case IWL_FW_INI_REGION_DEVICE_MEMORY : +case IWL_FW_INI_REGION_INTERNAL_BUFFER : ops.get_num_of_ranges = iwl_dump_ini_mem_ranges; ops.get_size = iwl_dump_ini_mem_get_size; ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header;
@@ -1396,7 +1397,6 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,iwl_dump_ini_mem (fwrt, type, data, reg, &ops);break ;case IWL_FW_INI_REGION_DRAM_IMR : -case IWL_FW_INI_REGION_INTERNAL_BUFFER :/* This is undefined yet */ default :break ;
@@ -1853,7 +1853,8 @@ iwl_fw_dbg_buffer_allocation(struct iwl_fw_runtime *fwrt, u32 size) }static void iwl_fw_dbg_buffer_apply (struct iwl_fw_runtime *fwrt, -struct iwl_fw_ini_allocation_data *alloc) +struct iwl_fw_ini_allocation_data *alloc, +enum iwl_fw_ini_apply_point pnt) {struct iwl_trans *trans = fwrt->trans;struct iwl_ldbg_config_cmd ldbg_cmd = {
@@ -1867,9 +1868,19 @@ static void iwl_fw_dbg_buffer_apply(struct iwl_fw_runtime *fwrt, .len[0] = sizeof(ldbg_cmd), };int block_idx = trans->num_blocks; +u32 buf_location =le32_to_cpu (alloc->tlv.buffer_location); + +if (buf_location ==IWL_FW_INI_LOCATION_SRAM_PATH ) { +if (!WARN (pnt !=IWL_FW_INI_APPLY_EARLY , +"Invalid apply point %d for SMEM buffer allocation" , + pnt)) +/* set sram monitor by enabling bit 7 */ +iwl_set_bit (fwrt->trans,CSR_HW_IF_CONFIG_REG , +CSR_HW_IF_CONFIG_REG_BIT_MONITOR_SRAM ); +return ; + } -if (le32_to_cpu (alloc->tlv.buffer_location) != -IWL_FW_INI_LOCATION_DRAM_PATH ) +if (buf_location !=IWL_FW_INI_LOCATION_DRAM_PATH )return ;if (!alloc->is_alloc) {
@@ -2017,7 +2028,7 @@ static void _iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt,case IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION : {struct iwl_fw_ini_allocation_data *buf_alloc = ini_tlv; -iwl_fw_dbg_buffer_apply (fwrt, ini_tlv); +iwl_fw_dbg_buffer_apply (fwrt, ini_tlv, pnt); iter +=sizeof (buf_alloc->is_alloc);break ; }
drivers/net/wireless/intel/iwlwifi/iwl-csr.h +1 -0
@@ -180,6 +180,7 @@/* Bits for CSR_HW_IF_CONFIG_REG */ #define CSR_HW_IF_CONFIG_REG_MSK_MAC_DASH (0x00000003)#define CSR_HW_IF_CONFIG_REG_MSK_MAC_STEP (0x0000000C) +#define CSR_HW_IF_CONFIG_REG_BIT_MONITOR_SRAM (0x00000080)#define CSR_HW_IF_CONFIG_REG_MSK_BOARD_VER (0x000000C0)#define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI (0x00000100)#define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI (0x00000200)
Signature · 1 line
2.20.1
PATCH 6/17 iwlwifi: mvm: don't require WOWLAN images when unified
In reply to Luca CoelhoFrom: Ido Yariv <[email protected]>
WOWLAN images in unified firmwares should not be used, so don't require them to support wowlan. This will allow to reduce the firmware's file size.
--- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +5 -1
@@ -420,6 +420,10 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)WLAN_CIPHER_SUITE_TKIP , WLAN_CIPHER_SUITE_CCMP, }; +#ifdef CONFIG_PM_SLEEP +bool unified =fw_has_capa (&mvm->fw->ucode_capa, +IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG ); +#endif /* Tell mac80211 our characteristics */ ieee80211_hw_set (hw,SIGNAL_DBM );
@@ -709,7 +713,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) hw->wiphy->wowlan = &mvm->wowlan; } -if (mvm->fw->img[IWL_UCODE_WOWLAN ].num_sec && +if ((unified || mvm->fw->img[IWL_UCODE_WOWLAN ].num_sec) && mvm->trans->ops->d3_suspend && mvm->trans->ops->d3_resume &&device_can_wakeup (mvm->trans->dev)) {
Signature · 1 line
2.20.1
PATCH 7/17 iwlwifi: dbg_ini: implement monitor dram memory dump
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
Implement monitor dram memory dump in the new dump mechanism.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 86 ++++++++++++++++--- .../wireless/intel/iwlwifi/fw/error-dump.h | 16 +++- 2 files changed, 89 insertions(+), 13 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +74 -12
@@ -1132,6 +1132,26 @@ static int iwl_dump_ini_paging_iter(struct iwl_fw_runtime *fwrt,return le32_to_cpu (range->range_data_size); } +static int +iwl_dump_ini_mon_dram_iter (struct iwl_fw_runtime *fwrt, +struct iwl_fw_ini_error_dump_range *range, +struct iwl_fw_ini_region_cfg *reg, +int idx) +{ +u32 start_addr =iwl_read_prph (fwrt->trans,MON_BUFF_BASE_ADDR_VER2 ); + +if (start_addr ==0x5a5a5a5a ) +return -1 ; + + range->start_addr =cpu_to_le32 (start_addr); + range->range_data_size =cpu_to_le32 (fwrt->trans->fw_mon[idx].size); + +memcpy (range->data, fwrt->trans->fw_mon[idx].block, + fwrt->trans->fw_mon[idx].size); + +return le32_to_cpu (range->range_data_size); +} +static struct iwl_fw_ini_error_dump_range *iwl_dump_ini_mem_fill_header (struct iwl_fw_runtime *fwrt,void *data) {
@@ -1140,6 +1160,27 @@ static struct iwl_fw_ini_error_dump_rangereturn dump->ranges; } +static struct iwl_fw_ini_error_dump_range +*iwl_dump_ini_mon_dram_fill_header (struct iwl_fw_runtime *fwrt,void *data) +{ +struct iwl_fw_ini_monitor_dram_dump *mon_dump = (void *)data; +u32 write_ptr, cycle_cnt; +unsigned long flags; + +if (!iwl_trans_grab_nic_access (fwrt->trans, &flags)) { +IWL_ERR (fwrt,"Failed to get DRAM monitor header\n" ); +return NULL ; + } + write_ptr =iwl_read_prph_no_grab (fwrt->trans,MON_BUFF_WRPTR_VER2 ); + cycle_cnt =iwl_read_prph_no_grab (fwrt->trans,MON_BUFF_CYCLE_CNT_VER2 ); +iwl_trans_release_nic_access (fwrt->trans, &flags); + + mon_dump->write_ptr =cpu_to_le32 (write_ptr); + mon_dump->cycle_cnt =cpu_to_le32 (cycle_cnt); + +return mon_dump->ranges; +} +static u32 iwl_dump_ini_mem_get_size (struct iwl_fw_runtime *fwrt,struct iwl_fw_ini_region_cfg *reg) {
@@ -1169,6 +1210,12 @@ static u32 iwl_dump_ini_paging_get_size(struct iwl_fw_runtime *fwrt,return size; } +static u32 iwl_dump_ini_mon_dram_get_size (struct iwl_fw_runtime *fwrt, +struct iwl_fw_ini_region_cfg *reg) +{ +return fwrt->trans->num_blocks ? fwrt->trans->fw_mon[0 ].size :0 ; +} +static u32 iwl_dump_ini_mem_ranges (struct iwl_fw_runtime *fwrt,struct iwl_fw_ini_region_cfg *reg) {
@@ -1187,6 +1234,12 @@ static u32 iwl_dump_ini_paging_ranges(struct iwl_fw_runtime *fwrt,return fwrt->num_of_paging_blk; } +static u32 iwl_dump_ini_mon_dram_ranges (struct iwl_fw_runtime *fwrt, +struct iwl_fw_ini_region_cfg *reg) +{ +return 1 ; +} +/** * struct iwl_dump_ini_mem_ops - ini memory dump operations * @get_num_of_ranges: returns the number of memory ranges in the region.
@@ -1312,7 +1365,13 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt,break ; }case IWL_FW_INI_REGION_DRAM_BUFFER : -/* Transport takes care of DRAM dumping */ +if (!fwrt->trans->num_blocks) +break ; + size += hdr_len + +sizeof (struct iwl_fw_ini_monitor_dram_dump ) * +iwl_dump_ini_mon_dram_ranges (fwrt, reg) + +iwl_dump_ini_mon_dram_get_size (fwrt, reg); +break ;case IWL_FW_INI_REGION_DRAM_IMR :/* Undefined yet */ default :
@@ -1324,8 +1383,7 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt,static void iwl_fw_ini_dump_trigger (struct iwl_fw_runtime *fwrt,struct iwl_fw_ini_trigger *trigger, -struct iwl_fw_error_dump_data **data, -u32 *dump_mask) +struct iwl_fw_error_dump_data **data) {int i, num =le32_to_cpu (trigger->num_regions);
@@ -1363,7 +1421,11 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,iwl_dump_ini_mem (fwrt, type, data, reg, &ops);break ;case IWL_FW_INI_REGION_DRAM_BUFFER : - *dump_mask |=BIT (IWL_FW_ERROR_DUMP_FW_MONITOR ); + ops.get_num_of_ranges = iwl_dump_ini_mon_dram_ranges; + ops.get_size = iwl_dump_ini_mon_dram_get_size; + ops.fill_mem_hdr = iwl_dump_ini_mon_dram_fill_header; + ops.fill_range = iwl_dump_ini_mon_dram_iter; +iwl_dump_ini_mem (fwrt, type, data, reg, &ops);break ;case IWL_FW_INI_REGION_PAGING : { ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header;
@@ -1406,8 +1468,7 @@ static void iwl_fw_ini_dump_trigger(struct iwl_fw_runtime *fwrt,static struct iwl_fw_error_dump_file *_iwl_fw_error_ini_dump (struct iwl_fw_runtime *fwrt, -struct iwl_fw_dump_ptrs *fw_error_dump, -u32 *dump_mask) +struct iwl_fw_dump_ptrs *fw_error_dump) {int size, id =le32_to_cpu (fwrt->dump.desc->trig_desc.type);struct iwl_fw_error_dump_data *dump_data;
@@ -1440,11 +1501,10 @@ _iwl_fw_error_ini_dump(struct iwl_fw_runtime *fwrt, dump_data = (void *)dump_file->data; dump_file->file_len =cpu_to_le32 (size); - *dump_mask =0 ;if (trigger) -iwl_fw_ini_dump_trigger (fwrt, trigger, &dump_data, dump_mask); +iwl_fw_ini_dump_trigger (fwrt, trigger, &dump_data);if (ext) -iwl_fw_ini_dump_trigger (fwrt, ext, &dump_data, dump_mask); +iwl_fw_ini_dump_trigger (fwrt, ext, &dump_data);return dump_file; }
@@ -1470,8 +1530,7 @@ void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt) goto out;if (fwrt->trans->ini_valid) - dump_file =_iwl_fw_error_ini_dump (fwrt, fw_error_dump, - &dump_mask); + dump_file =_iwl_fw_error_ini_dump (fwrt, fw_error_dump);else dump_file =_iwl_fw_error_dump (fwrt, fw_error_dump);
@@ -1483,7 +1542,10 @@ void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt)if (!fwrt->trans->ini_valid && fwrt->dump.monitor_only) dump_mask &=IWL_FW_ERROR_DUMP_FW_MONITOR ; - fw_error_dump->trans_ptr =iwl_trans_dump_data (fwrt->trans, dump_mask); +if (!fwrt->trans->ini_valid) + fw_error_dump->trans_ptr = +iwl_trans_dump_data (fwrt->trans, dump_mask); + file_len =le32_to_cpu (dump_file->file_len); fw_error_dump->fwrt_len = file_len;if (fw_error_dump->trans_ptr) {
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h +15 -1
@@ -301,7 +301,7 @@ struct iwl_fw_ini_error_dump_header {/** * struct iwl_fw_ini_error_dump - ini region dump * @header: the header of this region -* @ranges: the memory ranges of this this region +* @ranges: the memory ranges of this region */ struct iwl_fw_ini_error_dump {struct iwl_fw_ini_error_dump_header header;
@@ -322,6 +322,20 @@ struct iwl_fw_error_dump_rb {u8 data[]; }; +/** +* struct iwl_fw_ini_monitor_dram_dump - ini dram monitor dump +* @header - header of the region +* @write_ptr - write pointer position in the dram +* @cycle_cnt - cycles count +* @ranges - the memory ranges of this this region +*/ +struct iwl_fw_ini_monitor_dram_dump { +struct iwl_fw_ini_error_dump_header header; +__le32 write_ptr; +__le32 cycle_cnt; +struct iwl_fw_ini_error_dump_range ranges[]; +} __packed; +/** * struct iwl_fw_error_dump_paging - content of the UMAC's image page * block on DRAM
Signature · 1 line
2.20.1
PATCH 8/17 iwlwifi: mvm: support FTM responder
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
Add support for FTM responder for hardware/firmware combinations that advertise support for it.
--- drivers/net/wireless/intel/iwlwifi/fw/file.h | 9 + .../net/wireless/intel/iwlwifi/mvm/Makefile | 2 +- .../intel/iwlwifi/mvm/ftm-responder.c | 244 ++++++++++++++++++ .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 92 ++++++- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 9 + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 + 6 files changed, 353 insertions(+), 5 deletions(-) create mode 100644 drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
drivers/net/wireless/intel/iwlwifi/fw/file.h +9 -0
@@ -370,12 +370,15 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;* capability. * @IWL_UCODE_TLV_CAPA_CSI_REPORTING: firmware is capable of being configured * to report the CSI information with (certain) RX frames +* @IWL_UCODE_TLV_CAPA_FTM_CALIBRATED: has FTM calibrated and thus supports both +* initiator and responder * * @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload * * @NUM_IWL_UCODE_TLV_CAPA: number of bits used */ enum iwl_ucode_tlv_capa { +/* set 0 */ IWL_UCODE_TLV_CAPA_D0I3_SUPPORT = (__force iwl_ucode_tlv_capa_t )0 ,IWL_UCODE_TLV_CAPA_LAR_SUPPORT = (__force iwl_ucode_tlv_capa_t )1 ,IWL_UCODE_TLV_CAPA_UMAC_SCAN = (__force iwl_ucode_tlv_capa_t )2 ,
@@ -397,6 +400,8 @@ enum iwl_ucode_tlv_capa {IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC = (__force iwl_ucode_tlv_capa_t )29 ,IWL_UCODE_TLV_CAPA_BT_COEX_RRC = (__force iwl_ucode_tlv_capa_t )30 ,IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT = (__force iwl_ucode_tlv_capa_t )31 , + +/* set 1 */ IWL_UCODE_TLV_CAPA_STA_PM_NOTIF = (__force iwl_ucode_tlv_capa_t )38 ,IWL_UCODE_TLV_CAPA_BINDING_CDB_SUPPORT = (__force iwl_ucode_tlv_capa_t )39 , IWL_UCODE_TLV_CAPA_CDB_SUPPORT = (__force iwl_ucode_tlv_capa_t)40,
@@ -406,6 +411,9 @@ enum iwl_ucode_tlv_capa {IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2 = (__force iwl_ucode_tlv_capa_t )45 ,IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD = (__force iwl_ucode_tlv_capa_t )46 ,IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS = (__force iwl_ucode_tlv_capa_t )48 , +IWL_UCODE_TLV_CAPA_FTM_CALIBRATED = (__force iwl_ucode_tlv_capa_t )47 , + +/* set 2 */ IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE = (__force iwl_ucode_tlv_capa_t )64 ,IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS = (__force iwl_ucode_tlv_capa_t )65 , IWL_UCODE_TLV_CAPA_BT_MPLUT_SUPPORT = (__force iwl_ucode_tlv_capa_t)67,
@@ -426,6 +434,7 @@ enum iwl_ucode_tlv_capa {IWL_UCODE_TLV_CAPA_MCC_UPDATE_11AX_SUPPORT = (__force iwl_ucode_tlv_capa_t )89 ,IWL_UCODE_TLV_CAPA_CSI_REPORTING = (__force iwl_ucode_tlv_capa_t )90 , +/* set 3 */ IWL_UCODE_TLV_CAPA_MLME_OFFLOAD = (__force iwl_ucode_tlv_capa_t )96 ,NUM_IWL_UCODE_TLV_CAPA
drivers/net/wireless/intel/iwlwifi/mvm/Makefile +1 -1
@@ -4,7 +4,7 @@ iwlmvm-y += fw.o mac80211.o nvm.o ops.o phy-ctxt.o mac-ctxt.o iwlmvm-y += utils.o rx.o rxmq.o tx.o binding.o quota.o sta.o sf.o iwlmvm-y += scan.o time-event.o rs.o rs-fw.o iwlmvm-y += power.o coex.o -iwlmvm-y += tt.o offloading.o tdls.o +iwlmvm-y += tt.o offloading.o tdls.o ftm-responder.o iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o iwlmvm-$(CONFIG_PM) += d3.o
drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c new file +244 -0
244 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +88 -4
165 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +9 -0
@@ -1150,6 +1150,8 @@ struct iwl_mvm {u32 ciphers[IWL_MVM_NUM_CIPHERS ];struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS ]; +struct cfg80211_ftm_responder_stats ftm_resp_stats; +struct ieee80211_vif *nan_vif;#define IWL_MAX_BAID 32struct iwl_mvm_baid_data __rcu *baid_map[IWL_MAX_BAID ];
@@ -2060,6 +2062,13 @@ void iwl_mvm_update_changed_regdom(struct iwl_mvm *mvm);int iwl_mvm_sf_update (struct iwl_mvm *mvm,struct ieee80211_vif *vif,bool added_vif); +/* FTM responder */ +int iwl_mvm_ftm_start_responder (struct iwl_mvm *mvm,struct ieee80211_vif *vif); +void iwl_mvm_ftm_restart_responder (struct iwl_mvm *mvm, +struct ieee80211_vif *vif); +void iwl_mvm_ftm_responder_stats (struct iwl_mvm *mvm, +struct iwl_rx_cmd_buffer *rxb); +/* TDLS */ /*
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +2 -0
@@ -300,6 +300,8 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = { RX_HANDLER_ASYNC_LOCKED),RX_HANDLER (MFUART_LOAD_NOTIFICATION , iwl_mvm_rx_mfuart_notif,RX_HANDLER_SYNC ), +RX_HANDLER_GRP (LOCATION_GROUP ,TOF_RESPONDER_STATS , + iwl_mvm_ftm_responder_stats,RX_HANDLER_ASYNC_LOCKED ),RX_HANDLER_GRP (DEBUG_GROUP ,MFU_ASSERT_DUMP_NTF , iwl_mvm_mfu_assert_dump_notif,RX_HANDLER_SYNC ), RX_HANDLER_GRP(PROT_OFFLOAD_GROUP, STORED_BEACON_NTF,
Signature · 1 line
2.20.1
PATCH 9/17 iwlwifi: mvm: support FTM initiator
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
Add support for FTM initiator, i.e. peer measurements with FTM if the firmware supports FTM.
Additionally, add two defines we depend on ininclude/linux/ieee80211.h.
--- .../wireless/intel/iwlwifi/fw/api/location.h | 10 +- .../net/wireless/intel/iwlwifi/mvm/Makefile | 3 +- .../wireless/intel/iwlwifi/mvm/constants.h | 3 + .../intel/iwlwifi/mvm/ftm-initiator.c | 459 ++++++++++++++++++ .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 56 ++- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 16 + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 7 + include/linux/ieee80211.h | 2 + 8 files changed, 552 insertions(+), 4 deletions(-) create mode 100644 drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
drivers/net/wireless/intel/iwlwifi/fw/api/location.h +8 -2
@@ -7,6 +7,7 @@* * Copyright(c) 2015 - 2017 Intel Deutschland GmbH * Copyright (C) 2018 Intel Corporation +* Copyright (C) 2019 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as
@@ -28,6 +29,7 @@* * Copyright(c) 2015 - 2017 Intel Deutschland GmbH * Copyright (C) 2018 Intel Corporation +* Copyright (C) 2019 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -403,7 +405,10 @@ enum iwl_tof_response_mode {* @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A: use antenna A fo TX ACKs during FTM * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B: use antenna B fo TX ACKs during FTM * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C: use antenna C fo TX ACKs during FTM -* @IWL_TOF_INITIATOR_FLAGS_MINDELTA_NO_PREF: no preference for minDeltaFTM +* @IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB: use the specific calib value from +* the range request command +* @IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB: use the common calib value from the +* ragne request command */ enum iwl_tof_initiator_flags {IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED =BIT (0 ),
@@ -413,7 +418,8 @@ enum iwl_tof_initiator_flags {IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A =BIT (4 ),IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B =BIT (5 ),IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C =BIT (6 ), - IWL_TOF_INITIATOR_FLAGS_MINDELTA_NO_PREF = BIT(7), +IWL_TOF_INITIATOR_FLAGS_SPECIFIC_CALIB =BIT (15 ), + IWL_TOF_INITIATOR_FLAGS_COMMON_CALIB = BIT(16), }; /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */#define IWL_MVM_TOF_MAX_APS 5
drivers/net/wireless/intel/iwlwifi/mvm/Makefile +2 -1
@@ -4,7 +4,8 @@ iwlmvm-y += fw.o mac80211.o nvm.o ops.o phy-ctxt.o mac-ctxt.o iwlmvm-y += utils.o rx.o rxmq.o tx.o binding.o quota.o sta.o sf.o iwlmvm-y += scan.o time-event.o rs.o rs-fw.o iwlmvm-y += power.o coex.o -iwlmvm-y += tt.o offloading.o tdls.o ftm-responder.o +iwlmvm-y += tt.o offloading.o tdls.o +iwlmvm-y += ftm-responder.o ftm-initiator.o iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o iwlmvm-$(CONFIG_PM) += d3.o
drivers/net/wireless/intel/iwlwifi/mvm/constants.h +3 -0
@@ -63,6 +63,7 @@#define __MVM_CONSTANTS_H#include <linux/ieee80211.h> +#include "fw-api.h" #define IWL_MVM_UAPSD_NOAGG_BSSIDS_NUM 20
@@ -145,5 +146,7 @@#define IWL_MVM_RS_TPC_SR_NO_INCREASE 85/* percent */ #define IWL_MVM_RS_TPC_TX_POWER_STEP 3#define IWL_MVM_ENABLE_EBS 1 +#define IWL_MVM_FTM_INITIATOR_ALGO IWL_TOF_ALGO_TYPE_MAX_LIKE +#define IWL_MVM_FTM_INITIATOR_DYNACK true#endif /* __MVM_CONSTANTS_H */
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c new file +459 -0
459 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +55 -1
88 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +16 -0
@@ -1151,6 +1151,12 @@ struct iwl_mvm {struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS ];struct cfg80211_ftm_responder_stats ftm_resp_stats; +struct { +struct cfg80211_pmsr_request *req; +struct wireless_dev *req_wdev; +struct list_head loc_list; +int responses[IWL_MVM_TOF_MAX_APS ]; + } ftm_initiator;struct ieee80211_vif *nan_vif;#define IWL_MAX_BAID 32
@@ -2069,6 +2075,16 @@ void iwl_mvm_ftm_restart_responder(struct iwl_mvm *mvm,void iwl_mvm_ftm_responder_stats (struct iwl_mvm *mvm,struct iwl_rx_cmd_buffer *rxb); +/* FTM initiator */ +void iwl_mvm_ftm_restart (struct iwl_mvm *mvm); +void iwl_mvm_ftm_range_resp (struct iwl_mvm *mvm, +struct iwl_rx_cmd_buffer *rxb); +void iwl_mvm_ftm_lc_notif (struct iwl_mvm *mvm, +struct iwl_rx_cmd_buffer *rxb); +int iwl_mvm_ftm_start (struct iwl_mvm *mvm,struct ieee80211_vif *vif, +struct cfg80211_pmsr_request *request); +void iwl_mvm_ftm_abort (struct iwl_mvm *mvm,struct cfg80211_pmsr_request *req); +/* TDLS */ /*
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +7 -0
@@ -302,6 +302,12 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = { RX_HANDLER_SYNC),RX_HANDLER_GRP (LOCATION_GROUP ,TOF_RESPONDER_STATS , iwl_mvm_ftm_responder_stats,RX_HANDLER_ASYNC_LOCKED ), + +RX_HANDLER_GRP (LOCATION_GROUP ,TOF_RANGE_RESPONSE_NOTIF , + iwl_mvm_ftm_range_resp,RX_HANDLER_ASYNC_LOCKED ), +RX_HANDLER_GRP (LOCATION_GROUP ,TOF_LC_NOTIF , + iwl_mvm_ftm_lc_notif,RX_HANDLER_ASYNC_LOCKED ), +RX_HANDLER_GRP (DEBUG_GROUP ,MFU_ASSERT_DUMP_NTF , iwl_mvm_mfu_assert_dump_notif,RX_HANDLER_SYNC ), RX_HANDLER_GRP(PROT_OFFLOAD_GROUP, STORED_BEACON_NTF,
@@ -693,6 +699,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,INIT_LIST_HEAD (&mvm->aux_roc_te_list);INIT_LIST_HEAD (&mvm->async_handlers_list);spin_lock_init (&mvm->time_event_lock); +INIT_LIST_HEAD (&mvm->ftm_initiator.loc_list);INIT_WORK (&mvm->async_handlers_wk, iwl_mvm_async_handlers_wk);INIT_WORK (&mvm->roc_done_wk, iwl_mvm_roc_done_wk);
include/linux/ieee80211.h +2 -0
@@ -2118,6 +2118,8 @@ ieee80211_he_oper_size(const u8 *he_oper_ie)#define IEEE80211_SPCT_MSR_RPRT_TYPE_BASIC 0#define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1#define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2 +#define IEEE80211_SPCT_MSR_RPRT_TYPE_LCI 8 +#define IEEE80211_SPCT_MSR_RPRT_TYPE_CIVIC 11/* 802.11g ERP information element */ #define WLAN_ERP_NON_ERP_PRESENT (1<<0)
Signature · 1 line
2.20.1
PATCH 10/17 iwlwifi: mvm: clean up NO_PSDU case
In reply to Luca CoelhoFrom: Johannes Berg <[email protected]>
We now no longer have any special code iniwl_mvm_pass_packet_to_mac80211(), so don't
need to pass NO_PSDU packets through it.
Stop doing so and clean up the code there.
--- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +2 -5
@@ -258,10 +258,7 @@ static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm, struct ieee80211_sta *sta, bool csi) { -struct ieee80211_rx_status *rx_status =IEEE80211_SKB_RXCB (skb); - -if (!(rx_status->flag &RX_FLAG_NO_PSDU ) && -iwl_mvm_check_pn (mvm, skb, queue, sta)) + if (iwl_mvm_check_pn(mvm, skb, queue, sta)) kfree_skb(skb); else ieee80211_rx_napi(mvm->hw, sta, skb, napi);
@@ -1800,7 +1797,7 @@ void iwl_mvm_rx_monitor_ndp(struct iwl_mvm *mvm, struct napi_struct *napi, rx_status->rate_idx = rate; } -iwl_mvm_pass_packet_to_mac80211 (mvm, napi, skb, queue, sta, false); +ieee80211_rx_napi (mvm->hw, sta, skb, napi); out:rcu_read_unlock (); }
Signature · 1 line
2.20.1
PATCH 11/17 iwlwifi: receive umac and lmac error table addresses from TLVs
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
TLV 54 holds umac debug related addresses.
TLV 55 holds lmac debug related addresses.
These TLVs aim to replace the alive notification data in the future.
Parse and keep error table addresses received from the TLVs for both lmac and umac and use these addresses instead of the pointer received from alive notification.
The feature supports only unified image.
--- .../net/wireless/intel/iwlwifi/fw/api/alive.h | 28 +++++++++------ drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 20 +++++++++++ drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 ++ drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 35 +++++++++++++++++++ .../net/wireless/intel/iwlwifi/iwl-trans.h | 10 ++++++ drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 23 +++++++----- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 -- .../net/wireless/intel/iwlwifi/mvm/utils.c | 12 ++++--- 9 files changed, 107 insertions(+), 28 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/alive.h +18 -10
@@ -96,14 +96,7 @@ enum {#define IWL_ALIVE_FLG_RFKILL BIT(0) -struct iwl_lmac_alive { -__le32 ucode_major; -__le32 ucode_minor; -u8 ver_subtype; -u8 ver_type; -u8 mac; -u8 opt; -__le32 timestamp; +struct iwl_lmac_debug_addrs {__le32 error_event_table_ptr;/* SRAM address for error log */ __le32 log_event_table_ptr;/* SRAM address for LMAC event log */ __le32 cpu_register_ptr;
@@ -112,13 +105,28 @@ struct iwl_lmac_alive {__le32 scd_base_ptr;/* SRAM address for SCD */ __le32 st_fwrd_addr;/* pointer to Store and forward */ __le32 st_fwrd_size; +} __packed;/* UCODE_DEBUG_ADDRS_API_S_VER_2 */ + +struct iwl_lmac_alive { +__le32 ucode_major; +__le32 ucode_minor; +u8 ver_subtype; +u8 ver_type; +u8 mac; +u8 opt; +__le32 timestamp; +struct iwl_lmac_debug_addrs dbg_ptrs; } __packed;/* UCODE_ALIVE_NTFY_API_S_VER_3 */ +struct iwl_umac_debug_addrs { +__le32 error_info_addr;/* SRAM address for UMAC error log */ +__le32 dbg_print_buff_addr; +} __packed;/* UMAC_DEBUG_ADDRS_API_S_VER_1 */ +struct iwl_umac_alive {__le32 umac_major;/* UMAC version: major */ __le32 umac_minor;/* UMAC version: minor */ -__le32 error_info_addr;/* SRAM address for UMAC error log */ -__le32 dbg_print_buff_addr; +struct iwl_umac_debug_addrs dbg_ptrs; } __packed;/* UMAC_ALIVE_DATA_API_S_VER_2 */ struct mvm_alive_resp_v3 {
drivers/net/wireless/intel/iwlwifi/fw/dbg.h +20 -0
@@ -442,6 +442,26 @@ void iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt,void iwl_fwrt_stop_device (struct iwl_fw_runtime *fwrt); +static inline void iwl_fw_lmac1_set_alive_err_table (struct iwl_trans *trans, +u32 lmac_error_event_table) +{ +if (!(trans->error_event_table_tlv_status & +IWL_ERROR_EVENT_TABLE_LMAC1 ) || +WARN_ON (trans->lmac_error_event_table[0 ] != + lmac_error_event_table)) + trans->lmac_error_event_table[0 ] = lmac_error_event_table; +} + +static inline void iwl_fw_umac_set_alive_err_table (struct iwl_trans *trans, +u32 umac_error_event_table) +{ +if (!(trans->error_event_table_tlv_status & +IWL_ERROR_EVENT_TABLE_UMAC ) || +WARN_ON (trans->umac_error_event_table != + umac_error_event_table)) + trans->umac_error_event_table = umac_error_event_table; +} +/* This bit is used to differentiate the legacy dump from the ini dump */ #define INI_DUMP_BIT BIT(31)
drivers/net/wireless/intel/iwlwifi/fw/file.h +2 -0
@@ -143,6 +143,8 @@ enum iwl_ucode_tlv_type {IWL_UCODE_TLV_FW_GSCAN_CAPA =50 ,IWL_UCODE_TLV_FW_MEM_SEG =51 ,IWL_UCODE_TLV_IML =52 , +IWL_UCODE_TLV_UMAC_DEBUG_ADDRS =54 , +IWL_UCODE_TLV_LMAC_DEBUG_ADDRS =55 ,IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION =IWL_UCODE_INI_TLV_GROUP |0x1 ,IWL_UCODE_TLV_TYPE_HCMD =IWL_UCODE_INI_TLV_GROUP |0x2 , IWL_UCODE_TLV_TYPE_REGIONS = IWL_UCODE_INI_TLV_GROUP | 0x3,
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +35 -0
@@ -75,6 +75,7 @@#include "iwl-dbg-tlv.h" #include "iwl-config.h" #include "iwl-modparams.h" +#include "fw/api/alive.h" /****************************************************************************** *
@@ -588,6 +589,8 @@ static int iwl_parse_v1_v2_firmware(struct iwl_drv *drv,return 0 ; } +#define FW_ADDR_CACHE_CONTROL 0xC0000000 + static int iwl_parse_tlv_firmware(struct iwl_drv *drv, const struct firmware *ucode_raw, struct iwl_firmware_pieces *pieces,
@@ -1085,6 +1088,38 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,return -ENOMEM ;break ; } +case IWL_UCODE_TLV_UMAC_DEBUG_ADDRS : { +struct iwl_umac_debug_addrs *dbg_ptrs = + (void *)tlv_data; + +if (tlv_len !=sizeof (*dbg_ptrs)) + goto invalid_tlv_len; +if (drv->trans->cfg->device_family < +IWL_DEVICE_FAMILY_22000 ) +break ; + drv->trans->umac_error_event_table = +le32_to_cpu (dbg_ptrs->error_info_addr) & + ~FW_ADDR_CACHE_CONTROL ; + drv->trans->error_event_table_tlv_status |= +IWL_ERROR_EVENT_TABLE_UMAC ; +break ; + } +case IWL_UCODE_TLV_LMAC_DEBUG_ADDRS : { +struct iwl_lmac_debug_addrs *dbg_ptrs = + (void *)tlv_data; + +if (tlv_len !=sizeof (*dbg_ptrs)) + goto invalid_tlv_len; +if (drv->trans->cfg->device_family < +IWL_DEVICE_FAMILY_22000 ) +break ; + drv->trans->lmac_error_event_table[0 ] = +le32_to_cpu (dbg_ptrs->error_event_table_ptr) & + ~FW_ADDR_CACHE_CONTROL ; + drv->trans->error_event_table_tlv_status |= +IWL_ERROR_EVENT_TABLE_LMAC1 ; +break ; + }case IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION :case IWL_UCODE_TLV_TYPE_HCMD :case IWL_UCODE_TLV_TYPE_REGIONS :
drivers/net/wireless/intel/iwlwifi/iwl-trans.h +10 -0
@@ -232,6 +232,12 @@ enum iwl_hcmd_dataflag { IWL_HCMD_DFL_DUP = BIT(1), }; +enum iwl_error_event_table_status { +IWL_ERROR_EVENT_TABLE_LMAC1 =BIT (0 ), +IWL_ERROR_EVENT_TABLE_LMAC2 =BIT (1 ), +IWL_ERROR_EVENT_TABLE_UMAC =BIT (2 ), +}; +/** * struct iwl_host_cmd - Host command to the uCode *
@@ -759,6 +765,10 @@ struct iwl_self_init_dram {* mode is set during the initialization phase and is not * supposed to change during runtime. * @dbg_rec_on: true iff there is a fw debug recording currently active +* @lmac_error_event_table: addrs of lmacs error tables +* @umac_error_event_table: addr of umac error table +* @error_event_table_tlv_status: bitmap that indicates what error table +* pointers was recevied via TLV. use enum &iwl_error_event_table_status */ struct iwl_trans {const struct iwl_trans_ops *ops;
drivers/net/wireless/intel/iwlwifi/mvm/d3.c +1 -1
@@ -1899,7 +1899,7 @@ static void iwl_mvm_d3_disconnect_iter(void *data, u8 *mac,static int iwl_mvm_check_rt_status (struct iwl_mvm *mvm,struct ieee80211_vif *vif) { -u32 base = mvm->error_event_table[0 ]; +u32 base = mvm->trans->lmac_error_event_table[0 ];struct error_table_start {/* cf. struct iwl_error_event_table */ u32 valid;
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +14 -9
@@ -218,7 +218,7 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,struct iwl_lmac_alive *lmac1;struct iwl_lmac_alive *lmac2 =NULL ;u16 status; -u32 umac_error_event_table; +u32 lmac_error_event_table, umac_error_event_table;if (iwl_rx_packet_payload_len (pkt) ==sizeof (*palive)) { palive = (void *)pkt->data;
@@ -233,30 +233,35 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait, status =le16_to_cpu (palive3->status); } - mvm->error_event_table[0 ] =le32_to_cpu (lmac1->error_event_table_ptr); + lmac_error_event_table = +le32_to_cpu (lmac1->dbg_ptrs.error_event_table_ptr); +iwl_fw_lmac1_set_alive_err_table (mvm->trans, lmac_error_event_table); +if (lmac2) - mvm->error_event_table[1 ] = -le32_to_cpu (lmac2->error_event_table_ptr); - mvm->log_event_table =le32_to_cpu (lmac1->log_event_table_ptr); + mvm->trans->lmac_error_event_table[1 ] = +le32_to_cpu (lmac2->dbg_ptrs.error_event_table_ptr); - umac_error_event_table =le32_to_cpu (umac->error_info_addr); + umac_error_event_table =le32_to_cpu (umac->dbg_ptrs.error_info_addr);if (!umac_error_event_table) { mvm->support_umac_log = false; }else if (umac_error_event_table >= mvm->trans->cfg->min_umac_error_event_table) { mvm->support_umac_log = true; - mvm->umac_error_event_table = umac_error_event_table; }else {IWL_ERR (mvm,"Not valid error log pointer 0x%08X for %s uCode\n" , - mvm->umac_error_event_table, + umac_error_event_table, (mvm->fwrt.cur_fw_img ==IWL_UCODE_INIT ) ?"Init" :"RT" ); mvm->support_umac_log = false; } - alive_data->scd_base_addr =le32_to_cpu (lmac1->scd_base_ptr); +if (mvm->support_umac_log) +iwl_fw_umac_set_alive_err_table (mvm->trans, + umac_error_event_table); + + alive_data->scd_base_addr =le32_to_cpu (lmac1->dbg_ptrs.scd_base_ptr); alive_data->valid = status ==IWL_ALIVE_STATUS_OK ; IWL_DEBUG_FW(mvm,
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +0 -3
@@ -879,9 +879,6 @@ struct iwl_mvm {bool hw_registered;bool calibrating; -u32 error_event_table[2 ]; -u32 log_event_table; -u32 umac_error_event_table;bool support_umac_log;u32 ampdu_ref;
drivers/net/wireless/intel/iwlwifi/mvm/utils.c +7 -5
@@ -457,12 +457,14 @@ static void iwl_mvm_dump_umac_error_log(struct iwl_mvm *mvm) {struct iwl_trans *trans = mvm->trans;struct iwl_umac_error_event_table table; +u32 base = mvm->trans->umac_error_event_table; -if (!mvm->support_umac_log) +if (!mvm->support_umac_log && + !(mvm->trans->error_event_table_tlv_status & +IWL_ERROR_EVENT_TABLE_UMAC ))return ; -iwl_trans_read_mem_bytes (trans, mvm->umac_error_event_table, &table, -sizeof (table)); +iwl_trans_read_mem_bytes (trans, base, &table,sizeof (table));if (table.valid) mvm->fwrt.dump.umac_err_id = table.error_id;
@@ -494,7 +496,7 @@ static void iwl_mvm_dump_lmac_error_log(struct iwl_mvm *mvm, u8 lmac_num) {struct iwl_trans *trans = mvm->trans;struct iwl_error_event_table table; -u32 val, base = mvm->error_event_table[lmac_num]; +u32 val, base = mvm->trans->lmac_error_event_table[lmac_num];if (mvm->fwrt.cur_fw_img ==IWL_UCODE_INIT ) {if (!base)
@@ -590,7 +592,7 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)iwl_mvm_dump_lmac_error_log (mvm,0 ); -if (mvm->error_event_table[1 ]) +if (mvm->trans->lmac_error_event_table[1 ])iwl_mvm_dump_lmac_error_log (mvm,1 );iwl_mvm_dump_umac_error_log (mvm);
Signature · 1 line
2.20.1
PATCH 12/17 iwlwifi: dbg_ini: rewrite trigger flow and align to FW API changes
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
Trigger field ignore_default was changed to override_trig. The first byte of the field indicates the driver to override existing configuration or keep the previous one
The second byte of the field indicated the driver to replace the regions of the previous trigger or to append new regions to it.
Change the way the active triggers are maintained to support trigger override in different apply points.
Do this by making a trigger that updates at runtime by the triggers that are being used in the different apply points.
In case of an assert, the driver does not reconfigure the triggers and uses the old configuration which leads to undefined behavior. Solve this by clearing the triggers in assert recovery flow.
--- .../wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 11 +- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 116 ++++++++++++------ drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 7 +- drivers/net/wireless/intel/iwlwifi/fw/img.h | 10 +- .../net/wireless/intel/iwlwifi/fw/runtime.h | 12 ++ 5 files changed, 107 insertions(+), 49 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h +8 -3
@@ -204,8 +204,13 @@ struct iwl_fw_ini_region_tlv {* struct iwl_fw_ini_trigger - (IWL_FW_INI_TLV_TYPE_DUMP_CFG) * Region sections define IDs and triggers that use those IDs TLV * -* @trigger_id: enum &iwl_fw_ini_trigger_id -* @ignore_default: override FW TLV with binary TLV +* @trigger_id: enum &iwl_fw_ini_tigger_id +* @override_trig: determines how apply trigger in case a trigger with the +* same id is already in use. Using the first 2 bytes: +* Byte 0: if 0, override trigger configuration, otherwise use the +* existing configuration. +* Byte 1: if 0, override trigger regions, otherwise append regions to +* existing trigger. * @dump_delay: delay from trigger fire to dump, in usec * @occurrences: max amount of times to be fired * @ignore_consec: ignore consecutive triggers, in usec
@@ -217,7 +222,7 @@ struct iwl_fw_ini_region_tlv {*/ struct iwl_fw_ini_trigger {__le32 trigger_id; -__le32 ignore_default; +__le32 override_trig;__le32 dump_delay;__le32 occurrences;__le32 ignore_consec;
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +79 -37
193 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/fw/dbg.h +4 -3
@@ -225,16 +225,17 @@ static inline bool _iwl_fw_ini_trigger_on(struct iwl_fw_runtime *fwrt, const enum iwl_fw_dbg_trigger id) { - struct iwl_fw_ini_active_triggers *trig = &fwrt->dump.active_trigs[id]; + struct iwl_fw_ini_active_triggers *active = + &fwrt->dump.active_trigs[id];u32 ms;if (!fwrt->trans->ini_valid)return false; -if (!trig || !trig->active) +if (!active->active)return false; - ms =le32_to_cpu (trig->conf->ignore_consec); + ms =le32_to_cpu (active->trig->ignore_consec);if (ms) ms /=USEC_PER_MSEC ;
drivers/net/wireless/intel/iwlwifi/fw/img.h +4 -6
@@ -234,15 +234,13 @@ struct iwl_fw_ini_allocation_data {/** * struct iwl_fw_ini_active_triggers * @active: is this trigger active -* @apply_point: last apply point that updated this trigger -* @conf: active trigger -* @conf_ext: second trigger, contains extra regions to dump +* @size: allocated memory size of the trigger +* @trig: trigger */ struct iwl_fw_ini_active_triggers {bool active; -enum iwl_fw_ini_apply_point apply_point; -struct iwl_fw_ini_trigger *conf; -struct iwl_fw_ini_trigger *conf_ext; +size_t size; +struct iwl_fw_ini_trigger *trig; };/**
drivers/net/wireless/intel/iwlwifi/fw/runtime.h +12 -0
@@ -160,8 +160,20 @@ void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans,static inline void iwl_fw_runtime_free (struct iwl_fw_runtime *fwrt) { +int i; +kfree (fwrt->dump.d3_debug_data); fwrt->dump.d3_debug_data =NULL ; + +for (i =0 ; i <IWL_FW_TRIGGER_ID_NUM ; i++) { +struct iwl_fw_ini_active_triggers *active = + &fwrt->dump.active_trigs[i]; + + active->active = false; + active->size =0 ; +kfree (active->trig); + active->trig =NULL ; + } }void iwl_fw_runtime_suspend (struct iwl_fw_runtime *fwrt);
Signature · 1 line
2.20.1
PATCH 13/17 iwlwifi: introduce device family AX210
In reply to Luca CoelhoFrom: Shaul Triebitz <[email protected]>
Add new device family AX210.
Make the needed changes for this family.
--- .../net/wireless/intel/iwlwifi/cfg/22000.c | 47 +++++++++++++++++++ .../net/wireless/intel/iwlwifi/iwl-config.h | 7 +++ drivers/net/wireless/intel/iwlwifi/iwl-csr.h | 4 ++ drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 3 +- .../intel/iwlwifi/pcie/ctxt-info-gen3.c | 13 +++-- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 8 ++++ drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 15 +++++- .../wireless/intel/iwlwifi/pcie/trans-gen2.c | 7 +-- .../net/wireless/intel/iwlwifi/pcie/trans.c | 17 +++++-- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 12 ++++- 10 files changed, 119 insertions(+), 14 deletions(-)
drivers/net/wireless/intel/iwlwifi/cfg/22000.c +47 -0
@@ -84,6 +84,10 @@#define IWL_22000_SU_Z0_FW_PRE "iwlwifi-su-z0-"#define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0-"#define IWL_CC_A_FW_PRE "iwlwifi-cc-a0-" +#define IWL_22000_SO_A_JF_B_FW_PRE "iwlwifi-so-a0-jf-b0-" +#define IWL_22000_SO_A_HR_B_FW_PRE "iwlwifi-so-a0-hr-b0-" +#define IWL_22000_SO_A_GF_A_FW_PRE "iwlwifi-so-a0-gf-a0-" +#define IWL_22000_TY_A_GF_A_FW_PRE "iwlwifi-ty-a0-gf-a0-"#define IWL_22000_HR_MODULE_FIRMWARE (api) \ IWL_22000_HR_FW_PRE __stringify(api) ".ucode"
@@ -107,6 +111,14 @@ IWL_QU_B_JF_B_FW_PRE __stringify(api) ".ucode"#define IWL_CC_A_MODULE_FIRMWARE (api) \ IWL_CC_A_FW_PRE __stringify(api) ".ucode" +#define IWL_22000_SO_A_JF_B_MODULE_FIRMWARE (api) \ + IWL_22000_SO_A_JF_B_FW_PRE __stringify(api) ".ucode" +#define IWL_22000_SO_A_HR_B_MODULE_FIRMWARE (api) \ + IWL_22000_SO_A_HR_B_FW_PRE __stringify(api) ".ucode" +#define IWL_22000_SO_A_GF_A_MODULE_FIRMWARE (api) \ + IWL_22000_SO_A_GF_A_FW_PRE __stringify(api) ".ucode" +#define IWL_22000_TY_A_GF_A_MODULE_FIRMWARE (api) \ + IWL_22000_TY_A_GF_A_FW_PRE __stringify(api) ".ucode"static const struct iwl_base_params iwl_22000_base_params = { .eeprom_size =OTP_LOW_IMAGE_SIZE_32K ,
@@ -179,6 +191,13 @@ static const struct iwl_ht_params iwl_22000_ht_params = { .base_params = &iwl_22560_base_params, \ .csr = &iwl_csr_v2 +#define IWL_DEVICE_AX210 \ + IWL_DEVICE_22000_COMMON, \ + .device_family = IWL_DEVICE_FAMILY_AX210, \ + .base_params = &iwl_22000_base_params, \ + .csr = &iwl_csr_v1, \ + .min_txq_size = 128 +const struct iwl_cfg iwl22000_2ac_cfg_hr = { .name ="Intel(R) Dual Band Wireless AC 22000" , .fw_name_pre =IWL_22000_HR_FW_PRE ,
@@ -387,6 +406,30 @@ const struct iwl_cfg iwl22560_2ax_cfg_su_cdb = { .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, }; +const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0 = { + .name ="Intel(R) Wireless-AC 9560 160MHz" , + .fw_name_pre =IWL_22000_SO_A_JF_B_FW_PRE , +IWL_DEVICE_AX210 , +}; + +const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0 = { + .name ="Intel(R) Wi-Fi 6 AX201 160MHz" , + .fw_name_pre =IWL_22000_SO_A_HR_B_FW_PRE , +IWL_DEVICE_AX210 , +}; + +const struct iwl_cfg iwlax210_2ax_cfg_so_gf_a0 = { + .name ="Intel(R) Wi-Fi 7 AX211 160MHz" , + .fw_name_pre =IWL_22000_SO_A_GF_A_FW_PRE , +IWL_DEVICE_AX210 , +}; + +const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = { + .name ="Intel(R) Wi-Fi 7 AX210 160MHz" , + .fw_name_pre =IWL_22000_TY_A_GF_A_FW_PRE , +IWL_DEVICE_AX210 , +}; +MODULE_FIRMWARE (IWL_22000_HR_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_22000_JF_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));
@@ -397,3 +440,7 @@ MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));MODULE_FIRMWARE (IWL_22000_SU_Z0_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_QU_B_JF_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_CC_A_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_22000_SO_A_JF_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_22000_SO_A_HR_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_22000_SO_A_GF_A_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL_22000_TY_A_GF_A_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));
drivers/net/wireless/intel/iwlwifi/iwl-config.h +7 -0
@@ -89,6 +89,7 @@ enum iwl_device_family {IWL_DEVICE_FAMILY_9000 ,IWL_DEVICE_FAMILY_22000 ,IWL_DEVICE_FAMILY_22560 , + IWL_DEVICE_FAMILY_AX210, };/*
@@ -380,6 +381,7 @@ struct iwl_csr_params {* @d3_debug_data_base_addr: base address where D3 debug data is stored * @d3_debug_data_length: length of the D3 debug data * @bisr_workaround: BISR hardware workaround (for 22260 series devices) +* @min_txq_size: minimum number of slots required in a TX queue * * We enable the driver to be backward compatible wrt. hardware features. * API differences in uCode shouldn't be handled here but through TLVs
@@ -445,6 +447,7 @@ struct iwl_cfg {u32 extra_phy_cfg_flags;u32 d3_debug_data_base_addr;u32 d3_debug_data_length; +u32 min_txq_size; };extern const struct iwl_csr_params iwl_csr_v1;
@@ -563,6 +566,10 @@ extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_b0;extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_jf_b0;extern const struct iwl_cfg iwl22000_2ax_cfg_qnj_hr_a0;extern const struct iwl_cfg iwl22560_2ax_cfg_su_cdb; +extern const struct iwl_cfg iwlax210_2ax_cfg_so_jf_a0; +extern const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0; +extern const struct iwl_cfg iwlax210_2ax_cfg_so_gf_a0; +extern const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0;#endif /* CPTCFG_IWLMVM || CPTCFG_IWLFMAC */ #endif /* __IWL_CONFIG_H__ */
drivers/net/wireless/intel/iwlwifi/iwl-csr.h +4 -0
@@ -328,11 +328,14 @@ enum {#define CSR_HW_REV_TYPE_QNJ (0x0000360)#define CSR_HW_REV_TYPE_QNJ_B0 (0x0000364)#define CSR_HW_REV_TYPE_HR_CDB (0x0000340) +#define CSR_HW_REV_TYPE_SO (0x0000370) +#define CSR_HW_REV_TYPE_TY (0x0000420)/* RF_ID value */ #define CSR_HW_RF_ID_TYPE_JF (0x00105100)#define CSR_HW_RF_ID_TYPE_HR (0x0010A000)#define CSR_HW_RF_ID_TYPE_HRCDB (0x00109F00) +#define CSR_HW_RF_ID_TYPE_GF (0x0010D000)/* HW_RF CHIP ID */ #define CSR_HW_RF_ID_TYPE_CHIP_ID (_val) (((_val) >> 12) & 0xFFF)
@@ -594,6 +597,7 @@ enum msix_hw_int_causes {MSIX_HW_INT_CAUSES_REG_ALIVE =BIT (0 ),MSIX_HW_INT_CAUSES_REG_WAKEUP =BIT (1 ),MSIX_HW_INT_CAUSES_REG_IPC =BIT (1 ), +MSIX_HW_INT_CAUSES_REG_IML =BIT (2 ),MSIX_HW_INT_CAUSES_REG_SW_ERR_V2 =BIT (5 ),MSIX_HW_INT_CAUSES_REG_CT_KILL =BIT (6 ), MSIX_HW_INT_CAUSES_REG_RF_KILL = BIT(7),
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +2 -1
@@ -750,7 +750,8 @@ static int iwl_mvm_tvqm_enable_txq(struct iwl_mvm *mvm,if (tid ==IWL_MAX_TID_COUNT ) { tid =IWL_MGMT_TID ; - size =IWL_MGMT_QUEUE_SIZE ; + size =max_t (u32,IWL_MGMT_QUEUE_SIZE , + mvm->trans->cfg->min_txq_size); } queue = iwl_trans_txq_alloc(mvm->trans, cpu_to_le16(TX_QUEUE_CFG_ENABLE_QUEUE),
drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c +10 -3
@@ -66,6 +66,7 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,void *iml_img;u32 control_flags =0 ;int ret; +int cmdq_size =max_t (u32,TFD_CMD_SLOTS , trans->cfg->min_txq_size);/* Allocate prph scratch */ prph_scratch = dma_alloc_coherent(trans->dev, sizeof(*prph_scratch),
@@ -151,7 +152,7 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans, ctxt_info_gen3->mcr_base_addr =cpu_to_le64 (trans_pcie->rxq->used_bd_dma); ctxt_info_gen3->mtr_size = -cpu_to_le16 (TFD_QUEUE_CB_SIZE (TFD_CMD_SLOTS )); +cpu_to_le16 (TFD_QUEUE_CB_SIZE (cmdq_size)); ctxt_info_gen3->mcr_size =cpu_to_le16 (RX_QUEUE_CB_SIZE (MQ_RX_TABLE_SIZE ));
@@ -175,8 +176,14 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,iwl_write64 (trans,CSR_IML_DATA_ADDR , trans_pcie->iml_dma_addr);iwl_write32 (trans,CSR_IML_SIZE_ADDR , trans->iml_len); -iwl_set_bit (trans,CSR_CTXT_INFO_BOOT_CTRL ,CSR_AUTO_FUNC_BOOT_ENA ); -iwl_set_bit (trans,CSR_GP_CNTRL ,CSR_AUTO_FUNC_INIT ); + +if (trans->cfg->device_family >=IWL_DEVICE_FAMILY_AX210 ) { +iwl_write_prph (trans,UREG_CPU_INIT_RUN ,1 ); + }else { +iwl_set_bit (trans,CSR_CTXT_INFO_BOOT_CTRL , +CSR_AUTO_FUNC_BOOT_ENA ); +iwl_set_bit (trans,CSR_GP_CNTRL ,CSR_AUTO_FUNC_INIT ); + }return 0 ; }
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +8 -0
@@ -948,6 +948,14 @@ static const struct pci_device_id iwl_hw_card_ids[] = { {IWL_PCI_DEVICE(0x1a56, 0x1653, killer1650w_2ax_cfg)}, {IWL_PCI_DEVICE(0x1a56, 0x1654, killer1650x_2ax_cfg)}, + {IWL_PCI_DEVICE(0x2725, 0x0090, iwlax210_2ax_cfg_so_hr_a0)}, + {IWL_PCI_DEVICE(0x7A70, 0x0090, iwlax210_2ax_cfg_so_hr_a0)}, + {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax210_2ax_cfg_so_hr_a0)}, + {IWL_PCI_DEVICE(0x2725, 0x0020, iwlax210_2ax_cfg_so_hr_a0)}, + {IWL_PCI_DEVICE(0x2725, 0x0310, iwlax210_2ax_cfg_so_hr_a0)}, + {IWL_PCI_DEVICE(0x2725, 0x0A10, iwlax210_2ax_cfg_so_hr_a0)}, + {IWL_PCI_DEVICE(0x2725, 0x00B0, iwlax210_2ax_cfg_so_hr_a0)}, + #endif /* CONFIG_IWLMVM */ {0}
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +13 -2
@@ -247,7 +247,7 @@ static void iwl_pcie_rxq_inc_wr_ptr(struct iwl_trans *trans, } rxq->write_actual =round_down (rxq->write,8 ); -if (trans->cfg->device_family >=IWL_DEVICE_FAMILY_22560 ) +if (trans->cfg->device_family ==IWL_DEVICE_FAMILY_22560 )iwl_write32 (trans,HBUS_TARG_WRPTR , (rxq->write_actual | ((FIRST_RX_QUEUE + rxq->id) <<16 )));
@@ -2133,7 +2133,7 @@ irqreturn_t iwl_pcie_irq_msix_handler(int irq, void *dev_id) } } -if (trans->cfg->device_family >=IWL_DEVICE_FAMILY_22560 && +if (trans->cfg->device_family ==IWL_DEVICE_FAMILY_22560 && inta_hw &MSIX_HW_INT_CAUSES_REG_IPC ) {/* Reflect IML transfer status */ int res =iwl_read32 (trans,CSR_IML_RESP_ADDR );
@@ -2152,6 +2152,17 @@ irqreturn_t iwl_pcie_irq_msix_handler(int irq, void *dev_id) isr_stats->wakeup++; } +if (inta_hw &MSIX_HW_INT_CAUSES_REG_IML ) { +/* Reflect IML transfer status */ +int res =iwl_read32 (trans,CSR_IML_RESP_ADDR ); + +IWL_DEBUG_ISR (trans,"IML transfer status: %d\n" , res); +if (res ==IWL_IMAGE_RESP_FAIL ) { + isr_stats->sw++; +iwl_pcie_irq_handle_error (trans); + } + } +/* Chip got too hot and stopped itself */ if (inta_hw &MSIX_HW_INT_CAUSES_REG_CT_KILL ) {IWL_ERR (trans,"Microcode CT kill error detected.\n" );
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c +4 -3
@@ -171,7 +171,7 @@ void _iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans, bool low_power) }iwl_pcie_ctxt_info_free_paging (trans); -if (trans->cfg->device_family ==IWL_DEVICE_FAMILY_22560 ) +if (trans->cfg->device_family >=IWL_DEVICE_FAMILY_22560 )iwl_pcie_ctxt_info_gen3_free (trans);else iwl_pcie_ctxt_info_free (trans);
@@ -234,6 +234,7 @@ void iwl_trans_pcie_gen2_stop_device(struct iwl_trans *trans, bool low_power)static int iwl_pcie_gen2_nic_init (struct iwl_trans *trans) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); +int queue_size =max_t (u32,TFD_CMD_SLOTS , trans->cfg->min_txq_size);/* TODO: most of the logic can be removed in A0 - but not in Z0 */ spin_lock (&trans_pcie->irq_lock);
@@ -247,7 +248,7 @@ static int iwl_pcie_gen2_nic_init(struct iwl_trans *trans)return -ENOMEM ;/* Allocate or reset and init all Tx and Command queues */ -if (iwl_pcie_gen2_tx_init (trans, trans_pcie->cmd_queue,TFD_CMD_SLOTS )) +if (iwl_pcie_gen2_tx_init (trans, trans_pcie->cmd_queue, queue_size))return -ENOMEM ;/* enable shadow regs in HW */
@@ -332,7 +333,7 @@ int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans, goto out; } -if (trans->cfg->device_family ==IWL_DEVICE_FAMILY_22560 ) +if (trans->cfg->device_family >=IWL_DEVICE_FAMILY_22560 ) ret =iwl_pcie_ctxt_info_gen3_init (trans, fw);else ret =iwl_pcie_ctxt_info_init (trans, fw);
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +14 -3
@@ -1094,6 +1094,7 @@ static struct iwl_causes_list causes_list[] = { {MSIX_FH_INT_CAUSES_FH_ERR, CSR_MSIX_FH_INT_MASK_AD, 0x5}, {MSIX_HW_INT_CAUSES_REG_ALIVE, CSR_MSIX_HW_INT_MASK_AD, 0x10}, {MSIX_HW_INT_CAUSES_REG_WAKEUP, CSR_MSIX_HW_INT_MASK_AD, 0x11}, + {MSIX_HW_INT_CAUSES_REG_IML, CSR_MSIX_HW_INT_MASK_AD, 0x12}, {MSIX_HW_INT_CAUSES_REG_CT_KILL, CSR_MSIX_HW_INT_MASK_AD, 0x16}, {MSIX_HW_INT_CAUSES_REG_RF_KILL, CSR_MSIX_HW_INT_MASK_AD, 0x17}, {MSIX_HW_INT_CAUSES_REG_PERIODIC, CSR_MSIX_HW_INT_MASK_AD, 0x18},
@@ -1126,7 +1127,7 @@ static void iwl_pcie_map_non_rx_causes(struct iwl_trans *trans)struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);int val = trans_pcie->def_irq |MSIX_NON_AUTO_CLEAR_CAUSE ;int i, arr_size = - (trans->cfg->device_family <IWL_DEVICE_FAMILY_22560 ) ? + (trans->cfg->device_family !=IWL_DEVICE_FAMILY_22560 ) ?ARRAY_SIZE (causes_list) :ARRAY_SIZE (causes_list_v2);/*
@@ -1136,7 +1137,7 @@ static void iwl_pcie_map_non_rx_causes(struct iwl_trans *trans)*/ for (i =0 ; i < arr_size; i++) {struct iwl_causes_list *causes = - (trans->cfg->device_family <IWL_DEVICE_FAMILY_22560 ) ? + (trans->cfg->device_family !=IWL_DEVICE_FAMILY_22560 ) ? causes_list : causes_list_v2;iwl_write8 (trans,CSR_MSIX_IVAR (causes[i].addr), val);
@@ -3503,7 +3504,17 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,#if IS_ENABLED (CONFIG_IWLMVM ) trans->hw_rf_id =iwl_read32 (trans,CSR_HW_RF_ID ); -if (cfg == &iwl22560_2ax_cfg_hr) { +if (cfg == &iwlax210_2ax_cfg_so_hr_a0) { +if (trans->hw_rev ==CSR_HW_REV_TYPE_TY ) { + trans->cfg = &iwlax210_2ax_cfg_ty_gf_a0; + }else if (CSR_HW_RF_ID_TYPE_CHIP_ID (trans->hw_rf_id) == +CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_JF )) { + trans->cfg = &iwlax210_2ax_cfg_so_jf_a0; + }else if (CSR_HW_RF_ID_TYPE_CHIP_ID (trans->hw_rf_id) == +CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_GF )) { + trans->cfg = &iwlax210_2ax_cfg_so_gf_a0; + } + }else if (cfg == &iwl22560_2ax_cfg_hr) {if (CSR_HW_RF_ID_TYPE_CHIP_ID (trans->hw_rf_id) ==CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HR )) { trans->cfg = &iwl22560_2ax_cfg_hr;
drivers/net/wireless/intel/iwlwifi/pcie/tx.c +10 -2
@@ -995,7 +995,11 @@ static int iwl_pcie_tx_alloc(struct iwl_trans *trans) txq_id++) {bool cmd_queue = (txq_id == trans_pcie->cmd_queue); - slots_num = cmd_queue ?TFD_CMD_SLOTS :TFD_TX_CMD_SLOTS ; +if (cmd_queue) + slots_num =max_t (u32,TFD_CMD_SLOTS , + trans->cfg->min_txq_size); +else + slots_num =TFD_TX_CMD_SLOTS ; trans_pcie->txq[txq_id] = &trans_pcie->txq_memory[txq_id]; ret =iwl_pcie_txq_alloc (trans, trans_pcie->txq[txq_id], slots_num, cmd_queue);
@@ -1044,7 +1048,11 @@ int iwl_pcie_tx_init(struct iwl_trans *trans) txq_id++) {bool cmd_queue = (txq_id == trans_pcie->cmd_queue); - slots_num = cmd_queue ?TFD_CMD_SLOTS :TFD_TX_CMD_SLOTS ; +if (cmd_queue) + slots_num =max_t (u32,TFD_CMD_SLOTS , + trans->cfg->min_txq_size); +else + slots_num =TFD_TX_CMD_SLOTS ; ret =iwl_pcie_txq_init (trans, trans_pcie->txq[txq_id], slots_num, cmd_queue);if (ret) {
Signature · 1 line
2.20.1
PATCH 14/17 iwlwifi: add FW recovery flow
In reply to Luca CoelhoFrom: Mordechay Goodstein <[email protected]>
Add new API and TLV for the ability to send commands in the beginning and end of reset flow.
The full flow of recovery is:
1. While loading FW, get address (from the TLV) of target buffer to read in case of reset
2. If an error/assert happens read the address data from step 1.
3. Reset the HW and load the FW.
4. Send the data read in step 2.
5. Add station keys
6. Send notification to FW that reset flow is done.
The main use of the recovery flow is for support in PN/SN recovery when offloaded
--- .../net/wireless/intel/iwlwifi/fw/api/alive.h | 20 +++++++ .../wireless/intel/iwlwifi/fw/api/commands.h | 5 ++ drivers/net/wireless/intel/iwlwifi/fw/file.h | 1 + drivers/net/wireless/intel/iwlwifi/fw/img.h | 2 + drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 14 +++++ drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 54 +++++++++++++++++++ .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 + drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 18 +++++++ 9 files changed, 118 insertions(+)
drivers/net/wireless/intel/iwlwifi/fw/api/alive.h +20 -0
@@ -197,4 +197,24 @@ struct iwl_card_state_notif { __le32 flags; } __packed;/* CARD_STATE_NTFY_API_S_VER_1 */ +/** +* enum iwl_error_recovery_flags - flags for error recovery cmd +* @ERROR_RECOVERY_UPDATE_DB: update db from blob sent +* @ERROR_RECOVERY_END_OF_RECOVERY: end of recovery +*/ +enum iwl_error_recovery_flags { +ERROR_RECOVERY_UPDATE_DB =BIT (0 ), +ERROR_RECOVERY_END_OF_RECOVERY =BIT (1 ), +}; + +/** +* struct iwl_fw_error_recovery_cmd - recovery cmd sent upon assert +* @flags: &enum iwl_error_recovery_flags +* @buf_size: db buffer size in bytes +*/ +struct iwl_fw_error_recovery_cmd { +__le32 flags; +__le32 buf_size; +} __packed;/* ERROR_RECOVERY_CMD_HDR_API_S_VER_1 */ +#endif /* __iwl_fw_api_alive_h__ */
drivers/net/wireless/intel/iwlwifi/fw/api/commands.h +5 -0
@@ -643,6 +643,11 @@ enum iwl_system_subcmd_ids {* @INIT_EXTENDED_CFG_CMD: &struct iwl_init_extended_cfg_cmd */ INIT_EXTENDED_CFG_CMD =0x03 , + +/** +* @FW_ERROR_RECOVERY_CMD: &struct iwl_fw_error_recovery_cmd +*/ + FW_ERROR_RECOVERY_CMD = 0x7, };#endif /* __iwl_fw_api_commands_h__ */
drivers/net/wireless/intel/iwlwifi/fw/file.h +1 -0
@@ -145,6 +145,7 @@ enum iwl_ucode_tlv_type {IWL_UCODE_TLV_IML =52 ,IWL_UCODE_TLV_UMAC_DEBUG_ADDRS =54 ,IWL_UCODE_TLV_LMAC_DEBUG_ADDRS =55 , +IWL_UCODE_TLV_FW_RECOVERY_INFO =57 ,IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION =IWL_UCODE_INI_TLV_GROUP |0x1 ,IWL_UCODE_TLV_TYPE_HCMD =IWL_UCODE_INI_TLV_GROUP |0x2 , IWL_UCODE_TLV_TYPE_REGIONS = IWL_UCODE_INI_TLV_GROUP | 0x3,
drivers/net/wireless/intel/iwlwifi/fw/img.h +2 -0
@@ -105,6 +105,8 @@ struct iwl_ucode_capabilities {u32 n_scan_channels;u32 standard_phy_calibration_size;u32 flags; +u32 error_log_addr; +u32 error_log_size;unsigned long _api[BITS_TO_LONGS (NUM_IWL_UCODE_TLV_API )];unsigned long _capa[BITS_TO_LONGS (NUM_IWL_UCODE_TLV_CAPA )]; };
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +14 -0
@@ -1088,6 +1088,20 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,return -ENOMEM ;break ; } +case IWL_UCODE_TLV_FW_RECOVERY_INFO : { +struct { +__le32 buf_addr; +__le32 buf_size; + } *recov_info = (void *)tlv_data; + +if (tlv_len !=sizeof (*recov_info)) + goto invalid_tlv_len; + capa->error_log_addr = +le32_to_cpu (recov_info->buf_addr); + capa->error_log_size = +le32_to_cpu (recov_info->buf_size); + } +break ;case IWL_UCODE_TLV_UMAC_DEBUG_ADDRS : {struct iwl_umac_debug_addrs *dbg_ptrs = (void *)tlv_data;
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +54 -0
66 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +2 -0
@@ -1326,6 +1326,8 @@ static void iwl_mvm_restart_complete(struct iwl_mvm *mvm)/* allow transport/FW low power modes */ iwl_mvm_unref (mvm,IWL_MVM_REF_UCODE_DOWN ); +iwl_mvm_send_recovery_cmd (mvm,ERROR_RECOVERY_END_OF_RECOVERY ); +/* * If we have TDLS peers, remove them. We don't know the last seqno/PN * of packets the FW sent out, so we must reconnect.
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +2 -0
@@ -1014,6 +1014,7 @@ struct iwl_mvm {/* -1 for always, 0 for never, >0 for that many times */ s8 fw_restart; +u8 *error_recovery_buf;#ifdef CONFIG_IWLWIFI_LEDS struct led_classdev led;
@@ -1657,6 +1658,7 @@ void iwl_mvm_rx_queue_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,void iwl_mvm_rx_tx_cmd (struct iwl_mvm *mvm,struct iwl_rx_cmd_buffer *rxb);void iwl_mvm_mfu_assert_dump_notif (struct iwl_mvm *mvm,struct iwl_rx_cmd_buffer *rxb); +void iwl_mvm_send_recovery_cmd (struct iwl_mvm *mvm,u32 flags);void iwl_mvm_rx_ba_notif (struct iwl_mvm *mvm,struct iwl_rx_cmd_buffer *rxb);void iwl_mvm_rx_ant_coupling_notif (struct iwl_mvm *mvm,struct iwl_rx_cmd_buffer *rxb);
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +18 -0
@@ -422,6 +422,7 @@ static const struct iwl_hcmd_names iwl_mvm_legacy_names[] = {static const struct iwl_hcmd_names iwl_mvm_system_names[] = {HCMD_NAME (SHARED_MEM_CFG_CMD ),HCMD_NAME (INIT_EXTENDED_CFG_CMD ), +HCMD_NAME (FW_ERROR_RECOVERY_CMD ), };/* Please keep this array *SORTED* by hex value.
@@ -921,6 +922,9 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode)kfree (mvm->mcast_filter_cmd); mvm->mcast_filter_cmd =NULL ; +kfree (mvm->error_recovery_buf); + mvm->error_recovery_buf =NULL ; +#if defined(CONFIG_PM_SLEEP ) && defined(CONFIG_IWLWIFI_DEBUGFS )kfree (mvm->d3_resume_sram);#endif
@@ -1301,6 +1305,20 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)/* don't let the transport/FW power down */ iwl_mvm_ref (mvm,IWL_MVM_REF_UCODE_DOWN ); +if (mvm->fw->ucode_capa.error_log_size) { +u32 src_size = mvm->fw->ucode_capa.error_log_size; +u32 src_addr = mvm->fw->ucode_capa.error_log_addr; +u8 *recover_buf =kzalloc (src_size,GFP_ATOMIC ); + +if (recover_buf) { + mvm->error_recovery_buf = recover_buf; +iwl_trans_read_mem_bytes (mvm->trans, + src_addr, + recover_buf, + src_size); + } + } +if (fw_error && mvm->fw_restart >0 ) mvm->fw_restart--;set_bit (IWL_MVM_STATUS_HW_RESTART_REQUESTED , &mvm->status);
Signature · 1 line
2.20.1
PATCH 15/17 iwlwifi: do not fail on large amount of channels
In reply to Luca CoelhoFrom: Shaul Triebitz <[email protected]>
Until supporting UHB (ultra high band) channels for devices AX210, do not fail if number of channels reported by firmware is greater than NL80211_MAX_SUPP_REG_RULES. The Driver in that case will use only the non-UHB channels.
--- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +3 -3
@@ -1102,12 +1102,12 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,int max_num_ch = cfg->nvm_type ==IWL_NVM_EXT ?IWL_NVM_NUM_CHANNELS_EXT :IWL_NVM_NUM_CHANNELS ; -if (WARN_ON_ONCE (num_of_ch >NL80211_MAX_SUPP_REG_RULES )) -return ERR_PTR (-EINVAL ); -if (WARN_ON (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 ); +IWL_DEBUG_DEV (dev,IWL_DL_LAR ,"building regdom for %d channels\n" , num_of_ch);
Signature · 1 line
2.20.1
PATCH 16/17 iwlwifi: mvm: Fix possible NULL pointer dereference
In reply to Luca CoelhoFrom: Avraham Stern <[email protected]>
iwl_mvm_te_clear_data() is called for cleanup in case sending the HOT_SPOT_CMD failed. However, in case sending the command caused a fw error and restart (e.g. if the command is not supported) then the te_data pointer may no longer be valid, which leads to a NULL pointer dereference.
Fix it by checking that the te_data pointer is not NULL before dereferencing it.
--- drivers/net/wireless/intel/iwlwifi/mvm/time-event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +1 -1
@@ -85,7 +85,7 @@ void iwl_mvm_te_clear_data(struct iwl_mvm *mvm, {lockdep_assert_held (&mvm->time_event_lock); -if (!te_data->vif) +if (!te_data || !te_data->vif)return ;list_del (&te_data->list);
Signature · 1 line
2.20.1
PATCH 17/17 iwlwifi: mvm: support beacon IE injection
In reply to Luca CoelhoFrom: Sara Sharon <[email protected]>
This is useful for automated tests.
--- .../net/wireless/intel/iwlwifi/mvm/debugfs.c | 106 ++++++++++++++++++ .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 22 ++-- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 11 ++ 3 files changed, 128 insertions(+), 11 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +106 -0
@@ -1188,6 +1188,108 @@ static ssize_t iwl_dbgfs_inject_packet_write(struct iwl_mvm *mvm,return ret ?: count; } +static int _iwl_dbgfs_inject_beacon_ie (struct iwl_mvm *mvm,char *bin,int len) +{ +struct ieee80211_vif *vif; +struct iwl_mvm_vif *mvmvif; +struct sk_buff *beacon; +struct ieee80211_tx_info *info; +struct iwl_mac_beacon_cmd beacon_cmd = {}; +u8 rate; +u16 flags; +int i; + + len /=2 ; + +/* Element len should be represented by u8 */ +if (len >=U8_MAX ) +return -EINVAL ; + +if (!iwl_mvm_firmware_running (mvm)) +return -EIO ; + +if (!iwl_mvm_has_new_tx_api (mvm) && + !fw_has_api (&mvm->fw->ucode_capa, +IWL_UCODE_TLV_API_NEW_BEACON_TEMPLATE )) +return -EINVAL ; + +rcu_read_lock (); + +for (i =0 ; i <NUM_MAC_INDEX_DRIVER ; i++) { + vif =iwl_mvm_rcu_dereference_vif_id (mvm, i, true); +if (!vif) +continue ; + +if (vif->type ==NL80211_IFTYPE_AP ) +break ; + } + +if (i ==NUM_MAC_INDEX_DRIVER || !vif) + goto out_err; + + mvm->hw->extra_beacon_tailroom = len; + + beacon =ieee80211_beacon_get_template (mvm->hw, vif,NULL ); +if (!beacon) + goto out_err; + +if (len &&hex2bin (skb_put_zero (beacon, len), bin, len)) { +dev_kfree_skb (beacon); + goto out_err; + } + + mvmvif =iwl_mvm_vif_from_mac80211 (vif); + info =IEEE80211_SKB_CB (beacon); + rate =iwl_mvm_mac_ctxt_get_lowest_rate (info, vif); + flags =iwl_mvm_mac80211_idx_to_hwrate (rate); + +if (rate ==IWL_FIRST_CCK_RATE ) + flags |=IWL_MAC_BEACON_CCK ; + + beacon_cmd.flags =cpu_to_le16 (flags); + beacon_cmd.byte_cnt =cpu_to_le16 ((u16 )beacon->len); + beacon_cmd.template_id =cpu_to_le32 ((u32 )mvmvif->id); + +iwl_mvm_mac_ctxt_set_tim (mvm, &beacon_cmd.tim_idx, + &beacon_cmd.tim_size, + beacon->data, beacon->len); + +mutex_lock (&mvm->mutex); +iwl_mvm_mac_ctxt_send_beacon_cmd (mvm, beacon, &beacon_cmd, +sizeof (beacon_cmd)); +mutex_unlock (&mvm->mutex); + +dev_kfree_skb (beacon); + +rcu_read_unlock (); +return 0 ; + +out_err: +rcu_read_unlock (); +return -EINVAL ; +} + +static ssize_t iwl_dbgfs_inject_beacon_ie_write (struct iwl_mvm *mvm, +char *buf,size_t count, +loff_t *ppos) +{ +int ret =_iwl_dbgfs_inject_beacon_ie (mvm, buf, count); + + mvm->hw->extra_beacon_tailroom =0 ; +return ret ?: count; +} + +static ssize_t iwl_dbgfs_inject_beacon_ie_restore_write (struct iwl_mvm *mvm, +char *buf, +size_t count, +loff_t *ppos) +{ +int ret =_iwl_dbgfs_inject_beacon_ie (mvm,NULL ,0 ); + + mvm->hw->extra_beacon_tailroom =0 ; +return ret ?: count; +} +static ssize_t iwl_dbgfs_fw_dbg_conf_read (struct file *file,char __user *user_buf,size_t count,loff_t *ppos)
@@ -1806,6 +1908,8 @@ MVM_DEBUGFS_WRITE_FILE_OPS(max_amsdu_len, 8);MVM_DEBUGFS_WRITE_FILE_OPS (indirection_tbl, (IWL_RSS_INDIRECTION_TABLE_SIZE *2 ));MVM_DEBUGFS_WRITE_FILE_OPS (inject_packet,512 ); +MVM_DEBUGFS_WRITE_FILE_OPS (inject_beacon_ie,512 ); +MVM_DEBUGFS_WRITE_FILE_OPS (inject_beacon_ie_restore,512 );MVM_DEBUGFS_READ_FILE_OPS (uapsd_noagg_bssids);
@@ -2007,6 +2111,8 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)MVM_DEBUGFS_ADD_FILE (send_echo_cmd, mvm->debugfs_dir,0200 );MVM_DEBUGFS_ADD_FILE (indirection_tbl, mvm->debugfs_dir,0200 );MVM_DEBUGFS_ADD_FILE (inject_packet, mvm->debugfs_dir,0200 ); +MVM_DEBUGFS_ADD_FILE (inject_beacon_ie, mvm->debugfs_dir,0200 ); +MVM_DEBUGFS_ADD_FILE (inject_beacon_ie_restore, mvm->debugfs_dir,0200 );#ifdef CONFIG_ACPI MVM_DEBUGFS_ADD_FILE (sar_geo_profile, dbgfs_dir,0400 );#endif
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +11 -11
@@ -811,9 +811,9 @@ static int iwl_mvm_mac_ctxt_cmd_p2p_device(struct iwl_mvm *mvm,return iwl_mvm_mac_ctxt_send_cmd (mvm, &cmd); } -static void iwl_mvm_mac_ctxt_set_tim (struct iwl_mvm *mvm, -__le32 *tim_index,__le32 *tim_size, -u8 *beacon,u32 frame_size) +void iwl_mvm_mac_ctxt_set_tim (struct iwl_mvm *mvm, +__le32 *tim_index,__le32 *tim_size, +u8 *beacon,u32 frame_size) {u32 tim_idx;struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)beacon;
@@ -853,8 +853,8 @@ static u32 iwl_mvm_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size)return ie - beacon; } -static u8 iwl_mvm_mac_ctxt_get_lowest_rate (struct ieee80211_tx_info *info, -struct ieee80211_vif *vif) +u8 iwl_mvm_mac_ctxt_get_lowest_rate (struct ieee80211_tx_info *info, +struct ieee80211_vif *vif) {u8 rate;
@@ -904,9 +904,9 @@ static void iwl_mvm_mac_ctxt_set_tx(struct iwl_mvm *mvm, } -static int iwl_mvm_mac_ctxt_send_beacon_cmd (struct iwl_mvm *mvm, -struct sk_buff *beacon, -void *data,int len) +int iwl_mvm_mac_ctxt_send_beacon_cmd (struct iwl_mvm *mvm, +struct sk_buff *beacon, +void *data,int len) {struct iwl_host_cmd cmd = { .id =BEACON_TEMPLATE_CMD ,
@@ -1009,9 +1009,9 @@ static int iwl_mvm_mac_ctxt_send_beacon_v9(struct iwl_mvm *mvm, sizeof(beacon_cmd)); } -static int iwl_mvm_mac_ctxt_send_beacon (struct iwl_mvm *mvm, -struct ieee80211_vif *vif, -struct sk_buff *beacon) +int iwl_mvm_mac_ctxt_send_beacon (struct iwl_mvm *mvm, +struct ieee80211_vif *vif, +struct sk_buff *beacon) {if (WARN_ON (!beacon))return -EINVAL ;
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +11 -0
@@ -1693,6 +1693,17 @@ int iwl_mvm_mac_ctxt_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,int iwl_mvm_mac_ctxt_remove (struct iwl_mvm *mvm,struct ieee80211_vif *vif);int iwl_mvm_mac_ctxt_beacon_changed (struct iwl_mvm *mvm,struct ieee80211_vif *vif); +int iwl_mvm_mac_ctxt_send_beacon (struct iwl_mvm *mvm, +struct ieee80211_vif *vif, +struct sk_buff *beacon); +int iwl_mvm_mac_ctxt_send_beacon_cmd (struct iwl_mvm *mvm, +struct sk_buff *beacon, +void *data,int len); +u8 iwl_mvm_mac_ctxt_get_lowest_rate (struct ieee80211_tx_info *info, +struct ieee80211_vif *vif); +void iwl_mvm_mac_ctxt_set_tim (struct iwl_mvm *mvm, +__le32 *tim_index,__le32 *tim_size, +u8 *beacon,u32 frame_size);void iwl_mvm_rx_beacon_notif (struct iwl_mvm *mvm,struct iwl_rx_cmd_buffer *rxb); void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm,
Signature · 1 line
2.20.1