iwlwifi: updates intended for v5.1 2019-01-30
cover iwlwifi: updates intended for v5.1 2019-01-30
From: Luca Coelho <[email protected]>
Hi,
Here's the fifth 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;
* Support for new FW version 44;
* A couple of new FW API changes;
* A bunch of fixes for static analyzer reported issues;
* General bugfixes;
* Other cleanups and small fixes;
As usual, I'm pushing this to a pending branch, for kbuild bot, and will send a pull-request later.
Please review.
Cheers,
Luca.
Emmanuel Grumbach (2):
iwlwifi: mvm: support new format for the beacon notification
iwlwifi: mvm: fix AP mode in WEP
Luca Coelho (3):
iwlwifi: bump FW API to 44 for 9000 and 22000 series
iwlwifi: dvm: fix some fall through warnings
iwlwifi: mvm: add fall through comments where needed
Sara Sharon (2):
iwlwifi: mvm: simplify some return conditions
iwlwifi: mvm: support CHANNEL_SWITCH_TIME_EVENT_CMD command
Shahar S Matityahu (9):
iwlwifi dbg_ini: update ini structs doc
iwlwifi: dbg_ini: fix iwl_fw_ini_buffer_location field enum bad naming
iwlwifi: dbg_ini: give better naming to region struct fields
iwlwifi: fix bad dma handling in page_mem dumping flow
iwlwifi: differentiate between alive timeout and alive flow failure
iwlwifi: dbg_ini: update ini triggers enum
iwlwifi: dbg_ini: update max region id num to support 64 regions
iwlwifi: Fix pre operational dumping flows
iwlwifi: fix fallthrough comment in iwl-dnt-cfg.c
YueHaibing (1):
iwlwifi: mvm: remove duplicated include from ops.c
.../net/wireless/intel/iwlwifi/cfg/22000.c | 2 +- drivers/net/wireless/intel/iwlwifi/cfg/9000.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/rx.c | 6 +- drivers/net/wireless/intel/iwlwifi/dvm/scan.c | 3 +- .../wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 140 ++++++++--------- .../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 27 ++++ .../net/wireless/intel/iwlwifi/fw/api/tx.h | 18 ++- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 110 ++++++++------ drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 5 +- .../wireless/intel/iwlwifi/fw/error-dump.h | 7 +- drivers/net/wireless/intel/iwlwifi/fw/file.h | 5 + drivers/net/wireless/intel/iwlwifi/fw/init.c | 3 + .../net/wireless/intel/iwlwifi/fw/runtime.h | 1 - .../net/wireless/intel/iwlwifi/iwl-trans.h | 13 ++ drivers/net/wireless/intel/iwlwifi/mvm/coex.c | 7 +- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 9 +- drivers/net/wireless/intel/iwlwifi/mvm/led.c | 3 + .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 91 +++++++---- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 102 +++++++++---- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 15 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 6 +- .../net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | 1 + drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 11 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 141 ++++++++++-------- drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 3 + .../net/wireless/intel/iwlwifi/pcie/trans.c | 4 - 28 files changed, 464 insertions(+), 275 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/17 iwlwifi: bump FW API to 44 for 9000 and 22000 series
From: Luca Coelho <[email protected]>
Start supporting API version 44 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 43 +#define IWL_22000_UCODE_API_MAX 44/* 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 43 +#define IWL9000_UCODE_API_MAX 44/* Lowest firmware API version supported */ #define IWL9000_UCODE_API_MIN 30
Signature · 1 line
2.20.1
PATCH 2/17 iwlwifi dbg_ini: update ini structs doc
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
update ini struct documentation to the structs being used in the FW
--- drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h +5 -5
@@ -155,20 +155,20 @@ struct iwl_fw_ini_region_cfg { };__le32 size;__le32 start_addr[]; -} __packed;/* FW_INI_REGION_CONFIG_S */ +} __packed;/* FW_DEBUG_TLV_REGION_CONFIG_S */ /** * struct iwl_fw_ini_region_tlv - (IWL_FW_INI_TLV_TYPE_REGION_CFG) * DUMP sections define IDs and triggers that use those IDs TLV * @header: header * @num_regions: how many different region section and IDs are coming next -* @iwl_fw_ini_dump dump_config: list of dump configurations +* @region_config: list of dump configurations */ struct iwl_fw_ini_region_tlv {struct iwl_fw_ini_header header;__le32 num_regions;struct iwl_fw_ini_region_cfg region_config[]; -} __packed;/* FW_INI_REGION_CFG_S */ +} __packed;/* FW_DEBUG_TLV_REGIONS_S_VER_1 */ /** * struct iwl_fw_ini_trigger - (IWL_FW_INI_TLV_TYPE_DUMP_CFG)
@@ -196,7 +196,7 @@ struct iwl_fw_ini_trigger {__le32 trigger_data;__le32 num_regions;__le32 data[]; -} __packed;/* FW_INI_TRIGGER_CONFIG_S */ +} __packed;/* FW_TLV_DEBUG_TRIGGER_CONFIG_S */ /** * struct iwl_fw_ini_trigger_tlv - (IWL_FW_INI_TLV_TYPE_TRIGGERS_CFG)
@@ -210,7 +210,7 @@ struct iwl_fw_ini_trigger_tlv {struct iwl_fw_ini_header header;__le32 num_triggers;struct iwl_fw_ini_trigger trigger_config[]; -} __packed;/* FW_INI_TRIGGER_CFG_S */ +} __packed;/* FW_TLV_DEBUG_TRIGGERS_S_VER_1 */ /** * enum iwl_fw_ini_trigger_id
Signature · 1 line
2.20.1
PATCH 3/17 iwlwifi: dbg_ini: fix iwl_fw_ini_buffer_location field enum bad naming
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
change IWL_FW_INI_LOCATION_SRAM_INVALID into IWL_FW_INI_LOCATION_INVALID
--- drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h +1 -1
@@ -349,7 +349,7 @@ enum iwl_fw_ini_allocation_id {* @IWL_FW_INI_LOCATION_DRAM_PATH: DRAM location */ enum iwl_fw_ini_buffer_location { -IWL_FW_INI_LOCATION_SRAM_INVALID , +IWL_FW_INI_LOCATION_INVALID ,IWL_FW_INI_LOCATION_SRAM_PATH ,IWL_FW_INI_LOCATION_DRAM_PATH , };/* FW_INI_BUFFER_LOCATION_E_VER_1 */
Signature · 1 line
2.20.1
PATCH 4/17 iwlwifi: dbg_ini: give better naming to region struct fields
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
Some of the region struct fields have misleading naming change those fields to have an informative naming
--- .../wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 12 ++++++----- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 21 ++++++++++--------- 2 files changed, 18 insertions(+), 15 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h +7 -5
@@ -138,11 +138,13 @@ struct iwl_fw_ini_debug_flow_tlv {* @region_id: ID of this dump configuration * @region_type: &enum iwl_fw_ini_region_type * @num_regions: amount of regions in the address array. -* @allocation_id: For DRAM type field substitutes for allocation_id. * @name_len: name length * @name: file name to use for this region -* @size: size of the data, in bytes.(unused for IWL_FW_INI_REGION_DRAM_BUFFER) -* @start_addr: array of addresses. (unused for IWL_FW_INI_REGION_DRAM_BUFFER) +* @num_of_range: the amount of ranges in the region. +* @allocation_id: For DRAM type field substitutes for allocation_id +* @range_data_size: size of the data to read per range, in bytes. +* @start_addr: array of addresses. for type IWL_FW_INI_REGION_DRAM_BUFFER, +* 1 entry. For any other case, num_of_ranges entries. */ struct iwl_fw_ini_region_cfg {__le32 region_id;
@@ -150,10 +152,10 @@ struct iwl_fw_ini_region_cfg {__le32 name_len;u8 name[IWL_FW_INI_MAX_NAME ];union { -__le32 num_regions; +__le32 num_of_ranges;__le32 allocation_id; }; -__le32 size; +__le32 range_data_size;__le32 start_addr[]; } __packed;/* FW_DEBUG_TLV_REGION_CONFIG_S */
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +11 -10
@@ -1065,7 +1065,7 @@ static void iwl_dump_prph_ini(struct iwl_trans *trans, {struct iwl_fw_error_dump_prph *prph;unsigned long flags; -u32 i, size =le32_to_cpu (reg->num_regions); +u32 i, size =le32_to_cpu (reg->num_of_ranges);IWL_DEBUG_INFO (trans,"WRT PRPH dump\n" );
@@ -1074,7 +1074,7 @@ static void iwl_dump_prph_ini(struct iwl_trans *trans,for (i =0 ; i < size; i++) { (*data)->type =cpu_to_le32 (IWL_FW_ERROR_DUMP_PRPH ); - (*data)->len =cpu_to_le32 (le32_to_cpu (reg->size) + + (*data)->len =cpu_to_le32 (le32_to_cpu (reg->range_data_size) +sizeof (*prph)); prph = (void *)(*data)->data; prph->prph_start = reg->start_addr[i];
@@ -1089,8 +1089,8 @@ static void iwl_dump_csr_ini(struct iwl_trans *trans,struct iwl_fw_error_dump_data **data, struct iwl_fw_ini_region_cfg *reg) { - int i, num = le32_to_cpu(reg->num_regions); -u32 size =le32_to_cpu (reg->size); + int i, num = le32_to_cpu(reg->num_of_ranges); +u32 size =le32_to_cpu (reg->range_data_size);IWL_DEBUG_INFO (trans,"WRT CSR dump\n" );
@@ -1133,13 +1133,13 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt,continue ; type =le32_to_cpu (reg->region_type); - num_entries =le32_to_cpu (reg->num_regions); + num_entries =le32_to_cpu (reg->num_of_ranges);switch (type) {case IWL_FW_INI_REGION_DEVICE_MEMORY : size += hdr_len +sizeof (struct iwl_fw_error_dump_named_mem ) + -le32_to_cpu (reg->size); +le32_to_cpu (reg->range_data_size);break ;case IWL_FW_INI_REGION_PERIPHERY_MAC :case IWL_FW_INI_REGION_PERIPHERY_PHY :
@@ -1165,7 +1165,7 @@ static int iwl_fw_ini_get_trigger_len(struct iwl_fw_runtime *fwrt,break ;case IWL_FW_INI_REGION_CSR : size += num_entries * - (hdr_len +le32_to_cpu (reg->size)); + (hdr_len +le32_to_cpu (reg->range_data_size));break ;case IWL_FW_INI_REGION_DRAM_BUFFER :/* Transport takes care of DRAM dumping */
@@ -1202,10 +1202,10 @@ 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 : -if (WARN_ON (le32_to_cpu (reg->num_regions) >1 )) +if (WARN_ON (le32_to_cpu (reg->num_of_ranges) >1 ))continue ;iwl_fw_dump_named_mem (fwrt, data, -le32_to_cpu (reg->size), +le32_to_cpu (reg->range_data_size),le32_to_cpu (reg->start_addr[0 ]), reg->name,le32_to_cpu (reg->name_len));
@@ -1773,7 +1773,8 @@ static void iwl_fw_dbg_update_regions(struct iwl_fw_runtime *fwrt,if (le32_to_cpu (reg->region_type) !=IWL_FW_INI_REGION_DRAM_BUFFER ) - iter +=le32_to_cpu (reg->num_regions) *sizeof (__le32); + iter +=le32_to_cpu (reg->num_of_ranges) * +sizeof (__le32); iter +=sizeof (*reg); }
Signature · 1 line
2.20.1
PATCH 5/17 iwlwifi: fix bad dma handling in page_mem dumping flow
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
Prior to gen2 we allocate the paging memory via alloc_pages which requires passing ownership on the memory between the cpu and the device using dma_sync_single_for_cpu and dma_sync_single_for_device.
Add missing dma_sync_single_for_device in iwl_dump_paging after copying the memory.
since gen2, we allocate the paging memory using dma_alloc_coherent which does not need passing ownership between the cpu and device.
Remove unneeded call to dma_sync_single_for_cpu in iwl_trans_pcie_dump_data prior to copying the memory.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 3 +++ drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +3 -0
@@ -815,6 +815,9 @@ static void iwl_dump_paging(struct iwl_fw_runtime *fwrt, DMA_BIDIRECTIONAL);memcpy (paging->data,page_address (pages),PAGING_BLOCK_SIZE ); +dma_sync_single_for_device (fwrt->trans->dev, addr, +PAGING_BLOCK_SIZE , +DMA_BIDIRECTIONAL ); (*data) =iwl_fw_error_next_data (*data); } }
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +0 -4
@@ -3277,16 +3277,12 @@ static struct iwl_trans_dump_dataif (trans->cfg->gen2 && dump_mask &BIT (IWL_FW_ERROR_DUMP_PAGING )) {for (i =0 ; i < trans_pcie->init_dram.paging_cnt; i++) {struct iwl_fw_error_dump_paging *paging; -dma_addr_t addr = - trans_pcie->init_dram.paging[i].physical;u32 page_len = trans_pcie->init_dram.paging[i].size; data->type =cpu_to_le32 (IWL_FW_ERROR_DUMP_PAGING ); data->len =cpu_to_le32 (sizeof (*paging) + page_len); paging = (void *)data->data; paging->index =cpu_to_le32 (i); -dma_sync_single_for_cpu (trans->dev, addr, page_len, -DMA_BIDIRECTIONAL );memcpy (paging->data, trans_pcie->init_dram.paging[i].block, page_len); data =iwl_fw_error_next_data (data);
Signature · 1 line
2.20.1
PATCH 6/17 iwlwifi: mvm: simplify some return conditions
In reply to Luca CoelhoFrom: Sara Sharon <[email protected]>
Simplify some return conditions found by running a semantic patch to detect unnecessary assignments to local variables.
--- drivers/net/wireless/intel/iwlwifi/mvm/coex.c | 7 ++----- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 5 ++--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 9 +++------ 3 files changed, 7 insertions(+), 14 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/coex.c +2 -5
@@ -241,7 +241,6 @@ static int iwl_mvm_bt_coex_reduced_txp(struct iwl_mvm *mvm, u8 sta_id,struct iwl_bt_coex_reduced_txp_update_cmd cmd = {};struct iwl_mvm_sta *mvmsta;u32 value; -int ret; mvmsta =iwl_mvm_sta_from_staid_protected (mvm, sta_id);if (!mvmsta)
@@ -262,10 +261,8 @@ static int iwl_mvm_bt_coex_reduced_txp(struct iwl_mvm *mvm, u8 sta_id, cmd.reduced_txp =cpu_to_le32 (value); mvmsta->bt_reduced_txpower = enable; - ret =iwl_mvm_send_cmd_pdu (mvm,BT_COEX_UPDATE_REDUCED_TXP ,CMD_ASYNC , -sizeof (cmd), &cmd); - -return ret; +return iwl_mvm_send_cmd_pdu (mvm,BT_COEX_UPDATE_REDUCED_TXP , +CMD_ASYNC ,sizeof (cmd), &cmd); }struct iwl_bt_iterator_data {
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +2 -3
@@ -1976,9 +1976,8 @@ static int iwl_mvm_scan_stop_wait(struct iwl_mvm *mvm, int type)return ret; } - ret =iwl_wait_notification (&mvm->notif_wait, &wait_scan_done,1 *HZ ); - -return ret; +return iwl_wait_notification (&mvm->notif_wait, &wait_scan_done, +1 *HZ ); }int iwl_mvm_scan_size (struct iwl_mvm *mvm)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +3 -6
@@ -314,7 +314,6 @@ static int iwl_mvm_invalidate_sta_queue(struct iwl_mvm *mvm, int queue,struct iwl_mvm_sta *mvmsta;u32 status;u8 sta_id; -int ret;if (WARN_ON (iwl_mvm_has_new_tx_api (mvm)))return -EINVAL ;
@@ -349,11 +348,9 @@ static int iwl_mvm_invalidate_sta_queue(struct iwl_mvm *mvm, int queue,/* Notify FW of queue removal from the STA queues */ status =ADD_STA_SUCCESS ; - ret =iwl_mvm_send_cmd_pdu_status (mvm,ADD_STA , -iwl_mvm_add_sta_cmd_size (mvm), - &cmd, &status); - -return ret; +return iwl_mvm_send_cmd_pdu_status (mvm,ADD_STA , +iwl_mvm_add_sta_cmd_size (mvm), + &cmd, &status); } static int iwl_mvm_disable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
Signature · 1 line
2.20.1
PATCH 7/17 iwlwifi: mvm: support CHANNEL_SWITCH_TIME_EVENT_CMD command
In reply to Luca CoelhoFrom: Sara Sharon <[email protected]>
When we do channel switch, we used to schedule time events ourselves. This was offloaded to FW. Support the new command and flow.
--- .../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 27 +++++++ drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 + .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 58 +++++++++------ .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 71 ++++++++++++++----- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 + 5 files changed, 119 insertions(+), 40 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h +27 -0
@@ -73,6 +73,10 @@ enum iwl_mac_conf_subcmd_ids {* @LOW_LATENCY_CMD: &struct iwl_mac_low_latency_cmd */ LOW_LATENCY_CMD =0x3 , +/** +* @CHANNEL_SWITCH_TIME_EVENT_CMD: &struct iwl_chan_switch_te_cmd +*/ + CHANNEL_SWITCH_TIME_EVENT_CMD = 0x4,/** * @PROBE_RESPONSE_DATA_NOTIF: &struct iwl_probe_resp_data_notif */
@@ -135,6 +139,29 @@ struct iwl_channel_switch_noa_notif {__le32 id_and_color; } __packed;/* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */ +/** +* struct iwl_chan_switch_te_cmd - Channel Switch Time Event command +* +* @mac_id: MAC ID for channel switch +* @action: action to perform, one of FW_CTXT_ACTION_* +* @tsf: beacon tsf +* @cs_count: channel switch count from CSA/eCSA IE +* @cs_delayed_bcn_count: if set to N (!= 0) GO/AP can delay N beacon intervals +* at the new channel after the channel switch, otherwise (N == 0) expect +* beacon right after the channel switch. +* @cs_mode: 1 - quiet, 0 - otherwise +* @reserved: reserved for alignment purposes +*/ +struct iwl_chan_switch_te_cmd { +__le32 mac_id; +__le32 action; +__le32 tsf; +u8 cs_count; +u8 cs_delayed_bcn_count; +u8 cs_mode; +u8 reserved; +} __packed;/* MAC_CHANNEL_SWITCH_TIME_EVENT_S_VER_2 */ +/** * struct iwl_mac_low_latency_cmd - set/clear mac to 'low-latency mode' *
drivers/net/wireless/intel/iwlwifi/fw/file.h +2 -0
@@ -333,6 +333,7 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;* @IWL_UCODE_TLV_CAPA_TLC_OFFLOAD: firmware implements rate scaling algorithm * @IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA: firmware implements quota related * @IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2: firmware implements Coex Schema 2 +* IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD: firmware supports CSA command * @IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS: firmware supports ultra high band * (6 GHz). * @IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE: extended DTS measurement
@@ -397,6 +398,7 @@ enum iwl_ucode_tlv_capa {IWL_UCODE_TLV_CAPA_TLC_OFFLOAD = (__force iwl_ucode_tlv_capa_t )43 ,IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA = (__force iwl_ucode_tlv_capa_t )44 ,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_EXTENDED_DTS_MEASURE = (__force iwl_ucode_tlv_capa_t )64 , IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS = (__force iwl_ucode_tlv_capa_t)65,
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +37 -21
79 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +52 -19
104 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +1 -0
@@ -421,6 +421,7 @@ static const struct iwl_hcmd_names iwl_mvm_system_names[] = {* Access is done through binary search */ static const struct iwl_hcmd_names iwl_mvm_mac_conf_names[] = { +HCMD_NAME (CHANNEL_SWITCH_TIME_EVENT_CMD ),HCMD_NAME (CHANNEL_SWITCH_NOA_NOTIF ), };
Signature · 1 line
2.20.1
PATCH 8/17 iwlwifi: differentiate between alive timeout and alive flow failure
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
There are two cases that can cause the alive flow to fail, an assert or a timeout.
Currently we mask any incoming asserts when we wait for alive.
Solve this by differentiating between the two cases:
1. Let the regular error handling to handle a received assert
2. Do a dump collection in the case of a timeout
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 31 +++++++++++-------- drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 2 +- .../wireless/intel/iwlwifi/fw/error-dump.h | 4 +-- .../net/wireless/intel/iwlwifi/fw/runtime.h | 1 - drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 5 +-- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 -- 6 files changed, 24 insertions(+), 21 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +18 -13
@@ -1373,29 +1373,35 @@ void iwl_fw_assert_error_dump(struct iwl_fw_runtime *fwrt) }IWL_EXPORT_SYMBOL (iwl_fw_assert_error_dump); -void iwl_fw_alive_error_dump (struct iwl_fw_runtime *fwrt) +void iwl_fw_alive_timeout_dump (struct iwl_fw_runtime *fwrt) { -struct iwl_fw_dump_desc *iwl_dump_desc_no_alive = -kmalloc (sizeof (*iwl_dump_desc_no_alive),GFP_KERNEL ); +struct iwl_fw_dump_desc *iwl_dump_desc_alive_timeout; -if (!iwl_dump_desc_no_alive) +if (test_and_set_bit (IWL_FWRT_STATUS_DUMPING , &fwrt->status))return ; - iwl_dump_desc_no_alive->trig_desc.type = -cpu_to_le32 (FW_DBG_TRIGGER_NO_ALIVE ); - iwl_dump_desc_no_alive->len =0 ; + iwl_dump_desc_alive_timeout = +kmalloc (sizeof (*iwl_dump_desc_alive_timeout),GFP_KERNEL ); +if (!iwl_dump_desc_alive_timeout) +return ; + + iwl_dump_desc_alive_timeout->trig_desc.type = +cpu_to_le32 (FW_DBG_TRIGGER_ALIVE_TIMEOUT ); + iwl_dump_desc_alive_timeout->len =0 ;if (WARN_ON (fwrt->dump.desc))iwl_fw_free_dump_desc (fwrt);IWL_WARN (fwrt,"Collecting data: trigger %d fired.\n" , -FW_DBG_TRIGGER_NO_ALIVE ); +FW_DBG_TRIGGER_ALIVE_TIMEOUT ); + +/* set STATUS_FW_ERROR to collect all memory regions. */ +set_bit (STATUS_FW_ERROR , &fwrt->trans->status); - fwrt->dump.desc = iwl_dump_desc_no_alive; + fwrt->dump.desc = iwl_dump_desc_alive_timeout;iwl_fw_error_dump (fwrt); -clear_bit (IWL_FWRT_STATUS_WAIT_ALIVE , &fwrt->status); } -IWL_EXPORT_SYMBOL (iwl_fw_alive_error_dump); +IWL_EXPORT_SYMBOL (iwl_fw_alive_timeout_dump); int iwl_fw_dbg_collect_desc(struct iwl_fw_runtime *fwrt, const struct iwl_fw_dump_desc *desc,
@@ -1418,8 +1424,7 @@ int iwl_fw_dbg_collect_desc(struct iwl_fw_runtime *fwrt, fwrt->smem_cfg.num_lmacs)return -EIO ; -if (test_and_set_bit (IWL_FWRT_STATUS_DUMPING , &fwrt->status) || -test_bit (IWL_FWRT_STATUS_WAIT_ALIVE , &fwrt->status)) +if (test_and_set_bit (IWL_FWRT_STATUS_DUMPING , &fwrt->status))return -EBUSY ;if (WARN_ON (fwrt->dump.desc))
drivers/net/wireless/intel/iwlwifi/fw/dbg.h +1 -1
@@ -435,7 +435,7 @@ static inline void iwl_fw_resume_timestamp(struct iwl_fw_runtime *fwrt) {}#endif /* CONFIG_IWLWIFI_DEBUGFS */ void iwl_fw_assert_error_dump (struct iwl_fw_runtime *fwrt); -void iwl_fw_alive_error_dump (struct iwl_fw_runtime *fwrt); +void iwl_fw_alive_timeout_dump (struct iwl_fw_runtime *fwrt);void iwl_fw_dbg_collect_sync (struct iwl_fw_runtime *fwrt);void iwl_fw_dbg_apply_point (struct iwl_fw_runtime *fwrt,enum iwl_fw_ini_apply_point apply_point);
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h +2 -2
@@ -355,7 +355,7 @@ iwl_fw_error_next_data(struct iwl_fw_error_dump_data *data)* @FW_DBG_TDLS: trigger log collection upon TDLS related events. * @FW_DBG_TRIGGER_TX_STATUS: trigger log collection upon tx status when * the firmware sends a tx reply. -* @FW_DBG_TRIGGER_NO_ALIVE: trigger log collection if alive flow fails +* @FW_DBG_TRIGGER_ALIVE_TIMEOUT: trigger log collection if alive flow timeouts */ enum iwl_fw_dbg_trigger {FW_DBG_TRIGGER_INVALID =0 ,
@@ -373,7 +373,7 @@ enum iwl_fw_dbg_trigger {FW_DBG_TRIGGER_TX_LATENCY ,FW_DBG_TRIGGER_TDLS ,FW_DBG_TRIGGER_TX_STATUS , -FW_DBG_TRIGGER_NO_ALIVE , +FW_DBG_TRIGGER_ALIVE_TIMEOUT ,/* must be last */ FW_DBG_TRIGGER_MAX,
drivers/net/wireless/intel/iwlwifi/fw/runtime.h +0 -1
@@ -90,7 +90,6 @@ struct iwl_fwrt_shared_mem_cfg {enum iwl_fw_runtime_status {IWL_FWRT_STATUS_DUMPING =0 , -IWL_FWRT_STATUS_WAIT_ALIVE , };/**
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +3 -2
@@ -299,7 +299,6 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,enum iwl_ucode_type old_type = mvm->fwrt.cur_fw_img;static const u16 alive_cmd[] = {MVM_ALIVE }; -set_bit (IWL_FWRT_STATUS_WAIT_ALIVE , &mvm->fwrt.status); if (ucode_type == IWL_UCODE_REGULAR && iwl_fw_dbg_conf_usniffer(mvm->fw, FW_DBG_START_FROM_ALIVE) && !(fw_has_capa(&mvm->fw->ucode_capa,
@@ -332,6 +331,9 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,if (ret) {struct iwl_trans *trans = mvm->trans; +if (ret == -ETIMEDOUT ) +iwl_fw_alive_timeout_dump (&mvm->fwrt); +if (trans->cfg->device_family >=IWL_DEVICE_FAMILY_22000 ) IWL_ERR(mvm, "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n",
@@ -377,7 +379,6 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,#ifdef CONFIG_IWLWIFI_DEBUGFS iwl_fw_set_dbg_rec_on (&mvm->fwrt);#endif -clear_bit (IWL_FWRT_STATUS_WAIT_ALIVE , &mvm->fwrt.status);return 0 ; }
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +0 -2
@@ -818,8 +818,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,mutex_lock (&mvm->mutex);iwl_mvm_ref (mvm,IWL_MVM_REF_INIT_UCODE ); err =iwl_run_init_mvm_ucode (mvm, true); -if (test_bit (IWL_FWRT_STATUS_WAIT_ALIVE , &mvm->fwrt.status)) -iwl_fw_alive_error_dump (&mvm->fwrt);if (!iwlmvm_mod_params.init_dbg || !err)iwl_mvm_stop_device (mvm);iwl_mvm_unref (mvm,IWL_MVM_REF_INIT_UCODE );
Signature · 1 line
2.20.1
PATCH 9/17 iwlwifi: dbg_ini: update ini triggers enum
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
Align the triggers enum in the driver to the one in the FW.
--- .../wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h +46 -46
@@ -217,15 +217,12 @@ struct iwl_fw_ini_trigger_tlv {/** * enum iwl_fw_ini_trigger_id * @IWL_FW_TRIGGER_ID_FW_ASSERT: FW assert -* @IWL_FW_TRIGGER_ID_FW_TFD_Q_HANG: TFD queue hang * @IWL_FW_TRIGGER_ID_FW_HW_ERROR: HW assert -* @IWL_FW_TRIGGER_ID_FW_TRIGGER_ERROR: FW error notification -* @IWL_FW_TRIGGER_ID_FW_TRIGGER_WARNING: FW warning notification -* @IWL_FW_TRIGGER_ID_FW_TRIGGER_INFO: FW info notification -* @IWL_FW_TRIGGER_ID_FW_TRIGGER_DEBUG: FW debug notification +* @IWL_FW_TRIGGER_ID_FW_TFD_Q_HANG: TFD queue hang +* @IWL_FW_TRIGGER_ID_FW_DEBUG_HOST_TRIGGER: FW debug notification +* @IWL_FW_TRIGGER_ID_FW_GENERIC_NOTIFOCATION: FW generic notification * @IWL_FW_TRIGGER_ID_USER_TRIGGER: User trigger * @IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_INACTIVITY: peer inactivity -* @FW_DEBUG_TLV_TRIGGER_ID_HOST_DID_INITIATED_EVENT: undefined * @IWL_FW_TRIGGER_ID_HOST_TX_LATENCY_THRESHOLD_CROSSED: TX latency * threshold was crossed * @IWL_FW_TRIGGER_ID_HOST_TX_RESPONSE_STATUS_FAILED: TX failed
@@ -259,50 +256,53 @@ struct iwl_fw_ini_trigger_tlv {* @IWL_FW_TRIGGER_ID_NUM: number of trigger IDs */ enum iwl_fw_ini_trigger_id { +IWL_FW_TRIGGER_ID_INVALID =0 , +/* Errors triggers */ IWL_FW_TRIGGER_ID_FW_ASSERT =1 , -IWL_FW_TRIGGER_ID_FW_TFD_Q_HANG =2 , -IWL_FW_TRIGGER_ID_FW_HW_ERROR =3 , -/* Generic triggers */ -IWL_FW_TRIGGER_ID_FW_TRIGGER_ERROR =4 , -IWL_FW_TRIGGER_ID_FW_TRIGGER_WARNING =5 , -IWL_FW_TRIGGER_ID_FW_TRIGGER_INFO =6 , -IWL_FW_TRIGGER_ID_FW_TRIGGER_DEBUG =7 , -/* User Trigger */ -IWL_FW_TRIGGER_ID_USER_TRIGGER =8 , +IWL_FW_TRIGGER_ID_FW_HW_ERROR =2 , +IWL_FW_TRIGGER_ID_FW_TFD_Q_HANG =3 , + +/* FW triggers */ +IWL_FW_TRIGGER_ID_FW_DEBUG_HOST_TRIGGER =4 , +IWL_FW_TRIGGER_ID_FW_GENERIC_NOTIFOCATION =5 , + +/* User trigger */ +IWL_FW_TRIGGER_ID_USER_TRIGGER =6 , +/* Host triggers */ -IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_INACTIVITY =9 , -IWL_FW_TRIGGER_ID_HOST_DID_INITIATED_EVENT =10 , -IWL_FW_TRIGGER_ID_HOST_TX_LATENCY_THRESHOLD_CROSSED =11 , -IWL_FW_TRIGGER_ID_HOST_TX_RESPONSE_STATUS_FAILED =12 , -IWL_FW_TRIGGER_ID_HOST_OS_REQ_DEAUTH_PEER =13 , -IWL_FW_TRIGGER_ID_HOST_STOP_GO_REQUEST =14 , -IWL_FW_TRIGGER_ID_HOST_START_GO_REQUEST =15 , -IWL_FW_TRIGGER_ID_HOST_JOIN_GROUP_REQUEST =16 , -IWL_FW_TRIGGER_ID_HOST_SCAN_START =17 , -IWL_FW_TRIGGER_ID_HOST_SCAN_SUBITTED =18 , -IWL_FW_TRIGGER_ID_HOST_SCAN_PARAMS =19 , -IWL_FW_TRIGGER_ID_HOST_CHECK_FOR_HANG =20 , -IWL_FW_TRIGGER_ID_HOST_BAR_RECEIVED =21 , -IWL_FW_TRIGGER_ID_HOST_AGG_TX_RESPONSE_STATUS_FAILED =22 , -IWL_FW_TRIGGER_ID_HOST_EAPOL_TX_RESPONSE_FAILED =23 , -IWL_FW_TRIGGER_ID_HOST_FAKE_TX_RESPONSE_SUSPECTED =24 , -IWL_FW_TRIGGER_ID_HOST_AUTH_REQ_FROM_ASSOC_CLIENT =25 , -IWL_FW_TRIGGER_ID_HOST_ROAM_COMPLETE =26 , -IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAST_FAILED =27 , -IWL_FW_TRIGGER_ID_HOST_D3_START =28 , -IWL_FW_TRIGGER_ID_HOST_D3_END =29 , -IWL_FW_TRIGGER_ID_HOST_BSS_MISSED_BEACONS =30 , -IWL_FW_TRIGGER_ID_HOST_P2P_CLIENT_MISSED_BEACONS =31 , -IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_TX_FAILURES =32 , -IWL_FW_TRIGGER_ID_HOST_TX_WFD_ACTION_FRAME_FAILED =33 , -IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAILED =34 , -IWL_FW_TRIGGER_ID_HOST_SCAN_COMPLETE =35 , -IWL_FW_TRIGGER_ID_HOST_SCAN_ABORT =36 , -IWL_FW_TRIGGER_ID_HOST_NIC_ALIVE =37 , -IWL_FW_TRIGGER_ID_HOST_CHANNEL_SWITCH_COMPLETE =38 , +IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_INACTIVITY =7 , +IWL_FW_TRIGGER_ID_HOST_TX_LATENCY_THRESHOLD_CROSSED =8 , +IWL_FW_TRIGGER_ID_HOST_TX_RESPONSE_STATUS_FAILED =9 , +IWL_FW_TRIGGER_ID_HOST_OS_REQ_DEAUTH_PEER =10 , +IWL_FW_TRIGGER_ID_HOST_STOP_GO_REQUEST =11 , +IWL_FW_TRIGGER_ID_HOST_START_GO_REQUEST =12 , +IWL_FW_TRIGGER_ID_HOST_JOIN_GROUP_REQUEST =13 , +IWL_FW_TRIGGER_ID_HOST_SCAN_START =14 , +IWL_FW_TRIGGER_ID_HOST_SCAN_SUBMITTED =15 , +IWL_FW_TRIGGER_ID_HOST_SCAN_PARAMS =16 , +IWL_FW_TRIGGER_ID_HOST_CHECK_FOR_HANG =17 , +IWL_FW_TRIGGER_ID_HOST_BAR_RECEIVED =18 , +IWL_FW_TRIGGER_ID_HOST_AGG_TX_RESPONSE_STATUS_FAILED =19 , +IWL_FW_TRIGGER_ID_HOST_EAPOL_TX_RESPONSE_FAILED =20 , +IWL_FW_TRIGGER_ID_HOST_FAKE_TX_RESPONSE_SUSPECTED =21 , +IWL_FW_TRIGGER_ID_HOST_AUTH_REQ_FROM_ASSOC_CLIENT =22 , +IWL_FW_TRIGGER_ID_HOST_ROAM_COMPLETE =23 , +IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAST_FAILED =24 , +IWL_FW_TRIGGER_ID_HOST_D3_START =25 , +IWL_FW_TRIGGER_ID_HOST_D3_END =26 , +IWL_FW_TRIGGER_ID_HOST_BSS_MISSED_BEACONS =27 , +IWL_FW_TRIGGER_ID_HOST_P2P_CLIENT_MISSED_BEACONS =28 , +IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_TX_FAILURES =29 , +IWL_FW_TRIGGER_ID_HOST_TX_WFD_ACTION_FRAME_FAILED =30 , +IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAILED =31 , +IWL_FW_TRIGGER_ID_HOST_SCAN_COMPLETE =32 , +IWL_FW_TRIGGER_ID_HOST_SCAN_ABORT =33 , +IWL_FW_TRIGGER_ID_HOST_NIC_ALIVE =34 , +IWL_FW_TRIGGER_ID_HOST_CHANNEL_SWITCH_COMPLETE =35 , +IWL_FW_TRIGGER_ID_NUM , -};/* FW_INI_TRIGGER_ID_E_VER_1 */ +};/* FW_DEBUG_TLV_TRIGGER_ID_E_VER_1 */ /** * enum iwl_fw_ini_apply_point
Signature · 1 line
2.20.1
PATCH 10/17 iwlwifi: dbg_ini: update max region id num to support 64 regions
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
The driver should support 64 region ids. UpdateIWL_FW_INI_MAX_REGION_ID accordingly.
--- drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h +1 -1
@@ -131,7 +131,7 @@ struct iwl_fw_ini_debug_flow_tlv {__le32 debug_flow_cfg; } __packed;/* FW_INI_DEBUG_FLOW_TLV_S_VER_1 */ -#define IWL_FW_INI_MAX_REGION_ID 20 +#define IWL_FW_INI_MAX_REGION_ID 64#define IWL_FW_INI_MAX_NAME 32/** * struct iwl_fw_ini_region_cfg
Signature · 1 line
2.20.1
PATCH 11/17 iwlwifi: mvm: support new format for the beacon notification
In reply to Luca CoelhoFrom: Emmanuel Grumbach <[email protected]>
The firmware is changing the format of the beacon notification to remove the dependency on the Tx response format.
--- .../net/wireless/intel/iwlwifi/fw/api/tx.h | 18 ++++++++-- drivers/net/wireless/intel/iwlwifi/fw/file.h | 3 ++ .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 35 ++++++++++++------- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 6 ++++ 4 files changed, 48 insertions(+), 14 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/tx.h +16 -2
@@ -847,19 +847,33 @@ struct iwl_beacon_notif { } __packed;/** -* struct iwl_extended_beacon_notif - notifies about beacon transmission +* struct iwl_extended_beacon_notif_v5 - notifies about beacon transmission * @beacon_notify_hdr: tx response command associated with the beacon * @tsf: last beacon tsf * @ibss_mgr_status: whether IBSS is manager * @gp2: last beacon time in gp2 */ -struct iwl_extended_beacon_notif { +struct iwl_extended_beacon_notif_v5 {struct iwl_mvm_tx_resp beacon_notify_hdr;__le64 tsf;__le32 ibss_mgr_status;__le32 gp2; } __packed;/* BEACON_NTFY_API_S_VER_5 */ +/** +* struct iwl_extended_beacon_notif - notifies about beacon transmission +* @status: the status of the Tx response of the beacon +* @tsf: last beacon tsf +* @ibss_mgr_status: whether IBSS is manager +* @gp2: last beacon time in gp2 +*/ +struct iwl_extended_beacon_notif { +__le32 status; +__le64 tsf; +__le32 ibss_mgr_status; +__le32 gp2; +} __packed;/* BEACON_NTFY_API_S_VER_6_ */ +/** * enum iwl_dump_control - dump (flush) control flags * @DUMP_TX_FIFO_FLUSH: Dump MSDUs until the the FIFO is empty
drivers/net/wireless/intel/iwlwifi/fw/file.h +3 -0
@@ -263,6 +263,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_api_t;* @IWL_UCODE_TLV_API_FRAG_EBS: This ucode supports fragmented EBS * @IWL_UCODE_TLV_API_REDUCE_TX_POWER: This ucode supports v5 of * the REDUCE_TX_POWER_CMD. +* @IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF: This ucode supports the short +* version of the beacon notification. * * @NUM_IWL_UCODE_TLV_API: number of bits used */
@@ -287,6 +289,7 @@ enum iwl_ucode_tlv_api {IWL_UCODE_TLV_API_ADAPTIVE_DWELL_V2 = (__force iwl_ucode_tlv_api_t )42 ,IWL_UCODE_TLV_API_FRAG_EBS = (__force iwl_ucode_tlv_api_t )44 ,IWL_UCODE_TLV_API_REDUCE_TX_POWER = (__force iwl_ucode_tlv_api_t )45 , +IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF = (__force iwl_ucode_tlv_api_t )46 , NUM_IWL_UCODE_TLV_API#ifdef __CHECKER__
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +23 -12
@@ -1330,7 +1330,7 @@ void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm, {struct iwl_rx_packet *pkt =rxb_addr (rxb);struct iwl_extended_beacon_notif *beacon = (void *)pkt->data; -struct iwl_mvm_tx_resp *beacon_notify_hdr; +struct iwl_extended_beacon_notif_v5 *beacon_v5 = (void *)pkt->data;struct ieee80211_vif *csa_vif;struct ieee80211_vif *tx_blocked_vif;struct agg_tx_status *agg_status;
@@ -1338,18 +1338,29 @@ void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm,lockdep_assert_held (&mvm->mutex); - beacon_notify_hdr = &beacon->beacon_notify_hdr; mvm->ap_last_beacon_gp2 =le32_to_cpu (beacon->gp2); - mvm->ibss_manager = beacon->ibss_mgr_status !=0 ; - - agg_status =iwl_mvm_get_agg_status (mvm, beacon_notify_hdr); - status =le16_to_cpu (agg_status->status) &TX_STATUS_MSK ; -IWL_DEBUG_RX (mvm, -"beacon status %#x retries:%d tsf:0x%016llX gp2:0x%X rate:%d\n" , - status, beacon_notify_hdr->failure_frame, -le64_to_cpu (beacon->tsf), - mvm->ap_last_beacon_gp2, -le32_to_cpu (beacon_notify_hdr->initial_rate)); + +if (!iwl_mvm_is_short_beacon_notif_supported (mvm)) { +struct iwl_mvm_tx_resp *beacon_notify_hdr = + &beacon_v5->beacon_notify_hdr; + + mvm->ibss_manager = beacon_v5->ibss_mgr_status !=0 ; + agg_status =iwl_mvm_get_agg_status (mvm, beacon_notify_hdr); + status =le16_to_cpu (agg_status->status) &TX_STATUS_MSK ; +IWL_DEBUG_RX (mvm, +"beacon status %#x retries:%d tsf:0x%016llX gp2:0x%X rate:%d\n" , + status, beacon_notify_hdr->failure_frame, +le64_to_cpu (beacon->tsf), + mvm->ap_last_beacon_gp2, +le32_to_cpu (beacon_notify_hdr->initial_rate)); + }else { + mvm->ibss_manager = beacon->ibss_mgr_status !=0 ; + status =le32_to_cpu (beacon->status) &TX_STATUS_MSK ; +IWL_DEBUG_RX (mvm, +"beacon status %#x tsf:0x%016llX gp2:0x%X\n" , + status,le64_to_cpu (beacon->tsf), + mvm->ap_last_beacon_gp2); + } csa_vif =rcu_dereference_protected (mvm->csa_vif,lockdep_is_held (&mvm->mutex));
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +6 -0
@@ -1311,6 +1311,12 @@ static inline bool iwl_mvm_is_frag_ebs_supported(struct iwl_mvm *mvm)return fw_has_api (&mvm->fw->ucode_capa,IWL_UCODE_TLV_API_FRAG_EBS ); } +static inline bool iwl_mvm_is_short_beacon_notif_supported (struct iwl_mvm *mvm) +{ +return fw_has_api (&mvm->fw->ucode_capa, +IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF ); +} +static inline bool iwl_mvm_enter_d0i3_on_suspend (struct iwl_mvm *mvm) {/* For now we only use this mode to differentiate between
Signature · 1 line
2.20.1
PATCH 12/17 iwlwifi: mvm: remove duplicated include from ops.c
In reply to Luca CoelhoFrom: YueHaibing <[email protected]>
Remove duplicated include.
--- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +0 -1
@@ -82,7 +82,6 @@#include "fw/api/scan.h" #include "time-event.h" #include "fw-api.h" -#include "fw/api/scan.h" #include "fw/acpi.h" #define DRV_DESCRIPTION "The new Intel(R) wireless AGN driver for Linux"
Signature · 1 line
2.20.1
PATCH 13/17 iwlwifi: Fix pre operational dumping flows
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
There are several dumping flows in the driver in case of a fail prior to operational.
In some cases we get 2 dumps while in others we get none.
Fix this by uniting the different flows.
Add a different dump type to driver triggered dumps in case we want a dump but did not got assert, and make all dumping go through iwl_fw_dbg_collect_desc to avoid multiple dumps.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 89 +++++++++++-------- drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 5 +- .../wireless/intel/iwlwifi/fw/error-dump.h | 3 + drivers/net/wireless/intel/iwlwifi/fw/init.c | 3 + .../net/wireless/intel/iwlwifi/iwl-trans.h | 13 +++ drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 6 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 9 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 + 8 files changed, 81 insertions(+), 49 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +51 -38
@@ -1365,44 +1365,6 @@ const struct iwl_fw_dump_desc iwl_dump_desc_assert = { };IWL_EXPORT_SYMBOL (iwl_dump_desc_assert); -void iwl_fw_assert_error_dump (struct iwl_fw_runtime *fwrt) -{ -IWL_INFO (fwrt,"error dump due to fw assert\n" ); - fwrt->dump.desc = &iwl_dump_desc_assert; -iwl_fw_error_dump (fwrt); -} -IWL_EXPORT_SYMBOL (iwl_fw_assert_error_dump); - -void iwl_fw_alive_timeout_dump (struct iwl_fw_runtime *fwrt) -{ -struct iwl_fw_dump_desc *iwl_dump_desc_alive_timeout; - -if (test_and_set_bit (IWL_FWRT_STATUS_DUMPING , &fwrt->status)) -return ; - - iwl_dump_desc_alive_timeout = -kmalloc (sizeof (*iwl_dump_desc_alive_timeout),GFP_KERNEL ); -if (!iwl_dump_desc_alive_timeout) -return ; - - iwl_dump_desc_alive_timeout->trig_desc.type = -cpu_to_le32 (FW_DBG_TRIGGER_ALIVE_TIMEOUT ); - iwl_dump_desc_alive_timeout->len =0 ; - -if (WARN_ON (fwrt->dump.desc)) -iwl_fw_free_dump_desc (fwrt); - -IWL_WARN (fwrt,"Collecting data: trigger %d fired.\n" , -FW_DBG_TRIGGER_ALIVE_TIMEOUT ); - -/* set STATUS_FW_ERROR to collect all memory regions. */ -set_bit (STATUS_FW_ERROR , &fwrt->trans->status); - - fwrt->dump.desc = iwl_dump_desc_alive_timeout; -iwl_fw_error_dump (fwrt); -} -IWL_EXPORT_SYMBOL (iwl_fw_alive_timeout_dump); - int iwl_fw_dbg_collect_desc(struct iwl_fw_runtime *fwrt, const struct iwl_fw_dump_desc *desc, bool monitor_only,
@@ -1442,6 +1404,33 @@ int iwl_fw_dbg_collect_desc(struct iwl_fw_runtime *fwrt, }IWL_EXPORT_SYMBOL (iwl_fw_dbg_collect_desc); +int iwl_fw_dbg_error_collect (struct iwl_fw_runtime *fwrt, +enum iwl_fw_dbg_trigger trig_type) +{ +int ret; +struct iwl_fw_dump_desc *iwl_dump_error_desc = +kmalloc (sizeof (*iwl_dump_error_desc),GFP_KERNEL ); + +if (!iwl_dump_error_desc) +return -ENOMEM ; + + iwl_dump_error_desc->trig_desc.type =cpu_to_le32 (trig_type); + iwl_dump_error_desc->len =0 ; + + ret =iwl_fw_dbg_collect_desc (fwrt, iwl_dump_error_desc, false,0 ); +if (ret) { +kfree (iwl_dump_error_desc); + }else { +set_bit (STATUS_FW_WAIT_DUMP , &fwrt->trans->status); + +/* trigger nmi to halt the fw */ +iwl_force_nmi (fwrt->trans); + } + +return ret; +} +IWL_EXPORT_SYMBOL (iwl_fw_dbg_error_collect); + int _iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt, enum iwl_fw_dbg_trigger trig, const char *str, size_t len,
@@ -1893,3 +1882,27 @@ void iwl_fw_dbg_apply_point(struct iwl_fw_runtime *fwrt,_iwl_fw_dbg_apply_point (fwrt, data, apply_point, true); }IWL_EXPORT_SYMBOL (iwl_fw_dbg_apply_point); + +void iwl_fwrt_stop_device (struct iwl_fw_runtime *fwrt) +{ +/* if the wait event timeout elapses instead of wake up then +* the driver did not receive NMI interrupt and can not assume the FW +* is halted +*/ +int ret =wait_event_timeout (fwrt->trans->fw_halt_waitq, + !test_bit (STATUS_FW_WAIT_DUMP , + &fwrt->trans->status), +msecs_to_jiffies (2000 )); +if (!ret) { +/* failed to receive NMI interrupt, assuming the FW is stuck */ +set_bit (STATUS_FW_ERROR , &fwrt->trans->status); + +clear_bit (STATUS_FW_WAIT_DUMP , &fwrt->trans->status); + } + +/* Assuming the op mode mutex is held at this point */ +iwl_fw_dbg_collect_sync (fwrt); + +iwl_trans_stop_device (fwrt->trans); +} +IWL_EXPORT_SYMBOL (iwl_fwrt_stop_device);
drivers/net/wireless/intel/iwlwifi/fw/dbg.h +3 -2
@@ -112,6 +112,8 @@ void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt);int iwl_fw_dbg_collect_desc (struct iwl_fw_runtime *fwrt,const struct iwl_fw_dump_desc *desc,bool monitor_only,unsigned int delay); +int iwl_fw_dbg_error_collect (struct iwl_fw_runtime *fwrt, +enum iwl_fw_dbg_trigger trig_type); int _iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt, enum iwl_fw_dbg_trigger trig, const char *str, size_t len,
@@ -434,10 +436,9 @@ static inline void iwl_fw_resume_timestamp(struct iwl_fw_runtime *fwrt) {}#endif /* CONFIG_IWLWIFI_DEBUGFS */ -void iwl_fw_assert_error_dump (struct iwl_fw_runtime *fwrt); -void iwl_fw_alive_timeout_dump (struct iwl_fw_runtime *fwrt);void iwl_fw_dbg_collect_sync (struct iwl_fw_runtime *fwrt);void iwl_fw_dbg_apply_point (struct iwl_fw_runtime *fwrt,enum iwl_fw_ini_apply_point apply_point); +void iwl_fwrt_stop_device (struct iwl_fw_runtime *fwrt);#endif /* __iwl_fw_dbg_h__ */
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h +3 -0
@@ -356,6 +356,8 @@ iwl_fw_error_next_data(struct iwl_fw_error_dump_data *data)* @FW_DBG_TRIGGER_TX_STATUS: trigger log collection upon tx status when * the firmware sends a tx reply. * @FW_DBG_TRIGGER_ALIVE_TIMEOUT: trigger log collection if alive flow timeouts +* @FW_DBG_TRIGGER_DRIVER: trigger log collection upon a flow failure +* in the driver. */ enum iwl_fw_dbg_trigger {FW_DBG_TRIGGER_INVALID =0 ,
@@ -374,6 +376,7 @@ enum iwl_fw_dbg_trigger {FW_DBG_TRIGGER_TDLS ,FW_DBG_TRIGGER_TX_STATUS ,FW_DBG_TRIGGER_ALIVE_TIMEOUT , +FW_DBG_TRIGGER_DRIVER ,/* must be last */ FW_DBG_TRIGGER_MAX,
drivers/net/wireless/intel/iwlwifi/fw/init.c +3 -0
@@ -6,6 +6,7 @@* GPL LICENSE SUMMARY * * Copyright(c) 2017 Intel Deutschland GmbH +* 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
@@ -26,6 +27,7 @@* BSD LICENSE * * Copyright(c) 2017 Intel Deutschland GmbH +* Copyright(c) 2019 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -74,6 +76,7 @@ void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, fwrt->ops_ctx = ops_ctx;INIT_DELAYED_WORK (&fwrt->dump.wk, iwl_fw_error_dump_wk);iwl_fwrt_dbgfs_register (fwrt, dbgfs_dir); +init_waitqueue_head (&fwrt->trans->fw_halt_waitq); }IWL_EXPORT_SYMBOL (iwl_fw_runtime_init);
drivers/net/wireless/intel/iwlwifi/iwl-trans.h +13 -0
@@ -8,6 +8,7 @@* Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +* Copyright(c) 2018 - 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
@@ -30,6 +31,7 @@* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH +* Copyright(c) 2018 - 2019 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -330,6 +332,7 @@ enum iwl_d3_status {* are sent * @STATUS_TRANS_IDLE: the trans is idle - general commands are not to be sent * @STATUS_TRANS_DEAD: trans is dead - avoid any read/write operation +* @STATUS_FW_WAIT_DUMP: if set, wait until cleared before collecting dump */ enum iwl_trans_status {STATUS_SYNC_HCMD_ACTIVE ,
@@ -342,6 +345,7 @@ enum iwl_trans_status {STATUS_TRANS_GOING_IDLE ,STATUS_TRANS_IDLE ,STATUS_TRANS_DEAD , + STATUS_FW_WAIT_DUMP, }; static inline int
@@ -796,6 +800,11 @@ struct iwl_trans {bool suspending;bool dbg_rec_on; +u32 lmac_error_event_table[2 ]; +u32 umac_error_event_table; +unsigned int error_event_table_tlv_status; +wait_queue_head_t fw_halt_waitq; +/* pointer to trans specific struct */ /*Ensure that this pointer will always be aligned to sizeof pointer */ char trans_specific[0 ]__aligned(sizeof(void *)) ;
@@ -1202,6 +1211,10 @@ static inline void iwl_trans_fw_error(struct iwl_trans *trans)/* prevent double restarts due to the same erroneous FW */ if (!test_and_set_bit (STATUS_FW_ERROR , &trans->status))iwl_op_mode_nic_error (trans->op_mode); + +if (test_and_clear_bit (STATUS_FW_WAIT_DUMP , &trans->status)) +wake_up (&trans->fw_halt_waitq); + }/*****************************************************
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +3 -3
@@ -332,7 +332,8 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,struct iwl_trans *trans = mvm->trans;if (ret == -ETIMEDOUT ) -iwl_fw_alive_timeout_dump (&mvm->fwrt); +iwl_fw_dbg_error_collect (&mvm->fwrt, +FW_DBG_TRIGGER_ALIVE_TIMEOUT );if (trans->cfg->device_family >=IWL_DEVICE_FAMILY_22000 ) IWL_ERR(mvm,
@@ -408,7 +409,6 @@ static int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm) ret =iwl_mvm_load_ucode_wait_alive (mvm,IWL_UCODE_REGULAR );if (ret) {IWL_ERR (mvm,"Failed to start RT ucode: %d\n" , ret); -iwl_fw_assert_error_dump (&mvm->fwrt); goto error; }
@@ -1053,7 +1053,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm) ret =iwl_mvm_load_rt_fw (mvm);if (ret) {IWL_ERR (mvm,"Failed to start RT ucode: %d\n" , ret); -iwl_fw_assert_error_dump (&mvm->fwrt); +iwl_fw_dbg_error_collect (&mvm->fwrt,FW_DBG_TRIGGER_DRIVER ); goto error; }
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +3 -6
@@ -2013,15 +2013,12 @@ static inline void iwl_mvm_stop_device(struct iwl_mvm *mvm) &mvm->status))iwl_fw_dbg_collect_desc (&mvm->fwrt, &iwl_dump_desc_assert, false,0 ); -/* calling this function without using dump_start/end since at this -* point we already hold the op mode mutex -*/ -iwl_fw_dbg_collect_sync (&mvm->fwrt); +iwl_fw_cancel_timestamp (&mvm->fwrt); -iwl_free_fw_paging (&mvm->fwrt);clear_bit (IWL_MVM_STATUS_FIRMWARE_RUNNING , &mvm->status); +iwl_fwrt_stop_device (&mvm->fwrt); +iwl_free_fw_paging (&mvm->fwrt);iwl_fw_dump_conf_clear (&mvm->fwrt); -iwl_trans_stop_device (mvm->trans); }/* Re-configure the SCD for a queue that has already been configured */
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +2 -0
@@ -817,6 +817,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,mutex_lock (&mvm->mutex);iwl_mvm_ref (mvm,IWL_MVM_REF_INIT_UCODE ); err =iwl_run_init_mvm_ucode (mvm, true); +if (err) +iwl_fw_dbg_error_collect (&mvm->fwrt,FW_DBG_TRIGGER_DRIVER );if (!iwlmvm_mod_params.init_dbg || !err)iwl_mvm_stop_device (mvm);iwl_mvm_unref (mvm,IWL_MVM_REF_INIT_UCODE );
Signature · 1 line
2.20.1
PATCH 14/17 iwlwifi: fix fallthrough comment in iwl-dnt-cfg.c
In reply to Luca CoelhoFrom: Shahar S Matityahu <[email protected]>
I placed the fall through comment in the wrong case. Move it to the right place.
--- .../wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h +11 -11
@@ -70,7 +70,7 @@ struct iwl_fw_ini_header {__le32 tlv_version;__le32 apply_point;u8 data[]; -} __packed;/* FW_INI_HEADER_TLV_S */ +} __packed;/* FW_DEBUG_TLV_HEADER_S */ /** * struct iwl_fw_ini_allocation_tlv - (IWL_FW_INI_TLV_TYPE_BUFFER_ALLOCATION)
@@ -92,7 +92,7 @@ struct iwl_fw_ini_allocation_tlv {__le32 size;__le32 max_fragments;__le32 min_frag_size; -} __packed;/* FW_INI_BUFFER_ALLOCATION_TLV_S_VER_1 */ +} __packed;/* FW_DEBUG_TLV_BUFFER_ALLOCATION_TLV_S_VER_1 */ /** * struct iwl_fw_ini_hcmd (IWL_FW_INI_TLV_TYPE_HCMD)
@@ -108,7 +108,7 @@ struct iwl_fw_ini_hcmd {u8 group;__le16 padding;u8 data[0 ]; -} __packed;/* FW_INI_HCMD_S */ +} __packed;/* FW_DEBUG_TLV_HCMD_DATA_S */ /** * struct iwl_fw_ini_hcmd_tlv
@@ -118,7 +118,7 @@ struct iwl_fw_ini_hcmd {struct iwl_fw_ini_hcmd_tlv {struct iwl_fw_ini_header header;struct iwl_fw_ini_hcmd hcmd; -} __packed;/* FW_INI_HCMD_TLV_S_VER_1 */ +} __packed;/* FW_DEBUG_TLV_HCMD_S_VER_1 */ /* * struct iwl_fw_ini_debug_flow_tlv (IWL_FW_INI_TLV_TYPE_DEBUG_FLOW)
@@ -129,7 +129,7 @@ struct iwl_fw_ini_hcmd_tlv {struct iwl_fw_ini_debug_flow_tlv {struct iwl_fw_ini_header header;__le32 debug_flow_cfg; -} __packed;/* FW_INI_DEBUG_FLOW_TLV_S_VER_1 */ +} __packed;/* FW_DEBUG_TLV_FLOW_TLV_S_VER_1 */ #define IWL_FW_INI_MAX_REGION_ID 64#define IWL_FW_INI_MAX_NAME 32
@@ -176,7 +176,7 @@ 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_tigger_id +* @trigger_id: enum &iwl_fw_ini_trigger_id * @ignore_default: override FW TLV with binary TLV * @dump_delay: delay from trigger fire to dump, in usec * @occurrences: max amount of times to be fired
@@ -322,7 +322,7 @@ enum iwl_fw_ini_apply_point {IWL_FW_INI_APPLY_MISSED_BEACONS ,IWL_FW_INI_APPLY_SCAN_COMPLETE , IWL_FW_INI_APPLY_NUM, -}; /* FW_INI_APPLY_POINT_E_VER_1 */ +}; /* FW_DEBUG_TLV_APPLY_POINT_E_VER_1 *//** * enum iwl_fw_ini_allocation_id
@@ -342,7 +342,7 @@ enum iwl_fw_ini_allocation_id {IWL_FW_INI_ALLOCATION_ID_SDFX ,IWL_FW_INI_ALLOCATION_ID_FW_DUMP , IWL_FW_INI_ALLOCATION_ID_USER_DEFINED, -}; /* FW_INI_ALLOCATION_ID_E_VER_1 */ +}; /* FW_DEBUG_TLV_ALLOCATION_ID_E_VER_1 *//** * enum iwl_fw_ini_buffer_location
@@ -354,7 +354,7 @@ enum iwl_fw_ini_buffer_location {IWL_FW_INI_LOCATION_INVALID ,IWL_FW_INI_LOCATION_SRAM_PATH , IWL_FW_INI_LOCATION_DRAM_PATH, -}; /* FW_INI_BUFFER_LOCATION_E_VER_1 */ +}; /* FW_DEBUG_TLV_BUFFER_LOCATION_E_VER_1 *//** * enum iwl_fw_ini_debug_flow
@@ -366,7 +366,7 @@ enum iwl_fw_ini_debug_flow {IWL_FW_INI_DEBUG_INVALID ,IWL_FW_INI_DEBUG_DBTR_FLOW , IWL_FW_INI_DEBUG_TB2DTF_FLOW, -}; /* FW_INI_DEBUG_FLOW_E_VER_1 */ +}; /* FW_DEBUG_TLV_FLOW_E_VER_1 *//** * enum iwl_fw_ini_region_type
@@ -398,6 +398,6 @@ enum iwl_fw_ini_region_type {IWL_FW_INI_REGION_PAGING ,IWL_FW_INI_REGION_CSR ,IWL_FW_INI_REGION_NUM -}; /* FW_INI_REGION_TYPE_E_VER_1*/ +}; /* FW_DEBUG_TLV_REGION_TYPE_E_VER_1 */#endif
Signature · 1 line
2.20.1
Re: [PATCH 14/17] iwlwifi: fix fallthrough comment in iwl-dnt-cfg.c
Quoted 7 lines · Luca Coelho
From: Shahar S Matityahu <[email protected]>
I placed the fall through comment in the wrong case. Move it to the right place.
Signed-off-by Luca Coelho <[email protected]>---
Oops, this came out with the wrong commit message, I'll replace it with the proper one.
--
Luca.
PATCH 1/1 iwlwifi: dbg_ini: update ini structs meta doc
From: Shahar S Matityahu <[email protected]>
Align the documentation of the structs with the latest version in the FW.
--- .../wireless/intel/iwlwifi/fw/api/dbg-tlv.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h +11 -11
@@ -70,7 +70,7 @@ struct iwl_fw_ini_header {__le32 tlv_version;__le32 apply_point;u8 data[]; -} __packed;/* FW_INI_HEADER_TLV_S */ +} __packed;/* FW_DEBUG_TLV_HEADER_S */ /** * struct iwl_fw_ini_allocation_tlv - (IWL_FW_INI_TLV_TYPE_BUFFER_ALLOCATION)
@@ -92,7 +92,7 @@ struct iwl_fw_ini_allocation_tlv {__le32 size;__le32 max_fragments;__le32 min_frag_size; -} __packed;/* FW_INI_BUFFER_ALLOCATION_TLV_S_VER_1 */ +} __packed;/* FW_DEBUG_TLV_BUFFER_ALLOCATION_TLV_S_VER_1 */ /** * struct iwl_fw_ini_hcmd (IWL_FW_INI_TLV_TYPE_HCMD)
@@ -108,7 +108,7 @@ struct iwl_fw_ini_hcmd {u8 group;__le16 padding;u8 data[0 ]; -} __packed;/* FW_INI_HCMD_S */ +} __packed;/* FW_DEBUG_TLV_HCMD_DATA_S */ /** * struct iwl_fw_ini_hcmd_tlv
@@ -118,7 +118,7 @@ struct iwl_fw_ini_hcmd {struct iwl_fw_ini_hcmd_tlv {struct iwl_fw_ini_header header;struct iwl_fw_ini_hcmd hcmd; -} __packed;/* FW_INI_HCMD_TLV_S_VER_1 */ +} __packed;/* FW_DEBUG_TLV_HCMD_S_VER_1 */ /* * struct iwl_fw_ini_debug_flow_tlv (IWL_FW_INI_TLV_TYPE_DEBUG_FLOW)
@@ -129,7 +129,7 @@ struct iwl_fw_ini_hcmd_tlv {struct iwl_fw_ini_debug_flow_tlv {struct iwl_fw_ini_header header;__le32 debug_flow_cfg; -} __packed;/* FW_INI_DEBUG_FLOW_TLV_S_VER_1 */ +} __packed;/* FW_DEBUG_TLV_FLOW_TLV_S_VER_1 */ #define IWL_FW_INI_MAX_REGION_ID 64#define IWL_FW_INI_MAX_NAME 32
@@ -176,7 +176,7 @@ 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_tigger_id +* @trigger_id: enum &iwl_fw_ini_trigger_id * @ignore_default: override FW TLV with binary TLV * @dump_delay: delay from trigger fire to dump, in usec * @occurrences: max amount of times to be fired
@@ -322,7 +322,7 @@ enum iwl_fw_ini_apply_point {IWL_FW_INI_APPLY_MISSED_BEACONS ,IWL_FW_INI_APPLY_SCAN_COMPLETE , IWL_FW_INI_APPLY_NUM, -}; /* FW_INI_APPLY_POINT_E_VER_1 */ +}; /* FW_DEBUG_TLV_APPLY_POINT_E_VER_1 *//** * enum iwl_fw_ini_allocation_id
@@ -342,7 +342,7 @@ enum iwl_fw_ini_allocation_id {IWL_FW_INI_ALLOCATION_ID_SDFX ,IWL_FW_INI_ALLOCATION_ID_FW_DUMP , IWL_FW_INI_ALLOCATION_ID_USER_DEFINED, -}; /* FW_INI_ALLOCATION_ID_E_VER_1 */ +}; /* FW_DEBUG_TLV_ALLOCATION_ID_E_VER_1 *//** * enum iwl_fw_ini_buffer_location
@@ -354,7 +354,7 @@ enum iwl_fw_ini_buffer_location {IWL_FW_INI_LOCATION_INVALID ,IWL_FW_INI_LOCATION_SRAM_PATH , IWL_FW_INI_LOCATION_DRAM_PATH, -}; /* FW_INI_BUFFER_LOCATION_E_VER_1 */ +}; /* FW_DEBUG_TLV_BUFFER_LOCATION_E_VER_1 *//** * enum iwl_fw_ini_debug_flow
@@ -366,7 +366,7 @@ enum iwl_fw_ini_debug_flow {IWL_FW_INI_DEBUG_INVALID ,IWL_FW_INI_DEBUG_DBTR_FLOW , IWL_FW_INI_DEBUG_TB2DTF_FLOW, -}; /* FW_INI_DEBUG_FLOW_E_VER_1 */ +}; /* FW_DEBUG_TLV_FLOW_E_VER_1 *//** * enum iwl_fw_ini_region_type
@@ -398,6 +398,6 @@ enum iwl_fw_ini_region_type {IWL_FW_INI_REGION_PAGING ,IWL_FW_INI_REGION_CSR ,IWL_FW_INI_REGION_NUM -}; /* FW_INI_REGION_TYPE_E_VER_1*/ +}; /* FW_DEBUG_TLV_REGION_TYPE_E_VER_1 */#endif
Signature · 1 line
2.20.1
PATCH 15/17 iwlwifi: dvm: fix some fall through warnings
In reply to Luca CoelhoFrom: Luca Coelho <[email protected]>
Some case statements were missing a comment about falling through or had more text than the compiler can recognize. Fix that.
--- drivers/net/wireless/intel/iwlwifi/dvm/rx.c | 6 ++++-- drivers/net/wireless/intel/iwlwifi/dvm/scan.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/dvm/rx.c +4 -2
@@ -2,6 +2,7 @@* * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2015 Intel Deutschland GmbH +* Copyright(c) 2018 Intel Corporation * * Portions of this file are derived from the ipw3945 project, as well * as portionhelp of the ieee80211 subsystem header files.
@@ -592,7 +593,7 @@ static int iwlagn_set_decrypted_flag(struct iwl_priv *priv,if ((decrypt_res &RX_RES_STATUS_DECRYPT_TYPE_MSK ) ==RX_RES_STATUS_BAD_KEY_TTAK )break ; - +/* fall through */ case RX_RES_STATUS_SEC_TYPE_WEP :if ((decrypt_res &RX_RES_STATUS_DECRYPT_TYPE_MSK ) ==RX_RES_STATUS_BAD_ICV_MIC ) {
@@ -601,6 +602,7 @@ static int iwlagn_set_decrypted_flag(struct iwl_priv *priv,IWL_DEBUG_RX (priv,"Packet destroyed\n" );return -1 ; } +/* fall through */ case RX_RES_STATUS_SEC_TYPE_CCMP :if ((decrypt_res &RX_RES_STATUS_DECRYPT_TYPE_MSK ) ==RX_RES_STATUS_DECRYPT_OK ) {
@@ -729,7 +731,7 @@ static u32 iwlagn_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in) decrypt_out |=RX_RES_STATUS_BAD_KEY_TTAK ;break ; } -/* fall through if TTAK OK */ +/* fall through */ default :if (!(decrypt_in &RX_MPDU_RES_STATUS_ICV_OK )) decrypt_out |=RX_RES_STATUS_BAD_ICV_MIC ;
drivers/net/wireless/intel/iwlwifi/dvm/scan.c +2 -1
@@ -3,6 +3,7 @@* GPL LICENSE SUMMARY * * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. +* Copyright(c) 2018 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
@@ -418,7 +419,7 @@ static u16 iwl_limit_dwell(struct iwl_priv *priv, u16 dwell_time) limit = (limits[1 ] *98 ) /100 -IWL_CHANNEL_TUNE_TIME *2 ; limit /=2 ; dwell_time =min (limit, dwell_time); -/* fall through to limit further */ +/* fall through */ case 1 : limit = (limits[0 ] *98 ) /100 -IWL_CHANNEL_TUNE_TIME *2 ; limit /= n_active;
Signature · 1 line
2.20.1
PATCH 16/17 iwlwifi: mvm: add fall through comments where needed
In reply to Luca CoelhoFrom: Luca Coelho <[email protected]>
Some switch-cases were missing a fall through comment, so the compiler may warn. Fix that by adding the comments where needed. In other cases there was more text in the comment, which the compiler doesn't recognize, so either remove the extra text or move it to a separate comment line as appropriate.
--- drivers/net/wireless/intel/iwlwifi/mvm/led.c | 3 +++ drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 1 + drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | 1 + drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 6 +++--- 6 files changed, 10 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/led.c +3 -0
@@ -7,6 +7,7 @@* * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2017 Intel Deutschland GmbH +* Copyright(c) 2018 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) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2017 Intel Deutschland GmbH +* Copyright(c) 2018 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -113,6 +115,7 @@ int iwl_mvm_leds_init(struct iwl_mvm *mvm)switch (mode) {case IWL_LED_BLINK :IWL_ERR (mvm,"Blink led mode not supported, used default\n" ); +/* fall through */ case IWL_LED_DEFAULT :case IWL_LED_RF_STATE : mode =IWL_LED_RF_STATE ;
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +1 -0
@@ -3901,6 +3901,7 @@ static int __iwl_mvm_assign_vif_chanctx(struct iwl_mvm *mvm, mvmvif->ap_ibss_active = true;break ; } +/* fall through */ case NL80211_IFTYPE_ADHOC :/* * The AP binding flow is handled as part of the start_ap flow
drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c +1 -0
@@ -109,6 +109,7 @@ u8 iwl_mvm_get_ctrl_pos(struct cfg80211_chan_def *chandef)return PHY_VHT_CTRL_POS_4_ABOVE ;default :WARN (1 ,"Invalid channel definition" ); +/* fall through */ case 0 :/* * The FW is expected to check the control channel position only
drivers/net/wireless/intel/iwlwifi/mvm/rx.c +1 -1
@@ -222,7 +222,7 @@ static u32 iwl_mvm_set_mac80211_rx_flag(struct iwl_mvm *mvm, !(rx_pkt_status & RX_MPDU_RES_STATUS_TTAK_OK))return 0 ; *crypt_len =IEEE80211_TKIP_IV_LEN ; -/* fall through if TTAK OK */ +/* fall through */ case RX_MPDU_RES_STATUS_SEC_WEP_ENC :if (!(rx_pkt_status &RX_MPDU_RES_STATUS_ICV_OK ))
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +1 -1
@@ -310,7 +310,7 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr, stats->flag |=RX_FLAG_MMIC_ERROR ; *crypt_len =IEEE80211_TKIP_IV_LEN ; -/* fall through if TTAK OK */ +/* fall through */ case IWL_RX_MPDU_STATUS_SEC_WEP :if (!(status &IWL_RX_MPDU_STATUS_ICV_OK ))return -1 ;
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +3 -3
@@ -1616,10 +1616,10 @@ static int iwl_mvm_check_running_scans(struct iwl_mvm *mvm, int type)if (mvm->scan_status &IWL_MVM_SCAN_SCHED_MASK )return iwl_mvm_scan_stop (mvm,IWL_MVM_SCAN_SCHED , true); - -/* fall through, something is wrong if no scan was -* running but we ran out of scans. +/* Something is wrong if no scan was running but we +* ran out of scans. */ +/* fall through */ default :WARN_ON (1 );break ;
Signature · 1 line
2.20.1
PATCH 17/17 iwlwifi: mvm: fix AP mode in WEP
In reply to Luca CoelhoFrom: Emmanuel Grumbach <[email protected]>
Recently we started to send the WEP keys to the firmware so that we could use hardware Tx encryption also on newer devices that require the keys to be installed in the firmware for encryption (as opposed to older devices that can get the key in the Tx command for each Tx).
When we implemented that, we forgot to remove the key when we remove a station leading to a situation where a station that connects and disconnects a lot of times exhausts the key database inside the firmware.
A fix was made for that, but we always removed the same
key: mvmvif->ap_wep_key which means that we removed the same key entry in the firmware. This can make sense since in WEP, the key is the same for all the stations, but the internal implementation of iwl_mvm_set_sta_key and iwl_mvm_remove_sta_key assumes that each station uses a different key in the firmware's key database.
So now we got to the situation where we have a single ieee80211_key_conf instance that means, a single ieee80211_key_conf.hw_key_idx index for several stations and hence for several keys. ieee80211_key_conf.hw_key_idx is set to 0 when the first station associates, and then it is overwritten to 1 when the second station associates which is a buggy of course. This led to the following message upon the removal of the second station:
iwlwifi 0000:00:03.0: offset 1 not used in fw key table.
WARNING: CPU: 2 PID: 27883 at net/mac80211/sta_info.c:1122 __sta_info_destroy_part2+0x16b/0x180 [mac80211] RIP: 0010:__sta_info_destroy_part2+0x16b/0x180 [mac80211] Call Trace: __sta_info_destroy+0x2a/0x40 [mac80211] sta_info_destroy_addr_bss+0x38/0x60 [mac80211] ieee80211_del_station+0x1d/0x30 [mac80211] nl80211_del_station+0xe0/0x1f0 [cfg80211]
Fix this by copying the ieee80211_key_conf structure for each and every station. This is the easiest way to properly remove the keys with the right index. Another solution would have been to allow several stations to use the same key offset in the firmware. That would require to change the way we track keys in iwlmvm and not really worth it.
Also, maintain correctly fw_key_table when we add a key for the multicast station.
Remove the key when we remove the multicast station.
--- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 30 ++-- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 132 +++++++++++------- drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 3 + 3 files changed, 102 insertions(+), 63 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +21 -9
@@ -3078,6 +3078,24 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, ret =iwl_mvm_update_sta (mvm, vif, sta); }else if (old_state ==IEEE80211_STA_ASSOC && new_state ==IEEE80211_STA_AUTHORIZED ) { +/* if wep is used, need to set the key for the station now */ +if (vif->type ==NL80211_IFTYPE_AP && mvmvif->ap_wep_key) { + mvm_sta->wep_key = +kmemdup (mvmvif->ap_wep_key, +sizeof (*mvmvif->ap_wep_key) + + mvmvif->ap_wep_key->keylen, +GFP_KERNEL ); +if (!mvm_sta->wep_key) { + ret = -ENOMEM ; + goto out_unlock; + } + + ret =iwl_mvm_set_sta_key (mvm, vif, sta, + mvm_sta->wep_key, +STA_KEY_IDX_INVALID ); + }else { + ret =0 ; + }/* we don't support TDLS during DCM */ if (iwl_mvm_phy_ctx_count (mvm) >1 )
@@ -3092,14 +3110,6 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,iwl_mvm_rs_rate_init (mvm, sta, mvmvif->phy_ctxt->channel->band, true); - -/* if wep is used, need to set the key for the station now */ -if (vif->type ==NL80211_IFTYPE_AP && mvmvif->ap_wep_key) - ret =iwl_mvm_set_sta_key (mvm, vif, sta, - mvmvif->ap_wep_key, -STA_KEY_IDX_INVALID ); -else - ret =0 ; }else if (old_state ==IEEE80211_STA_AUTHORIZED && new_state ==IEEE80211_STA_ASSOC ) {/* disable beacon filtering */
@@ -3127,10 +3137,12 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,/* Remove STA key if this is an AP using WEP */ if (vif->type ==NL80211_IFTYPE_AP && mvmvif->ap_wep_key) {int rm_ret =iwl_mvm_remove_sta_key (mvm, vif, sta, - mvmvif->ap_wep_key); + mvm_sta->wep_key);if (!ret) ret = rm_ret; +kfree (mvm_sta->wep_key); + mvm_sta->wep_key =NULL ; } }else {
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +78 -54
160 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/sta.h +3 -0
@@ -394,6 +394,7 @@ struct iwl_mvm_rxq_dup_data {* the BA window. To be used for UAPSD only. * @ptk_pn: per-queue PTK PN data structures * @dup_data: per queue duplicate packet detection data +* @wep_key: used in AP mode. Is a duplicate of the WEP key. * @deferred_traffic_tid_map: indication bitmap of deferred traffic per-TID * @tx_ant: the index of the antenna to use for data tx to this station. Only * used during connection establishment (e.g. for the 4 way handshake
@@ -425,6 +426,8 @@ struct iwl_mvm_sta {struct iwl_mvm_key_pn __rcu *ptk_pn[4 ];struct iwl_mvm_rxq_dup_data *dup_data; +struct ieee80211_key_conf *wep_key; +u8 reserved_queue;/* Temporary, until the new TLC will control the Tx protection */
Signature · 1 line
2.20.1