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uaCAgICAgfCAgICA2ICstDQogZHJp dmVycy9uZXQvd2lyZWxlc3MvaW50ZWwvaXdsd2lmaS9wY2llL3J4LmMgICAgICAgICAgIHwgICAx MiArLQ0KIGRyaXZlcnMvbmV0L3dpcmVsZXNzL2ludGVsL2l3bHdpZmkvcGNpZS90cmFucy5jICAg ICAgICB8ICAgMzUgKystLQ0KIGRyaXZlcnMvbmV0L3dpcmVsZXNzL2ludGVsL2l3bHdpZmkvcGNp ZS90eC5jICAgICAgICAgICB8ICAgODAgKysrKystLS0tDQogNDcgZmlsZXMgY2hhbmdlZCwgMTQ3 NSBpbnNlcnRpb25zKCspLCAxOTA3IGRlbGV0aW9ucygtKQ0KIGRlbGV0ZSBtb2RlIDEwMDY0NCBk cml2ZXJzL25ldC93aXJlbGVzcy9pbnRlbC9pd2x3aWZpL212bS9jb2V4X2xlZ2FjeS5j
PATCH 1/43 iwlwifi: pcie: clear trans reference on queue stop
From: Sara Sharon <[email protected]>
Currently when stop flow is performed, there might be transport TX RTPM references that are not freed in case we unmap a queue that still has packets not reclaimed. Fix that.
--- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 59 +++++++++++++++++----------- 1 file changed, 36 insertions(+), 23 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/tx.c +36 -23
@@ -596,6 +596,28 @@ static void iwl_pcie_free_tso_page(struct sk_buff *skb) } } +static void iwl_pcie_clear_cmd_in_flight (struct iwl_trans *trans) +{ +struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); + +lockdep_assert_held (&trans_pcie->reg_lock); + +if (trans_pcie->ref_cmd_in_flight) { + trans_pcie->ref_cmd_in_flight = false; +IWL_DEBUG_RPM (trans,"clear ref_cmd_in_flight - unref\n" ); +iwl_trans_pcie_unref (trans); + } + +if (!trans->cfg->base_params->apmg_wake_up_wa) +return ; +if (WARN_ON (!trans_pcie->cmd_hold_nic_awake)) +return ; + + trans_pcie->cmd_hold_nic_awake = false; +__iwl_trans_pcie_clear_bit (trans,CSR_GP_CNTRL , +CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ ); +} +/* * iwl_pcie_txq_unmap - Unmap any remaining DMA mappings and free skb's */
@@ -620,6 +642,20 @@ static void iwl_pcie_txq_unmap(struct iwl_trans *trans, int txq_id) }iwl_pcie_txq_free_tfd (trans, txq); q->read_ptr =iwl_queue_inc_wrap (q->read_ptr); + +if (q->read_ptr == q->write_ptr) { +unsigned long flags; + +spin_lock_irqsave (&trans_pcie->reg_lock, flags); +if (txq_id != trans_pcie->cmd_queue) { +IWL_DEBUG_RPM (trans,"Q %d - last tx freed\n" , + q->id); +iwl_trans_pcie_unref (trans); + }else { +iwl_pcie_clear_cmd_in_flight (trans); + } +spin_unlock_irqrestore (&trans_pcie->reg_lock, flags); + } } txq->active = false;
@@ -1148,29 +1184,6 @@ static int iwl_pcie_set_cmd_in_flight(struct iwl_trans *trans,return 0 ; } -static int iwl_pcie_clear_cmd_in_flight (struct iwl_trans *trans) -{ -struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); - -lockdep_assert_held (&trans_pcie->reg_lock); - -if (trans_pcie->ref_cmd_in_flight) { - trans_pcie->ref_cmd_in_flight = false; -IWL_DEBUG_RPM (trans,"clear ref_cmd_in_flight - unref\n" ); -iwl_trans_pcie_unref (trans); - } - -if (trans->cfg->base_params->apmg_wake_up_wa) { -if (WARN_ON (!trans_pcie->cmd_hold_nic_awake)) -return 0 ; - - trans_pcie->cmd_hold_nic_awake = false; -__iwl_trans_pcie_clear_bit (trans,CSR_GP_CNTRL , -CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ ); - } -return 0 ; -} -/* * iwl_pcie_cmdq_reclaim - Reclaim TX command queue entries already Tx'd *
Signature · 1 line
2.5.0
PATCH 2/43 iwlwifi: mvm: Decrease size of the paging download buffer
In reply to Grumbach, EmmanuelFrom: Matti Gottlieb <[email protected]>
Currently the driver has 2 buffers for paging:
1. paging db - this contains all of the pages that were in the FW image, that the driver stores for the FW. This is allocated for each block separately (not contiguous).
2. download buffer - we need to provide this empty buffer for the iwl_sdio_load_fw_chunk function to copy the requested pages to the shared memory. This is one big buffer of contiguous memory whose size is the size of all the blocks that the fw paging section can contain.
This download buffer size is too big, and causes the allocation to fail sometimes. Since the driver allocates memory for each block separately, it is not possible for the FW to request all of the pages in one request (the FW gives an address and size, so blocks need to be contiguous for this to happen), therefore the FW is limited to request only one block.
Decrease the size of the paging download buffer to be the size of a paging block.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +3 -1
@@ -410,7 +410,9 @@ static int iwl_trans_get_paging_item(struct iwl_mvm *mvm) goto exit; } - mvm->trans->paging_download_buf =kzalloc (MAX_PAGING_IMAGE_SIZE , +/* Add an extra page for headers */ + mvm->trans->paging_download_buf =kzalloc (PAGING_BLOCK_SIZE + +FW_PAGING_SIZE ,GFP_KERNEL );if (!mvm->trans->paging_download_buf) { ret = -ENOMEM ;
Signature · 1 line
2.5.0
PATCH 3/43 iwlwifi: mvm: make sure FW contains the right amount of paging sections
In reply to Grumbach, EmmanuelFrom: Matti Gottlieb <[email protected]>
Paging contains 3 sections in the fw. The first for the paging separator, The second for the CSS block, the third with the paging data.
Currently if the driver finds the paging separator, and there is only section left (CSS), once reading the CSS section, the driver will attempt to read the paging data and will go out of the arrays bounds.
Make sure that the FW image contains the right amount of sections for paging.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +6 -2
@@ -174,8 +174,12 @@ static int iwl_fill_paging_mem(struct iwl_mvm *mvm, const struct fw_img *image) } } -if (sec_idx >=IWL_UCODE_SECTION_MAX ) { -IWL_ERR (mvm,"driver didn't find paging image\n" ); +/* +* If paging is enabled there should be at least 2 more sections left +* (one for CSS and one for Paging data) +*/ +if (sec_idx >=ARRAY_SIZE (image->sec) -1 ) { +IWL_ERR (mvm,"Paging: Missing CSS and/or paging sections\n" );iwl_free_fw_paging (mvm);return -EINVAL ; }
Signature · 1 line
2.5.0
PATCH 4/43 iwlwifi: mvm: support dumping UMAC internal txfifos
In reply to Grumbach, EmmanuelFrom: Golan Ben-Ami <[email protected]>
In case of FW error, support dumping the UMAC internal txfifos. To do so, support version 2 of shared memory cfg command, which contains the sizes of the internal txfifos, and move the command to the system group.
--- .../net/wireless/intel/iwlwifi/iwl-fw-error-dump.h | 1 + drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h | 3 + drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 12 ++++ drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h | 17 ++++- drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c | 79 +++++++++++++++++++++- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 28 +++++++- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 8 +++ 8 files changed, 146 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-fw-error-dump.h +1 -0
@@ -105,6 +105,7 @@ enum iwl_fw_error_dump_type {IWL_FW_ERROR_DUMP_RB =11 ,IWL_FW_ERROR_DUMP_PAGING =12 ,IWL_FW_ERROR_DUMP_RADIO_REG =13 , +IWL_FW_ERROR_DUMP_INTERNAL_TXF =14 , IWL_FW_ERROR_DUMP_MAX, };
drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h +3 -0
@@ -324,6 +324,8 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_capa_t;* @IWL_UCODE_TLV_CAPA_CTDP_SUPPORT: supports cTDP command * @IWL_UCODE_TLV_CAPA_USNIFFER_UNIFIED: supports usniffer enabled in * regular image. +* @IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG: support getting more shared +* memory addresses from the firmware. * * @NUM_IWL_UCODE_TLV_CAPA: number of bits used */
@@ -361,6 +363,7 @@ enum iwl_ucode_tlv_capa {IWL_UCODE_TLV_CAPA_TEMP_THS_REPORT_SUPPORT = (__force iwl_ucode_tlv_capa_t )75 ,IWL_UCODE_TLV_CAPA_CTDP_SUPPORT = (__force iwl_ucode_tlv_capa_t )76 ,IWL_UCODE_TLV_CAPA_USNIFFER_UNIFIED = (__force iwl_ucode_tlv_capa_t )77 , +IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG = (__force iwl_ucode_tlv_capa_t )80 , NUM_IWL_UCODE_TLV_CAPA#ifdef __CHECKER__
drivers/net/wireless/intel/iwlwifi/iwl-prph.h +12 -0
@@ -7,6 +7,7 @@* * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH +* Copyright(c) 2016 Intel Deutschland GmbH * * 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
@@ -33,6 +34,7 @@* * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH +* Copyright(c) 2016 Intel Deutschland GmbH * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -345,6 +347,16 @@ enum secure_load_status_reg {#define TXF_READ_MODIFY_DATA (0xa00448)#define TXF_READ_MODIFY_ADDR (0xa0044c) +/* UMAC Internal Tx Fifo */ +#define TXF_CPU2_FIFO_ITEM_CNT (0xA00538) +#define TXF_CPU2_WR_PTR (0xA00514) +#define TXF_CPU2_RD_PTR (0xA00510) +#define TXF_CPU2_FENCE_PTR (0xA00518) +#define TXF_CPU2_LOCK_FENCE (0xA00524) +#define TXF_CPU2_NUM (0xA0053C) +#define TXF_CPU2_READ_MODIFY_DATA (0xA00548) +#define TXF_CPU2_READ_MODIFY_ADDR (0xA0054C) +/* Radio registers access */ #define RSP_RADIO_CMD (0xa02804)#define RSP_RADIO_RDDAT (0xa02814)
drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h +16 -1
@@ -287,6 +287,10 @@ enum iwl_phy_ops_subcmd_ids { DTS_MEASUREMENT_NOTIF_WIDE = 0xFF, }; +enum iwl_system_subcmd_ids { +SHARED_MEM_CFG_CMD =0x0 , +}; +enum iwl_data_path_subcmd_ids {UPDATE_MU_GROUPS_CMD =0x1 ,TRIGGER_RX_QUEUES_NOTIF_CMD =0x2 ,
@@ -302,6 +306,7 @@ enum iwl_prot_offload_subcmd_ids {enum {LEGACY_GROUP =0x0 ,LONG_GROUP =0x1 , +SYSTEM_GROUP =0x2 ,PHY_OPS_GROUP =0x4 ,DATA_PATH_GROUP =0x5 ,PROT_OFFLOAD_GROUP =0xb ,
@@ -1923,6 +1928,7 @@ struct iwl_tdls_config_res {#define TX_FIFO_MAX_NUM 8#define RX_FIFO_MAX_NUM 2 +#define TX_FIFO_INTERNAL_MAX_NUM 6/** * Shared memory configuration information from the FW
@@ -1940,6 +1946,12 @@ struct iwl_tdls_config_res {* @page_buff_addr: used by UMAC and performance debug (page miss analysis), * when paging is not supported this should be 0 * @page_buff_size: size of %page_buff_addr +* @rxfifo_addr: Start address of rxFifo +* @internal_txfifo_addr: start address of internalFifo +* @internal_txfifo_size: internal fifos' size +* +* NOTE: on firmware that don't have IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG +* set, the last 3 members don't exist. */ struct iwl_shared_mem_cfg {__le32 shared_mem_addr;
@@ -1951,7 +1963,10 @@ struct iwl_shared_mem_cfg {__le32 rxfifo_size[RX_FIFO_MAX_NUM ];__le32 page_buff_addr;__le32 page_buff_size; -} __packed;/* SHARED_MEM_ALLOC_API_S_VER_1 */ +__le32 rxfifo_addr; +__le32 internal_txfifo_addr; +__le32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM ]; +} __packed;/* SHARED_MEM_ALLOC_API_S_VER_2 */ /** * VHT MU-MIMO group configuration
drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c +77 -2
103 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +26 -2
@@ -794,17 +794,22 @@ out:static void iwl_mvm_get_shared_mem_conf (struct iwl_mvm *mvm) {struct iwl_host_cmd cmd = { - .id =SHARED_MEM_CFG , .flags =CMD_WANT_SKB , .data = {NULL , }, .len = {0 , }, }; -struct iwl_rx_packet *pkt;struct iwl_shared_mem_cfg *mem_cfg; +struct iwl_rx_packet *pkt;u32 i;lockdep_assert_held (&mvm->mutex); +if (fw_has_capa (&mvm->fw->ucode_capa, +IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG )) + cmd.id =iwl_cmd_id (SHARED_MEM_CFG_CMD ,SYSTEM_GROUP ,0 ); +else + cmd.id =SHARED_MEM_CFG ; +if (WARN_ON (iwl_mvm_send_cmd (mvm, &cmd)))return ;
@@ -830,6 +835,25 @@ static void iwl_mvm_get_shared_mem_conf(struct iwl_mvm *mvm)le32_to_cpu (mem_cfg->page_buff_addr); mvm->shared_mem_cfg.page_buff_size =le32_to_cpu (mem_cfg->page_buff_size); + +/* new API has more data */ +if (fw_has_capa (&mvm->fw->ucode_capa, +IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG )) { + mvm->shared_mem_cfg.rxfifo_addr = +le32_to_cpu (mem_cfg->rxfifo_addr); + mvm->shared_mem_cfg.internal_txfifo_addr = +le32_to_cpu (mem_cfg->internal_txfifo_addr); + +BUILD_BUG_ON (sizeof (mvm->shared_mem_cfg.internal_txfifo_size) != +sizeof (mem_cfg->internal_txfifo_size)); + +for (i =0 ; + i <ARRAY_SIZE (mvm->shared_mem_cfg.internal_txfifo_size); + i++) + mvm->shared_mem_cfg.internal_txfifo_size[i] = +le32_to_cpu (mem_cfg->internal_txfifo_size[i]); + } +IWL_DEBUG_INFO (mvm,"SHARED MEM CFG: got memory offsets/sizes\n" );iwl_free_resp (&cmd);
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +3 -0
@@ -602,6 +602,9 @@ struct iwl_mvm_shared_mem_cfg {u32 rxfifo_size[RX_FIFO_MAX_NUM ];u32 page_buff_addr;u32 page_buff_size; +u32 rxfifo_addr; +u32 internal_txfifo_addr; +u32 internal_txfifo_size[TX_FIFO_INTERNAL_MAX_NUM ]; };struct iwl_mvm {
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +8 -0
@@ -421,6 +421,13 @@ static const struct iwl_hcmd_names iwl_mvm_legacy_names[] = {/* Please keep this array *SORTED* by hex value. * Access is done through binary search */ +static const struct iwl_hcmd_names iwl_mvm_system_names[] = { +HCMD_NAME (SHARED_MEM_CFG_CMD ), +}; + +/* Please keep this array *SORTED* by hex value. +* Access is done through binary search +*/ static const struct iwl_hcmd_names iwl_mvm_phy_names[] = {HCMD_NAME (CMD_DTS_MEASUREMENT_TRIGGER_WIDE ),HCMD_NAME (CTDP_CONFIG_CMD ),
@@ -449,6 +456,7 @@ static const struct iwl_hcmd_names iwl_mvm_prot_offload_names[] = {static const struct iwl_hcmd_arr iwl_mvm_groups[] = { [LEGACY_GROUP ] =HCMD_ARR (iwl_mvm_legacy_names), [LONG_GROUP ] =HCMD_ARR (iwl_mvm_legacy_names), + [SYSTEM_GROUP ] =HCMD_ARR (iwl_mvm_system_names), [PHY_OPS_GROUP ] =HCMD_ARR (iwl_mvm_phy_names), [DATA_PATH_GROUP ] =HCMD_ARR (iwl_mvm_data_path_names), [PROT_OFFLOAD_GROUP ] =HCMD_ARR (iwl_mvm_prot_offload_names),
Signature · 1 line
2.5.0
PATCH 5/43 iwlwifi: mvm: add LQM vendor command and notification
In reply to Grumbach, EmmanuelFrom: Aviya Erenfeld <[email protected]>
LQM stands for Link Quality Measurement. The firmware will collect a defined set of statitics (see the notification for details) that allow to know how busy the medium is. The driver issues a request to the firmware that includes the duration of the measurement (the firmware needs to be on channel for that amount of time) and the timeout (in case the firmware has a lot of offchannel activities). If the timeout elapses, the firmware will send partial results which are still valuable.
In case of disassociation / channel switch and alike, the driver is in charge of stopping the measurements and the firmware will reply with partial results.
The user space API for now is debugfs only and will be implmemented in an upcoming patch.
--- drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h | 2 + drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h | 62 ++++++++++++++++++++ drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 10 ++++ drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 12 ++++ drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 9 +++ drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 71 +++++++++++++++++++++++ 6 files changed, 166 insertions(+)
drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h +2 -0
@@ -326,6 +326,7 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_capa_t;* regular image. * @IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG: support getting more shared * memory addresses from the firmware. +* @IWL_UCODE_TLV_CAPA_LQM_SUPPORT: supports Link Quality Measurement * * @NUM_IWL_UCODE_TLV_CAPA: number of bits used */
@@ -364,6 +365,7 @@ enum iwl_ucode_tlv_capa {IWL_UCODE_TLV_CAPA_CTDP_SUPPORT = (__force iwl_ucode_tlv_capa_t )76 ,IWL_UCODE_TLV_CAPA_USNIFFER_UNIFIED = (__force iwl_ucode_tlv_capa_t )77 ,IWL_UCODE_TLV_CAPA_EXTEND_SHARED_MEM_CFG = (__force iwl_ucode_tlv_capa_t )80 , +IWL_UCODE_TLV_CAPA_LQM_SUPPORT = (__force iwl_ucode_tlv_capa_t )81 , NUM_IWL_UCODE_TLV_CAPA#ifdef __CHECKER__
drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h +62 -0
78 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +10 -0
@@ -1821,6 +1821,11 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,if (changes &BSS_CHANGED_ASSOC && bss_conf->assoc)iwl_mvm_mac_ctxt_recalc_tsf_id (mvm, vif); +if (changes &BSS_CHANGED_ASSOC && !bss_conf->assoc && + mvmvif->lqm_active) +iwl_mvm_send_lqm_cmd (vif,LQM_CMD_OPERATION_STOP_MEASUREMENT , +0 ,0 ); +/* * If we're not associated yet, take the (new) BSSID before associating * so the firmware knows. If we're already associated, then use the old
@@ -3628,6 +3633,11 @@ static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw,break ;case NL80211_IFTYPE_STATION : +if (mvmvif->lqm_active) +iwl_mvm_send_lqm_cmd (vif, +LQM_CMD_OPERATION_STOP_MEASUREMENT , +0 ,0 ); +/* Schedule the time event to a bit before beacon 1, * to make sure we're in the new channel when the * GO/AP arrives.
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +12 -0
@@ -453,6 +453,12 @@ struct iwl_mvm_vif {/* TCP Checksum Offload */ netdev_features_t features; + +/* +* link quality measurement - used to check whether this interface +* is in the middle of a link quality measurement +*/ +bool lqm_active; }; static inline struct iwl_mvm_vif *
@@ -1637,4 +1643,10 @@ unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm,void iwl_mvm_connection_loss (struct iwl_mvm *mvm,struct ieee80211_vif *vif,const char *errmsg); +/* Link Quality Measurement */ +int iwl_mvm_send_lqm_cmd (struct ieee80211_vif *vif, +enum iwl_lqm_cmd_operatrions operation, +u32 duration,u32 timeout); +bool iwl_mvm_lqm_active (struct iwl_mvm *mvm); +#endif /* __IWL_MVM_H__ */
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +9 -0
@@ -428,6 +428,14 @@ static const struct iwl_hcmd_names iwl_mvm_system_names[] = {/* Please keep this array *SORTED* by hex value. * Access is done through binary search */ +static const struct iwl_hcmd_names iwl_mvm_mac_conf_names[] = { +HCMD_NAME (LINK_QUALITY_MEASUREMENT_CMD ), +HCMD_NAME (LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF ), +}; + +/* Please keep this array *SORTED* by hex value. +* Access is done through binary search +*/ static const struct iwl_hcmd_names iwl_mvm_phy_names[] = {HCMD_NAME (CMD_DTS_MEASUREMENT_TRIGGER_WIDE ),HCMD_NAME (CTDP_CONFIG_CMD ),
@@ -457,6 +465,7 @@ static const struct iwl_hcmd_arr iwl_mvm_groups[] = { [LEGACY_GROUP] = HCMD_ARR(iwl_mvm_legacy_names), [LONG_GROUP] = HCMD_ARR(iwl_mvm_legacy_names), [SYSTEM_GROUP] = HCMD_ARR(iwl_mvm_system_names), + [MAC_CONF_GROUP] = HCMD_ARR(iwl_mvm_mac_conf_names), [PHY_OPS_GROUP] = HCMD_ARR(iwl_mvm_phy_names), [DATA_PATH_GROUP] = HCMD_ARR(iwl_mvm_data_path_names), [PROT_OFFLOAD_GROUP] = HCMD_ARR(iwl_mvm_prot_offload_names),
drivers/net/wireless/intel/iwlwifi/mvm/utils.c +71 -0
74 lines not on this page · raw message
Signature · 1 line
2.5.0
PATCH 6/43 iwlwifi: add a debugfs hook for LQM
In reply to Grumbach, EmmanuelFrom: Aviya Erenfeld <[email protected]>
Add debugfs entry named lqm_send_cmd for kicking a measurement. This hook takes the duration and the timeout as parameter.
--- .../net/wireless/intel/iwlwifi/mvm/debugfs-vif.c | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +85 -0
@@ -1425,6 +1425,89 @@ static ssize_t iwl_dbgfs_quota_min_read(struct file *file,return simple_read_from_buffer (user_buf, count, ppos, buf, len); } +static const char *const chanwidths[] = { + [NL80211_CHAN_WIDTH_20_NOHT ] ="noht" , + [NL80211_CHAN_WIDTH_20 ] ="ht20" , + [NL80211_CHAN_WIDTH_40 ] ="ht40" , + [NL80211_CHAN_WIDTH_80 ] ="vht80" , + [NL80211_CHAN_WIDTH_80P80 ] ="vht80p80" , + [NL80211_CHAN_WIDTH_160 ] ="vht160" , +}; + +static bool iwl_mvm_lqm_notif_wait (struct iwl_notif_wait_data *notif_wait, +struct iwl_rx_packet *pkt,void *data) +{ +struct ieee80211_vif *vif = data; +struct iwl_mvm *mvm = + container_of(notif_wait, struct iwl_mvm, notif_wait); +struct iwl_link_qual_msrmnt_notif *report = (void *)pkt->data; +u32 num_of_stations =le32_to_cpu (report->number_of_stations); +int i; + +IWL_INFO (mvm,"LQM report:\n" ); +IWL_INFO (mvm,"\tstatus: %d\n" , report->status); +IWL_INFO (mvm,"\tmacID: %d\n" ,le32_to_cpu (report->mac_id)); +IWL_INFO (mvm,"\ttx_frame_dropped: %d\n" , +le32_to_cpu (report->tx_frame_dropped)); +IWL_INFO (mvm,"\ttime_in_measurement_window: %d us\n" , +le32_to_cpu (report->time_in_measurement_window)); +IWL_INFO (mvm,"\ttotal_air_time_other_stations: %d\n" , +le32_to_cpu (report->total_air_time_other_stations)); +IWL_INFO (mvm,"\tchannel_freq: %d\n" , + vif->bss_conf.chandef.center_freq1); +IWL_INFO (mvm,"\tchannel_width: %s\n" , + chanwidths[vif->bss_conf.chandef.width]); +IWL_INFO (mvm,"\tnumber_of_stations: %d\n" , num_of_stations); +for (i =0 ; i < num_of_stations; i++) +IWL_INFO (mvm,"\t\tsta[%d]: %d\n" , i, + report->frequent_stations_air_time[i]); + +return true; +} + +static ssize_t iwl_dbgfs_lqm_send_cmd_write (struct ieee80211_vif *vif, +char *buf,size_t count, +loff_t *ppos) +{ +struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (vif); +struct iwl_mvm *mvm = mvmvif->mvm; +struct iwl_notification_wait wait_lqm_notif; +static u16 lqm_notif[] = { +WIDE_ID (MAC_CONF_GROUP , +LINK_QUALITY_MEASUREMENT_COMPLETE_NOTIF ) + }; +int err; +u32 duration; +u32 timeout; + +if (sscanf (buf,"%d,%d" , &duration, &timeout) !=2 ) +return -EINVAL ; + +iwl_init_notification_wait (&mvm->notif_wait, &wait_lqm_notif, + lqm_notif,ARRAY_SIZE (lqm_notif), + iwl_mvm_lqm_notif_wait, vif); +mutex_lock (&mvm->mutex); + err =iwl_mvm_send_lqm_cmd (vif,LQM_CMD_OPERATION_START_MEASUREMENT , + duration, timeout); +mutex_unlock (&mvm->mutex); + +if (err) { +IWL_ERR (mvm,"Failed to send lqm cmdf(err=%d)\n" , err); +iwl_remove_notification (&mvm->notif_wait, &wait_lqm_notif); +return err; + } + +/* wait for 2 * timeout (safety guard) and convert to jiffies*/ + timeout =msecs_to_jiffies ((timeout *2 ) /1000 ); + + err =iwl_wait_notification (&mvm->notif_wait, &wait_lqm_notif, + timeout); +if (err) +IWL_ERR (mvm,"Getting lqm notif timed out\n" ); + +return count; +} +#define MVM_DEBUGFS_WRITE_FILE_OPS (name, bufsz) \ _MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz, struct ieee80211_vif)#define MVM_DEBUGFS_READ_WRITE_FILE_OPS (name, bufsz) \
@@ -1449,6 +1532,7 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(tof_range_abort, 32);MVM_DEBUGFS_READ_FILE_OPS (tof_range_response);MVM_DEBUGFS_READ_WRITE_FILE_OPS (tof_responder_params,32 );MVM_DEBUGFS_READ_WRITE_FILE_OPS (quota_min,32 ); +MVM_DEBUGFS_WRITE_FILE_OPS (lqm_send_cmd,64 );void iwl_mvm_vif_dbgfs_register (struct iwl_mvm *mvm,struct ieee80211_vif *vif) {
@@ -1488,6 +1572,7 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) S_IRUSR | S_IWUSR);MVM_DEBUGFS_ADD_FILE_VIF (quota_min, mvmvif->dbgfs_dir,S_IRUSR |S_IWUSR ); +MVM_DEBUGFS_ADD_FILE_VIF (lqm_send_cmd, mvmvif->dbgfs_dir,S_IWUSR );if (vif->type ==NL80211_IFTYPE_STATION && !vif->p2p && mvmvif == mvm->bf_allowed_vif)
Signature · 1 line
2.5.0
PATCH 7/43 iwlwifi: pcie: fix global table size
In reply to Grumbach, EmmanuelFrom: Sara Sharon <[email protected]>
My patch resized the pool size, but neglected to resize the global table, which is obviously wrong since the global table maps the pool's rxb to vid one to one. This results in a panic in 9000 devices.
Add a build bug to avoid such a case in the future.
--- drivers/net/wireless/intel/iwlwifi/pcie/internal.h | 2 +- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/internal.h +1 -1
@@ -348,7 +348,7 @@ struct iwl_tso_hdr_page {struct iwl_trans_pcie {struct iwl_rxq *rxq;struct iwl_rx_mem_buffer rx_pool[RX_POOL_SIZE ]; -struct iwl_rx_mem_buffer *global_table[MQ_RX_TABLE_SIZE ]; +struct iwl_rx_mem_buffer *global_table[RX_POOL_SIZE ];struct iwl_rb_allocator rba;struct iwl_trans *trans;struct iwl_drv *drv;
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +2 -0
@@ -908,6 +908,8 @@ int iwl_pcie_rx_init(struct iwl_trans *trans) allocator_pool_size = trans->num_rx_queues * (RX_CLAIM_REQ_ALLOC -RX_POST_REQ_ALLOC ); num_alloc = queue_size + allocator_pool_size; +BUILD_BUG_ON (ARRAY_SIZE (trans_pcie->global_table) != +ARRAY_SIZE (trans_pcie->rx_pool));for (i =0 ; i < num_alloc; i++) {struct iwl_rx_mem_buffer *rxb = &trans_pcie->rx_pool[i];
Signature · 1 line
2.5.0
PATCH 8/43 iwlwifi: pcie: enable interrupts explicitly on resume
In reply to Grumbach, EmmanuelFrom: Sara Sharon <[email protected]>
When entering suspend the driver calls iwl_disable_interrupts() and then iwl_pcie_disable_ict().
On resume the driver calls only iwl_pcie_reset_ict() without calling explicitly to iwl_enable_interrupts().
This mostly works since iwl_pcie_reset_ict is calling to iwl_enable_interrupts, but it doesn't work when there is no ict_table in MSIx mode.
The result is that driver tries to resume but fails since it doesn't get the RX interrupt from FW indicating that d0i3 exit was completed. Fix it by adding an explicit call to enable interrupts.
--- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +1 -0
@@ -1321,6 +1321,7 @@ static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans,* after this call. */ iwl_pcie_reset_ict (trans); +iwl_enable_interrupts (trans);iwl_set_bit (trans,CSR_GP_CNTRL ,CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ );iwl_set_bit (trans,CSR_GP_CNTRL ,CSR_GP_CNTRL_REG_FLAG_INIT_DONE );
Signature · 1 line
2.5.0
PATCH 9/43 iwlwifi: pcie: refcounting is not necessary anymore
In reply to Grumbach, EmmanuelFrom: Luca Coelho <[email protected]>
We don't use the refcount value anymore, all the refcounting is done in the runtime PM usage_count value. Remove it.
--- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 4 +--- drivers/net/wireless/intel/iwlwifi/pcie/internal.h | 4 ---- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 25 ++++++++-------------- 3 files changed, 10 insertions(+), 23 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +1 -3
@@ -651,10 +651,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)/* The PCI device starts with a reference taken and we are * supposed to release it here. But to simplify the * interaction with the opmode, we don't do it now, but let -* the opmode release it when it's ready. To account for this -* reference, we start with ref_count set to 1. +* the opmode release it when it's ready. */ - trans_pcie->ref_count =1 ;return 0 ;
drivers/net/wireless/intel/iwlwifi/pcie/internal.h +0 -4
@@ -403,10 +403,6 @@ struct iwl_trans_pcie {bool cmd_hold_nic_awake;bool ref_cmd_in_flight; -/* protect ref counter */ -spinlock_t ref_lock; -u32 ref_count; -dma_addr_t fw_mon_phys;struct page *fw_mon_page;u32 fw_mon_size;
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +9 -16
@@ -2015,38 +2015,32 @@ static void iwl_trans_pcie_set_bits_mask(struct iwl_trans *trans, u32 reg,void iwl_trans_pcie_ref (struct iwl_trans *trans) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); -unsigned long flags;if (iwlwifi_mod_params.d0i3_disable)return ; -spin_lock_irqsave (&trans_pcie->ref_lock, flags); -IWL_DEBUG_RPM (trans,"ref_counter: %d\n" , trans_pcie->ref_count); - trans_pcie->ref_count++;pm_runtime_get (&trans_pcie->pci_dev->dev); -spin_unlock_irqrestore (&trans_pcie->ref_lock, flags); + +#ifdef CONFIG_PM +IWL_DEBUG_RPM (trans,"runtime usage count: %d\n" , +atomic_read (&trans_pcie->pci_dev->dev.power.usage_count)); +#endif /* CONFIG_PM */ }void iwl_trans_pcie_unref (struct iwl_trans *trans) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); -unsigned long flags;if (iwlwifi_mod_params.d0i3_disable)return ; -spin_lock_irqsave (&trans_pcie->ref_lock, flags); -IWL_DEBUG_RPM (trans,"ref_counter: %d\n" , trans_pcie->ref_count); -if (WARN_ON_ONCE (trans_pcie->ref_count ==0 )) { -spin_unlock_irqrestore (&trans_pcie->ref_lock, flags); -return ; - } - trans_pcie->ref_count--; -pm_runtime_mark_last_busy (&trans_pcie->pci_dev->dev);pm_runtime_put_autosuspend (&trans_pcie->pci_dev->dev); -spin_unlock_irqrestore (&trans_pcie->ref_lock, flags); +#ifdef CONFIG_PM +IWL_DEBUG_RPM (trans,"runtime usage count: %d\n" , +atomic_read (&trans_pcie->pci_dev->dev.power.usage_count)); +#endif /* CONFIG_PM */ }static const char *get_csr_string (int cmd)
@@ -2794,7 +2788,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, trans_pcie->trans = trans;spin_lock_init (&trans_pcie->irq_lock);spin_lock_init (&trans_pcie->reg_lock); -spin_lock_init (&trans_pcie->ref_lock);mutex_init (&trans_pcie->mutex);init_waitqueue_head (&trans_pcie->ucode_write_waitq); trans_pcie->tso_hdr_page = alloc_percpu(struct iwl_tso_hdr_page);
Signature · 1 line
2.5.0
PATCH 10/43 iwlwifi: mvm: handle async temperature notification with unlocked mutex
In reply to Grumbach, EmmanuelFrom: Chaya Rachel Ivgi <[email protected]>
Use RX_HANDLER_ASYNC_UNLOCKED instead of unlock and re-lock the mutex independently.
--- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +1 -1
@@ -292,7 +292,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {RX_HANDLER (DTS_MEASUREMENT_NOTIFICATION , iwl_mvm_temp_notif,RX_HANDLER_ASYNC_LOCKED ),RX_HANDLER_GRP (PHY_OPS_GROUP ,DTS_MEASUREMENT_NOTIF_WIDE , - iwl_mvm_temp_notif,RX_HANDLER_ASYNC_LOCKED ), + iwl_mvm_temp_notif,RX_HANDLER_ASYNC_UNLOCKED ),RX_HANDLER_GRP (PHY_OPS_GROUP ,CT_KILL_NOTIFICATION , iwl_mvm_ct_kill_notif, RX_HANDLER_SYNC),
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +0 -9
@@ -204,20 +204,11 @@ void iwl_mvm_temp_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)if (WARN_ON (ths_crossed >=IWL_MAX_DTS_TRIPS ))return ; -/* -* We are now handling a temperature notification from the firmware -* in ASYNC and hold the mutex. thermal_notify_framework will call -* us back through get_temp() which ought to send a SYNC command to -* the firmware and hence to take the mutex. -* Avoid the deadlock by unlocking the mutex here. -*/ if (mvm->tz_device.tzone) {struct iwl_mvm_thermal_device *tz_dev = &mvm->tz_device; -mutex_unlock (&mvm->mutex);thermal_notify_framework (tz_dev->tzone, tz_dev->fw_trips_index[ths_crossed]); -mutex_lock (&mvm->mutex); }#endif /* CONFIG_THERMAL */ }
Signature · 1 line
2.5.0
PATCH 11/43 iwlwifi: pcie: print error value as signed int
In reply to Grumbach, EmmanuelBjorn pointed out that printing an error value as an hexadecimal isn't very convenient. Change that.
--- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +1 -1
@@ -1466,7 +1466,7 @@ static void iwl_pcie_set_interrupt_capa(struct pci_dev *pdev, ret =pci_enable_msi (pdev);if (ret) { -dev_err (&pdev->dev,"pci_enable_msi failed(0X%x)\n" , ret); +dev_err (&pdev->dev,"pci_enable_msi failed - %d\n" , ret);/* enable rfkill interrupt: hw bug w/a */ pci_read_config_word (pdev,PCI_COMMAND , &pci_cmd);if (pci_cmd &PCI_COMMAND_INTX_DISABLE ) {
Signature · 1 line
2.5.0
PATCH 12/43 iwlwifi: mvm: modify the max SP to infinite
In reply to Grumbach, EmmanuelThis makes u-APSD work with more peers.
--- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/power.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +1 -1
@@ -208,7 +208,7 @@ enum iwl_power_scheme { };#define IWL_CONN_MAX_LISTEN_INTERVAL 10 -#define IWL_UAPSD_MAX_SP IEEE80211_WMM_IE_STA_QOSINFO_SP_2 +#define IWL_UAPSD_MAX_SP IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL#ifdef CONFIG_IWLWIFI_DEBUGFS enum iwl_dbgfs_pm_mask {
drivers/net/wireless/intel/iwlwifi/mvm/power.c +1 -1
@@ -227,7 +227,7 @@ static void iwl_mvm_power_configure_uapsd(struct iwl_mvm *mvm,cpu_to_le16 (IWL_MVM_PS_SNOOZE_WINDOW ); } - cmd->uapsd_max_sp =IWL_UAPSD_MAX_SP ; + cmd->uapsd_max_sp = mvm->hw->uapsd_max_sp_len;if (mvm->cur_ucode ==IWL_UCODE_WOWLAN || cmd->flags &cpu_to_le16 (POWER_FLAGS_SNOOZE_ENA_MSK )) {
Signature · 1 line
2.5.0
PATCH 13/43 iwlwifi: pcie: do not pad QoS AMSDU
In reply to Grumbach, EmmanuelFrom: Sara Sharon <[email protected]>
We insert padding if the MAC header's size is not a multiple of 4 to ensure that the SNAP header is DWORD aligned. When we do so, we let the firmware know by setting a bit in Tx command (TX_CMD_FLG_MH_PAD) which will instruct the firmware to drop those 2 bytes before sending the frame.
However, this is not needed for AMSDU as the sub frame header (14B) complements the MAC header (26B) so that the SNAP header is DWORD aligned without adding any pad.
Until 9000, the firmware didn't check the TX_CMD_FLG_MH_PAD bit but rather checked the length of the MAC header itself and assumed the entity that enqueued the frame (driver or internal firmware code) added the pad.
Since the driver inserted the pad even for AMSDU this logic applied. Note that the padding is a DMA optimization but it's not strictly needed, so we could pad even if it was not needed.
However, the CSUM hardware introduced for the 9000 devices requires to not pad AMSDU as it is not needed, and will fail if such a pad exists.
Due to older FW not checking the padding bit but checking the mac header size itself - we cannot do this adjustments for older generations.
Do not align the size if it is an AMSDU and HW checksum is enabled - which will only happen on 9000 devices and on.
--- drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/tx.c +14 -7
@@ -2210,6 +2210,7 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb,__le16 fc;u8 hdr_len;u16 wifi_seq; +bool amsdu; txq = &trans_pcie->txq[txq_id]; q = &txq->q;
@@ -2301,11 +2302,18 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb,*/ len =sizeof (struct iwl_tx_cmd ) +sizeof (struct iwl_cmd_header ) + hdr_len -IWL_HCMD_SCRATCHBUF_SIZE ; - tb1_len =ALIGN (len,4 ); - -/* Tell NIC about any 2-byte padding after MAC header */ -if (tb1_len != len) - tx_cmd->tx_flags |=TX_CMD_FLG_MH_PAD_MSK ; +/* do not align A-MSDU to dword as the subframe header aligns it */ + amsdu =ieee80211_is_data_qos (fc) && + (*ieee80211_get_qos_ctl (hdr) & +IEEE80211_QOS_CTL_A_MSDU_PRESENT ); +if (trans_pcie->sw_csum_tx || !amsdu) { + tb1_len =ALIGN (len,4 ); +/* Tell NIC about any 2-byte padding after MAC header */ +if (tb1_len != len) + tx_cmd->tx_flags |=TX_CMD_FLG_MH_PAD_MSK ; + }else { + tb1_len = len; + }/* The first TB points to the scratchbuf data - min_copy bytes */ memcpy(&txq->scratchbufs[q->write_ptr], &dev_cmd->hdr,
@@ -2323,8 +2331,7 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, goto out_err;iwl_pcie_txq_build_tfd (trans, txq, tb1_phys, tb1_len, false); -if (ieee80211_is_data_qos (fc) && - (*ieee80211_get_qos_ctl (hdr) &IEEE80211_QOS_CTL_A_MSDU_PRESENT )) { +if (amsdu) {if (unlikely (iwl_fill_data_tbs_amsdu (trans, skb, txq, hdr_len, out_meta, dev_cmd, tb1_len)))
Signature · 1 line
2.5.0
PATCH 14/43 iwlwifi: mvm: add support for new TX CMD API
In reply to Grumbach, EmmanuelFrom: Sara Sharon <[email protected]>
TX CMD API has changed to support offload assist. Currently we do not enable checksum yet, but must set the padding indication, to avoid FW errors.
Set other amsdu flag as well.
The rest of the flags will be configured only if HW csum is enabled and will be set in future patches. This change is backward compatible.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h | 35 ++++++++++++++++++++-- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 9 +++++- 2 files changed, 41 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h +33 -2
@@ -6,6 +6,7 @@* GPL LICENSE SUMMARY * * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. +* Copyright(c) 2016 Intel Deutschland GmbH * * 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
@@ -193,11 +194,41 @@ enum iwl_tx_pm_timeouts {#define IWL_BAR_DFAULT_RETRY_LIMIT 60#define IWL_LOW_RETRY_LIMIT 7 +/** +* enum iwl_tx_offload_assist_flags_pos - set %iwl_tx_cmd offload_assist values +* @TX_CMD_OFFLD_IP_HDR_OFFSET: offset to start of IP header (in words) +* from mac header end. For normal case it is 4 words for SNAP. +* note: tx_cmd, mac header and pad are not counted in the offset. +* This is used to help the offload in case there is tunneling such as +* IPv6 in IPv4, in such case the ip header offset should point to the +* inner ip header and IPv4 checksum of the external header should be +* calculated by driver. +* @TX_CMD_OFFLD_L4_EN: enable TCP/UDP checksum +* @TX_CMD_OFFLD_L3_EN: enable IP header checksum +* @TX_CMD_OFFLD_MH_SIZE: size of the mac header in words. Includes the IV +* field. Doesn't include the pad. +* @TX_CMD_OFFLD_PAD: mark 2-byte pad was inserted after the mac header for +* alignment +* @TX_CMD_OFFLD_AMSDU: mark TX command is A-MSDU +*/ +enum iwl_tx_offload_assist_flags_pos { +TX_CMD_OFFLD_IP_HDR =0 , +TX_CMD_OFFLD_L4_EN =6 , +TX_CMD_OFFLD_L3_EN =7 , +TX_CMD_OFFLD_MH_SIZE =8 , +TX_CMD_OFFLD_PAD =13 , +TX_CMD_OFFLD_AMSDU =14 , +}; + +#define IWL_TX_CMD_OFFLD_MH_MASK 0x1f +#define IWL_TX_CMD_OFFLD_IP_HDR_MASK 0x3f +/* TODO: complete documentation for try_cnt and btkill_cnt */ /** * struct iwl_tx_cmd - TX command struct to FW * ( TX_CMD = 0x1c ) * @len: in bytes of the payload, see below for details +* @offload_assist: TX offload configuration * @tx_flags: combination of TX_CMD_FLG_* * @rate_n_flags: rate for *all* Tx attempts, if TX_CMD_FLG_STA_RATE_MSK is * cleared. Combination of RATE_MCS_*
@@ -231,7 +262,7 @@ enum iwl_tx_pm_timeouts {*/ struct iwl_tx_cmd {__le16 len; -__le16 next_frame_len; +__le16 offload_assist;__le32 tx_flags;struct {u8 try_cnt;
@@ -255,7 +286,7 @@ struct iwl_tx_cmd {__le16 reserved4;u8 payload[0 ];struct ieee80211_hdr hdr[0 ]; -} __packed;/* TX_CMD_API_S_VER_3 */ +} __packed;/* TX_CMD_API_S_VER_6 */ /* * TX response related data
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +8 -1
@@ -126,6 +126,9 @@ void iwl_mvm_set_tx_cmd(struct iwl_mvm *mvm, struct sk_buff *skb,u8 *qc =ieee80211_get_qos_ctl (hdr); tx_cmd->tid_tspec = qc[0 ] &0xf ; tx_flags &= ~TX_CMD_FLG_SEQ_CTL ; +if (*qc &IEEE80211_QOS_CTL_A_MSDU_PRESENT ) + tx_cmd->offload_assist |= +cpu_to_le16 (BIT (TX_CMD_OFFLD_AMSDU )); }else if (ieee80211_is_back_req (fc)) {struct ieee80211_bar *bar = (void *)skb->data;u16 control =le16_to_cpu (bar->control);
@@ -186,9 +189,13 @@ void iwl_mvm_set_tx_cmd(struct iwl_mvm *mvm, struct sk_buff *skb,/* Total # bytes to be transmitted */ tx_cmd->len =cpu_to_le16 ((u16 )skb->len + (uintptr_t )info->driver_data[0 ]); - tx_cmd->next_frame_len =0 ; tx_cmd->life_time =cpu_to_le32 (TX_CMD_LIFE_TIME_INFINITE ); tx_cmd->sta_id = sta_id; + +/* padding is inserted later in transport */ +if (ieee80211_hdrlen (fc) %4 && + !(tx_cmd->offload_assist &cpu_to_le16 (BIT (TX_CMD_OFFLD_AMSDU )))) + tx_cmd->offload_assist |=cpu_to_le16 (BIT (TX_CMD_OFFLD_PAD )); }/*
Signature · 1 line
2.5.0
PATCH 15/43 iwlwifi: add missing mutex_destroy statements
In reply to Grumbach, Emmanueliwlwifi / iwlmvm didn't destroy their mutexes. Fix that.
--- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 3 +++ drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 1 + 2 files changed, 4 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +3 -0
@@ -782,6 +782,9 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode)iwl_mvm_tof_clean (mvm); +mutex_destroy (&mvm->mutex); +mutex_destroy (&mvm->d0i3_suspend_mutex); +ieee80211_free_hw (mvm->hw); }
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +1 -0
@@ -1695,6 +1695,7 @@ void iwl_trans_pcie_free(struct iwl_trans *trans) }free_percpu (trans_pcie->tso_hdr_page); +mutex_destroy (&trans_pcie->mutex);iwl_trans_free (trans); }
Signature · 1 line
2.5.0
PATCH 16/43 iwlwifi: make uapsd_disable module param a bitmap
In reply to Grumbach, EmmanuelThis allows to disable uapsd for BSS only, or P2P client separately. Remove the now unneeded IWL_MVM_P2P_UAPSD_STANDALONE constant.
--- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 10 ++++++---- drivers/net/wireless/intel/iwlwifi/iwl-modparams.h | 10 ++++++++-- drivers/net/wireless/intel/iwlwifi/mvm/constants.h | 1 - drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 3 ++- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 ++- 5 files changed, 18 insertions(+), 9 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +6 -4
@@ -1561,7 +1561,7 @@ struct iwl_mod_params iwlwifi_mod_params = { .d0i3_disable = true, .d0i3_entry_delay = 1000, #ifndef CONFIG_IWLWIFI_UAPSD - .uapsd_disable = true, + .uapsd_disable = IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT,#endif /* CONFIG_IWLWIFI_UAPSD */ /* the rest are 0 by default */ };
@@ -1681,11 +1681,13 @@ module_param_named(lar_disable, iwlwifi_mod_params.lar_disable,MODULE_PARM_DESC (lar_disable,"disable LAR functionality (default: N)" );module_param_named (uapsd_disable, iwlwifi_mod_params.uapsd_disable, - bool,S_IRUGO |S_IWUSR ); + uint,S_IRUGO |S_IWUSR );#ifdef CONFIG_IWLWIFI_UAPSD -MODULE_PARM_DESC (uapsd_disable,"disable U-APSD functionality (default: N)" ); +MODULE_PARM_DESC (uapsd_disable, +"disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 0)" );#else -MODULE_PARM_DESC (uapsd_disable,"disable U-APSD functionality (default: Y)" ); +MODULE_PARM_DESC (uapsd_disable, +"disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3)" );#endif /*
drivers/net/wireless/intel/iwlwifi/iwl-modparams.h +8 -2
@@ -92,6 +92,11 @@ enum iwl_amsdu_size { IWL_AMSDU_12K = 2, }; +enum iwl_uapsd_disable { +IWL_DISABLE_UAPSD_BSS =BIT (0 ), +IWL_DISABLE_UAPSD_P2P_CLIENT =BIT (1 ), +}; +/** * struct iwl_mod_params *
@@ -109,7 +114,8 @@ enum iwl_amsdu_size {* @debug_level: levels are IWL_DL_* * @ant_coupling: antenna coupling in dB, default = 0 * @nvm_file: specifies a external NVM file -* @uapsd_disable: disable U-APSD, default = 1 +* @uapsd_disable: disable U-APSD, see %enum iwl_uapsd_disable, default = +* IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT * @d0i3_disable: disable d0i3, default = 1, * @d0i3_entry_delay: time to wait after no refs are taken before * entering D0i3 (in msecs)
@@ -131,7 +137,7 @@ struct iwl_mod_params {#endif int ant_coupling;char *nvm_file; -bool uapsd_disable; +u32 uapsd_disable;bool d0i3_disable;unsigned int d0i3_entry_delay;bool lar_disable;
drivers/net/wireless/intel/iwlwifi/mvm/constants.h +0 -1
@@ -75,7 +75,6 @@#define IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT (10 * USEC_PER_MSEC)#define IWL_MVM_SHORT_PS_TX_DATA_TIMEOUT (2 * 1024)/* defined in TU */ #define IWL_MVM_SHORT_PS_RX_DATA_TIMEOUT (40 * 1024)/* defined in TU */ -#define IWL_MVM_P2P_UAPSD_STANDALONE 0#define IWL_MVM_P2P_LOWLATENCY_PS_ENABLE 0#define IWL_MVM_UAPSD_RX_DATA_TIMEOUT (50 * USEC_PER_MSEC)#define IWL_MVM_UAPSD_TX_DATA_TIMEOUT (50 * USEC_PER_MSEC)
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +2 -1
@@ -2345,7 +2345,8 @@ static void iwl_mvm_check_uapsd(struct iwl_mvm *mvm, struct ieee80211_vif *vif,return ; } -if (iwlwifi_mod_params.uapsd_disable) { +if (!vif->p2p && + (iwlwifi_mod_params.uapsd_disable &IWL_DISABLE_UAPSD_BSS )) { vif->driver_flags &= ~IEEE80211_VIF_SUPPORTS_UAPSD ;return ; }
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +2 -1
@@ -1072,7 +1072,8 @@ bool iwl_mvm_is_p2p_standalone_uapsd_supported(struct iwl_mvm *mvm) {return fw_has_capa (&mvm->fw->ucode_capa,IWL_UCODE_TLV_CAPA_P2P_STANDALONE_UAPSD ) && -IWL_MVM_P2P_UAPSD_STANDALONE ; + !(iwlwifi_mod_params.uapsd_disable & +IWL_DISABLE_UAPSD_P2P_CLIENT ); }static inline bool iwl_mvm_has_new_rx_api (struct iwl_mvm *mvm)
Signature · 1 line
2.5.0
PATCH 17/43 iwlwifi: 9000: update device id and FW serial number
In reply to Grumbach, EmmanuelFrom: Haim Dreyfuss <[email protected]>
Update device id and FW serial number for 2X2 antenna devices in 9000 generation product. These will not be available on the market in the coming year.
--- drivers/net/wireless/intel/iwlwifi/iwl-9000.c | 8 ++++---- drivers/net/wireless/intel/iwlwifi/iwl-config.h | 2 +- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-9000.c +4 -4
@@ -5,7 +5,7 @@* * GPL LICENSE SUMMARY * -* Copyright(c) 2015 Intel Deutschland GmbH +* Copyright(c) 2015-2016 Intel Deutschland GmbH * * 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
@@ -18,7 +18,7 @@* * BSD LICENSE * -* Copyright(c) 2015 Intel Deutschland GmbH +* Copyright(c) 2015-2016 Intel Deutschland GmbH * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -143,8 +143,8 @@ static const struct iwl_tt_params iwl9000_tt_params = { .vht_mu_mimo_supported = true, \ .mac_addr_from_csr = true -const struct iwl_cfg iwl9260_2ac_cfg = { - .name ="Intel(R) Dual Band Wireless AC 9260" , +const struct iwl_cfg iwl9560_2ac_cfg = { + .name ="Intel(R) Dual Band Wireless AC 9560" , .fw_name_pre =IWL9000_FW_PRE ,IWL_DEVICE_9000 , .ht_params = &iwl9000_ht_params,
drivers/net/wireless/intel/iwlwifi/iwl-config.h +1 -1
@@ -439,7 +439,7 @@ extern const struct iwl_cfg iwl8265_2ac_cfg;extern const struct iwl_cfg iwl4165_2ac_cfg;extern const struct iwl_cfg iwl8260_2ac_sdio_cfg;extern const struct iwl_cfg iwl4165_2ac_sdio_cfg; -extern const struct iwl_cfg iwl9260_2ac_cfg; +extern const struct iwl_cfg iwl9560_2ac_cfg;extern const struct iwl_cfg iwl5165_2ac_cfg;#endif /* CONFIG_IWLMVM */
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +5 -5
@@ -485,15 +485,15 @@ static const struct pci_device_id iwl_hw_card_ids[] = { /* 9000 Series */ {IWL_PCI_DEVICE(0x9DF0, 0x2A10, iwl5165_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x2010, iwl5165_2ac_cfg)}, - {IWL_PCI_DEVICE(0x9DF0, 0x0A10, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0x9DF0, 0x0010, iwl9260_2ac_cfg)}, + {IWL_PCI_DEVICE(0x2526, 0x0A10, iwl9560_2ac_cfg)}, + {IWL_PCI_DEVICE(0x2526, 0x0010, iwl9560_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x0000, iwl5165_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x0310, iwl5165_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x0510, iwl5165_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x0710, iwl5165_2ac_cfg)}, - {IWL_PCI_DEVICE(0x9DF0, 0x0210, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0x9DF0, 0x0410, iwl9260_2ac_cfg)}, - {IWL_PCI_DEVICE(0x9DF0, 0x0610, iwl9260_2ac_cfg)}, + {IWL_PCI_DEVICE(0x2526, 0x0210, iwl9560_2ac_cfg)}, + {IWL_PCI_DEVICE(0x2526, 0x0410, iwl9560_2ac_cfg)}, + {IWL_PCI_DEVICE(0x2526, 0x0610, iwl9560_2ac_cfg)}, #endif /* CONFIG_IWLMVM */ {0}
Signature · 1 line
2.5.0
PATCH 18/43 iwlwifi: mvm: remove is_data_qos variable in TX
In reply to Grumbach, EmmanuelFrom: Johannes Berg <[email protected]>
"is_data_qos == true" is equivalent to "tid < IWL_MAX_TID_COUNT" since tid is only assigned (and range-checked) in that case.
This removes a (harmless) smatch warning that occurs because it can't seem to follow the above logic from the code.
--- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +2 -3
@@ -654,7 +654,7 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,u16 seq_number =0 ;u8 tid =IWL_MAX_TID_COUNT ;u8 txq_id = info->hw_queue; -bool is_data_qos = false, is_ampdu = false; +bool is_ampdu = false;int hdrlen; mvmsta =iwl_mvm_sta_from_mac80211 (sta);
@@ -694,7 +694,6 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb, seq_number &=IEEE80211_SCTL_SEQ ; hdr->seq_ctrl &=cpu_to_le16 (IEEE80211_SCTL_FRAG ); hdr->seq_ctrl |=cpu_to_le16 (seq_number); - is_data_qos = true; is_ampdu = info->flags &IEEE80211_TX_CTL_AMPDU ; }
@@ -722,7 +721,7 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,if (iwl_trans_tx (mvm->trans, skb, dev_cmd, txq_id)) goto drop_unlock_sta; -if (is_data_qos && !ieee80211_has_morefrags (fc)) +if (tid <IWL_MAX_TID_COUNT && !ieee80211_has_morefrags (fc)) mvmsta->tid_data[tid].seq_number = seq_number +0x10 ;spin_unlock (&mvmsta->lock);
Signature · 1 line
2.5.0
PATCH 19/43 iwlwifi: mvm: support bss dynamic alloc/dealloc of queues
In reply to Grumbach, EmmanuelFrom: Liad Kaufman <[email protected]>
"DQA" is shorthand for "dynamic queue allocation". This enables on-demand allocation of queues per RA/TID rather than statically allocating per vif, thus allowing a potential benefit of various factors.
Please refer to the DOC section this patch adds to sta.h to see a more in-depth explanation of this feature.
There are many things to take into consideration when working in DQA mode, and this patch is only one in a series. Note that default operation mode is non-DQA mode, unless the FW indicates that it supports DQA mode.
This patch enables support of DQA for a station connected to an AP, and works in a non-aggregated mode.
When a frame for an unused RA/TID arrives at the driver, it isn't TXed immediately, but deferred first until a suitable queue is first allocated for it, and then TXed by a worker that both allocates the queues and TXes deferred traffic.
When a STA is removed, its queues goes back into the queue pools for reuse as needed.
--- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h | 22 +- drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 21 +- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 49 +++++ drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 7 + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 + drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 254 +++++++++++++++++++++- drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 87 +++++++- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 54 +++++ 9 files changed, 481 insertions(+), 16 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/d3.c +1 -1
@@ -723,7 +723,7 @@ static int iwl_mvm_d3_reprogram(struct iwl_mvm *mvm, struct ieee80211_vif *vif,return -EIO ; } - ret =iwl_mvm_sta_send_to_fw (mvm, ap_sta, false); + ret =iwl_mvm_sta_send_to_fw (mvm, ap_sta, false,0 );if (ret)return ret;rcu_assign_pointer (mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], ap_sta);
drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h +21 -1
@@ -80,12 +80,32 @@#include "fw-api-stats.h" #include "fw-api-tof.h" -/* Tx queue numbers */ +/* Tx queue numbers for non-DQA mode */ enum {IWL_MVM_OFFCHANNEL_QUEUE =8 ,IWL_MVM_CMD_QUEUE =9 , }; +/* +* DQA queue numbers +* +* @IWL_MVM_DQA_MIN_MGMT_QUEUE: first TXQ in pool for MGMT and non-QOS frames. +* Each MGMT queue is mapped to a single STA +* MGMT frames are frames that return true on ieee80211_is_mgmt() +* @IWL_MVM_DQA_MAX_MGMT_QUEUE: last TXQ in pool for MGMT frames +* @IWL_MVM_DQA_MIN_DATA_QUEUE: first TXQ in pool for DATA frames. +* DATA frames are intended for !ieee80211_is_mgmt() frames, but if +* the MGMT TXQ pool is exhausted, mgmt frames can be sent on DATA queues +* as well +* @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames +*/ +enum iwl_mvm_dqa_txq { +IWL_MVM_DQA_MIN_MGMT_QUEUE =5 , +IWL_MVM_DQA_MAX_MGMT_QUEUE =8 , +IWL_MVM_DQA_MIN_DATA_QUEUE =10 , +IWL_MVM_DQA_MAX_DATA_QUEUE =31 , +}; +enum iwl_mvm_tx_fifo {IWL_MVM_TX_FIFO_BK =0 ,IWL_MVM_TX_FIFO_BE ,
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +19 -2
@@ -425,12 +425,17 @@ static int iwl_mvm_mac_ctxt_allocate_resources(struct iwl_mvm *mvm,return 0 ; } -/* Find available queues, and allocate them to the ACs */ +/* +* Find available queues, and allocate them to the ACs. When in +* DQA-mode they aren't really used, and this is done only so the +* mac80211 ieee80211_check_queues() function won't fail +*/ for (ac =0 ; ac <IEEE80211_NUM_ACS ; ac++) {u8 queue =find_first_zero_bit (&used_hw_queues, mvm->first_agg_queue); -if (queue >= mvm->first_agg_queue) { +if (!iwl_mvm_is_dqa_supported (mvm) && + queue >= mvm->first_agg_queue) {IWL_ERR (mvm,"Failed to allocate queue\n" ); ret = -EIO ; goto exit_fail;
@@ -495,6 +500,10 @@ int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif) IWL_MVM_TX_FIFO_MCAST, 0, wdg_timeout);/* fall through */ default : +/* If DQA is supported - queues will be enabled when needed */ +if (iwl_mvm_is_dqa_supported (mvm)) +break ; +for (ac =0 ; ac <IEEE80211_NUM_ACS ; ac++) iwl_mvm_enable_ac_txq(mvm, vif->hw_queue[ac], vif->hw_queue[ac],
@@ -523,6 +532,14 @@ void iwl_mvm_mac_ctxt_release(struct iwl_mvm *mvm, struct ieee80211_vif *vif) IWL_MAX_TID_COUNT, 0);/* fall through */ default : +/* +* If DQA is supported - queues were already disabled, since in +* DQA-mode the queues are a property of the STA and not of the +* vif, and at this point the STA was already deleted +*/ +if (iwl_mvm_is_dqa_supported (mvm)) +break ; +for (ac =0 ; ac <IEEE80211_NUM_ACS ; ac++) iwl_mvm_disable_txq(mvm, vif->hw_queue[ac], vif->hw_queue[ac],
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +49 -0
79 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +7 -0
@@ -665,10 +665,16 @@ struct iwl_mvm {/* Map to HW queue */ u32 hw_queue_to_mac80211;u8 hw_queue_refcount; +/* +* This is to mark that queue is reserved for a STA but not yet +* allocated. This is needed to make sure we have at least one +* available queue to use when adding a new STA +*/ bool setup_reserved;u16 tid_bitmap;/* Bitmap of the TIDs mapped to this queue */ } queue_info[IWL_MAX_HW_QUEUES ];spinlock_t queue_info_lock;/* For syncing queue mgmt operations */ +struct work_struct add_stream_wk;/* To add streams to queues */ atomic_t mac80211_queue_stop_count[IEEE80211_MAX_QUEUES ];const char *nvm_file_name;
@@ -688,6 +694,7 @@ struct iwl_mvm {struct iwl_rx_phy_info last_phy_info;struct ieee80211_sta __rcu *fw_id_to_mac_id[IWL_MVM_STATION_COUNT ];struct work_struct sta_drained_wk; +unsigned long sta_deferred_frames[BITS_TO_LONGS (IWL_MVM_STATION_COUNT )];unsigned long sta_drained[BITS_TO_LONGS (IWL_MVM_STATION_COUNT )];atomic_t pending_frames[IWL_MVM_STATION_COUNT ];u32 tfd_drained[IWL_MVM_STATION_COUNT ];
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +1 -0
@@ -579,6 +579,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,INIT_WORK (&mvm->d0i3_exit_work, iwl_mvm_d0i3_exit_work);INIT_DELAYED_WORK (&mvm->fw_dump_wk, iwl_mvm_fw_error_dump_wk);INIT_DELAYED_WORK (&mvm->tdls_cs.dwork, iwl_mvm_tdls_ch_switch_work); +INIT_WORK (&mvm->add_stream_wk, iwl_mvm_add_new_dqa_stream_wk);spin_lock_init (&mvm->d0i3_tx_lock);spin_lock_init (&mvm->refs_lock);
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +248 -6
314 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/sta.h +81 -6
158 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +54 -0
72 lines not on this page · raw message
Signature · 1 line
2.5.0
PATCH 20/43 iwlwifi: pcie: write to legacy register also in MQ
In reply to Grumbach, EmmanuelFrom: Sara Sharon <[email protected]>
Due to hardware bug, upon any shadow free-queue register write access, a legacy RBD shadow register must be written as well. This is required in order to trigger a copy of the shadow registers values after MAC exits sleep state.
Specifically, the driver has to write (any value) to the legacy RBD register each time FRBDCB is accessed.
--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +6 -2
@@ -210,8 +210,12 @@ static void iwl_pcie_rxq_inc_wr_ptr(struct iwl_trans *trans,if (trans->cfg->mq_rx_supported)iwl_write_prph (trans,RFH_Q_FRBDCB_WIDX (rxq->id), rxq->write_actual); -else -iwl_write32 (trans,FH_RSCSR_CHNL0_WPTR , rxq->write_actual); +/* +* write to FH_RSCSR_CHNL0_WPTR register even in MQ as a W/A to +* hardware shadow registers bug - writing to RFH_Q_FRBDCB_WIDX will +* not wake the NIC. +*/ +iwl_write32 (trans,FH_RSCSR_CHNL0_WPTR , rxq->write_actual); }static void iwl_pcie_rxq_check_wrptr (struct iwl_trans *trans)
Signature · 1 line
2.5.0
PATCH 21/43 iwlwifi: remove IWLWIFI_UAPSD Kconfig
In reply to Grumbach, EmmanuelWe have a module parameter, this is enough.
per platform customizations will be done through the init script of the platform.
--- drivers/net/wireless/intel/iwlwifi/Kconfig | 10 ---------- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 7 ------- 2 files changed, 17 deletions(-)
drivers/net/wireless/intel/iwlwifi/Kconfig +0 -10
@@ -88,16 +88,6 @@ config IWLWIFI_BCAST_FILTERING If unsure, don't enable this option, as some programs might expect incoming broadcasts for their normal operations. -config IWLWIFI_UAPSD - bool "enable U-APSD by default" - depends on IWLMVM - help - Say Y here to enable U-APSD by default. This may cause - interoperability problems with some APs, manifesting in lower than - expected throughput due to those APs not enabling aggregation - - If unsure, say N. - config IWLWIFI_PCIE_RTPM bool "Enable runtime power management mode for PCIe devices" depends on IWLMVM && PM
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +0 -7
@@ -1560,9 +1560,7 @@ struct iwl_mod_params iwlwifi_mod_params = { .power_level = IWL_POWER_INDEX_1, .d0i3_disable = true, .d0i3_entry_delay = 1000, -#ifndef CONFIG_IWLWIFI_UAPSD .uapsd_disable = IWL_DISABLE_UAPSD_BSS | IWL_DISABLE_UAPSD_P2P_CLIENT, -#endif /* CONFIG_IWLWIFI_UAPSD */ /* the rest are 0 by default */ };IWL_EXPORT_SYMBOL (iwlwifi_mod_params);
@@ -1682,13 +1680,8 @@ MODULE_PARM_DESC(lar_disable, "disable LAR functionality (default: N)");module_param_named (uapsd_disable, iwlwifi_mod_params.uapsd_disable, uint,S_IRUGO |S_IWUSR ); -#ifdef CONFIG_IWLWIFI_UAPSD -MODULE_PARM_DESC (uapsd_disable, -"disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 0)" ); -#else MODULE_PARM_DESC (uapsd_disable,"disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3)" ); -#endif /* * set bt_coex_active to true, uCode will do kill/defer
Signature · 1 line
2.5.0
PATCH 22/43 iwlwifi: mvm: update GSCAN capabilities
In reply to Grumbach, EmmanuelFrom: Ayala Beker <[email protected]>
Gscan capabilities were updated with new capabilities supported by the device. Update GSCAN capabilities TLV.
--- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +10 -3
@@ -1060,11 +1060,18 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,return -EINVAL ; } -if (WARN (fw_has_capa (capa,IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT ) && - !gscan_capa, -"GSCAN is supported but capabilities TLV is unavailable\n" )) +/* +* If ucode advertises that it supports GSCAN but GSCAN +* capabilities TLV is not present, or if it has an old format, +* warn and continue without GSCAN. +*/ +if (fw_has_capa (capa,IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT ) && + !gscan_capa) { +IWL_DEBUG_INFO (drv, +"GSCAN is supported but capabilities TLV is unavailable\n" );__clear_bit ((__force long )IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT , capa->_capa); + }return 0 ;
Signature · 1 line
2.5.0
PATCH 23/43 iwlwifi: remove support for fw older than -16.ucode
In reply to Grumbach, EmmanuelFrom: Sara Sharon <[email protected]>
API version lower than 16 is not supported anymore - don't load older ucode.
Remove code handling older versions.
--- drivers/net/wireless/intel/iwlwifi/iwl-7000.c | 12 +- drivers/net/wireless/intel/iwlwifi/iwl-8000.c | 4 +- drivers/net/wireless/intel/iwlwifi/iwl-9000.c | 4 +- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 5 +- drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h | 4 - drivers/net/wireless/intel/iwlwifi/mvm/Makefile | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/coex.c | 42 - .../net/wireless/intel/iwlwifi/mvm/coex_legacy.c | 1315 -------------------- drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 164 +-- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 16 - drivers/net/wireless/intel/iwlwifi/mvm/sf.c | 8 +- drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 86 -- 12 files changed, 41 insertions(+), 1621 deletions(-) delete mode 100644 drivers/net/wireless/intel/iwlwifi/mvm/coex_legacy.c
drivers/net/wireless/intel/iwlwifi/iwl-7000.c +6 -6
@@ -77,15 +77,15 @@#define IWL3168_UCODE_API_MAX 21/* Oldest version we won't warn about */ -#define IWL7260_UCODE_API_OK 13 -#define IWL7265_UCODE_API_OK 13 -#define IWL7265D_UCODE_API_OK 13 +#define IWL7260_UCODE_API_OK 16 +#define IWL7265_UCODE_API_OK 16 +#define IWL7265D_UCODE_API_OK 16#define IWL3168_UCODE_API_OK 20/* Lowest firmware API version supported */ -#define IWL7260_UCODE_API_MIN 13 -#define IWL7265_UCODE_API_MIN 13 -#define IWL7265D_UCODE_API_MIN 13 +#define IWL7260_UCODE_API_MIN 16 +#define IWL7265_UCODE_API_MIN 16 +#define IWL7265D_UCODE_API_MIN 16#define IWL3168_UCODE_API_MIN 20/* NVM versions */
drivers/net/wireless/intel/iwlwifi/iwl-8000.c +2 -2
@@ -74,11 +74,11 @@#define IWL8265_UCODE_API_MAX 21/* Oldest version we won't warn about */ -#define IWL8000_UCODE_API_OK 13 +#define IWL8000_UCODE_API_OK 16#define IWL8265_UCODE_API_OK 20/* Lowest firmware API version supported */ -#define IWL8000_UCODE_API_MIN 13 +#define IWL8000_UCODE_API_MIN 16#define IWL8265_UCODE_API_MIN 20/* NVM versions */
drivers/net/wireless/intel/iwlwifi/iwl-9000.c +2 -2
@@ -58,10 +58,10 @@#define IWL9000_UCODE_API_MAX 21/* Oldest version we won't warn about */ -#define IWL9000_UCODE_API_OK 13 +#define IWL9000_UCODE_API_OK 16/* Lowest firmware API version supported */ -#define IWL9000_UCODE_API_MIN 13 +#define IWL9000_UCODE_API_MIN 16/* NVM versions */ #define IWL9000_NVM_VERSION 0x0a1d
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +1 -4
@@ -1255,10 +1255,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)if (err) goto try_again; -if (fw_has_api (&drv->fw.ucode_capa,IWL_UCODE_TLV_API_NEW_VERSION )) - api_ver = drv->fw.ucode_ver; -else - api_ver =IWL_UCODE_API (drv->fw.ucode_ver); + api_ver = drv->fw.ucode_ver;/* * api_ver should match the api version forming part of the
drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h +0 -4
@@ -245,13 +245,11 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t;/** * enum iwl_ucode_tlv_api - ucode api -* @IWL_UCODE_TLV_API_BT_COEX_SPLIT: new API for BT Coex * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time * longer than the passive one, which is essential for fragmented scan. * @IWL_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source. * @IWL_UCODE_TLV_API_WIDE_CMD_HDR: ucode supports wide command header * @IWL_UCODE_TLV_API_LQ_SS_PARAMS: Configure STBC/BFER via LQ CMD ss_params -* @IWL_UCODE_TLV_API_NEW_VERSION: new versioning format * @IWL_UCODE_TLV_API_EXT_SCAN_PRIORITY: scan APIs use 8-level priority * instead of 3. * @IWL_UCODE_TLV_API_TX_POWER_CHAIN: TX power API has larger command size
@@ -260,12 +258,10 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t;* @NUM_IWL_UCODE_TLV_API: number of bits used */ enum iwl_ucode_tlv_api { -IWL_UCODE_TLV_API_BT_COEX_SPLIT = (__force iwl_ucode_tlv_api_t )3 ,IWL_UCODE_TLV_API_FRAGMENTED_SCAN = (__force iwl_ucode_tlv_api_t )8 ,IWL_UCODE_TLV_API_WIFI_MCC_UPDATE = (__force iwl_ucode_tlv_api_t )9 ,IWL_UCODE_TLV_API_WIDE_CMD_HDR = (__force iwl_ucode_tlv_api_t )14 ,IWL_UCODE_TLV_API_LQ_SS_PARAMS = (__force iwl_ucode_tlv_api_t )18 , -IWL_UCODE_TLV_API_NEW_VERSION = (__force iwl_ucode_tlv_api_t )20 ,IWL_UCODE_TLV_API_EXT_SCAN_PRIORITY = (__force iwl_ucode_tlv_api_t )24 ,IWL_UCODE_TLV_API_TX_POWER_CHAIN = (__force iwl_ucode_tlv_api_t )27 ,
drivers/net/wireless/intel/iwlwifi/mvm/Makefile +1 -1
@@ -2,7 +2,7 @@ obj-$(CONFIG_IWLMVM) += iwlmvm.o 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 -iwlmvm-y += power.o coex.o coex_legacy.o +iwlmvm-y += power.o coex.o iwlmvm-y += tt.o offloading.o tdls.o iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o
drivers/net/wireless/intel/iwlwifi/mvm/coex.c +0 -42
102 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/coex_legacy.c deleted +0 -1315
1,315 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +27 -137
192 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +0 -16
@@ -1470,22 +1470,6 @@ bool iwl_mvm_bt_coex_is_tpc_allowed(struct iwl_mvm *mvm,u8 iwl_mvm_bt_coex_tx_prio (struct iwl_mvm *mvm,struct ieee80211_hdr *hdr,struct ieee80211_tx_info *info,u8 ac); -bool iwl_mvm_bt_coex_is_shared_ant_avail_old (struct iwl_mvm *mvm); -void iwl_mvm_bt_coex_vif_change_old (struct iwl_mvm *mvm); -int iwl_send_bt_init_conf_old (struct iwl_mvm *mvm); -void iwl_mvm_rx_bt_coex_notif_old (struct iwl_mvm *mvm, -struct iwl_rx_cmd_buffer *rxb); -void iwl_mvm_bt_rssi_event_old (struct iwl_mvm *mvm,struct ieee80211_vif *vif, -enum ieee80211_rssi_event_data ); -u16 iwl_mvm_coex_agg_time_limit_old (struct iwl_mvm *mvm, -struct ieee80211_sta *sta); -bool iwl_mvm_bt_coex_is_mimo_allowed_old (struct iwl_mvm *mvm, -struct ieee80211_sta *sta); -bool iwl_mvm_bt_coex_is_tpc_allowed_old (struct iwl_mvm *mvm, -enum ieee80211_band band); -void iwl_mvm_rx_ant_coupling_notif_old (struct iwl_mvm *mvm, -struct iwl_rx_cmd_buffer *rxb); -/* beacon filtering */ #ifdef CONFIG_IWLWIFI_DEBUGFS void
drivers/net/wireless/intel/iwlwifi/mvm/sf.c +2 -6
@@ -193,7 +193,7 @@ static void iwl_mvm_fill_sf_command(struct iwl_mvm *mvm, } } -if (sta ||IWL_UCODE_API (mvm->fw->ucode_ver) <13 ) { +if (sta) {BUILD_BUG_ON (sizeof (sf_full_timeout) !=sizeof (__le32) *SF_NUM_SCENARIO *SF_NUM_TIMEOUT_TYPES );
@@ -220,9 +220,6 @@ static int iwl_mvm_sf_config(struct iwl_mvm *mvm, u8 sta_id,struct ieee80211_sta *sta;int ret =0 ; -if (IWL_UCODE_API (mvm->fw->ucode_ver) <13 ) - sf_cmd.state =cpu_to_le32 (new_state); -if (mvm->cfg->disable_dummy_notification) sf_cmd.state |=cpu_to_le32 (SF_CFG_DUMMY_NOTIF_OFF );
@@ -235,8 +232,7 @@ static int iwl_mvm_sf_config(struct iwl_mvm *mvm, u8 sta_id,switch (new_state) {case SF_UNINIT : -if (IWL_UCODE_API (mvm->fw->ucode_ver) >=13 ) -iwl_mvm_fill_sf_command (mvm, &sf_cmd,NULL ); +iwl_mvm_fill_sf_command (mvm, &sf_cmd,NULL );break ;case SF_FULL_ON :if (sta_id ==IWL_MVM_STATION_COUNT ) {
drivers/net/wireless/intel/iwlwifi/mvm/utils.c +0 -86
98 lines not on this page · raw message
Signature · 1 line
2.5.0
Re: [PATCH 23/43] iwlwifi: remove support for fw older than -16.ucode
This patch broke ucode loading on iwl6050 hardware.
[ 12.666080] iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-6050-exp.ucode failed with error -2 [ 12.672318] iwlwifi 0000:03:00.0: Driver unable to support your firmware API. Driver supports v5, firmware is v689702145. [ 12.676429] iwlwifi 0000:03:00.0: Driver unable to support your firmware API. Driver supports v5, firmware is v164168705. [ 12.676631] iwlwifi 0000:03:00.0: no suitable firmware found!
My guess is this block:
drivers/net/wireless/intel/iwlwifi/iwl-drv.c static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) · line 1258
Quoted 7 lines
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +1
-4-if (fw_has_api (&drv->fw.ucode_capa,IWL_UCODE_TLV_API_NEW_VERSION )) - api_ver = drv->fw.ucode_ver; -else - api_ver =IWL_UCODE_API (drv->fw.ucode_ver); + api_ver = drv->fw.ucode_ver;
is still required for some devices on DVM?
After reverting this patch:
[ 2947.082256] iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-6050-exp.ucode failed with error -2 [ 2947.082880] iwlwifi 0000:03:00.0: loaded firmware version 41.28.5.1 build 33926 op_mode iwldvm [ 2947.095203] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG enabled [ 2947.095207] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS disabled [ 2947.095211] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled [ 2947.095214] iwlwifi 0000:03:00.0: Detected Intel(R) Centrino(R) Advanced-N + WiMAX 6250 AGN, REV=0x84 [ 2947.095557] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled [ 2947.117923] ieee80211 phy0: Selected rate control algorithm 'iwl-agn-rs'
Everything is working.
Re: [PATCH 23/43] iwlwifi: remove support for fw older than -16.ucode
Quoted 9 lines · Pat Erley
This patch broke ucode loading on iwl6050 hardware.
[ 12.666080] iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-6050-exp.ucode failed with error -2 [ 12.672318] iwlwifi 0000:03:00.0: Driver unable to support your firmware API. Driver supports v5, firmware is v689702145. [ 12.676429] iwlwifi 0000:03:00.0: Driver unable to support your firmware API. Driver supports v5, firmware is v164168705. [ 12.676631] iwlwifi 0000:03:00.0: no suitable firmware found!
I'm seeing the same:
[ 7.459114] Intel(R) Wireless WiFi driver for Linux [ 7.459117] Copyright(c) 2003- 2015 Intel Corporation [ 7.459317] iwlwifi 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control [ 7.468245] iwlwifi 0000:03:00.0: Driver unable to support your firmware API. Driver supports v6, firmware is v313001473. [ 7.470916] iwlwifi 0000:03:00.0: Driver unable to support your firmware API. Driver supports v6, firmware is v296224003. [ 7.470931] iwlwifi 0000:03:00.0: no suitable firmware found!
My device:
03:00.0 Network controller [0280]: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] [8086:0085] (rev 34)
Signature · 1 line
Kalle Valo
PATCH 24/43 iwlwifi: dvm: use alloc_ordered_workqueue()
In reply to Grumbach, EmmanuelFrom: Eva Rachel Retuya <[email protected]>
Use alloc_ordered_workqueue() to allocate the workqueue instead of create_singlethread_workqueue() since the latter is deprecated and is scheduled for removal.
There are work items doing related operations that shouldn't be swapped when queued in a certain order hence preserve the strict execution ordering of a single threaded (ST) workqueue by switching to alloc_ordered_workqueue().
WQ_MEM_RECLAIM flag is not needed since the worker is not depended during memory reclaim.
--- drivers/net/wireless/intel/iwlwifi/dvm/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/dvm/main.c +1 -1
@@ -1071,7 +1071,7 @@ static void iwl_bg_restart(struct work_struct *data)static void iwl_setup_deferred_work (struct iwl_priv *priv) { - priv->workqueue =create_singlethread_workqueue (DRV_NAME ); + priv->workqueue =alloc_ordered_workqueue (DRV_NAME ,0 );INIT_WORK (&priv->restart, iwl_bg_restart);INIT_WORK (&priv->beacon_update, iwl_bg_beacon_update);
Signature · 1 line
2.5.0
PATCH 25/43 iwlwifi: mvm: report checksum is done also for IPv6 packets
In reply to Grumbach, EmmanuelFrom: Sara Sharon <[email protected]>
Currently the code checks if hardware reported both L4 and L3 checksums as valid, and only then reports it as validated to the stack.
However, IPv6 does not have checksum at all and the L3 checksum valid bit is always off for IPv6 packets, with the result of the stack re-validating L4 checksum.
Fix code to set CHECKSUM_UNNECESSARY also for IPv6 packets whose TCP/UDP checksum was verified.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw-api-rx.h | 15 ++++++++++++++- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 9 +++++++-- 2 files changed, 21 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw-api-rx.h +14 -1
@@ -268,12 +268,25 @@ enum iwl_rx_mpdu_amsdu_info { IWL_RX_MPDU_AMSDU_LAST_SUBFRAME = 0x80, }; +enum iwl_rx_l3_proto_values { +IWL_RX_L3_TYPE_NONE , +IWL_RX_L3_TYPE_IPV4 , +IWL_RX_L3_TYPE_IPV4_FRAG , +IWL_RX_L3_TYPE_IPV6_FRAG , +IWL_RX_L3_TYPE_IPV6 , +IWL_RX_L3_TYPE_IPV6_IN_IPV4 , +IWL_RX_L3_TYPE_ARP , +IWL_RX_L3_TYPE_EAPOL , +}; + +#define IWL_RX_L3_PROTO_POS 4 +enum iwl_rx_l3l4_flags {IWL_RX_L3L4_IP_HDR_CSUM_OK =BIT (0 ),IWL_RX_L3L4_TCP_UDP_CSUM_OK =BIT (1 ),IWL_RX_L3L4_TCP_FIN_SYN_RST_PSH =BIT (2 ),IWL_RX_L3L4_TCP_ACK =BIT (3 ), -IWL_RX_L3L4_L3_PROTO_MASK =0xf <<4 , +IWL_RX_L3L4_L3_PROTO_MASK =0xf <<IWL_RX_L3_PROTO_POS ,IWL_RX_L3L4_L4_PROTO_MASK =0xf <<8 ,IWL_RX_L3L4_RSS_HASH_MASK =0xf <<12 , };
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +7 -2
@@ -294,10 +294,15 @@ static void iwl_mvm_rx_csum(struct ieee80211_sta *sta, {struct iwl_mvm_sta *mvmsta =iwl_mvm_sta_from_mac80211 (sta);struct iwl_mvm_vif *mvmvif =iwl_mvm_vif_from_mac80211 (mvmsta->vif); +u16 flags =le16_to_cpu (desc->l3l4_flags); +u8 l3_prot = (u8)((flags &IWL_RX_L3L4_L3_PROTO_MASK ) >> +IWL_RX_L3_PROTO_POS );if (mvmvif->features &NETIF_F_RXCSUM && - desc->l3l4_flags &cpu_to_le16 (IWL_RX_L3L4_IP_HDR_CSUM_OK ) && - desc->l3l4_flags &cpu_to_le16 (IWL_RX_L3L4_TCP_UDP_CSUM_OK )) + flags &IWL_RX_L3L4_TCP_UDP_CSUM_OK && + (flags &IWL_RX_L3L4_IP_HDR_CSUM_OK || + l3_prot ==IWL_RX_L3_TYPE_IPV6 || + l3_prot ==IWL_RX_L3_TYPE_IPV6_FRAG )) skb->ip_summed =CHECKSUM_UNNECESSARY ; }
Signature · 1 line
2.5.0
PATCH 26/43 iwlwifi: mvm: set aux STA ID in scan config
In reply to Grumbach, EmmanuelFrom: David Spinadel <[email protected]>
Auxilary station ID in flag in scan config command wasn't set although we set the station ID. Add the flag.
--- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +1 -0
@@ -961,6 +961,7 @@ int iwl_mvm_config_scan(struct iwl_mvm *mvm)SCAN_CONFIG_FLAG_ALLOW_CHUB_REQS |SCAN_CONFIG_FLAG_SET_TX_CHAINS |SCAN_CONFIG_FLAG_SET_RX_CHAINS | +SCAN_CONFIG_FLAG_SET_AUX_STA_ID |SCAN_CONFIG_FLAG_SET_ALL_TIMES |SCAN_CONFIG_FLAG_SET_LEGACY_RATES | SCAN_CONFIG_FLAG_SET_MAC_ADDR |
Signature · 1 line
2.5.0
PATCH 27/43 iwlwifi: trans: fix iwl_trans_txq_scd_cfg.sta_id sign
In reply to Grumbach, EmmanuelFrom: Liad Kaufman <[email protected]>
For some reason, this was defined as a signed variable. Make it unsigned.
--- drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/iwl-trans.h +3 -1
@@ -7,6 +7,7 @@* * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH +* Copyright(c) 2016 Intel Deutschland GmbH * * 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
@@ -33,6 +34,7 @@* * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH +* Copyright(c) 2016 Intel Deutschland GmbH * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -519,7 +521,7 @@ struct iwl_trans;struct iwl_trans_txq_scd_cfg {u8 fifo; -s8 sta_id; +u8 sta_id;u8 tid;bool aggregate;int frame_limit;
Signature · 1 line
2.5.0
PATCH 28/43 iwlwifi: mvm: remove uneeded D0I3 checking
In reply to Grumbach, EmmanuelFrom: Chaya Rachel Ivgi <[email protected]>
The driver can read the current state during D0I3, therefore there is no reason not to do it.
--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +0 -3
@@ -787,9 +787,6 @@ static int iwl_mvm_tcool_get_cur_state(struct thermal_cooling_device *cdev, {struct iwl_mvm *mvm = (struct iwl_mvm *)(cdev->devdata); -if (test_bit (IWL_MVM_STATUS_IN_D0I3 , &mvm->status)) -return -EBUSY ; - *state = mvm->cooling_dev.cur_state;return 0 ;
Signature · 1 line
2.5.0
PATCH 29/43 iwlwifi: pcie: request one more interrupt vector
In reply to Grumbach, EmmanuelFrom: Sara Sharon <[email protected]>
We want to request an interrupt vector for RSS queue per CPU, one vector for fallback queue, and one for non-rx interrupts. Future patch will make sure that no RSS traffic is directed to fallback queue.
This will enable us to enable fast path on traffic that otherwise would have been received on the fallback queue.
--- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +1 -1
@@ -1435,7 +1435,7 @@ static void iwl_pcie_set_interrupt_capa(struct pci_dev *pdev,int ret, i;if (trans->cfg->mq_rx_supported) { - max_vector =min_t (u32, (num_possible_cpus () +1 ), + max_vector =min_t (u32, (num_possible_cpus () +2 ),IWL_MAX_RX_HW_QUEUES );for (i =0 ; i < max_vector; i++) trans_pcie->msix_entries[i].entry = i;
Signature · 1 line
2.5.0
PATCH 30/43 iwlwifi: mvm: improve RSS configuration
In reply to Grumbach, EmmanuelFrom: Sara Sharon <[email protected]>
Improve current RSS configuration:
* Use netdev_rss_key instead of keeping a local copy.
* Configure also UDP hashing to have UDP traffic spread across queues.
* Do not direct RSS traffic to our fallback queue.
--- drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 5 ++++- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 9 +++++++-- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 - drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 3 --- 4 files changed, 11 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +4 -1
@@ -65,6 +65,7 @@*****************************************************************************/ #include <linux/vmalloc.h> #include <linux/ieee80211.h> +#include <linux/netdevice.h> #include "mvm.h" #include "fw-dbg.h"
@@ -880,8 +881,10 @@ static ssize_t iwl_dbgfs_indirection_tbl_write(struct iwl_mvm *mvm,struct iwl_rss_config_cmd cmd = { .flags =cpu_to_le32 (IWL_RSS_ENABLE ), .hash_mask =IWL_RSS_HASH_TYPE_IPV4_TCP | +IWL_RSS_HASH_TYPE_IPV4_UDP |IWL_RSS_HASH_TYPE_IPV4_PAYLOAD |IWL_RSS_HASH_TYPE_IPV6_TCP | +IWL_RSS_HASH_TYPE_IPV6_UDP |IWL_RSS_HASH_TYPE_IPV6_PAYLOAD , };int ret, i, num_repeats, nbytes = count /2 ;
@@ -905,7 +908,7 @@ static ssize_t iwl_dbgfs_indirection_tbl_write(struct iwl_mvm *mvm,memcpy (&cmd.indirection_table[i * nbytes], cmd.indirection_table,ARRAY_SIZE (cmd.indirection_table) % nbytes); -memcpy (cmd.secret_key, mvm->secret_key,sizeof (cmd.secret_key)); +netdev_rss_key_fill (cmd.secret_key,sizeof (cmd.secret_key));mutex_lock (&mvm->mutex); ret =iwl_mvm_send_cmd_pdu (mvm,RSS_CONFIG_CMD ,0 ,sizeof (cmd), &cmd);
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +7 -2
@@ -64,6 +64,7 @@* *****************************************************************************/ #include <net/mac80211.h> +#include <linux/netdevice.h> #include "iwl-trans.h" #include "iwl-op-mode.h"
@@ -114,14 +115,18 @@ static int iwl_send_rss_cfg_cmd(struct iwl_mvm *mvm)struct iwl_rss_config_cmd cmd = { .flags =cpu_to_le32 (IWL_RSS_ENABLE ), .hash_mask =IWL_RSS_HASH_TYPE_IPV4_TCP | +IWL_RSS_HASH_TYPE_IPV4_UDP |IWL_RSS_HASH_TYPE_IPV4_PAYLOAD |IWL_RSS_HASH_TYPE_IPV6_TCP | +IWL_RSS_HASH_TYPE_IPV6_UDP |IWL_RSS_HASH_TYPE_IPV6_PAYLOAD , }; +/* Do not direct RSS traffic to Q 0 which is our fallback queue */ for (i =0 ; i <ARRAY_SIZE (cmd.indirection_table); i++) - cmd.indirection_table[i] = i % mvm->trans->num_rx_queues; -memcpy (cmd.secret_key, mvm->secret_key,sizeof (cmd.secret_key)); + cmd.indirection_table[i] = +1 + (i % (mvm->trans->num_rx_queues -1 )); +netdev_rss_key_fill (cmd.secret_key,sizeof (cmd.secret_key));return iwl_mvm_send_cmd_pdu (mvm,RSS_CONFIG_CMD ,0 ,sizeof (cmd), &cmd); }
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +0 -1
@@ -699,7 +699,6 @@ struct iwl_mvm {atomic_t pending_frames[IWL_MVM_STATION_COUNT ];u32 tfd_drained[IWL_MVM_STATION_COUNT ];u8 rx_ba_sessions; -u32 secret_key[IWL_RSS_HASH_KEY_CNT ];/* configured by mac80211 */ u32 rts_threshold;
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +0 -3
@@ -725,9 +725,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,iwl_mvm_tof_init (mvm); -/* init RSS hash key */ -get_random_bytes (mvm->secret_key,sizeof (mvm->secret_key)); -return op_mode; out_unregister:
Signature · 1 line
2.5.0
PATCH 31/43 iwlwifi: edit the 9000 series PCI IDs
In reply to Grumbach, EmmanuelFrom: Oren Givon <[email protected]>
Edit some of the 9560 series and 5165 series PCI IDs. These devices do not exist yet.
--- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +7 -5
@@ -483,17 +483,19 @@ static const struct pci_device_id iwl_hw_card_ids[] = { {IWL_PCI_DEVICE(0x24FD, 0x0810, iwl8265_2ac_cfg)}, /* 9000 Series */ + {IWL_PCI_DEVICE(0x9DF0, 0x0A10, iwl9560_2ac_cfg)}, + {IWL_PCI_DEVICE(0x9DF0, 0x0010, iwl9560_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x2A10, iwl5165_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x2010, iwl5165_2ac_cfg)}, - {IWL_PCI_DEVICE(0x2526, 0x0A10, iwl9560_2ac_cfg)}, - {IWL_PCI_DEVICE(0x2526, 0x0010, iwl9560_2ac_cfg)}, + {IWL_PCI_DEVICE(0x2526, 0x1420, iwl5165_2ac_cfg)}, + {IWL_PCI_DEVICE(0x2526, 0x0010, iwl5165_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x0000, iwl5165_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x0310, iwl5165_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x0510, iwl5165_2ac_cfg)}, {IWL_PCI_DEVICE(0x9DF0, 0x0710, iwl5165_2ac_cfg)}, - {IWL_PCI_DEVICE(0x2526, 0x0210, iwl9560_2ac_cfg)}, - {IWL_PCI_DEVICE(0x2526, 0x0410, iwl9560_2ac_cfg)}, - {IWL_PCI_DEVICE(0x2526, 0x0610, iwl9560_2ac_cfg)}, + {IWL_PCI_DEVICE(0x9DF0, 0x0210, iwl9560_2ac_cfg)}, + {IWL_PCI_DEVICE(0x9DF0, 0x0410, iwl9560_2ac_cfg)}, + {IWL_PCI_DEVICE(0x9DF0, 0x0610, iwl9560_2ac_cfg)}, #endif /* CONFIG_IWLMVM */ {0}
Signature · 1 line
2.5.0
PATCH 32/43 iwlwifi: mvm: use bss client queue for bss station
In reply to Grumbach, EmmanuelFrom: Liad Kaufman <[email protected]>
Use the reserved BSS Client queue when connecting to an AP in DQA mode.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h | 3 +++ drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 18 +++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h +3 -0
@@ -89,6 +89,8 @@ enum {/* * DQA queue numbers * +* @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure +* that we are never left without the possibility to connect to an AP. * @IWL_MVM_DQA_MIN_MGMT_QUEUE: first TXQ in pool for MGMT and non-QOS frames. * Each MGMT queue is mapped to a single STA * MGMT frames are frames that return true on ieee80211_is_mgmt()
@@ -100,6 +102,7 @@ enum {* @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames */ enum iwl_mvm_dqa_txq { +IWL_MVM_DQA_BSS_CLIENT_QUEUE =4 ,IWL_MVM_DQA_MIN_MGMT_QUEUE =5 ,IWL_MVM_DQA_MAX_MGMT_QUEUE =8 ,IWL_MVM_DQA_MIN_DATA_QUEUE =10 ,
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +13 -5
@@ -336,7 +336,8 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,* as aggregatable. * Mark all DATA queues as allowing to be aggregated at some point */ - cfg.aggregate = (queue >=IWL_MVM_DQA_MIN_DATA_QUEUE ); + cfg.aggregate = (queue >=IWL_MVM_DQA_MIN_DATA_QUEUE || + queue ==IWL_MVM_DQA_BSS_CLIENT_QUEUE );IWL_DEBUG_TX_QUEUES (mvm,"Allocating queue #%d to sta %d on tid %d\n" , queue, mvmsta->sta_id, tid);
@@ -448,7 +449,8 @@ void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk) }static int iwl_mvm_reserve_sta_stream (struct iwl_mvm *mvm, -struct ieee80211_sta *sta) +struct ieee80211_sta *sta, +enum nl80211_iftype vif_type) {struct iwl_mvm_sta *mvmsta =iwl_mvm_sta_from_mac80211 (sta);int queue;
@@ -456,8 +458,13 @@ static int iwl_mvm_reserve_sta_stream(struct iwl_mvm *mvm,spin_lock_bh (&mvm->queue_info_lock);/* Make sure we have free resources for this STA */ - queue =iwl_mvm_find_free_queue (mvm,IWL_MVM_DQA_MIN_DATA_QUEUE , -IWL_MVM_DQA_MAX_DATA_QUEUE ); +if (vif_type ==NL80211_IFTYPE_STATION && !sta->tdls && + !mvm->queue_info[IWL_MVM_DQA_BSS_CLIENT_QUEUE ].hw_queue_refcount && + !mvm->queue_info[IWL_MVM_DQA_BSS_CLIENT_QUEUE ].setup_reserved) + queue =IWL_MVM_DQA_BSS_CLIENT_QUEUE ; +else + queue =iwl_mvm_find_free_queue (mvm,IWL_MVM_DQA_MIN_DATA_QUEUE , +IWL_MVM_DQA_MAX_DATA_QUEUE );if (queue <0 ) {spin_unlock_bh (&mvm->queue_info_lock);IWL_ERR (mvm,"No available queues for new station\n" );
@@ -551,7 +558,8 @@ int iwl_mvm_add_sta(struct iwl_mvm *mvm, }if (iwl_mvm_is_dqa_supported (mvm)) { - ret =iwl_mvm_reserve_sta_stream (mvm, sta); + ret =iwl_mvm_reserve_sta_stream (mvm, sta, +ieee80211_vif_type_p2p (vif));if (ret) goto err; }
Signature · 1 line
2.5.0
PATCH 33/43 iwlwifi: mvm: set sta_id in SCD_QUEUE_CONFIG cmd
In reply to Grumbach, EmmanuelFrom: Liad Kaufman <[email protected]>
Set the correct sta_id in the SCD_QUEUE_CONFIG command sent to the FW when enabling/disabling queues. This is needed in DQA-mode to allow the FW to associate between queue and STA.
--- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 + drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 4 ++++ 2 files changed, 5 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +1 -0
@@ -665,6 +665,7 @@ struct iwl_mvm {/* Map to HW queue */ u32 hw_queue_to_mac80211;u8 hw_queue_refcount; +u8 ra_sta_id;/* The RA this queue is mapped to, if exists */ /* * This is to mark that queue is reserved for a STA but not yet * allocated. This is needed to make sure we have at least one
drivers/net/wireless/intel/iwlwifi/mvm/utils.c +4 -0
@@ -608,6 +608,8 @@ void iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue, mvm->queue_info[queue].hw_queue_refcount++;if (mvm->queue_info[queue].hw_queue_refcount >1 ) enable_queue = false; +else + mvm->queue_info[queue].ra_sta_id = cfg->sta_id; mvm->queue_info[queue].tid_bitmap |=BIT (cfg->tid); IWL_DEBUG_TX_QUEUES(mvm,
@@ -693,6 +695,8 @@ void iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, int mac80211_queue,return ; } + cmd.sta_id = mvm->queue_info[queue].ra_sta_id; +/* Make sure queue info is correct even though we overwrite it */ WARN(mvm->queue_info[queue].hw_queue_refcount || mvm->queue_info[queue].tid_bitmap ||
Signature · 1 line
2.5.0
PATCH 34/43 iwlwifi: mvm: allocate dedicated queue for cab in dqa mode
In reply to Grumbach, EmmanuelFrom: Liad Kaufman <[email protected]>
In DQA mode, allocate a dedicated queue (#3) for content after beacon (AKA "CaB").
--- drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h | 2 ++ drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h +2 -0
@@ -89,6 +89,7 @@ enum {/* * DQA queue numbers * +* @IWL_MVM_DQA_GCAST_QUEUE: a queue reserved for P2P GO/SoftAP GCAST frames * @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure * that we are never left without the possibility to connect to an AP. * @IWL_MVM_DQA_MIN_MGMT_QUEUE: first TXQ in pool for MGMT and non-QOS frames.
@@ -102,6 +103,7 @@ enum {* @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames */ enum iwl_mvm_dqa_txq { +IWL_MVM_DQA_GCAST_QUEUE =3 ,IWL_MVM_DQA_BSS_CLIENT_QUEUE =4 ,IWL_MVM_DQA_MIN_MGMT_QUEUE =5 ,IWL_MVM_DQA_MAX_MGMT_QUEUE =8 ,
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +12 -6
@@ -447,13 +447,19 @@ static int iwl_mvm_mac_ctxt_allocate_resources(struct iwl_mvm *mvm,/* Allocate the CAB queue for softAP and GO interfaces */ if (vif->type ==NL80211_IFTYPE_AP ) { -u8 queue =find_first_zero_bit (&used_hw_queues, - mvm->first_agg_queue); +u8 queue; -if (queue >= mvm->first_agg_queue) { -IWL_ERR (mvm,"Failed to allocate cab queue\n" ); - ret = -EIO ; - goto exit_fail; +if (!iwl_mvm_is_dqa_supported (mvm)) { + queue =find_first_zero_bit (&used_hw_queues, + mvm->first_agg_queue); + +if (queue >= mvm->first_agg_queue) { +IWL_ERR (mvm,"Failed to allocate cab queue\n" ); + ret = -EIO ; + goto exit_fail; + } + }else { + queue =IWL_MVM_DQA_GCAST_QUEUE ; } vif->cab_queue = queue;
Signature · 1 line
2.5.0
PATCH 35/43 iwlwifi: mvm: move cmd queue to be #0 in dqa mode
In reply to Grumbach, EmmanuelFrom: Liad Kaufman <[email protected]>
Change the CMD queue to be queue #0 (rather than queue #9) when working in DQA mode.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h | 2 ++ drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 5 ++++- drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 8 ++++++-- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h +2 -0
@@ -89,6 +89,7 @@ enum {/* * DQA queue numbers * +* @IWL_MVM_DQA_CMD_QUEUE: a queue reserved for sending HCMDs to the FW * @IWL_MVM_DQA_GCAST_QUEUE: a queue reserved for P2P GO/SoftAP GCAST frames * @IWL_MVM_DQA_BSS_CLIENT_QUEUE: a queue reserved for BSS activity, to ensure * that we are never left without the possibility to connect to an AP.
@@ -103,6 +104,7 @@ enum {* @IWL_MVM_DQA_MAX_DATA_QUEUE: last TXQ in pool for DATA frames */ enum iwl_mvm_dqa_txq { +IWL_MVM_DQA_CMD_QUEUE =0 ,IWL_MVM_DQA_GCAST_QUEUE =3 ,IWL_MVM_DQA_BSS_CLIENT_QUEUE =4 ,IWL_MVM_DQA_MIN_MGMT_QUEUE =5 ,
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +4 -1
@@ -652,7 +652,10 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,*/ memset (&mvm->queue_info,0 ,sizeof (mvm->queue_info)); - mvm->queue_info[IWL_MVM_CMD_QUEUE ].hw_queue_refcount =1 ; +if (iwl_mvm_is_dqa_supported (mvm)) + mvm->queue_info[IWL_MVM_DQA_CMD_QUEUE ].hw_queue_refcount =1 ; +else + mvm->queue_info[IWL_MVM_CMD_QUEUE ].hw_queue_refcount =1 ;for (i =0 ; i <IEEE80211_MAX_QUEUES ; i++)atomic_set (&mvm->mac80211_queue_stop_count[i],0 );
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +6 -2
@@ -252,10 +252,14 @@ unsigned long iwl_mvm_get_used_hw_queues(struct iwl_mvm *mvm, .exclude_vif = exclude_vif, .used_hw_queues =BIT (IWL_MVM_OFFCHANNEL_QUEUE ) | -BIT (mvm->aux_queue) | - BIT(IWL_MVM_CMD_QUEUE), + BIT(mvm->aux_queue), }; +if (iwl_mvm_is_dqa_supported (mvm)) + data.used_hw_queues |=BIT (IWL_MVM_DQA_CMD_QUEUE ); +else + data.used_hw_queues |=BIT (IWL_MVM_CMD_QUEUE ); +lockdep_assert_held (&mvm->mutex);/* mark all VIF used hw queues */
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +4 -1
@@ -619,7 +619,10 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, trans_cfg.command_groups = iwl_mvm_groups; trans_cfg.command_groups_size =ARRAY_SIZE (iwl_mvm_groups); - trans_cfg.cmd_queue =IWL_MVM_CMD_QUEUE ; +if (iwl_mvm_is_dqa_supported (mvm)) + trans_cfg.cmd_queue =IWL_MVM_DQA_CMD_QUEUE ; +else + trans_cfg.cmd_queue =IWL_MVM_CMD_QUEUE ; trans_cfg.cmd_fifo =IWL_MVM_TX_FIFO_CMD ; trans_cfg.scd_set_active = true;
Signature · 1 line
2.5.0
PATCH 36/43 iwlwifi: mvm: add a scan timeout for regular scans
In reply to Grumbach, EmmanuelFrom: Luca Coelho <[email protected]>
If something goes wrong with the firmware and we never get a scan complete notification, we stay stuck forever. In order to avoid this situation, add a timeout and trigger an NMI if it expires before receiving the notification., so we can clean things up.
--- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 ++ drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 5 +++++ drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +2 -0
@@ -710,6 +710,7 @@ struct iwl_mvm {struct iwl_mcast_filter_cmd *mcast_filter_cmd;enum iwl_mvm_scan_type scan_type;enum iwl_mvm_sched_scan_pass_all_states sched_scan_pass_all; +struct timer_list scan_timer;/* max number of simultaneous scans the FW supports */ unsigned int max_scans;
@@ -1314,6 +1315,7 @@ int iwl_mvm_scan_size(struct iwl_mvm *mvm);int iwl_mvm_scan_stop (struct iwl_mvm *mvm,int type,bool notify);int iwl_mvm_max_scan_ie_len (struct iwl_mvm *mvm);void iwl_mvm_report_scan_aborted (struct iwl_mvm *mvm); +void iwl_mvm_scan_timeout (unsigned long data);/* Scheduled scan */ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,
drivers/net/wireless/intel/iwlwifi/mvm/ops.c +5 -0
@@ -728,6 +728,9 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,iwl_mvm_tof_init (mvm); +setup_timer (&mvm->scan_timer, iwl_mvm_scan_timeout, + (unsigned long )mvm); +return op_mode; out_unregister:
@@ -783,6 +786,8 @@ static void iwl_op_mode_mvm_stop(struct iwl_op_mode *op_mode)iwl_mvm_tof_clean (mvm); +del_timer_sync (&mvm->scan_timer); +mutex_destroy (&mvm->mutex);mutex_destroy (&mvm->d0i3_suspend_mutex);
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +21 -0
@@ -70,6 +70,7 @@#include "mvm.h" #include "fw-api-scan.h" +#include "iwl-io.h" #define IWL_DENSE_EBS_SCAN_RATIO 5#define IWL_SPARSE_EBS_SCAN_RATIO 1
@@ -398,6 +399,10 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm,ieee80211_scan_completed (mvm->hw, scan_notif->status ==IWL_SCAN_OFFLOAD_ABORTED );iwl_mvm_unref (mvm,IWL_MVM_REF_SCAN ); +del_timer (&mvm->scan_timer); + }else { +IWL_ERR (mvm, +"got scan complete notification but no scan is running\n" ); } mvm->last_ebs_successful =
@@ -1217,6 +1222,18 @@ static int iwl_mvm_check_running_scans(struct iwl_mvm *mvm, int type)return -EIO ; } +#define SCAN_TIMEOUT (16 * HZ) + +void iwl_mvm_scan_timeout (unsigned long data) +{ +struct iwl_mvm *mvm = (struct iwl_mvm *)data; + +IWL_ERR (mvm,"regular scan timed out\n" ); + +del_timer (&mvm->scan_timer); +iwl_force_nmi (mvm->trans); +} +int iwl_mvm_reg_scan_start (struct iwl_mvm *mvm,struct ieee80211_vif *vif,struct cfg80211_scan_request *req,struct ieee80211_scan_ies *ies)
@@ -1296,6 +1313,8 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, mvm->scan_status |=IWL_MVM_SCAN_REGULAR ;iwl_mvm_ref (mvm,IWL_MVM_REF_SCAN ); +mod_timer (&mvm->scan_timer, jiffies +SCAN_TIMEOUT ); +return 0 ; }
@@ -1413,6 +1432,7 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm,if (mvm->scan_uid_status[uid] ==IWL_MVM_SCAN_REGULAR ) {ieee80211_scan_completed (mvm->hw, aborted);iwl_mvm_unref (mvm,IWL_MVM_REF_SCAN ); +del_timer (&mvm->scan_timer); }else if (mvm->scan_uid_status[uid] ==IWL_MVM_SCAN_SCHED ) {ieee80211_sched_scan_stopped (mvm->hw); mvm->sched_scan_pass_all =SCHED_SCAN_PASS_ALL_DISABLED ;
@@ -1608,6 +1628,7 @@ out:* to release the scan reference here. */ iwl_mvm_unref (mvm,IWL_MVM_REF_SCAN ); +del_timer (&mvm->scan_timer);if (notify)ieee80211_scan_completed (mvm->hw, true); }else if (notify) {
Signature · 1 line
2.5.0
PATCH 37/43 iwlwifi: mvm: enable TCP/UDP checksum support for 9000 family
In reply to Grumbach, EmmanuelFrom: Sara Sharon <[email protected]>
Declare and enable support of RX and TX checksum for 9000 family. Configure offload_assist in the TX cmd accordingly to support TX csum.
--- drivers/net/wireless/intel/iwlwifi/iwl-9000.c | 1 + drivers/net/wireless/intel/iwlwifi/iwl-config.h | 2 + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 13 +-- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 124 +++++++++++++++++++++- 4 files changed, 133 insertions(+), 7 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-9000.c +1 -0
@@ -137,6 +137,7 @@ static const struct iwl_tt_params iwl9000_tt_params = { .dccm2_len = IWL9000_DCCM2_LEN, \ .smem_offset = IWL9000_SMEM_OFFSET, \ .smem_len = IWL9000_SMEM_LEN, \ + .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, \ .thermal_params = &iwl9000_tt_params, \ .apmg_not_supported = true, \ .mq_rx_supported = true, \
drivers/net/wireless/intel/iwlwifi/iwl-config.h +2 -0
@@ -131,6 +131,8 @@ enum iwl_led_mode {#define IWL_MAX_WD_TIMEOUT 120000#define IWL_DEFAULT_MAX_TX_POWER 22 +#define IWL_TX_CSUM_NETIF_FLAGS (NETIF_F_IPV6_CSUM | NETIF_F_IP_CSUM |\ + NETIF_F_TSO | NETIF_F_TSO6)/* Antenna presence definitions */ #define ANT_NONE 0x0
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +7 -6
@@ -665,12 +665,13 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) } hw->netdev_features |= mvm->cfg->features; -if (!iwl_mvm_is_csum_supported (mvm)) - hw->netdev_features &= ~NETIF_F_RXCSUM ; - -if (IWL_MVM_SW_TX_CSUM_OFFLOAD ) - hw->netdev_features |=NETIF_F_IP_CSUM |NETIF_F_IPV6_CSUM | -NETIF_F_TSO |NETIF_F_TSO6 ; +if (!iwl_mvm_is_csum_supported (mvm)) { + hw->netdev_features &= ~(IWL_TX_CSUM_NETIF_FLAGS | +NETIF_F_RXCSUM ); +/* We may support SW TX CSUM */ +if (IWL_MVM_SW_TX_CSUM_OFFLOAD ) + hw->netdev_features |=IWL_TX_CSUM_NETIF_FLAGS ; + } ret =ieee80211_register_hw (mvm->hw);if (ret)
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +123 -1
160 lines not on this page · raw message
Signature · 1 line
2.5.0
PATCH 38/43 iwlwifi: remove IWL_*_UCODE_API_OK
In reply to Grumbach, Emmanuel_UCODE_API_OK was a intermediate version between MIN and MAX. If a user had a firmware below _OK but above _MIN, the driver would work but the user would get a warning in the kernel log telling him to update his firmware. This is not needed since most users won't look for these messages in the kernel log if their wifi is working.
--- drivers/net/wireless/intel/iwlwifi/iwl-1000.c | 10 ++-------- drivers/net/wireless/intel/iwlwifi/iwl-2000.c | 18 ++++-------------- drivers/net/wireless/intel/iwlwifi/iwl-5000.c | 11 ++--------- drivers/net/wireless/intel/iwlwifi/iwl-6000.c | 20 ++++---------------- drivers/net/wireless/intel/iwlwifi/iwl-7000.c | 20 +++++--------------- drivers/net/wireless/intel/iwlwifi/iwl-8000.c | 11 ++--------- drivers/net/wireless/intel/iwlwifi/iwl-9000.c | 6 +----- drivers/net/wireless/intel/iwlwifi/iwl-config.h | 3 --- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 24 +----------------------- 9 files changed, 21 insertions(+), 102 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-1000.c +2 -8
@@ -34,10 +34,6 @@#define IWL1000_UCODE_API_MAX 5#define IWL100_UCODE_API_MAX 5 -/* Oldest version we won't warn about */ -#define IWL1000_UCODE_API_OK 5 -#define IWL100_UCODE_API_OK 5 -/* Lowest firmware API version supported */ #define IWL1000_UCODE_API_MIN 1#define IWL100_UCODE_API_MIN 5
@@ -86,7 +82,6 @@ static const struct iwl_eeprom_params iwl1000_eeprom_params = {#define IWL_DEVICE_1000 \ .fw_name_pre = IWL1000_FW_PRE, \ .ucode_api_max = IWL1000_UCODE_API_MAX, \ - .ucode_api_ok = IWL1000_UCODE_API_OK, \ .ucode_api_min = IWL1000_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_1000, \ .max_inst_size = IWLAGN_RTC_INST_SIZE, \
@@ -112,7 +107,6 @@ const struct iwl_cfg iwl1000_bg_cfg = {#define IWL_DEVICE_100 \ .fw_name_pre = IWL100_FW_PRE, \ .ucode_api_max = IWL100_UCODE_API_MAX, \ - .ucode_api_ok = IWL100_UCODE_API_OK, \ .ucode_api_min = IWL100_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_100, \ .max_inst_size = IWLAGN_RTC_INST_SIZE, \
@@ -136,5 +130,5 @@ const struct iwl_cfg iwl100_bg_cfg = { IWL_DEVICE_100, }; -MODULE_FIRMWARE (IWL1000_MODULE_FIRMWARE (IWL1000_UCODE_API_OK )); -MODULE_FIRMWARE (IWL100_MODULE_FIRMWARE (IWL100_UCODE_API_OK)); +MODULE_FIRMWARE (IWL1000_MODULE_FIRMWARE (IWL1000_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL100_MODULE_FIRMWARE (IWL100_UCODE_API_MAX));
drivers/net/wireless/intel/iwlwifi/iwl-2000.c +4 -14
@@ -36,12 +36,6 @@#define IWL105_UCODE_API_MAX 6#define IWL135_UCODE_API_MAX 6 -/* Oldest version we won't warn about */ -#define IWL2030_UCODE_API_OK 6 -#define IWL2000_UCODE_API_OK 6 -#define IWL105_UCODE_API_OK 6 -#define IWL135_UCODE_API_OK 6 -/* Lowest firmware API version supported */ #define IWL2030_UCODE_API_MIN 5#define IWL2000_UCODE_API_MIN 5
@@ -114,7 +108,6 @@ static const struct iwl_eeprom_params iwl20x0_eeprom_params = {#define IWL_DEVICE_2000 \ .fw_name_pre = IWL2000_FW_PRE, \ .ucode_api_max = IWL2000_UCODE_API_MAX, \ - .ucode_api_ok = IWL2000_UCODE_API_OK, \ .ucode_api_min = IWL2000_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_2000, \ .max_inst_size = IWL60_RTC_INST_SIZE, \
@@ -142,7 +135,6 @@ const struct iwl_cfg iwl2000_2bgn_d_cfg = {#define IWL_DEVICE_2030 \ .fw_name_pre = IWL2030_FW_PRE, \ .ucode_api_max = IWL2030_UCODE_API_MAX, \ - .ucode_api_ok = IWL2030_UCODE_API_OK, \ .ucode_api_min = IWL2030_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_2030, \ .max_inst_size = IWL60_RTC_INST_SIZE, \
@@ -163,7 +155,6 @@ const struct iwl_cfg iwl2030_2bgn_cfg = {#define IWL_DEVICE_105 \ .fw_name_pre = IWL105_FW_PRE, \ .ucode_api_max = IWL105_UCODE_API_MAX, \ - .ucode_api_ok = IWL105_UCODE_API_OK, \ .ucode_api_min = IWL105_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_105, \ .max_inst_size = IWL60_RTC_INST_SIZE, \
@@ -191,7 +182,6 @@ const struct iwl_cfg iwl105_bgn_d_cfg = {#define IWL_DEVICE_135 \ .fw_name_pre = IWL135_FW_PRE, \ .ucode_api_max = IWL135_UCODE_API_MAX, \ - .ucode_api_ok = IWL135_UCODE_API_OK, \ .ucode_api_min = IWL135_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_135, \ .max_inst_size = IWL60_RTC_INST_SIZE, \
@@ -210,7 +200,7 @@ const struct iwl_cfg iwl135_bgn_cfg = { .ht_params = &iwl2000_ht_params, }; -MODULE_FIRMWARE (IWL2000_MODULE_FIRMWARE (IWL2000_UCODE_API_OK )); -MODULE_FIRMWARE (IWL2030_MODULE_FIRMWARE (IWL2030_UCODE_API_OK )); -MODULE_FIRMWARE (IWL105_MODULE_FIRMWARE (IWL105_UCODE_API_OK )); -MODULE_FIRMWARE (IWL135_MODULE_FIRMWARE (IWL135_UCODE_API_OK )); +MODULE_FIRMWARE (IWL2000_MODULE_FIRMWARE (IWL2000_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL2030_MODULE_FIRMWARE (IWL2030_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL105_MODULE_FIRMWARE (IWL105_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL135_MODULE_FIRMWARE (IWL135_UCODE_API_MAX ));
drivers/net/wireless/intel/iwlwifi/iwl-5000.c +2 -9
@@ -34,10 +34,6 @@#define IWL5000_UCODE_API_MAX 5#define IWL5150_UCODE_API_MAX 2 -/* Oldest version we won't warn about */ -#define IWL5000_UCODE_API_OK 5 -#define IWL5150_UCODE_API_OK 2 -/* Lowest firmware API version supported */ #define IWL5000_UCODE_API_MIN 1#define IWL5150_UCODE_API_MIN 1
@@ -84,7 +80,6 @@ static const struct iwl_eeprom_params iwl5000_eeprom_params = {#define IWL_DEVICE_5000 \ .fw_name_pre = IWL5000_FW_PRE, \ .ucode_api_max = IWL5000_UCODE_API_MAX, \ - .ucode_api_ok = IWL5000_UCODE_API_OK, \ .ucode_api_min = IWL5000_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_5000, \ .max_inst_size = IWLAGN_RTC_INST_SIZE, \
@@ -132,7 +127,6 @@ const struct iwl_cfg iwl5350_agn_cfg = { .name = "Intel(R) WiMAX/WiFi Link 5350 AGN", .fw_name_pre = IWL5000_FW_PRE, .ucode_api_max = IWL5000_UCODE_API_MAX, - .ucode_api_ok = IWL5000_UCODE_API_OK, .ucode_api_min = IWL5000_UCODE_API_MIN, .device_family = IWL_DEVICE_FAMILY_5000, .max_inst_size = IWLAGN_RTC_INST_SIZE,
@@ -149,7 +143,6 @@ const struct iwl_cfg iwl5350_agn_cfg = {#define IWL_DEVICE_5150 \ .fw_name_pre = IWL5150_FW_PRE, \ .ucode_api_max = IWL5150_UCODE_API_MAX, \ - .ucode_api_ok = IWL5150_UCODE_API_OK, \ .ucode_api_min = IWL5150_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_5150, \ .max_inst_size = IWLAGN_RTC_INST_SIZE, \
@@ -174,5 +167,5 @@ const struct iwl_cfg iwl5150_abg_cfg = { IWL_DEVICE_5150, }; -MODULE_FIRMWARE (IWL5000_MODULE_FIRMWARE (IWL5000_UCODE_API_OK )); -MODULE_FIRMWARE (IWL5150_MODULE_FIRMWARE (IWL5150_UCODE_API_OK)); +MODULE_FIRMWARE (IWL5000_MODULE_FIRMWARE (IWL5000_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL5150_MODULE_FIRMWARE (IWL5150_UCODE_API_MAX));
drivers/net/wireless/intel/iwlwifi/iwl-6000.c +4 -16
@@ -36,13 +36,6 @@#define IWL6000G2_UCODE_API_MAX 6#define IWL6035_UCODE_API_MAX 6 -/* Oldest version we won't warn about */ -#define IWL6000_UCODE_API_OK 4 -#define IWL6000G2_UCODE_API_OK 5 -#define IWL6050_UCODE_API_OK 5 -#define IWL6000G2B_UCODE_API_OK 6 -#define IWL6035_UCODE_API_OK 6 -/* Lowest firmware API version supported */ #define IWL6000_UCODE_API_MIN 4#define IWL6050_UCODE_API_MIN 4
@@ -136,7 +129,6 @@ static const struct iwl_eeprom_params iwl6000_eeprom_params = {#define IWL_DEVICE_6005 \ .fw_name_pre = IWL6005_FW_PRE, \ .ucode_api_max = IWL6000G2_UCODE_API_MAX, \ - .ucode_api_ok = IWL6000G2_UCODE_API_OK, \ .ucode_api_min = IWL6000G2_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_6005, \ .max_inst_size = IWL60_RTC_INST_SIZE, \
@@ -191,7 +183,6 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = {#define IWL_DEVICE_6030 \ .fw_name_pre = IWL6030_FW_PRE, \ .ucode_api_max = IWL6000G2_UCODE_API_MAX, \ - .ucode_api_ok = IWL6000G2B_UCODE_API_OK, \ .ucode_api_min = IWL6000G2_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_6030, \ .max_inst_size = IWL60_RTC_INST_SIZE, \
@@ -228,7 +219,6 @@ const struct iwl_cfg iwl6030_2bg_cfg = {#define IWL_DEVICE_6035 \ .fw_name_pre = IWL6030_FW_PRE, \ .ucode_api_max = IWL6035_UCODE_API_MAX, \ - .ucode_api_ok = IWL6035_UCODE_API_OK, \ .ucode_api_min = IWL6035_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_6030, \ .max_inst_size = IWL60_RTC_INST_SIZE, \
@@ -282,7 +272,6 @@ const struct iwl_cfg iwl130_bg_cfg = {#define IWL_DEVICE_6000i \ .fw_name_pre = IWL6000_FW_PRE, \ .ucode_api_max = IWL6000_UCODE_API_MAX, \ - .ucode_api_ok = IWL6000_UCODE_API_OK, \ .ucode_api_min = IWL6000_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_6000i, \ .max_inst_size = IWL60_RTC_INST_SIZE, \
@@ -370,7 +359,6 @@ const struct iwl_cfg iwl6000_3agn_cfg = { .name = "Intel(R) Centrino(R) Ultimate-N 6300 AGN", .fw_name_pre = IWL6000_FW_PRE, .ucode_api_max = IWL6000_UCODE_API_MAX, - .ucode_api_ok = IWL6000_UCODE_API_OK, .ucode_api_min = IWL6000_UCODE_API_MIN, .device_family = IWL_DEVICE_FAMILY_6000, .max_inst_size = IWL60_RTC_INST_SIZE,
@@ -383,7 +371,7 @@ const struct iwl_cfg iwl6000_3agn_cfg = { .led_mode = IWL_LED_BLINK, }; -MODULE_FIRMWARE (IWL6000_MODULE_FIRMWARE (IWL6000_UCODE_API_OK )); -MODULE_FIRMWARE (IWL6050_MODULE_FIRMWARE (IWL6050_UCODE_API_OK )); -MODULE_FIRMWARE (IWL6005_MODULE_FIRMWARE (IWL6000G2_UCODE_API_OK )); -MODULE_FIRMWARE (IWL6030_MODULE_FIRMWARE (IWL6000G2B_UCODE_API_OK )); +MODULE_FIRMWARE (IWL6000_MODULE_FIRMWARE (IWL6000_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL6050_MODULE_FIRMWARE (IWL6050_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL6005_MODULE_FIRMWARE (IWL6000G2_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL6030_MODULE_FIRMWARE (IWL6000G2B_UCODE_API_MAX ));
drivers/net/wireless/intel/iwlwifi/iwl-7000.c +5 -15
@@ -76,12 +76,6 @@#define IWL7265D_UCODE_API_MAX 21#define IWL3168_UCODE_API_MAX 21 -/* Oldest version we won't warn about */ -#define IWL7260_UCODE_API_OK 16 -#define IWL7265_UCODE_API_OK 16 -#define IWL7265D_UCODE_API_OK 16 -#define IWL3168_UCODE_API_OK 20 -/* Lowest firmware API version supported */ #define IWL7260_UCODE_API_MIN 16#define IWL7265_UCODE_API_MIN 16
@@ -179,25 +173,21 @@ static const struct iwl_ht_params iwl7000_ht_params = {#define IWL_DEVICE_7000 \ IWL_DEVICE_7000_COMMON, \ .ucode_api_max = IWL7260_UCODE_API_MAX, \ - .ucode_api_ok = IWL7260_UCODE_API_OK, \ .ucode_api_min = IWL7260_UCODE_API_MIN#define IWL_DEVICE_7005 \ IWL_DEVICE_7000_COMMON, \ .ucode_api_max = IWL7265_UCODE_API_MAX, \ - .ucode_api_ok = IWL7265_UCODE_API_OK, \ .ucode_api_min = IWL7265_UCODE_API_MIN#define IWL_DEVICE_3008 \ IWL_DEVICE_7000_COMMON, \ .ucode_api_max = IWL3168_UCODE_API_MAX, \ - .ucode_api_ok = IWL3168_UCODE_API_OK, \ .ucode_api_min = IWL3168_UCODE_API_MIN#define IWL_DEVICE_7005D \ IWL_DEVICE_7000_COMMON, \ .ucode_api_max = IWL7265D_UCODE_API_MAX, \ - .ucode_api_ok = IWL7265D_UCODE_API_OK, \ .ucode_api_min = IWL7265D_UCODE_API_MINconst struct iwl_cfg iwl7260_2ac_cfg = {
@@ -388,8 +378,8 @@ const struct iwl_cfg iwl7265d_n_cfg = { .dccm_len = IWL7265_DCCM_LEN, }; -MODULE_FIRMWARE (IWL7260_MODULE_FIRMWARE (IWL7260_UCODE_API_OK )); -MODULE_FIRMWARE (IWL3160_MODULE_FIRMWARE (IWL7260_UCODE_API_OK )); -MODULE_FIRMWARE (IWL3168_MODULE_FIRMWARE (IWL3168_UCODE_API_OK )); -MODULE_FIRMWARE (IWL7265_MODULE_FIRMWARE (IWL7265_UCODE_API_OK )); -MODULE_FIRMWARE (IWL7265D_MODULE_FIRMWARE (IWL7265D_UCODE_API_OK )); +MODULE_FIRMWARE (IWL7260_MODULE_FIRMWARE (IWL7260_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL3160_MODULE_FIRMWARE (IWL7260_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL3168_MODULE_FIRMWARE (IWL3168_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL7265_MODULE_FIRMWARE (IWL7265_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL7265D_MODULE_FIRMWARE (IWL7265D_UCODE_API_MAX ));
drivers/net/wireless/intel/iwlwifi/iwl-8000.c +2 -9
@@ -73,10 +73,6 @@#define IWL8000_UCODE_API_MAX 21#define IWL8265_UCODE_API_MAX 21 -/* Oldest version we won't warn about */ -#define IWL8000_UCODE_API_OK 16 -#define IWL8265_UCODE_API_OK 20 -/* Lowest firmware API version supported */ #define IWL8000_UCODE_API_MIN 16#define IWL8265_UCODE_API_MIN 20
@@ -175,19 +171,16 @@ static const struct iwl_tt_params iwl8000_tt_params = {#define IWL_DEVICE_8000 \ IWL_DEVICE_8000_COMMON, \ .ucode_api_max = IWL8000_UCODE_API_MAX, \ - .ucode_api_ok = IWL8000_UCODE_API_OK, \ .ucode_api_min = IWL8000_UCODE_API_MIN \#define IWL_DEVICE_8260 \ IWL_DEVICE_8000_COMMON, \ .ucode_api_max = IWL8000_UCODE_API_MAX, \ - .ucode_api_ok = IWL8000_UCODE_API_OK, \ .ucode_api_min = IWL8000_UCODE_API_MIN \#define IWL_DEVICE_8265 \ IWL_DEVICE_8000_COMMON, \ .ucode_api_max = IWL8265_UCODE_API_MAX, \ - .ucode_api_ok = IWL8265_UCODE_API_OK, \ .ucode_api_min = IWL8265_UCODE_API_MIN \const struct iwl_cfg iwl8260_2n_cfg = {
@@ -259,5 +252,5 @@ const struct iwl_cfg iwl4165_2ac_sdio_cfg = { .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO, }; -MODULE_FIRMWARE (IWL8000_MODULE_FIRMWARE (IWL8000_UCODE_API_OK )); -MODULE_FIRMWARE (IWL8265_MODULE_FIRMWARE (IWL8265_UCODE_API_OK )); +MODULE_FIRMWARE (IWL8000_MODULE_FIRMWARE (IWL8000_UCODE_API_MAX )); +MODULE_FIRMWARE (IWL8265_MODULE_FIRMWARE (IWL8265_UCODE_API_MAX ));
drivers/net/wireless/intel/iwlwifi/iwl-9000.c +1 -5
@@ -57,9 +57,6 @@/* Highest firmware API version supported */ #define IWL9000_UCODE_API_MAX 21 -/* Oldest version we won't warn about */ -#define IWL9000_UCODE_API_OK 16 -/* Lowest firmware API version supported */ #define IWL9000_UCODE_API_MIN 16
@@ -122,7 +119,6 @@ static const struct iwl_tt_params iwl9000_tt_params = {#define IWL_DEVICE_9000 \ .ucode_api_max = IWL9000_UCODE_API_MAX, \ - .ucode_api_ok = IWL9000_UCODE_API_OK, \ .ucode_api_min = IWL9000_UCODE_API_MIN, \ .device_family = IWL_DEVICE_FAMILY_8000, \ .max_inst_size = IWL60_RTC_INST_SIZE, \
@@ -164,4 +160,4 @@ const struct iwl_cfg iwl5165_2ac_cfg = { .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, }; -MODULE_FIRMWARE (IWL9000_MODULE_FIRMWARE (IWL9000_UCODE_API_OK )); +MODULE_FIRMWARE (IWL9000_MODULE_FIRMWARE (IWL9000_UCODE_API_MAX ));
drivers/net/wireless/intel/iwlwifi/iwl-config.h +0 -3
@@ -279,8 +279,6 @@ struct iwl_pwr_tx_backoff {* (.ucode) will be added to filename before loading from disk. The * filename is constructed as fw_name_pre<api>.ucode. * @ucode_api_max: Highest version of uCode API supported by driver. -* @ucode_api_ok: oldest version of the uCode API that is OK to load -* without a warning, for use in transitions * @ucode_api_min: Lowest version of uCode API supported by driver. * @max_inst_size: The maximal length of the fw inst section * @max_data_size: The maximal length of the fw data section
@@ -326,7 +324,6 @@ struct iwl_cfg {const char *name;const char *fw_name_pre;const unsigned int ucode_api_max; -const unsigned int ucode_api_ok;const unsigned int ucode_api_min;const enum iwl_device_family device_family;const u32 max_data_size;
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +1 -23
@@ -1206,7 +1206,6 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)int err;struct iwl_firmware_pieces *pieces;const unsigned int api_max = drv->cfg->ucode_api_max; -unsigned int api_ok = drv->cfg->ucode_api_ok;const unsigned int api_min = drv->cfg->ucode_api_min;size_t trigger_tlv_sz[FW_DBG_TRIGGER_MAX ];u32 api_ver;
@@ -1219,20 +1218,12 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE ; fw->ucode_capa.n_scan_channels =IWL_DEFAULT_SCAN_CHANNELS ; -if (!api_ok) - api_ok = api_max; - pieces =kzalloc (sizeof (*pieces),GFP_KERNEL );if (!pieces)return ; -if (!ucode_raw) { -if (drv->fw_index <= api_ok) -IWL_ERR (drv, -"request for firmware file '%s' failed.\n" , - drv->firmware_name); +if (!ucode_raw) goto try_again; - }IWL_DEBUG_INFO (drv,"Loaded firmware file '%s' (%zd bytes).\n" , drv->firmware_name, ucode_raw->size);
@@ -1271,19 +1262,6 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) api_max, api_ver); goto try_again; } - -if (api_ver < api_ok) { -if (api_ok != api_max) -IWL_ERR (drv,"Firmware has old API version, " -"expected v%u through v%u, got v%u.\n" , - api_ok, api_max, api_ver); -else -IWL_ERR (drv,"Firmware has old API version, " -"expected v%u, got v%u.\n" , - api_max, api_ver); -IWL_ERR (drv,"New firmware can be obtained from " -"http://www.intellinuxwireless.org/.\n" ); - } }/*
Signature · 1 line
2.5.0
PATCH 39/43 iwlwifi: pcie: Fix index iteration on free_irq in MSIX mode
In reply to Grumbach, EmmanuelFrom: Haim Dreyfuss <[email protected]>
In MSIX mode we iterate over the allocated interrupt vectors and register them to an handler. In case of registration failure, we free all the allocated irq.
we use the outer index mistakenly instead of the inner one.
--- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +2 -2
@@ -1500,8 +1500,8 @@ static int iwl_pcie_init_msix_handler(struct pci_dev *pdev,IWL_ERR (trans_pcie->trans,"Error allocating IRQ %d\n" , i);for (j =0 ; j < i; j++) -free_irq (trans_pcie->msix_entries[i].vector, - &trans_pcie->msix_entries[i]); +free_irq (trans_pcie->msix_entries[j].vector, + &trans_pcie->msix_entries[j]);pci_disable_msix (pdev);return ret; }
Signature · 1 line
2.5.0
PATCH 40/43 iwlwifi: store fw memory segments length and addresses in run-time
In reply to Grumbach, EmmanuelFrom: Golan Ben-Ami <[email protected]>
Currently reading the fw memory segments is done according to addresses and data length that are hard-coded.
Lately a new tlv was appended to the ucode, that contains the data type, length and address.
Parse this tlv, and in run-time store the memory segments length and addresses that would be dumped upon a fw error.
--- drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 45 +++++++++++++++++ drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h | 32 +++++++++++++ drivers/net/wireless/intel/iwlwifi/iwl-fw.h | 2 + drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c | 61 ++++++++++++++++++------ 4 files changed, 125 insertions(+), 15 deletions(-)
drivers/net/wireless/intel/iwlwifi/iwl-drv.c +45 -0
@@ -179,6 +179,8 @@ static void iwl_dealloc_ucode(struct iwl_drv *drv)kfree (drv->fw.dbg_conf_tlv[i]);for (i =0 ; i <ARRAY_SIZE (drv->fw.dbg_trigger_tlv); i++)kfree (drv->fw.dbg_trigger_tlv[i]); +for (i =0 ; i <ARRAY_SIZE (drv->fw.dbg_mem_tlv); i++) +kfree (drv->fw.dbg_mem_tlv[i]);for (i =0 ; i <IWL_UCODE_TYPE_MAX ; i++)iwl_free_fw_img (drv, drv->fw.img + i);
@@ -297,6 +299,7 @@ struct iwl_firmware_pieces {size_t dbg_conf_tlv_len[FW_DBG_CONF_MAX ];struct iwl_fw_dbg_trigger_tlv *dbg_trigger_tlv[FW_DBG_TRIGGER_MAX ];size_t dbg_trigger_tlv_len[FW_DBG_TRIGGER_MAX ]; +struct iwl_fw_dbg_mem_seg_tlv *dbg_mem_tlv[FW_DBG_MEM_MAX ]; };/*
@@ -1041,6 +1044,37 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,iwl_store_gscan_capa (&drv->fw, tlv_data, tlv_len); gscan_capa = true;break ; +case IWL_UCODE_TLV_FW_MEM_SEG : { +struct iwl_fw_dbg_mem_seg_tlv *dbg_mem = + (void *)tlv_data; +u32 type; + +if (tlv_len != (sizeof (*dbg_mem))) + goto invalid_tlv_len; + + type =le32_to_cpu (dbg_mem->data_type); + drv->fw.dbg_dynamic_mem = true; + +if (type >=ARRAY_SIZE (drv->fw.dbg_mem_tlv)) { +IWL_ERR (drv, +"Skip unknown dbg mem segment: %u\n" , + dbg_mem->data_type); +break ; + } + +if (pieces->dbg_mem_tlv[type]) { +IWL_ERR (drv, +"Ignore duplicate mem segment: %u\n" , + dbg_mem->data_type); +break ; + } + +IWL_DEBUG_INFO (drv,"Found debug memory segment: %u\n" , + dbg_mem->data_type); + + pieces->dbg_mem_tlv[type] = dbg_mem; +break ; + }default :IWL_DEBUG_INFO (drv,"unknown TLV: %d\n" , tlv_type);break ;
@@ -1350,6 +1384,17 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) } } +for (i =0 ; i <ARRAY_SIZE (drv->fw.dbg_mem_tlv); i++) { +if (pieces->dbg_mem_tlv[i]) { + drv->fw.dbg_mem_tlv[i] = +kmemdup (pieces->dbg_mem_tlv[i], +sizeof (*drv->fw.dbg_mem_tlv[i]), +GFP_KERNEL ); +if (!drv->fw.dbg_mem_tlv[i]) + goto out_free_fw; + } + } +/* Now that we can no longer fail, copy information */ /*
drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h +32 -0
@@ -142,6 +142,7 @@ enum iwl_ucode_tlv_type {IWL_UCODE_TLV_FW_DBG_CONF =39 ,IWL_UCODE_TLV_FW_DBG_TRIGGER =40 ,IWL_UCODE_TLV_FW_GSCAN_CAPA =50 , + IWL_UCODE_TLV_FW_MEM_SEG = 51, }; struct iwl_ucode_tlv {
@@ -492,6 +493,37 @@ enum iwl_fw_dbg_monitor_mode { };/** +* enum iwl_fw_mem_seg_type - data types for dumping on error +* +* @FW_DBG_MEM_SMEM: the data type is SMEM +* @FW_DBG_MEM_DCCM_LMAC: the data type is DCCM_LMAC +* @FW_DBG_MEM_DCCM_UMAC: the data type is DCCM_UMAC +*/ +enum iwl_fw_dbg_mem_seg_type { +FW_DBG_MEM_DCCM_LMAC =0 , +FW_DBG_MEM_DCCM_UMAC , +FW_DBG_MEM_SMEM , + +/* Must be last */ +FW_DBG_MEM_MAX , +}; + +/** +* struct iwl_fw_dbg_mem_seg_tlv - configures the debug data memory segments +* +* @data_type: enum %iwl_fw_mem_seg_type +* @ofs: the memory segment offset +* @len: the memory segment length, in bytes +* +* This parses IWL_UCODE_TLV_FW_MEM_SEG +*/ +struct iwl_fw_dbg_mem_seg_tlv { +__le32 data_type; +__le32 ofs; +__le32 len; +} __packed; + +/** * struct iwl_fw_dbg_dest_tlv - configures the destination of the debug data * * @version: version of the TLV - currently 0
drivers/net/wireless/intel/iwlwifi/iwl-fw.h +2 -0
@@ -286,6 +286,8 @@ struct iwl_fw {struct iwl_fw_dbg_conf_tlv *dbg_conf_tlv[FW_DBG_CONF_MAX ];size_t dbg_conf_tlv_len[FW_DBG_CONF_MAX ];struct iwl_fw_dbg_trigger_tlv *dbg_trigger_tlv[FW_DBG_TRIGGER_MAX ]; +struct iwl_fw_dbg_mem_seg_tlv *dbg_mem_tlv[FW_DBG_MEM_MAX ]; +bool dbg_dynamic_mem;size_t dbg_trigger_tlv_len[FW_DBG_TRIGGER_MAX ];u8 dbg_dest_reg_num;struct iwl_gscan_capabilities gscan_capa;
drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c +46 -15
134 lines not on this page · raw message
Signature · 1 line
2.5.0
PATCH 41/43 iwlwifi: mvm: fix inconsistent lock in dqa mode
In reply to Grumbach, EmmanuelFrom: Liad Kaufman <[email protected]>
When working in DQA mode, there is a lockdep log warning about an inconsistent state of the mvmsta->lock and the mvm->queue_info_lock. Fix this. This mode is not activated for now.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +4 -4
@@ -296,7 +296,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,lockdep_assert_held (&mvm->mutex); -spin_lock (&mvm->queue_info_lock); +spin_lock_bh (&mvm->queue_info_lock);/* * Non-QoS, QoS NDP and MGMT frames should go to a MGMT queue, if one
@@ -324,7 +324,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm,if (queue >=0 ) mvm->queue_info[queue].setup_reserved = false; -spin_unlock (&mvm->queue_info_lock); +spin_unlock_bh (&mvm->queue_info_lock);/* TODO: support shared queues for same RA */ if (queue <0 )
@@ -402,12 +402,12 @@ static void iwl_mvm_tx_deferred_stream(struct iwl_mvm *mvm,__skb_queue_head_init (&deferred_tx); +/* Disable bottom-halves when entering TX path */ +local_bh_disable ();spin_lock (&mvmsta->lock);skb_queue_splice_init (&tid_data->deferred_tx_frames, &deferred_tx);spin_unlock (&mvmsta->lock); -/* Disable bottom-halves when entering TX path */ -local_bh_disable ();while ((skb =__skb_dequeue (&deferred_tx)))if (no_queue ||iwl_mvm_tx_skb (mvm, skb, sta))ieee80211_free_txskb (mvm->hw, skb);
Signature · 1 line
2.5.0
PATCH 42/43 iwlwifi: mvm: allow setting the thermal state in D0i3
In reply to Grumbach, EmmanuelFrom: Luca Coelho <[email protected]>
We were not allowing the thermal state to be set when we were in D0i3 mode. It was not very clearly specified how it should work, but now a decision was made to allow the state to be set in D0i3 (which will cause a brief wake up). Remove the check in the set_cur_state operation.
--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +0 -3
@@ -801,9 +801,6 @@ static int iwl_mvm_tcool_set_cur_state(struct thermal_cooling_device *cdev,if (!mvm->ucode_loaded || !(mvm->cur_ucode ==IWL_UCODE_REGULAR ))return -EIO ; -if (test_bit (IWL_MVM_STATUS_IN_D0I3 , &mvm->status)) -return -EBUSY ; -mutex_lock (&mvm->mutex);if (new_state >=ARRAY_SIZE (iwl_mvm_cdev_budgets)) {
Signature · 1 line
2.5.0
PATCH 43/43 iwlwifi: pcie: remove duplicate assignment of variable isr_stats
In reply to Grumbach, EmmanuelFrom: Colin Ian King <[email protected]>
isr_stats is written twice with the same value, remove one of the redundant assignments to isr_stats.
--- drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/pcie/rx.c +1 -1
@@ -1811,7 +1811,7 @@ irqreturn_t iwl_pcie_irq_msix_handler(int irq, void *dev_id)struct msix_entry *entry = dev_id;struct iwl_trans_pcie *trans_pcie =iwl_pcie_get_trans_pcie (entry);struct iwl_trans *trans = trans_pcie->trans; -struct isr_statistics *isr_stats = isr_stats = &trans_pcie->isr_stats; +struct isr_statistics *isr_stats = &trans_pcie->isr_stats;u32 inta_fh, inta_hw;lock_map_acquire (&trans->sync_cmd_lockdep_map);
Signature · 1 line
2.5.0
Quoted 6 lines · Emmanuel
This is a pull request for 4.7. Lots of work here and more to come when dependencies on mac80211 will be resolved.
Let me know if you have issues!Thanks.
Quoted 7 lines
The following changes since commit
1200b6809dfd9d73bc4c7db76d288c35fa4b2ebe:Merge
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next(2016-03-19 10:05:34 -0700)are available in the git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git tags/iwlwifi-next-for-kalle-2016-03-30
Pulled, thanks.
Signature · 1 line
Kalle Valo