pull request: iwlwifi-next 2014-06-24
Hi John,
This is a pull request for 3.17.
I have here a whole bunch of various things. Andy contributes better debug prints for dvm specific flows and a module parameter to completely disable power save for dvm. Andrei is sharing the premises of his work on CSA - more to come. Eran and Liad keep on working on the new devices. I have the regular amount of BT Coex stuff and I continue to work on the firmware error report system adding more debug capabilities. More to come on that subject too.
I merged iwlwifi-fixes in order to be able to apply patches that relied on patches there.
Let me know if you have problems - please pull.
The following changes since commit 7171511eaec5bf23fb06078f59784a3a0626b38f:
Linux 3.16-rc1 (2014-06-15 17:45:28 -1000)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git master
for you to fetch changes up to c47af22ad630e03053f3eeefd19bd8274989ffbb:
iwlwifi: mvm: handle device start failures during restart (2014-06-24 21:55:41 +0300)
----------------------------------------------------------------
Andrei Otcheretianski (1):
iwlwifi: mvm: Introduce an API to set STA_FLG_DISABLE_TX flag
Andy Lutomirski (3):
iwlwifi: pcie: log when waking the NIC for hcmd submission fails
iwlwifi: pcie: improve debugfs queue info
iwlwifi: dvm: add a force_cam module parameter to fully disable power saving
David Spinadel (4):
iwlwifi: mvm: use ksize to memset scan_command
iwlwifi: mvm: don't use hardcoded num of scan channels
iwlwifi: fix NVM channel attribute map.
iwlwifi: mvm: support extended beacon notification
Eliad Peller (3):
iwlwifi: mvm: rework sched scan channel configuration
iwlwifi: remove MCS32 support declaration
iwlwifi: mvm: disable beacon filtering escape timer in d0i3
Emmanuel Grumbach (11):
iwlwifi: bump API version for 8000 devices
Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next
iwlwifi: add device / firmware to fw-error-dump file
iwlwifi: rename iwl_mvm_fw_error_next_data
iwlwifi: pcie: add firmware monitor capabilities
iwlwifi: mvm: BT Coex - allow to force the antenna allocation
iwlwifi: mvm: BT Coex - allow MIMO in more cases
iwlwifi: mvm: BT Coex - don't limit rate control if TTC is on
iwlwifi: mvm: BT Coex - add reduced Tx power thresholds to constants
iwlwifi: mvm: BT Coex - avoid the shared antenna for management frames
iwlwivi: mvm: BT Coex - properly set the priority of beacons
Eran Harary (2):
iwlwifi: mvm: fixes for 8000 NVM flow
iwlwifi: mvm: fix bug in set_hw_address function
Johannes Berg (2):
iwlwifi: mvm: add back support for low-priority scan
iwlwifi: mvm: handle device start failures during restart
Liad Kaufman (3):
iwlwifi: update trans->hw_rev 8000 hw family format
iwlwifi: nvm: update maximal parsed values in external nvm
iwlwifi: mvm: assure no overflows occur while reading otp
drivers/net/wireless/iwlwifi/dvm/power.c | 9 +++++++++ drivers/net/wireless/iwlwifi/iwl-8000.c | 5 ++--- drivers/net/wireless/iwlwifi/iwl-config.h | 2 +- drivers/net/wireless/iwlwifi/iwl-drv.c | 15 +++++++++++++++ drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c | 1 - drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h | 46 ++++++++++++++++++++++++++++++++++++++++++++-- drivers/net/wireless/iwlwifi/iwl-fw-file.h | 6 ++++-- drivers/net/wireless/iwlwifi/iwl-fw.h | 8 ++++++++ drivers/net/wireless/iwlwifi/iwl-modparams.h | 2 ++ drivers/net/wireless/iwlwifi/iwl-nvm-parse.c | 56 ++++++++++++++++++++++++++++++++++++++++---------------- drivers/net/wireless/iwlwifi/iwl-prph.h | 6 ++++++ drivers/net/wireless/iwlwifi/mvm/coex.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------- drivers/net/wireless/iwlwifi/mvm/constants.h | 2 ++ drivers/net/wireless/iwlwifi/mvm/debugfs.c | 39 +++++++++++++++++++++++++++++++++++++++ drivers/net/wireless/iwlwifi/mvm/fw-api-coex.h | 10 +++++++++- drivers/net/wireless/iwlwifi/mvm/fw-api-power.h | 2 +- drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h | 47 ++++++++++++++--------------------------------- drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h | 7 ++----- drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h | 14 ++++++++++++++ drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | 45 +++++++++++++++++++++++++++++---------------- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 15 ++++++++++++++- drivers/net/wireless/iwlwifi/mvm/mvm.h | 14 ++++++++++++++ drivers/net/wireless/iwlwifi/mvm/nvm.c | 29 +++++++++++++++++++++++++---- drivers/net/wireless/iwlwifi/mvm/ops.c | 31 +++++++++++++++++++++++++------ drivers/net/wireless/iwlwifi/mvm/scan.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------- drivers/net/wireless/iwlwifi/mvm/sta.c | 20 ++++++++++++++++++++ drivers/net/wireless/iwlwifi/mvm/sta.h | 2 ++ drivers/net/wireless/iwlwifi/mvm/tx.c | 8 +++++++- drivers/net/wireless/iwlwifi/pcie/internal.h | 7 +++++++ drivers/net/wireless/iwlwifi/pcie/trans.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ drivers/net/wireless/iwlwifi/pcie/tx.c | 1 + 31 files changed, 609 insertions(+), 177 deletions(-)
PATCH 1/27 iwlwifi: bump API version for 8000 devices
From: Emmanuel Grumbach <[email protected]>
--- drivers/net/wireless/iwlwifi/iwl-8000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/iwl-8000.c +1 -1
@@ -67,7 +67,7 @@#include "iwl-agn-hw.h" /* Highest firmware API version supported */ -#define IWL8000_UCODE_API_MAX 8 +#define IWL8000_UCODE_API_MAX 9/* Oldest version we won't warn about */ #define IWL8000_UCODE_API_OK 8
Signature · 1 line
1.8.3.2
PATCH 2/27 iwlwifi: mvm: use ksize to memset scan_command
In reply to Emmanuel GrumbachFrom: David Spinadel <[email protected]>
Use ksize to get scan command size instead of calculating it, to avoid nasty bugs.
--- drivers/net/wireless/iwlwifi/mvm/scan.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/mvm/scan.c +1 -3
@@ -325,9 +325,7 @@ int iwl_mvm_scan_request(struct iwl_mvm *mvm,IWL_DEBUG_SCAN (mvm,"Handling mac80211 scan request\n" ); mvm->scan_status =IWL_MVM_SCAN_OS ; -memset (cmd,0 ,sizeof (struct iwl_scan_cmd ) + - mvm->fw->ucode_capa.max_probe_length + - (MAX_NUM_SCAN_CHANNELS *sizeof (struct iwl_scan_channel ))); +memset (cmd,0 ,ksize (cmd)); cmd->channel_count = (u8 )req->n_channels; cmd->quiet_time =cpu_to_le16 (IWL_ACTIVE_QUIET_TIME );
Signature · 1 line
1.8.3.2
PATCH 3/27 iwlwifi: mvm: add back support for low-priority scan
In reply to Emmanuel GrumbachFrom: Johannes Berg <[email protected]>
The low-priority scan feature can be useful, e.g. for OBSS scans (if those are required by the AP); add back support for it, restoring the maximum out time to the value it was for low-priority scan before that was removed.
--- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 1 + drivers/net/wireless/iwlwifi/mvm/scan.c | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/mvm/mac80211.c +1 -0
@@ -374,6 +374,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) hw->wiphy->max_sched_scan_ie_len =SCAN_OFFLOAD_PROBE_REQ_SIZE -24 -2 ; hw->wiphy->features |=NL80211_FEATURE_P2P_GO_CTWIN | +NL80211_FEATURE_LOW_PRIORITY_SCAN |NL80211_FEATURE_P2P_GO_OPPPS ; mvm->rts_threshold =IEEE80211_MAX_RTS_THRESHOLD ;
drivers/net/wireless/iwlwifi/mvm/scan.c +6 -3
@@ -267,7 +267,7 @@ static void iwl_mvm_scan_condition_iterator(void *data, u8 *mac,static void iwl_mvm_scan_calc_params (struct iwl_mvm *mvm,struct ieee80211_vif *vif, -int n_ssids, +int n_ssids,u32 flags,struct iwl_mvm_scan_params *params) {bool global_bound = false;
@@ -289,6 +289,9 @@ static void iwl_mvm_scan_calc_params(struct iwl_mvm *mvm, params->max_out_time =250 ; } +if (flags &NL80211_SCAN_FLAG_LOW_PRIORITY ) + params->max_out_time =200 ; + not_bound:for (band =IEEE80211_BAND_2GHZ ; band <IEEE80211_NUM_BANDS ; band++) {
@@ -332,7 +335,7 @@ int iwl_mvm_scan_request(struct iwl_mvm *mvm, cmd->quiet_plcp_th =cpu_to_le16 (IWL_PLCP_QUIET_THRESH ); cmd->rxchain_sel_flags =iwl_mvm_scan_rx_chain (mvm); -iwl_mvm_scan_calc_params (mvm, vif, req->n_ssids, ¶ms); +iwl_mvm_scan_calc_params (mvm, vif, req->n_ssids, req->flags, ¶ms); cmd->max_out_time =cpu_to_le32 (params.max_out_time); cmd->suspend_time =cpu_to_le32 (params.suspend_time);if (params.passive_fragmented)
@@ -758,7 +761,7 @@ int iwl_mvm_config_sched_scan(struct iwl_mvm *mvm,if (!scan_cfg)return -ENOMEM ; -iwl_mvm_scan_calc_params (mvm, vif, req->n_ssids, ¶ms); +iwl_mvm_scan_calc_params (mvm, vif, req->n_ssids,0 , ¶ms);iwl_build_scan_cmd (mvm, vif, req, &scan_cfg->scan_cmd, ¶ms); scan_cfg->scan_cmd.len =cpu_to_le16 (cmd_len);
Signature · 1 line
1.8.3.2
PATCH 4/27 iwlwifi: mvm: don't use hardcoded num of scan channels
In reply to Emmanuel GrumbachFrom: David Spinadel <[email protected]>
Use num of scan channels as advertised by fw TLV.
--- drivers/net/wireless/iwlwifi/iwl-drv.c | 9 +++++ drivers/net/wireless/iwlwifi/iwl-fw-file.h | 1 + drivers/net/wireless/iwlwifi/iwl-fw.h | 1 + drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h | 47 ++++++++------------------ drivers/net/wireless/iwlwifi/mvm/mac80211.c | 3 +- drivers/net/wireless/iwlwifi/mvm/ops.c | 3 +- drivers/net/wireless/iwlwifi/mvm/scan.c | 43 ++++++++++++++--------- 7 files changed, 56 insertions(+), 51 deletions(-)
drivers/net/wireless/iwlwifi/iwl-drv.c +9 -0
@@ -155,6 +155,8 @@ static struct iwlwifi_opmode_table { [MVM_OP_MODE] = { .name = "iwlmvm", .ops = NULL }, }; +#define IWL_DEFAULT_SCAN_CHANNELS 40 +/* * struct fw_sec: Just for the image parsing proccess. * For the fw storage we are using struct fw_desc.
@@ -819,6 +821,12 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,if (iwl_store_cscheme (&drv->fw, tlv_data, tlv_len)) goto invalid_tlv_len;break ; +case IWL_UCODE_TLV_N_SCAN_CHANNELS : +if (tlv_len !=sizeof (u32)) + goto invalid_tlv_len; + capa->n_scan_channels = +le32_to_cpup ((__le32 *)tlv_data); +break ;default :IWL_DEBUG_INFO (drv,"unknown TLV: %d\n" , tlv_type);break ;
@@ -973,6 +981,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context) fw->ucode_capa.max_probe_length =IWL_DEFAULT_MAX_PROBE_LENGTH ; fw->ucode_capa.standard_phy_calibration_size =IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE ; + fw->ucode_capa.n_scan_channels =IWL_DEFAULT_SCAN_CHANNELS ;if (!api_ok) api_ok = api_max;
drivers/net/wireless/iwlwifi/iwl-fw-file.h +1 -0
@@ -128,6 +128,7 @@ enum iwl_ucode_tlv_type {IWL_UCODE_TLV_CSCHEME =28 ,IWL_UCODE_TLV_API_CHANGES_SET =29 ,IWL_UCODE_TLV_ENABLED_CAPABILITIES =30 , + IWL_UCODE_TLV_N_SCAN_CHANNELS = 31, }; struct iwl_ucode_tlv {
drivers/net/wireless/iwlwifi/iwl-fw.h +1 -0
@@ -178,6 +178,7 @@ enum iwl_ucode_sec {struct iwl_ucode_capabilities {u32 max_probe_length; +u32 n_scan_channels;u32 standard_phy_calibration_size;u32 flags;u32 api[IWL_API_ARRAY_SIZE ];
drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h +14 -33
86 lines not on this page · raw message
drivers/net/wireless/iwlwifi/mvm/mac80211.c +2 -1
@@ -1543,7 +1543,8 @@ static int iwl_mvm_mac_hw_scan(struct ieee80211_hw *hw,struct iwl_mvm *mvm =IWL_MAC80211_GET_MVM (hw);int ret; -if (req->n_channels ==0 || req->n_channels >MAX_NUM_SCAN_CHANNELS ) +if (req->n_channels ==0 || + req->n_channels > mvm->fw->ucode_capa.n_scan_channels)return -EINVAL ;mutex_lock (&mvm->mutex);
drivers/net/wireless/iwlwifi/mvm/ops.c +2 -1
@@ -504,7 +504,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, scan_size =sizeof (struct iwl_scan_cmd ) + mvm->fw->ucode_capa.max_probe_length + - (MAX_NUM_SCAN_CHANNELS *sizeof (struct iwl_scan_channel )); + (mvm->fw->ucode_capa.n_scan_channels * +sizeof (struct iwl_scan_channel )); mvm->scan_cmd =kmalloc (scan_size,GFP_KERNEL );if (!mvm->scan_cmd) goto out_free;
drivers/net/wireless/iwlwifi/mvm/scan.c +27 -16
101 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH 5/27 iwlwifi: remove MCS32 support declaration
In reply to Emmanuel GrumbachFrom: Eliad Peller <[email protected]>
MCS32 is currently not supported, so don't
declare support for it.
--- drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c +0 -1
@@ -779,7 +779,6 @@ void iwl_init_ht_hw_capab(const struct iwl_cfg *cfg,if (cfg->ht_params->ht40_bands &BIT (band)) { ht_info->cap |=IEEE80211_HT_CAP_SUP_WIDTH_20_40 ; ht_info->cap |=IEEE80211_HT_CAP_SGI_40 ; - ht_info->mcs.rx_mask[4 ] =0x01 ; max_bit_rate =MAX_BIT_RATE_40_MHZ ; }
Signature · 1 line
1.8.3.2
PATCH 6/27 iwlwifi: add device / firmware to fw-error-dump file
In reply to Emmanuel GrumbachFrom: Emmanuel Grumbach <[email protected]>
This can be useful later for parsing since the parsing may differ based on the device's family / bus.
Also add the human readable version of the firmware.
--- drivers/net/wireless/iwlwifi/iwl-drv.c | 2 ++ drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h | 24 ++++++++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-fw-file.h | 5 +++-- drivers/net/wireless/iwlwifi/iwl-fw.h | 3 +++ drivers/net/wireless/iwlwifi/mvm/ops.c | 24 +++++++++++++++++++++--- 5 files changed, 53 insertions(+), 5 deletions(-)
drivers/net/wireless/iwlwifi/iwl-drv.c +2 -0
@@ -567,6 +567,8 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, } drv->fw.ucode_ver =le32_to_cpu (ucode->ver); +memcpy (drv->fw.human_readable, ucode->human_readable, +sizeof (drv->fw.human_readable)); build =le32_to_cpu (ucode->build);if (build)
drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h +24 -0
@@ -74,12 +74,15 @@* @IWL_FW_ERROR_DUMP_RXF: * @IWL_FW_ERROR_DUMP_TXCMD: last TX command data, structured as * &struct iwl_fw_error_dump_txcmd packets +* @IWL_FW_ERROR_DUMP_DEV_FW_INFO: struct %iwl_fw_error_dump_info +* info on the device / firmware. */ enum iwl_fw_error_dump_type {IWL_FW_ERROR_DUMP_SRAM =0 ,IWL_FW_ERROR_DUMP_REG =1 ,IWL_FW_ERROR_DUMP_RXF =2 ,IWL_FW_ERROR_DUMP_TXCMD =3 , +IWL_FW_ERROR_DUMP_DEV_FW_INFO =4 ,IWL_FW_ERROR_DUMP_MAX , };
@@ -120,6 +123,27 @@ struct iwl_fw_error_dump_txcmd {u8 data[]; } __packed; +enum iwl_fw_error_dump_family { +IWL_FW_ERROR_DUMP_FAMILY_7 =7 , +IWL_FW_ERROR_DUMP_FAMILY_8 =8 , +}; + +/** +* struct iwl_fw_error_dump_info - info on the device / firmware +* @device_family: the family of the device (7 / 8) +* @hw_step: the step of the device +* @fw_human_readable: human readable FW version +* @dev_human_readable: name of the device +* @bus_human_readable: name of the bus used +*/ +struct iwl_fw_error_dump_info { +__le32 device_family; +__le32 hw_step; +u8 fw_human_readable[FW_VER_HUMAN_READABLE_SZ ]; +u8 dev_human_readable[64 ]; +u8 bus_human_readable[8 ]; +} __packed; +/** * iwl_mvm_fw_error_next_data - advance fw error dump data pointer * @data: previous data block
drivers/net/wireless/iwlwifi/iwl-fw-file.h +3 -2
@@ -137,7 +137,8 @@ struct iwl_ucode_tlv {u8 data[0 ]; }; -#define IWL_TLV_UCODE_MAGIC 0x0a4c5749 +#define IWL_TLV_UCODE_MAGIC 0x0a4c5749 +#define FW_VER_HUMAN_READABLE_SZ 64struct iwl_tlv_ucode_header {/*
@@ -148,7 +149,7 @@ struct iwl_tlv_ucode_header {*/ __le32 zero;__le32 magic; -u8 human_readable[64 ]; +u8 human_readable[FW_VER_HUMAN_READABLE_SZ ];__le32 ver;/* major/minor/API/serial */ __le32 build;__le64 ignore;
drivers/net/wireless/iwlwifi/iwl-fw.h +3 -0
@@ -65,6 +65,8 @@#include <linux/types.h> #include <net/mac80211.h> +#include "iwl-fw-file.h" +/** * enum iwl_ucode_tlv_flag - ucode API flags * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously
@@ -312,6 +314,7 @@ struct iwl_fw {bool mvm_fw;struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS ]; + u8 human_readable[FW_VER_HUMAN_READABLE_SZ]; };#endif /* __iwl_fw_h__ */
drivers/net/wireless/iwlwifi/mvm/ops.c +21 -3
@@ -827,6 +827,7 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) {struct iwl_fw_error_dump_file *dump_file;struct iwl_fw_error_dump_data *dump_data; +struct iwl_fw_error_dump_info *dump_info;u32 file_len;u32 trans_len;
@@ -835,10 +836,11 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)if (mvm->fw_error_dump)return ; - file_len = mvm->fw_error_sram_len + + file_len =sizeof (*dump_file) + +sizeof (*dump_data) *3 + + mvm->fw_error_sram_len + mvm->fw_error_rxf_len + -sizeof (*dump_file) + -sizeof (*dump_data) *2 ; +sizeof (*dump_info); trans_len =iwl_trans_dump_data (mvm->trans,NULL ,0 );if (trans_len)
@@ -853,6 +855,22 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) dump_file->barker =cpu_to_le32 (IWL_FW_ERROR_DUMP_BARKER ); dump_file->file_len =cpu_to_le32 (file_len); dump_data = (void *)dump_file->data; + + dump_data->type =cpu_to_le32 (IWL_FW_ERROR_DUMP_DEV_FW_INFO ); + dump_data->len =cpu_to_le32 (sizeof (*dump_info)); + dump_info = (void *) dump_data->data; + dump_info->device_family = + mvm->cfg->device_family ==IWL_DEVICE_FAMILY_7000 ? +cpu_to_le32 (IWL_FW_ERROR_DUMP_FAMILY_7 ) : +cpu_to_le32 (IWL_FW_ERROR_DUMP_FAMILY_8 ); +memcpy (dump_info->fw_human_readable, mvm->fw->human_readable, +sizeof (dump_info->fw_human_readable)); +strncpy (dump_info->dev_human_readable, mvm->cfg->name, +sizeof (dump_info->dev_human_readable)); +strncpy (dump_info->bus_human_readable, mvm->dev->bus->name, +sizeof (dump_info->bus_human_readable)); + + dump_data =iwl_mvm_fw_error_next_data (dump_data); dump_data->type =cpu_to_le32 (IWL_FW_ERROR_DUMP_RXF ); dump_data->len =cpu_to_le32 (mvm->fw_error_rxf_len);memcpy (dump_data->data, mvm->fw_error_rxf, mvm->fw_error_rxf_len);
Signature · 1 line
1.8.3.2
PATCH 7/27 iwlwifi: rename iwl_mvm_fw_error_next_data
In reply to Emmanuel GrumbachFrom: Emmanuel Grumbach <[email protected]>
This is not related to mvm. Rename to iwl_fw_error_next_data.
--- drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h | 4 ++-- drivers/net/wireless/iwlwifi/mvm/ops.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h +2 -2
@@ -145,12 +145,12 @@ struct iwl_fw_error_dump_info { } __packed;/** -* iwl_mvm_fw_error_next_data - advance fw error dump data pointer +* iwl_fw_error_next_data - advance fw error dump data pointer * @data: previous data block * Returns: next data block */ static inline struct iwl_fw_error_dump_data * -iwl_mvm_fw_error_next_data (struct iwl_fw_error_dump_data *data) +iwl_fw_error_next_data (struct iwl_fw_error_dump_data *data) {return (void *)(data->data +le32_to_cpu (data->len)); }
drivers/net/wireless/iwlwifi/mvm/ops.c +3 -3
@@ -870,12 +870,12 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm)strncpy (dump_info->bus_human_readable, mvm->dev->bus->name,sizeof (dump_info->bus_human_readable)); - dump_data =iwl_mvm_fw_error_next_data (dump_data); + dump_data =iwl_fw_error_next_data (dump_data); dump_data->type =cpu_to_le32 (IWL_FW_ERROR_DUMP_RXF ); dump_data->len =cpu_to_le32 (mvm->fw_error_rxf_len);memcpy (dump_data->data, mvm->fw_error_rxf, mvm->fw_error_rxf_len); - dump_data =iwl_mvm_fw_error_next_data (dump_data); + dump_data =iwl_fw_error_next_data (dump_data); dump_data->type =cpu_to_le32 (IWL_FW_ERROR_DUMP_SRAM ); dump_data->len =cpu_to_le32 (mvm->fw_error_sram_len);
@@ -895,7 +895,7 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) mvm->fw_error_sram_len =0 ;if (trans_len) { -void *buf =iwl_mvm_fw_error_next_data (dump_data); +void *buf =iwl_fw_error_next_data (dump_data);u32 real_trans_len =iwl_trans_dump_data (mvm->trans, buf, trans_len); dump_data = (void *)((u8 *)buf + real_trans_len);
Signature · 1 line
1.8.3.2
PATCH 8/27 iwlwifi: pcie: add firmware monitor capabilities
In reply to Emmanuel GrumbachFrom: Emmanuel Grumbach <[email protected]>
This allows to use the firmware monitor. This capability uses a lot of contiguous memory (up to 64MB), so make its usage module parameter dependent.
The driver will try to allocate as much contiguous memory as possible downgrading its requirements until the allocation succeeds.
Dump this data into the fw-error dump file when an error happens.
--- drivers/net/wireless/iwlwifi/iwl-drv.c | 4 + drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h | 18 ++++ drivers/net/wireless/iwlwifi/iwl-modparams.h | 2 + drivers/net/wireless/iwlwifi/iwl-prph.h | 6 ++ drivers/net/wireless/iwlwifi/pcie/internal.h | 7 ++ drivers/net/wireless/iwlwifi/pcie/trans.c | 125 ++++++++++++++++++++++- 6 files changed, 158 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl-drv.c +4 -0
@@ -1405,3 +1405,7 @@ module_param_named(power_level, iwlwifi_mod_params.power_level, int, S_IRUGO);MODULE_PARM_DESC (power_level,"default power save level (range from 1 - 5, default: 1)" ); + +module_param_named (fw_monitor, iwlwifi_mod_params.fw_monitor, bool,S_IRUGO ); +MODULE_PARM_DESC (dbgm, +"firmware monitor - to debug FW (default: false - needs lots of memory)" );
drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h +18 -0
@@ -76,6 +76,7 @@* &struct iwl_fw_error_dump_txcmd packets * @IWL_FW_ERROR_DUMP_DEV_FW_INFO: struct %iwl_fw_error_dump_info * info on the device / firmware. +* @IWL_FW_ERROR_DUMP_FW_MONITOR: firmware monitor */ enum iwl_fw_error_dump_type {IWL_FW_ERROR_DUMP_SRAM =0 ,
@@ -83,6 +84,7 @@ enum iwl_fw_error_dump_type {IWL_FW_ERROR_DUMP_RXF =2 ,IWL_FW_ERROR_DUMP_TXCMD =3 ,IWL_FW_ERROR_DUMP_DEV_FW_INFO =4 , +IWL_FW_ERROR_DUMP_FW_MONITOR =5 , IWL_FW_ERROR_DUMP_MAX, };
@@ -145,6 +147,22 @@ struct iwl_fw_error_dump_info { } __packed;/** +* struct iwl_fw_error_fw_mon - FW monitor data +* @fw_mon_wr_ptr: the position of the write pointer in the cyclic buffer +* @fw_mon_base_ptr: base pointer of the data +* @fw_mon_cycle_cnt: number of wrap arounds +* @reserved: for future use +* @data: captured data +*/ +struct iwl_fw_error_fw_mon { +__le32 fw_mon_wr_ptr; +__le32 fw_mon_base_ptr; +__le32 fw_mon_cycle_cnt; +__le32 reserved[3 ]; +u8 data[]; +} __packed; + +/** * iwl_fw_error_next_data - advance fw error dump data pointer * @data: previous data block * Returns: next data block
drivers/net/wireless/iwlwifi/iwl-modparams.h +2 -0
@@ -103,6 +103,7 @@ enum iwl_disable_11n {* @power_level: power level, default = 1 * @debug_level: levels are IWL_DL_* * @ant_coupling: antenna coupling in dB, default = 0 +* @fw_monitor: allow to use firmware monitor */ struct iwl_mod_params {int sw_crypto;
@@ -120,6 +121,7 @@ struct iwl_mod_params {int ant_coupling;char *nvm_file;bool uapsd_disable; + bool fw_monitor; };#endif /* #__iwl_modparams_h__ */
drivers/net/wireless/iwlwifi/iwl-prph.h +6 -0
@@ -359,4 +359,10 @@ enum secure_load_status_reg {#define RXF_LD_FENCE_OFFSET_ADDR (0xa00c10)#define RXF_FIFO_RD_FENCE_ADDR (0xa00c0c) +/* FW monitor */ +#define MON_BUFF_BASE_ADDR (0xa03c3c) +#define MON_BUFF_END_ADDR (0xa03c40) +#define MON_BUFF_WRPTR (0xa03c44) +#define MON_BUFF_CYCLE_CNT (0xa03c48) +#endif /* __iwl_prph_h__ */
drivers/net/wireless/iwlwifi/pcie/internal.h +7 -0
@@ -260,6 +260,9 @@ iwl_pcie_get_scratchbuf_dma(struct iwl_txq *txq, int idx)* @wd_timeout: queue watchdog timeout (jiffies) * @reg_lock: protect hw register access * @cmd_in_flight: true when we have a host command in flight +* @fw_mon_phys: physical address of the buffer for the firmware monitor +* @fw_mon_page: points to the first page of the buffer for the firmware monitor +* @fw_mon_size: size of the buffer for the firmware monitor */ struct iwl_trans_pcie {struct iwl_rxq rxq;
@@ -312,6 +315,10 @@ struct iwl_trans_pcie {/*protect hw register */ spinlock_t reg_lock;bool cmd_in_flight; + +dma_addr_t fw_mon_phys; +struct page *fw_mon_page; +u32 fw_mon_size; };#define IWL_TRANS_GET_PCIE_TRANS (_iwl_trans) \
drivers/net/wireless/iwlwifi/pcie/trans.c +121 -4
162 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH 9/27 iwlwifi: mvm: fixes for 8000 NVM flow
In reply to Emmanuel GrumbachFrom: Eran Harary <[email protected]>
The nvm_file should be loaded by default for SDIO procucts only. Change the configuration accordingly. While at it, fix a typo in the device name.
--- drivers/net/wireless/iwlwifi/iwl-8000.c | 3 +-- drivers/net/wireless/iwlwifi/iwl-config.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-8000.c +1 -2
@@ -119,10 +119,9 @@ const struct iwl_cfg iwl8260_2ac_cfg = { .ht_params = &iwl8000_ht_params, .nvm_ver = IWL8000_NVM_VERSION, .nvm_calib_ver = IWL8000_TX_POWER_VERSION, - .default_nvm_file = DEFAULT_NVM_FILE_FAMILY_8000, }; -const struct iwl_cfg iwl8260_n_cfg = { +const struct iwl_cfg iwl8260_2ac_sdio_cfg = { .name ="Intel(R) Dual Band Wireless-AC 8260" , .fw_name_pre =IWL8000_FW_PRE ,IWL_DEVICE_8000 ,
drivers/net/wireless/iwlwifi/iwl-config.h +1 -1
@@ -337,7 +337,7 @@ extern const struct iwl_cfg iwl7265_2ac_cfg;extern const struct iwl_cfg iwl7265_2n_cfg;extern const struct iwl_cfg iwl7265_n_cfg;extern const struct iwl_cfg iwl8260_2ac_cfg; -extern const struct iwl_cfg iwl8260_n_cfg; +extern const struct iwl_cfg iwl8260_2ac_sdio_cfg;#endif /* CONFIG_IWLMVM */ #endif /* __IWL_CONFIG_H__ */
Signature · 1 line
1.8.3.2
PATCH 10/27 iwlwifi: fix NVM channel attribute map.
In reply to Emmanuel GrumbachFrom: David Spinadel <[email protected]>
Fix NVM channel attributes. Add indoor-only and GO Concurrent bits. Remove DFS channel bit which is overlapped with radar.
--- drivers/net/wireless/iwlwifi/iwl-nvm-parse.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +18 -4
@@ -174,7 +174,9 @@ static struct ieee80211_rate iwl_cfg80211_rates[] = {* @NVM_CHANNEL_IBSS: usable as an IBSS channel * @NVM_CHANNEL_ACTIVE: active scanning allowed * @NVM_CHANNEL_RADAR: radar detection required -* @NVM_CHANNEL_DFS: dynamic freq selection candidate +* @NVM_CHANNEL_INDOOR_ONLY: only indoor use is allowed +* @NVM_CHANNEL_GO_CONCURRENT: GO operation is allowed when connected to BSS +* on same channel on 2.4 or same UNII band on 5.2 * @NVM_CHANNEL_WIDE: 20 MHz channel okay (?) * @NVM_CHANNEL_40MHZ: 40 MHz channel okay (?) * @NVM_CHANNEL_80MHZ: 80 MHz channel okay (?)
@@ -185,7 +187,8 @@ enum iwl_nvm_channel_flags {NVM_CHANNEL_IBSS =BIT (1 ),NVM_CHANNEL_ACTIVE =BIT (3 ),NVM_CHANNEL_RADAR =BIT (4 ), -NVM_CHANNEL_DFS =BIT (7 ), +NVM_CHANNEL_INDOOR_ONLY =BIT (5 ), +NVM_CHANNEL_GO_CONCURRENT =BIT (6 ),NVM_CHANNEL_WIDE =BIT (8 ),NVM_CHANNEL_40MHZ =BIT (9 ), NVM_CHANNEL_80MHZ = BIT(10),
@@ -273,6 +276,16 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,if (ch_flags &NVM_CHANNEL_RADAR ) channel->flags |=IEEE80211_CHAN_RADAR ; +if (ch_flags &NVM_CHANNEL_INDOOR_ONLY ) + channel->flags |=IEEE80211_CHAN_INDOOR_ONLY ; + +/* Set the GO concurrent flag only in case that NO_IR is set. +* Otherwise it is meaningless +*/ +if ((ch_flags &NVM_CHANNEL_GO_CONCURRENT ) && + (channel->flags &IEEE80211_CHAN_NO_IR )) + channel->flags |=IEEE80211_CHAN_GO_CONCURRENT ; +/* Initialize regulatory-based run-time data */ /*
@@ -282,7 +295,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, channel->max_power =DEFAULT_MAX_TX_POWER ; is_5ghz = channel->band ==IEEE80211_BAND_5GHZ ; IWL_DEBUG_EEPROM(dev, - "Ch. %d [%sGHz] %s%s%s%s%s%s(0x%02x %ddBm): Ad-Hoc %ssupported\n", + "Ch. %d [%sGHz] %s%s%s%s%s%s%s(0x%02x %ddBm): Ad-Hoc %ssupported\n", channel->hw_value, is_5ghz ? "5.2" : "2.4", CHECK_AND_PRINT_I(VALID),
@@ -290,7 +303,8 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,CHECK_AND_PRINT_I (ACTIVE ),CHECK_AND_PRINT_I (RADAR ),CHECK_AND_PRINT_I (WIDE ), -CHECK_AND_PRINT_I (DFS ), +CHECK_AND_PRINT_I (INDOOR_ONLY ), +CHECK_AND_PRINT_I (GO_CONCURRENT ), ch_flags, channel->max_power, ((ch_flags & NVM_CHANNEL_IBSS) &&
Signature · 1 line
1.8.3.2
PATCH 11/27 iwlwifi: pcie: log when waking the NIC for hcmd submission fails
In reply to Emmanuel GrumbachFrom: Andy Lutomirski <[email protected]>
I've never seen this happen, but it's useful to rule it out.
--- drivers/net/wireless/iwlwifi/pcie/tx.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/iwlwifi/pcie/tx.c +1 -0
@@ -1438,6 +1438,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);spin_unlock_irqrestore (&trans_pcie->reg_lock, flags); trans_pcie->cmd_in_flight = false; +IWL_ERR (trans,"Failed to wake NIC for hcmd\n" ); idx = -EIO ; goto out; }
Signature · 1 line
1.8.3.2
PATCH 12/27 iwlwifi: pcie: improve debugfs queue info
In reply to Emmanuel GrumbachFrom: Andy Lutomirski <[email protected]>
This adds need_update and write_actual to rx_queue and need_update and an HCMD indicator to tx_queue.
On my card, rx_queue now looks like:
read: 181
write: 180write_actual: 176need_update: 0free_count: 40closed_rb_num: 181
tx_queue now looks like:
hwq 00: read=29 write=30 use=1 stop=0 need_update=0 hwq 01: read=0 write=0 use=1 stop=0 need_update=0 hwq 02: read=128 write=128 use=1 stop=0 need_update=0 hwq 03: read=0 write=0 use=1 stop=0 need_update=0 hwq 04: read=94 write=94 use=1 stop=0 need_update=0 HCMD hwq 05: read=0 write=0 use=0 stop=0 need_update=0 hwq 06: read=0 write=0 use=0 stop=0 need_update=0 hwq 07: read=0 write=0 use=0 stop=0 need_update=0 hwq 08: read=0 write=0 use=0 stop=0 need_update=0 hwq 09: read=0 write=0 use=0 stop=0 need_update=0 hwq 10: read=0 write=0 use=0 stop=0 need_update=0 hwq 11: read=0 write=0 use=0 stop=0 need_update=0 hwq 12: read=0 write=0 use=0 stop=0 need_update=0 hwq 13: read=0 write=0 use=0 stop=0 need_update=0 hwq 14: read=0 write=0 use=0 stop=0 need_update=0 hwq 15: read=0 write=0 use=0 stop=0 need_update=0 hwq 16: read=0 write=0 use=0 stop=0 need_update=0 hwq 17: read=0 write=0 use=0 stop=0 need_update=0 hwq 18: read=0 write=0 use=0 stop=0 need_update=0 hwq 19: read=0 write=0 use=0 stop=0 need_update=0
This may help with debugging queue stalls.
--- drivers/net/wireless/iwlwifi/pcie/trans.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/pcie/trans.c +8 -2
@@ -1573,10 +1573,12 @@ static ssize_t iwl_dbgfs_tx_queue_read(struct file *file, txq = &trans_pcie->txq[cnt]; q = &txq->q; pos +=scnprintf (buf + pos, bufsz - pos, -"hwq %.2d: read=%u write=%u use=%d stop=%d\n" , +"hwq %.2d: read=%u write=%u use=%d stop=%d need_update=%d%s\n" , cnt, q->read_ptr, q->write_ptr, !!test_bit (cnt, trans_pcie->queue_used), - !!test_bit (cnt, trans_pcie->queue_stopped)); + !!test_bit (cnt, trans_pcie->queue_stopped), + txq->need_update, + (cnt == trans_pcie->cmd_queue ?" HCMD" :"" )); } ret =simple_read_from_buffer (user_buf, count, ppos, buf, pos);kfree (buf);
@@ -1598,6 +1600,10 @@ static ssize_t iwl_dbgfs_rx_queue_read(struct file *file, rxq->read); pos +=scnprintf (buf + pos, bufsz - pos,"write: %u\n" , rxq->write); + pos +=scnprintf (buf + pos, bufsz - pos,"write_actual: %u\n" , + rxq->write_actual); + pos +=scnprintf (buf + pos, bufsz - pos,"need_update: %d\n" , + rxq->need_update); pos +=scnprintf (buf + pos, bufsz - pos,"free_count: %u\n" , rxq->free_count);if (rxq->rb_stts) {
Signature · 1 line
1.8.3.2
PATCH 13/27 iwlwifi: dvm: add a force_cam module parameter to fully disable power saving
In reply to Emmanuel GrumbachFrom: Andy Lutomirski <[email protected]>
iwldvm stalls are often blamed on power management. Add an option to force it all the way off.
--- drivers/net/wireless/iwlwifi/dvm/power.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/wireless/iwlwifi/dvm/power.c +9 -0
@@ -40,6 +40,10 @@#include "commands.h" #include "power.h" +static bool force_cam; +module_param (force_cam, bool,0644 ); +MODULE_PARM_DESC (force_cam,"force continuously aware mode (no power saving at all)" ); +/* * Setting power level allows the card to go to sleep when not busy. *
@@ -288,6 +292,11 @@ static void iwl_power_build_cmd(struct iwl_priv *priv,bool enabled = priv->hw->conf.flags &IEEE80211_CONF_PS ;int dtimper; +if (force_cam) { +iwl_power_sleep_cam_cmd (priv, cmd); +return ; + } + dtimper = priv->hw->conf.ps_dtim_period ?:1 ;if (priv->wowlan)
Signature · 1 line
1.8.3.2
PATCH 14/27 iwlwifi: mvm: fix bug in set_hw_address function
In reply to Emmanuel GrumbachFrom: Eran Harary <[email protected]>
Don't use nvm_hw pointer if it is NULL. Print an error message if the MAC address isn't valid.
--- drivers/net/wireless/iwlwifi/iwl-nvm-parse.c | 34 ++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-)
drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +22 -12
@@ -476,7 +476,8 @@ static void iwl_set_hw_address(const struct iwl_cfg *cfg, data->hw_addr[5 ] = hw_addr[4 ]; } -static void iwl_set_hw_address_family_8000 (const struct iwl_cfg *cfg, +static void iwl_set_hw_address_family_8000 (struct device *dev, +const struct iwl_cfg *cfg,struct iwl_nvm_data *data,const __le16 *mac_override,const __le16 *nvm_hw)
@@ -495,20 +496,28 @@ static void iwl_set_hw_address_family_8000(const struct iwl_cfg *cfg, data->hw_addr[4 ] = hw_addr[5 ]; data->hw_addr[5 ] = hw_addr[4 ]; -if (is_valid_ether_addr (hw_addr)) +if (is_valid_ether_addr (data->hw_addr))return ; + +IWL_ERR_DEV (dev, +"mac address from nvm override section is not valid\n" ); } -/* take the MAC address from the OTP */ - hw_addr = (const u8 *)(nvm_hw +HW_ADDR0_FAMILY_8000 ); - data->hw_addr[0 ] = hw_addr[3 ]; - data->hw_addr[1 ] = hw_addr[2 ]; - data->hw_addr[2 ] = hw_addr[1 ]; - data->hw_addr[3 ] = hw_addr[0 ]; +if (nvm_hw) { +/* take the MAC address from the OTP */ + hw_addr = (const u8 *)(nvm_hw +HW_ADDR0_FAMILY_8000 ); + data->hw_addr[0 ] = hw_addr[3 ]; + data->hw_addr[1 ] = hw_addr[2 ]; + data->hw_addr[2 ] = hw_addr[1 ]; + data->hw_addr[3 ] = hw_addr[0 ]; + + hw_addr = (const u8 *)(nvm_hw +HW_ADDR1_FAMILY_8000 ); + data->hw_addr[4 ] = hw_addr[1 ]; + data->hw_addr[5 ] = hw_addr[0 ]; +return ; + } - hw_addr = (const u8 *)(nvm_hw +HW_ADDR1_FAMILY_8000 ); - data->hw_addr[4 ] = hw_addr[1 ]; - data->hw_addr[5 ] = hw_addr[0 ]; +IWL_ERR_DEV (dev,"mac address is not found\n" ); } struct iwl_nvm_data *
@@ -570,7 +579,8 @@ iwl_parse_nvm_data(struct device *dev, const struct iwl_cfg *cfg, rx_chains); }else {/* MAC address in family 8000 */ -iwl_set_hw_address_family_8000 (cfg, data, mac_override, nvm_hw); +iwl_set_hw_address_family_8000 (dev, cfg, data, mac_override, + nvm_hw); iwl_init_sbands(dev, cfg, data, regulatory, sku & NVM_SKU_CAP_11AC_ENABLE, tx_chains,
Signature · 1 line
1.8.3.2
PATCH 15/27 iwlwifi: update trans->hw_rev 8000 hw family format
In reply to Emmanuel GrumbachFrom: Liad Kaufman <[email protected]>
The format of the CSR_HW_REV register has changed in 8000 HW family. To keep backwards compatibility, we store the value of this register as usual in trans->hw_rev, only we store it in the old format in this variable.
--- drivers/net/wireless/iwlwifi/pcie/trans.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/wireless/iwlwifi/pcie/trans.c +10 -0
@@ -1993,6 +1993,16 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, } trans->hw_rev =iwl_read32 (trans,CSR_HW_REV ); +/* +* In the 8000 HW family the format of the 4 bytes of CSR_HW_REV have +* changed, and now the revision step also includes bit 0-1 (no more +* "dash" value). To keep hw_rev backwards compatible - we'll store it +* in the old format. +*/ +if (trans->cfg->device_family ==IWL_DEVICE_FAMILY_8000 ) + trans->hw_rev = (trans->hw_rev &0xfff0 ) | + ((trans->hw_rev <<2 ) &0xc ); + trans->hw_id = (pdev->device <<16 ) + pdev->subsystem_device;snprintf (trans->hw_id_str,sizeof (trans->hw_id_str),"PCI ID: 0x%04X:0x%04X" , pdev->device, pdev->subsystem_device);
Signature · 1 line
1.8.3.2
PATCH 16/27 iwlwifi: nvm: update maximal parsed values in external nvm
In reply to Emmanuel GrumbachFrom: Liad Kaufman <[email protected]>
Some of the maximum values of the parsed external NVM file in the B-step of the 8000 HW family were updated, so this updates these values.
--- drivers/net/wireless/iwlwifi/mvm/nvm.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/mvm/nvm.c +13 -2
@@ -69,7 +69,9 @@/* Default NVM size to read */ #define IWL_NVM_DEFAULT_CHUNK_SIZE (2*1024) -#define IWL_MAX_NVM_SECTION_SIZE 7000 +#define IWL_MAX_NVM_SECTION_SIZE 0x1b58 +#define IWL_MAX_NVM_8000A_SECTION_SIZE 0xffc +#define IWL_MAX_NVM_8000B_SECTION_SIZE 0x1ffc#define NVM_WRITE_OPCODE 1#define NVM_READ_OPCODE 0
@@ -326,6 +328,7 @@ static int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm)u8 data[]; } *file_sec;const u8 *eof, *temp; +int max_section_size;#define NVM_WORD1_LEN (x) (8 * (x & 0x03FF))#define NVM_WORD2_ID (x) (x >> 12)
@@ -334,6 +337,14 @@ static int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm)IWL_DEBUG_EEPROM (mvm->trans->dev,"Read from external NVM\n" ); +/* Maximal size depends on HW family and step */ +if (mvm->trans->cfg->device_family !=IWL_DEVICE_FAMILY_8000 ) + max_section_size =IWL_MAX_NVM_SECTION_SIZE ; +else if ((mvm->trans->hw_rev &0xc ) ==0 )/* Family 8000 A-step */ + max_section_size =IWL_MAX_NVM_8000A_SECTION_SIZE ; +else /* Family 8000 B-step */ + max_section_size =IWL_MAX_NVM_8000B_SECTION_SIZE ; +/* * Obtain NVM image via request_firmware. Since we already used * request_firmware_nowait() for the firmware binary load and only
@@ -392,7 +403,7 @@ static int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm) le16_to_cpu(file_sec->word1)); } -if (section_size >IWL_MAX_NVM_SECTION_SIZE ) { +if (section_size > max_section_size) {IWL_ERR (mvm,"ERROR - section too large (%d)\n" , section_size); ret = -EINVAL ;
Signature · 1 line
1.8.3.2
PATCH 17/27 iwlwifi: mvm: assure no overflows occur while reading otp
In reply to Emmanuel GrumbachFrom: Liad Kaufman <[email protected]>
Just in case sizes change in the OTP without proper SW updating, an additional check is inserted when reading OTP sections to assure no overflows occur.
--- drivers/net/wireless/iwlwifi/mvm/nvm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/mvm/nvm.c +12 -2
@@ -221,7 +221,7 @@ static int iwl_nvm_write_section(struct iwl_mvm *mvm, u16 section,* without overflowing, so no check is needed. */ static int iwl_nvm_read_section (struct iwl_mvm *mvm,u16 section, -u8 *data) +u8 *data,u32 size_read) {u16 length, offset =0 ;int ret;
@@ -233,6 +233,13 @@ static int iwl_nvm_read_section(struct iwl_mvm *mvm, u16 section,/* Read the NVM until exhausted (reading less than requested) */ while (ret == length) { +/* Check no memory assumptions fail and cause an overflow */ +if ((size_read + offset + length) > + mvm->cfg->base_params->eeprom_size) { +IWL_ERR (mvm,"EEPROM size is too small for NVM\n" ); +return -ENOBUFS ; + } + ret =iwl_nvm_read_chunk (mvm, section, offset, length, data);if (ret <0 ) { IWL_DEBUG_EEPROM(mvm->trans->dev,
@@ -470,6 +477,7 @@ int iwl_mvm_load_nvm_to_nic(struct iwl_mvm *mvm)int iwl_nvm_init (struct iwl_mvm *mvm,bool read_nvm_from_nic) {int ret, section; +u32 size_read =0 ;u8 *nvm_buffer, *temp;if (WARN_ON_ONCE (mvm->cfg->nvm_hw_section_num >=NVM_MAX_NUM_SECTIONS ))
@@ -486,9 +494,11 @@ int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic)return -ENOMEM ;for (section =0 ; section <NVM_MAX_NUM_SECTIONS ; section++) {/* we override the constness for initial read */ - ret =iwl_nvm_read_section (mvm, section, nvm_buffer); + ret =iwl_nvm_read_section (mvm, section, nvm_buffer, + size_read);if (ret <0 )continue ; + size_read += ret; temp =kmemdup (nvm_buffer, ret,GFP_KERNEL );if (!temp) { ret = -ENOMEM ;
Signature · 1 line
1.8.3.2
PATCH 18/27 iwlwifi: mvm: BT Coex - allow to force the antenna allocation
In reply to Emmanuel GrumbachFrom: Emmanuel Grumbach <[email protected]>
This can be used for testing.
--- drivers/net/wireless/iwlwifi/mvm/coex.c | 39 ++++++++++++++++++++++++++ drivers/net/wireless/iwlwifi/mvm/debugfs.c | 39 ++++++++++++++++++++++++++ drivers/net/wireless/iwlwifi/mvm/fw-api-coex.h | 6 ++++ drivers/net/wireless/iwlwifi/mvm/mvm.h | 10 +++++++ 4 files changed, 94 insertions(+)
drivers/net/wireless/iwlwifi/mvm/coex.c +39 -0
@@ -106,6 +106,9 @@ static const u8 iwl_bt_prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX] = {static int iwl_send_bt_prio_tbl (struct iwl_mvm *mvm) { +if (unlikely (mvm->bt_force_ant_mode !=BT_FORCE_ANT_DIS )) +return 0 ; +return iwl_mvm_send_cmd_pdu (mvm,BT_COEX_PRIO_TABLE ,0 ,sizeof (struct iwl_bt_coex_prio_tbl_cmd ), &iwl_bt_prio_tbl);
@@ -578,6 +581,29 @@ int iwl_send_bt_init_conf(struct iwl_mvm *mvm)return -ENOMEM ; cmd.data[0 ] = bt_cmd; +lockdep_assert_held (&mvm->mutex); + +if (unlikely (mvm->bt_force_ant_mode !=BT_FORCE_ANT_DIS )) { +switch (mvm->bt_force_ant_mode) { +case BT_FORCE_ANT_AUTO : + flags =BT_COEX_AUTO ; +break ; +case BT_FORCE_ANT_BT : + flags =BT_COEX_BT ; +break ; +case BT_FORCE_ANT_WIFI : + flags =BT_COEX_WIFI ; +break ; +default : +WARN_ON (1 ); + flags =0 ; + } + + bt_cmd->flags =cpu_to_le32 (flags); + bt_cmd->valid_bit_msk =cpu_to_le32 (BT_VALID_ENABLE ); + goto send_cmd; + } + bt_cmd->max_kill =5 ; bt_cmd->bt4_antenna_isolation_thr =BT_ANTENNA_COUPLING_THRESHOLD ; bt_cmd->bt4_antenna_isolation = iwlwifi_mod_params.ant_coupling;
@@ -642,6 +668,7 @@ int iwl_send_bt_init_conf(struct iwl_mvm *mvm) bt_cmd->kill_cts_msk =cpu_to_le32 (iwl_bt_cts_kill_msk[BT_KILL_MSK_DEFAULT ]); +send_cmd:memset (&mvm->last_bt_notif,0 ,sizeof (mvm->last_bt_notif));memset (&mvm->last_bt_ci_cmd,0 ,sizeof (mvm->last_bt_ci_cmd));
@@ -955,6 +982,10 @@ static void iwl_mvm_bt_coex_notif_handle(struct iwl_mvm *mvm)struct iwl_bt_coex_ci_cmd cmd = {};u8 ci_bw_idx; +/* Ignore updates if we are in force mode */ +if (unlikely (mvm->bt_force_ant_mode !=BT_FORCE_ANT_DIS )) +return ; +rcu_read_lock (); ieee80211_iterate_active_interfaces_atomic( mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
@@ -1121,6 +1152,10 @@ void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif,lockdep_assert_held (&mvm->mutex); +/* Ignore updates if we are in force mode */ +if (unlikely (mvm->bt_force_ant_mode !=BT_FORCE_ANT_DIS )) +return ; +/* * Rssi update while not associated - can happen since the statistics * are handled asynchronously
@@ -1274,6 +1309,10 @@ int iwl_mvm_rx_ant_coupling_notif(struct iwl_mvm *mvm,lockdep_assert_held (&mvm->mutex); +/* Ignore updates if we are in force mode */ +if (unlikely (mvm->bt_force_ant_mode !=BT_FORCE_ANT_DIS )) +return 0 ; +if (ant_isolation == mvm->last_ant_isol)return 0 ;
drivers/net/wireless/iwlwifi/mvm/debugfs.c +39 -0
@@ -455,6 +455,43 @@ iwl_dbgfs_bt_tx_prio_write(struct iwl_mvm *mvm, char *buf,return count; } +static ssize_t +iwl_dbgfs_bt_force_ant_write (struct iwl_mvm *mvm,char *buf, +size_t count,loff_t *ppos) +{ +static const char *const modes_str[BT_FORCE_ANT_MAX ] = { + [BT_FORCE_ANT_DIS ] ="dis" , + [BT_FORCE_ANT_AUTO ] ="auto" , + [BT_FORCE_ANT_BT ] ="bt" , + [BT_FORCE_ANT_WIFI ] ="wifi" , + }; +int ret, bt_force_ant_mode; + +for (bt_force_ant_mode =0 ; + bt_force_ant_mode <ARRAY_SIZE (modes_str); + bt_force_ant_mode++) { +if (!strcmp (buf, modes_str[bt_force_ant_mode])) +break ; + } + +if (bt_force_ant_mode >=ARRAY_SIZE (modes_str)) +return -EINVAL ; + + ret =0 ; +mutex_lock (&mvm->mutex); +if (mvm->bt_force_ant_mode == bt_force_ant_mode) + goto out; + + mvm->bt_force_ant_mode = bt_force_ant_mode; +IWL_DEBUG_COEX (mvm,"Force mode: %s\n" , + modes_str[mvm->bt_force_ant_mode]); + ret =iwl_send_bt_init_conf (mvm); + +out: +mutex_unlock (&mvm->mutex); +return ret ?: count; +} +#define PRINT_STATS_LE32 (_str, _val) \ pos += scnprintf(buf + pos, bufsz - pos, \ fmt_table, _str, \
@@ -1101,6 +1138,7 @@ MVM_DEBUGFS_READ_FILE_OPS(drv_rx_stats);MVM_DEBUGFS_WRITE_FILE_OPS (fw_restart,10 );MVM_DEBUGFS_WRITE_FILE_OPS (fw_nmi,10 );MVM_DEBUGFS_WRITE_FILE_OPS (bt_tx_prio,10 ); +MVM_DEBUGFS_WRITE_FILE_OPS (bt_force_ant,10 );MVM_DEBUGFS_READ_WRITE_FILE_OPS (scan_ant_rxchain,8 );MVM_DEBUGFS_READ_WRITE_FILE_OPS (d0i3_refs,8 );
@@ -1142,6 +1180,7 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)MVM_DEBUGFS_ADD_FILE (fw_restart, mvm->debugfs_dir,S_IWUSR );MVM_DEBUGFS_ADD_FILE (fw_nmi, mvm->debugfs_dir,S_IWUSR );MVM_DEBUGFS_ADD_FILE (bt_tx_prio, mvm->debugfs_dir,S_IWUSR ); +MVM_DEBUGFS_ADD_FILE (bt_force_ant, mvm->debugfs_dir,S_IWUSR );MVM_DEBUGFS_ADD_FILE (scan_ant_rxchain, mvm->debugfs_dir,S_IWUSR |S_IRUSR );MVM_DEBUGFS_ADD_FILE (prph_reg, mvm->debugfs_dir,S_IWUSR |S_IRUSR );
drivers/net/wireless/iwlwifi/mvm/fw-api-coex.h +6 -0
@@ -76,6 +76,9 @@* @BT_COEX_2W: * @BT_COEX_3W: * @BT_COEX_NW: +* @BT_COEX_AUTO: +* @BT_COEX_BT: Antenna is for BT (manufacuring tests) +* @BT_COEX_WIFI: Antenna is for BT (manufacuring tests) * @BT_COEX_SYNC2SCO: * @BT_COEX_CORUNNING: * @BT_COEX_MPLUT:
@@ -89,6 +92,9 @@ enum iwl_bt_coex_flags {BT_COEX_2W =0x1 <<BT_COEX_MODE_POS ,BT_COEX_3W =0x2 <<BT_COEX_MODE_POS ,BT_COEX_NW =0x3 <<BT_COEX_MODE_POS , +BT_COEX_AUTO =0x5 <<BT_COEX_MODE_POS , +BT_COEX_BT =0x6 <<BT_COEX_MODE_POS , +BT_COEX_WIFI =0x7 <<BT_COEX_MODE_POS ,BT_COEX_SYNC2SCO =BIT (7 ),BT_COEX_CORUNNING =BIT (8 ), BT_COEX_MPLUT = BIT(9),
drivers/net/wireless/iwlwifi/mvm/mvm.h +10 -0
@@ -235,6 +235,15 @@ enum iwl_mvm_ref_type { IWL_MVM_REF_COUNT, }; +enum iwl_bt_force_ant_mode { +BT_FORCE_ANT_DIS =0 , +BT_FORCE_ANT_AUTO , +BT_FORCE_ANT_BT , +BT_FORCE_ANT_WIFI , + +BT_FORCE_ANT_MAX , +}; +/** * struct iwl_mvm_vif_bf_data - beacon filtering related data * @bf_enabled: indicates if beacon filtering is enabled
@@ -629,6 +638,7 @@ struct iwl_mvm {u32 last_ant_isol;u8 last_corun_lut;u8 bt_tx_prio; +enum iwl_bt_force_ant_mode bt_force_ant_mode;/* Thermal Throttling and CTkill */ struct iwl_mvm_tt_mgmt thermal_throttle;
Signature · 1 line
1.8.3.2
PATCH 19/27 iwlwifi: mvm: BT Coex - allow MIMO in more cases
In reply to Emmanuel GrumbachFrom: Emmanuel Grumbach <[email protected]>
We can Tx in MIMO rates when we are in TxTx Disallow mode just like we can when we are in Tight mode.
Same if we are in 5Ghz regardless of the mode we are. Change the code to allow MIMO in these cases.
--- drivers/net/wireless/iwlwifi/mvm/coex.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/net/wireless/iwlwifi/mvm/coex.c +10 -7
@@ -538,7 +538,7 @@ iwl_get_coex_type(struct iwl_mvm *mvm, const struct ieee80211_vif *vif)if (!chanctx_conf || chanctx_conf->def.chan->band !=IEEE80211_BAND_2GHZ ) {rcu_read_unlock (); -return BT_COEX_LOOSE_LUT ; +return BT_COEX_INVALID_LUT ; } ret =BT_COEX_TX_DIS_LUT ;
@@ -1214,7 +1214,7 @@ u16 iwl_mvm_coex_agg_time_limit(struct iwl_mvm *mvm, lut_type =iwl_get_coex_type (mvm, mvmsta->vif); -if (lut_type ==BT_COEX_LOOSE_LUT ) +if (lut_type ==BT_COEX_LOOSE_LUT || lut_type ==BT_COEX_INVALID_LUT )return LINK_QUAL_AGG_TIME_LIMIT_DEF ;/* tight coex, high bt traffic, reduce AGG time limit */
@@ -1225,18 +1225,21 @@ bool iwl_mvm_bt_coex_is_mimo_allowed(struct iwl_mvm *mvm, struct ieee80211_sta *sta) {struct iwl_mvm_sta *mvmsta =iwl_mvm_sta_from_mac80211 (sta); +enum iwl_bt_coex_lut_type lut_type;if (le32_to_cpu (mvm->last_bt_notif.bt_activity_grading) <BT_HIGH_TRAFFIC )return true;/* -* In Tight, BT can't Rx while we Tx, so use both antennas since BT is -* already killed. -* In Loose, BT can Rx while we Tx, so forbid MIMO to let BT Rx while we -* Tx. +* In Tight / TxTxDis, BT can't Rx while we Tx, so use both antennas +* since BT is already killed. +* In Loose, BT can Rx while we Tx, so forbid MIMO to let BT Rx while +* we Tx. +* When we are in 5GHz, we'll get BT_COEX_INVALID_LUT allowing MIMO. */ -return iwl_get_coex_type (mvm, mvmsta->vif) ==BT_COEX_TIGHT_LUT ; + lut_type =iwl_get_coex_type (mvm, mvmsta->vif); +return lut_type !=BT_COEX_LOOSE_LUT ; } bool iwl_mvm_bt_coex_is_tpc_allowed(struct iwl_mvm *mvm,
Signature · 1 line
1.8.3.2
PATCH 20/27 iwlwifi: mvm: BT Coex - don't limit rate control if TTC is on
In reply to Emmanuel GrumbachFrom: Emmanuel Grumbach <[email protected]>
When the firmware enables TxTxCorunning, we can lift the constaints on the rate control.
--- drivers/net/wireless/iwlwifi/mvm/coex.c | 6 ++++++ drivers/net/wireless/iwlwifi/mvm/fw-api-coex.h | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/coex.c +6 -0
@@ -1212,6 +1212,9 @@ u16 iwl_mvm_coex_agg_time_limit(struct iwl_mvm *mvm, BT_HIGH_TRAFFIC)return LINK_QUAL_AGG_TIME_LIMIT_DEF ; +if (mvm->last_bt_notif.ttc_enabled) +return LINK_QUAL_AGG_TIME_LIMIT_DEF ; + lut_type =iwl_get_coex_type (mvm, mvmsta->vif);if (lut_type ==BT_COEX_LOOSE_LUT || lut_type ==BT_COEX_INVALID_LUT )
@@ -1227,6 +1230,9 @@ bool iwl_mvm_bt_coex_is_mimo_allowed(struct iwl_mvm *mvm,struct iwl_mvm_sta *mvmsta =iwl_mvm_sta_from_mac80211 (sta);enum iwl_bt_coex_lut_type lut_type; +if (mvm->last_bt_notif.ttc_enabled) +return true; +if (le32_to_cpu (mvm->last_bt_notif.bt_activity_grading) <BT_HIGH_TRAFFIC )return true;
drivers/net/wireless/iwlwifi/mvm/fw-api-coex.h +3 -1
@@ -305,6 +305,7 @@ enum iwl_bt_activity_grading {* @bt_traffic_load: load of BT traffic * @bt_agg_traffic_load: aggregated load of BT traffic * @bt_ci_compliance: 0 - no CI compliance, 1 - CI compliant +* @ttc_enabled: true if ttc has been enabled by the firmware * @primary_ch_lut: LUT used for primary channel * @secondary_ch_lut: LUT used for secondary channel * @bt_activity_grading: the activity of BT enum %iwl_bt_activity_grading
@@ -317,7 +318,8 @@ struct iwl_bt_coex_profile_notif {u8 bt_traffic_load;u8 bt_agg_traffic_load;u8 bt_ci_compliance; -u8 reserved[3 ]; +u8 ttc_enabled; +__le16 reserved;__le32 primary_ch_lut;__le32 secondary_ch_lut;
Signature · 1 line
1.8.3.2
PATCH 21/27 iwlwifi: mvm: BT Coex - add reduced Tx power thresholds to constants
In reply to Emmanuel GrumbachFrom: Emmanuel Grumbach <[email protected]>
This really belongs to the constants file.
--- drivers/net/wireless/iwlwifi/mvm/coex.c | 10 ++++------ drivers/net/wireless/iwlwifi/mvm/constants.h | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/mvm/coex.c +4 -6
@@ -100,8 +100,6 @@ static const u8 iwl_bt_prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX] = {#undef EVENT_PRIO_ANT -#define BT_ENABLE_REDUCED_TXPOWER_THRESHOLD (-62) -#define BT_DISABLE_REDUCED_TXPOWER_THRESHOLD (-65)#define BT_ANTENNA_COUPLING_THRESHOLD (30)static int iwl_send_bt_prio_tbl (struct iwl_mvm *mvm)
@@ -807,9 +805,9 @@ void iwl_mvm_bt_coex_enable_rssi_event(struct iwl_mvm *mvm, mvmvif->bf_data.last_bt_coex_event = rssi; mvmvif->bf_data.bt_coex_max_thold = - enable ?BT_ENABLE_REDUCED_TXPOWER_THRESHOLD :0 ; + enable ? -IWL_MVM_BT_COEX_EN_RED_TXP_THRESH :0 ; mvmvif->bf_data.bt_coex_min_thold = - enable ?BT_DISABLE_REDUCED_TXPOWER_THRESHOLD :0 ; + enable ? -IWL_MVM_BT_COEX_DIS_RED_TXP_THRESH :0 ; }/* must be called under rcu_read_lock */
@@ -946,7 +944,7 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac,/* if the RSSI isn't valid, fake it is very low */ if (!ave_rssi) ave_rssi =-100 ; -if (ave_rssi >BT_ENABLE_REDUCED_TXPOWER_THRESHOLD ) { +if (ave_rssi > -IWL_MVM_BT_COEX_EN_RED_TXP_THRESH ) {if (iwl_mvm_bt_coex_reduced_txp (mvm, mvmvif->ap_sta_id, true))IWL_ERR (mvm,"Couldn't send BT_CONFIG cmd\n" );
@@ -957,7 +955,7 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac,* the iteration, if one interface's rssi isn't good enough, * bt_kill_msk will be set to default values. */ - }else if (ave_rssi <BT_DISABLE_REDUCED_TXPOWER_THRESHOLD ) { + }else if (ave_rssi < -IWL_MVM_BT_COEX_DIS_RED_TXP_THRESH ) {if (iwl_mvm_bt_coex_reduced_txp (mvm, mvmvif->ap_sta_id, false))IWL_ERR (mvm,"Couldn't send BT_CONFIG cmd\n" );
drivers/net/wireless/iwlwifi/mvm/constants.h +2 -0
@@ -79,6 +79,8 @@#define IWL_MVM_PS_SNOOZE_WINDOW 50#define IWL_MVM_WOWLAN_PS_SNOOZE_WINDOW 25#define IWL_MVM_LOWLAT_QUOTA_MIN_PERCENT 64 +#define IWL_MVM_BT_COEX_EN_RED_TXP_THRESH 62 +#define IWL_MVM_BT_COEX_DIS_RED_TXP_THRESH 65#define IWL_MVM_BT_COEX_SYNC2SCO 1#define IWL_MVM_BT_COEX_CORUNNING 1#define IWL_MVM_BT_COEX_MPLUT 1
Signature · 1 line
1.8.3.2
PATCH 22/27 iwlwifi: mvm: BT Coex - avoid the shared antenna for management frames
In reply to Emmanuel GrumbachFrom: Emmanuel Grumbach <[email protected]>
If BT is active, we need to refrain from using the shared antenna. This logic is done in the firmware when we use the link quality tables. But for management frames, the rate is written in the Tx command by the driver.
Hence the driver needs to make sure not use the shared antenna when BT is active for any frames that don't use the rate scale table such as management frames or multicast.
--- drivers/net/wireless/iwlwifi/mvm/coex.c | 5 +++++ drivers/net/wireless/iwlwifi/mvm/mvm.h | 1 + drivers/net/wireless/iwlwifi/mvm/tx.c | 8 +++++++- 3 files changed, 13 insertions(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/coex.c +5 -0
@@ -1246,6 +1246,11 @@ bool iwl_mvm_bt_coex_is_mimo_allowed(struct iwl_mvm *mvm,return lut_type !=BT_COEX_LOOSE_LUT ; } +bool iwl_mvm_bt_coex_is_shared_ant_avail (struct iwl_mvm *mvm) +{ +return le32_to_cpu (mvm->last_bt_notif.bt_activity_grading) ==BT_OFF ; +} +bool iwl_mvm_bt_coex_is_tpc_allowed (struct iwl_mvm *mvm,enum ieee80211_band band) {
drivers/net/wireless/iwlwifi/mvm/mvm.h +1 -0
@@ -973,6 +973,7 @@ u16 iwl_mvm_coex_agg_time_limit(struct iwl_mvm *mvm, struct ieee80211_sta *sta);bool iwl_mvm_bt_coex_is_mimo_allowed (struct iwl_mvm *mvm,struct ieee80211_sta *sta); +bool iwl_mvm_bt_coex_is_shared_ant_avail (struct iwl_mvm *mvm);bool iwl_mvm_bt_coex_is_tpc_allowed (struct iwl_mvm *mvm,enum ieee80211_band band); u8 iwl_mvm_bt_coex_tx_prio(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr,
drivers/net/wireless/iwlwifi/mvm/tx.c +7 -1
@@ -205,7 +205,13 @@ static void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, mvm->mgmt_last_antenna_idx =iwl_mvm_next_antenna (mvm, mvm->fw->valid_tx_ant, mvm->mgmt_last_antenna_idx); - rate_flags =BIT (mvm->mgmt_last_antenna_idx) <<RATE_MCS_ANT_POS ; + +if (info->band ==IEEE80211_BAND_2GHZ && + !iwl_mvm_bt_coex_is_shared_ant_avail (mvm)) + rate_flags =BIT (ANT_A ) <<RATE_MCS_ANT_POS ; +else + rate_flags = +BIT (mvm->mgmt_last_antenna_idx) <<RATE_MCS_ANT_POS ;/* Set CCK flag as needed */ if ((rate_idx >=IWL_FIRST_CCK_RATE ) && (rate_idx <=IWL_LAST_CCK_RATE ))
Signature · 1 line
1.8.3.2
PATCH 23/27 iwlwifi: mvm: disable beacon filtering escape timer in d0i3
In reply to Emmanuel GrumbachFrom: Eliad Peller <[email protected]>
The beacon filtering configuration in d0i3 currently uses the max value defined as 1024. However, with beacon interval of 100ms we end up with too-frequent wakeups.
Instead, configure the escape timer to 0, asking the fw to disable it altogether.
--- drivers/net/wireless/iwlwifi/mvm/fw-api-power.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/fw-api-power.h +1 -1
@@ -336,7 +336,7 @@ struct iwl_beacon_filter_cmd {#define IWL_BF_DEBUG_FLAG_D0I3 0#define IWL_BF_ESCAPE_TIMER_DEFAULT 50 -#define IWL_BF_ESCAPE_TIMER_D0I3 1024 +#define IWL_BF_ESCAPE_TIMER_D0I3 0#define IWL_BF_ESCAPE_TIMER_MAX 1024#define IWL_BF_ESCAPE_TIMER_MIN 0
Signature · 1 line
1.8.3.2
PATCH 24/27 iwlwifi: mvm: Introduce an API to set STA_FLG_DISABLE_TX flag
In reply to Emmanuel GrumbachFrom: Andrei Otcheretianski <[email protected]>
Introduce new station flag STA_FLG_DISABLE_TX, which is modified with ADD_STA command. This flag, when set, disables tx to the STA.
Provide an API (iwl_mvm_sta_modify_disable_tx) to modify this flag, which should be used in channel switch and immediate quiet flows.
--- drivers/net/wireless/iwlwifi/iwl-fw.h | 2 ++ drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h | 7 ++----- drivers/net/wireless/iwlwifi/mvm/sta.c | 20 ++++++++++++++++++++ drivers/net/wireless/iwlwifi/mvm/sta.h | 2 ++ 4 files changed, 26 insertions(+), 5 deletions(-)
drivers/net/wireless/iwlwifi/iwl-fw.h +2 -0
@@ -120,10 +120,12 @@ enum iwl_ucode_tlv_flag {* enum iwl_ucode_tlv_api - ucode api * @IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID: wowlan config includes tid field. * @IWL_UCODE_TLV_API_CSA_FLOW: ucode can do unbind-bind flow for CSA. +* @IWL_UCODE_TLV_API_DISABLE_STA_TX: ucode supports tx_disable bit. */ enum iwl_ucode_tlv_api {IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID =BIT (0 ),IWL_UCODE_TLV_API_CSA_FLOW =BIT (4 ), +IWL_UCODE_TLV_API_DISABLE_STA_TX =BIT (5 ), };/**
drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h +2 -5
@@ -67,7 +67,7 @@* enum iwl_sta_flags - flags for the ADD_STA host command * @STA_FLG_REDUCED_TX_PWR_CTRL: * @STA_FLG_REDUCED_TX_PWR_DATA: -* @STA_FLG_FLG_ANT_MSK: Antenna selection +* @STA_FLG_DISABLE_TX: set if TX should be disabled * @STA_FLG_PS: set if STA is in Power Save * @STA_FLG_INVALID: set if STA is invalid * @STA_FLG_DLP_EN: Direct Link Protocol is enabled
@@ -91,10 +91,7 @@ enum iwl_sta_flags {STA_FLG_REDUCED_TX_PWR_CTRL =BIT (3 ),STA_FLG_REDUCED_TX_PWR_DATA =BIT (6 ), -STA_FLG_FLG_ANT_A = (1 <<4 ), -STA_FLG_FLG_ANT_B = (2 <<4 ), -STA_FLG_FLG_ANT_MSK = (STA_FLG_FLG_ANT_A | -STA_FLG_FLG_ANT_B ), +STA_FLG_DISABLE_TX =BIT (4 ),STA_FLG_PS =BIT (8 ), STA_FLG_DRAIN_FLOW = BIT(12),
drivers/net/wireless/iwlwifi/mvm/sta.c +20 -0
@@ -1448,3 +1448,23 @@ int iwl_mvm_rx_eosp_notif(struct iwl_mvm *mvm,return 0 ; } + +void iwl_mvm_sta_modify_disable_tx (struct iwl_mvm *mvm, +struct iwl_mvm_sta *mvmsta,bool disable) +{ +struct iwl_mvm_add_sta_cmd cmd = { + .add_modify =STA_MODE_MODIFY , + .sta_id = mvmsta->sta_id, + .station_flags = disable ?cpu_to_le32 (STA_FLG_DISABLE_TX ) :0 , + .station_flags_msk =cpu_to_le32 (STA_FLG_DISABLE_TX ), + .mac_id_n_color =cpu_to_le32 (mvmsta->mac_id_n_color), + }; +int ret; + +if (!(mvm->fw->ucode_capa.api[0 ] &IWL_UCODE_TLV_API_DISABLE_STA_TX )) +return ; + + ret =iwl_mvm_send_cmd_pdu (mvm,ADD_STA ,CMD_ASYNC ,sizeof (cmd), &cmd); +if (ret) +IWL_ERR (mvm,"Failed to send ADD_STA command (%d)\n" , ret); +}
drivers/net/wireless/iwlwifi/mvm/sta.h +2 -0
@@ -404,5 +404,7 @@ void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, bool agg);int iwl_mvm_drain_sta (struct iwl_mvm *mvm,struct iwl_mvm_sta *mvmsta,bool drain); +void iwl_mvm_sta_modify_disable_tx (struct iwl_mvm *mvm, +struct iwl_mvm_sta *mvmsta,bool disable);#endif /* __sta_h__ */
Signature · 1 line
1.8.3.2
PATCH 25/27 iwlwifi: mvm: support extended beacon notification
In reply to Emmanuel GrumbachFrom: David Spinadel <[email protected]>
Use extended beacon notification when supported by FW. Set last beacon system time to AP or GO interface. System time of last beacon can be used to avoid TBTT overlapping between two interfaces, CSA and other uses.
--- drivers/net/wireless/iwlwifi/iwl-fw.h | 2 ++ drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h | 14 ++++++++++++ drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | 32 +++++++++++++++++++--------- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 1 + drivers/net/wireless/iwlwifi/mvm/mvm.h | 3 +++ 5 files changed, 42 insertions(+), 10 deletions(-)
drivers/net/wireless/iwlwifi/iwl-fw.h +2 -0
@@ -119,11 +119,13 @@ enum iwl_ucode_tlv_flag {/** * enum iwl_ucode_tlv_api - ucode api * @IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID: wowlan config includes tid field. +* @IWL_UCODE_TLV_CAPA_EXTENDED_BEACON: Support Extended beacon notification * @IWL_UCODE_TLV_API_CSA_FLOW: ucode can do unbind-bind flow for CSA. * @IWL_UCODE_TLV_API_DISABLE_STA_TX: ucode supports tx_disable bit. */ enum iwl_ucode_tlv_api {IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID =BIT (0 ), +IWL_UCODE_TLV_CAPA_EXTENDED_BEACON =BIT (1 ),IWL_UCODE_TLV_API_CSA_FLOW =BIT (4 ),IWL_UCODE_TLV_API_DISABLE_STA_TX =BIT (5 ), };
drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h +14 -0
@@ -549,6 +549,20 @@ struct iwl_beacon_notif { } __packed;/** +* struct iwl_extended_beacon_notif - notifies about beacon transmission +* @beacon_notify_hdr: tx response command associated with the beacon +* @tsf: last beacon tsf +* @ibss_mgr_status: whether IBSS is manager +* @gp2: last beacon time in gp2 +*/ +struct iwl_extended_beacon_notif { +struct iwl_mvm_tx_resp beacon_notify_hdr; +__le64 tsf; +__le32 ibss_mgr_status; +__le32 gp2; +} __packed;/* BEACON_NTFY_API_S_VER_5 */ + +/** * enum iwl_dump_control - dump (flush) control flags * @DUMP_TX_FIFO_FLUSH: Dump MSDUs until the the FIFO is empty * and the TFD queues are empty.
drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c +22 -10
@@ -1205,19 +1205,31 @@ int iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm, struct iwl_device_cmd *cmd) {struct iwl_rx_packet *pkt =rxb_addr (rxb); -struct iwl_beacon_notif *beacon = (void *)pkt->data; -u16 status__maybe_unused = -le16_to_cpu (beacon->beacon_notify_hdr.status.status); -u32 rate__maybe_unused = -le32_to_cpu (beacon->beacon_notify_hdr.initial_rate); +struct iwl_mvm_tx_resp *beacon_notify_hdr; +u64 tsf;lockdep_assert_held (&mvm->mutex); -IWL_DEBUG_RX (mvm,"beacon status %#x retries:%d tsf:0x%16llX rate:%d\n" , - status &TX_STATUS_MSK , - beacon->beacon_notify_hdr.failure_frame, -le64_to_cpu (beacon->tsf), - rate); +if (mvm->fw->ucode_capa.api[0 ] &IWL_UCODE_TLV_CAPA_EXTENDED_BEACON ) { +struct iwl_extended_beacon_notif *beacon = (void *)pkt->data; + + beacon_notify_hdr = &beacon->beacon_notify_hdr; + tsf =le64_to_cpu (beacon->tsf); + mvm->ap_last_beacon_gp2 =le32_to_cpu (beacon->gp2); + }else { +struct iwl_beacon_notif *beacon = (void *)pkt->data; + + beacon_notify_hdr = &beacon->beacon_notify_hdr; + tsf =le64_to_cpu (beacon->tsf); + } + +IWL_DEBUG_RX (mvm, +"beacon status %#x retries:%d tsf:0x%16llX gp2:0x%X rate:%d\n" , +le16_to_cpu (beacon_notify_hdr->status.status) & +TX_STATUS_MSK , + beacon_notify_hdr->failure_frame, tsf, + mvm->ap_last_beacon_gp2, +le32_to_cpu (beacon_notify_hdr->initial_rate));if (unlikely (mvm->csa_vif && mvm->csa_vif->csa_active)) {if (!ieee80211_csa_is_complete (mvm->csa_vif)) {
drivers/net/wireless/iwlwifi/mvm/mac80211.c +1 -0
@@ -1465,6 +1465,7 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,mutex_lock (&mvm->mutex); mvmvif->ap_ibss_active = false; + mvm->ap_last_beacon_gp2 =0 ;iwl_mvm_bt_coex_vif_change (mvm);
drivers/net/wireless/iwlwifi/mvm/mvm.h +3 -0
@@ -658,6 +658,9 @@ struct iwl_mvm {bool ps_disabled;struct ieee80211_vif *csa_vif; + +/* system time of last beacon (for AP/GO interface) */ +u32 ap_last_beacon_gp2; };/* Extract MVM priv from op_mode and _hw */
Signature · 1 line
1.8.3.2
PATCH 26/27 iwlwivi: mvm: BT Coex - properly set the priority of beacons
In reply to Emmanuel GrumbachFrom: Emmanuel Grumbach <[email protected]>
Since the new API allows multiple priorities, we need to properly set the beacon's prorities in the TX cmd associated to it.
--- drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c +7 -6
@@ -904,7 +904,7 @@ static int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm,struct iwl_mac_beacon_cmd beacon_cmd = {};struct ieee80211_tx_info *info;u32 beacon_skb_len; -u32 rate; +u32 rate, tx_flags;if (WARN_ON (!beacon))return -EINVAL ;
@@ -914,14 +914,17 @@ static int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm,/* TODO: for now the beacon template id is set to be the mac context id. * Might be better to handle it as another resource ... */ beacon_cmd.template_id =cpu_to_le32 ((u32 )mvmvif->id); + info =IEEE80211_SKB_CB (beacon);/* Set up TX command fields */ beacon_cmd.tx.len =cpu_to_le16 ((u16 )beacon_skb_len); beacon_cmd.tx.sta_id = mvmvif->bcast_sta.sta_id; beacon_cmd.tx.life_time =cpu_to_le32 (TX_CMD_LIFE_TIME_INFINITE ); - beacon_cmd.tx.tx_flags =cpu_to_le32 (TX_CMD_FLG_SEQ_CTL | -TX_CMD_FLG_BT_DIS | -TX_CMD_FLG_TSF ); + tx_flags =TX_CMD_FLG_SEQ_CTL |TX_CMD_FLG_TSF ; + tx_flags |= +iwl_mvm_bt_coex_tx_prio (mvm, (void *)beacon->data, info,0 ) << +TX_CMD_FLG_BT_PRIO_POS ; + beacon_cmd.tx.tx_flags =cpu_to_le32 (tx_flags); mvm->mgmt_last_antenna_idx = iwl_mvm_next_antenna(mvm, mvm->fw->valid_tx_ant,
@@ -931,8 +934,6 @@ static int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm,cpu_to_le32 (BIT (mvm->mgmt_last_antenna_idx) <<RATE_MCS_ANT_POS ); - info =IEEE80211_SKB_CB (beacon); -if (info->band ==IEEE80211_BAND_5GHZ || vif->p2p) { rate =IWL_FIRST_OFDM_RATE ; }else {
Signature · 1 line
1.8.3.2
PATCH 27/27 iwlwifi: mvm: handle device start failures during restart
In reply to Emmanuel GrumbachFrom: Johannes Berg <[email protected]>
If the device fails during a restart, mac80211 now handles the situation better but we still have a little bit of cleanup to do in the driver - add the required code.
--- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/wireless/iwlwifi/mvm/mac80211.c +10 -0
@@ -689,6 +689,16 @@ static int iwl_mvm_mac_start(struct ieee80211_hw *hw)iwl_mvm_restart_cleanup (mvm); ret =iwl_mvm_up (mvm); + +if (ret &&test_bit (IWL_MVM_STATUS_IN_HW_RESTART , &mvm->status)) { +/* Something went wrong - we need to finish some cleanup +* that normally iwl_mvm_mac_restart_complete() below +* would do. +*/ +clear_bit (IWL_MVM_STATUS_IN_HW_RESTART , &mvm->status); +iwl_mvm_d0i3_enable_tx (mvm,NULL ); + } +mutex_unlock (&mvm->mutex);return ret;
Signature · 1 line
1.8.3.2
Quoted 10 lines · Emmanuel Grumbach
Hi John,
This is a pull request for 3.17.
I have here a whole bunch of various things. Andy contributes better debug prints for dvm specific flows and a module parameter to completely disable power save for dvm. Andrei is sharing the premises of his work on CSA - more to come. Eran and Liad keep on working on the new devices. I have the regular amount of BT Coex stuff and I continue to work on the firmware error report system adding more debug capabilities. More to come on that subject too.
I merged iwlwifi-fixes in order to be able to apply patches that relied on patches there.
Let me know if you have problems - please pull.
Quoted 7 lines
The following changes since commit
7171511eaec5bf23fb06078f59784a3a0626b38f:Linux 3.16-rc1 (2014-06-15 17:45:28 -1000)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.gitmaster
Of course - I meant:
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git for-john
Sorry for that.
Quoted 5 lines
for you to fetch changes up to
c47af22ad630e03053f3eeefd19bd8274989ffbb:iwlwifi: mvm: handle device start failures during restart (2014-06-24 21:55:41 +0300)
Quoted 14 lines · Emmanuel Grumbach
Hi John,
This is a pull request for 3.17.
I have here a whole bunch of various things. Andy contributes better debug prints for dvm specific flows and a module parameter to completely disable power save for dvm. Andrei is sharing the premises of his work on CSA - more to come. Eran and Liad keep on working on the new devices. I have the regular amount of BT Coex stuff and I continue to work on the firmware error report system adding more debug capabilities. More to come on that subject too.
I merged iwlwifi-fixes in order to be able to apply patches that relied on patches there.
Let me know if you have problems - please pull.
The following changes since commit
7171511eaec5bf23fb06078f59784a3a0626b38f:Linux 3.16-rc1 (2014-06-15 17:45:28 -1000)
Quoted 7 lines
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.gitmasterfor you to fetch changes up to
c47af22ad630e03053f3eeefd19bd8274989ffbb:iwlwifi: mvm: handle device start failures during restart (2014-06-24 21:55:41 +0300)
Pulling now...
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.