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ZnRlciBGVyByZXN0YXJ0DQoNCkxpYWQgS2F1Zm1hbiAo MSk6DQogICAgICBpd2x3aWZpOiBwY2llOiBwcmV2ZW50IHVzaW5nIHVubWFwcGVkIG1lbW9yeSBp biBmdyBtb25pdG9yDQoNCiBkcml2ZXJzL25ldC93aXJlbGVzcy9pd2x3aWZpL2l3bC1mdy1maWxl LmggICAgICB8ICAyICsrDQogZHJpdmVycy9uZXQvd2lyZWxlc3MvaXdsd2lmaS9pd2wtdHJhbnMu aCAgICAgICAgfCA0MSArKysrKysrKysrKysrKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLQ0K IGRyaXZlcnMvbmV0L3dpcmVsZXNzL2l3bHdpZmkvbXZtL2QzLmMgICAgICAgICAgIHwgIDIgKy0N CiBkcml2ZXJzL25ldC93aXJlbGVzcy9pd2x3aWZpL212bS9mdy1hcGktcG93ZXIuaCB8IDM0ICsr KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysNCiBkcml2ZXJzL25ldC93aXJlbGVzcy9p d2x3aWZpL212bS9mdy1hcGktc2Nhbi5oICB8IDQ0ICsrLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tDQogZHJpdmVycy9uZXQvd2lyZWxlc3MvaXdsd2lmaS9tdm0vZnct YXBpLmggICAgICAgfCAxMyAtLS0tLS0tLS0tLS0tDQogZHJpdmVycy9uZXQvd2lyZWxlc3MvaXds d2lmaS9tdm0vZncuYyAgICAgICAgICAgfCA1NCArKysrKysrKysrKysrKysrKysrKystLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCiBkcml2ZXJzL25ldC93aXJlbGVzcy9pd2x3aWZp L212bS9tYWM4MDIxMS5jICAgICB8IDI2ICsrKysrKysrKysrKysrKysrKysrKysrLS0tDQogZHJp dmVycy9uZXQvd2lyZWxlc3MvaXdsd2lmaS9tdm0vbXZtLmggICAgICAgICAgfCAgMSAtDQogZHJp dmVycy9uZXQvd2lyZWxlc3MvaXdsd2lmaS9tdm0vb3BzLmMgICAgICAgICAgfCAxMCArKysrKysr KysrDQogZHJpdmVycy9uZXQvd2lyZWxlc3MvaXdsd2lmaS9tdm0vcnguYyAgICAgICAgICAgfCAg NSArKysrKw0KIGRyaXZlcnMvbmV0L3dpcmVsZXNzL2l3bHdpZmkvbXZtL3NjYW4uYyAgICAgICAg IHwgIDIgKy0NCiBkcml2ZXJzL25ldC93aXJlbGVzcy9pd2x3aWZpL3BjaWUvdHJhbnMuYyAgICAg ICB8IDE3ICsrKysrKysrKy0tLS0tLS0tDQogMTMgZmlsZXMgY2hhbmdlZCwgMTM1IGluc2VydGlv bnMoKyksIDExNiBkZWxldGlvbnMoLSkNCg0K
PATCH 1/8 iwlwifi: mvm: fix Tx Power firmware API
From: Avri Altman <[email protected]>
The firmware doesn't relate the scan to a vif. The scan is run by a separate entity called auxiliary MAC (aka AUX MAC). This AUX MAC needs to get Tx power limitations that are not applied on a specific vif, but on the device as a whole.
This can be implemented by using the minimum of all the values set by the user for all the MACs. But then we need to ignore the limitations that come from the AP or regulatory for a specific vif: a specific vif might have regulatory limitations because of the channel is works on. This limit is irrelevant for the AUX MAC.
Use the new API from mac80211: the user_power_level in bss_conf to achieve this.
Firmware -13.ucode has already moved to this API.
--- drivers/net/wireless/iwlwifi/iwl-fw-file.h | 2 ++ drivers/net/wireless/iwlwifi/mvm/fw-api-power.h | 34 +++++++++++++++++++++++++ drivers/net/wireless/iwlwifi/mvm/fw-api.h | 13 ---------- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 24 +++++++++++++++-- 4 files changed, 58 insertions(+), 15 deletions(-)
drivers/net/wireless/iwlwifi/iwl-fw-file.h +2 -0
@@ -244,6 +244,7 @@ enum iwl_ucode_tlv_flag {* 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_HDC_PHASE_0: ucode supports finer configuration of LTR +* @IWL_UCODE_TLV_API_TX_POWER_DEV: new API for tx power. * @IWL_UCODE_TLV_API_BASIC_DWELL: use only basic dwell time in scan command, * regardless of the band or the number of the probes. FW will calculate * the actual dwell time.
@@ -260,6 +261,7 @@ enum iwl_ucode_tlv_api {IWL_UCODE_TLV_API_FRAGMENTED_SCAN =BIT (8 ),IWL_UCODE_TLV_API_WIFI_MCC_UPDATE =BIT (9 ),IWL_UCODE_TLV_API_HDC_PHASE_0 =BIT (10 ), +IWL_UCODE_TLV_API_TX_POWER_DEV =BIT (11 ),IWL_UCODE_TLV_API_BASIC_DWELL =BIT (13 ),IWL_UCODE_TLV_API_SCD_CFG =BIT (15 ), IWL_UCODE_TLV_API_SINGLE_SCAN_EBS = BIT(16),
drivers/net/wireless/iwlwifi/mvm/fw-api-power.h +34 -0
@@ -298,6 +298,40 @@ struct iwl_uapsd_misbehaving_ap_notif { } __packed;/** +* struct iwl_reduce_tx_power_cmd - TX power reduction command +* REDUCE_TX_POWER_CMD = 0x9f +* @flags: (reserved for future implementation) +* @mac_context_id: id of the mac ctx for which we are reducing TX power. +* @pwr_restriction: TX power restriction in dBms. +*/ +struct iwl_reduce_tx_power_cmd { +u8 flags; +u8 mac_context_id; +__le16 pwr_restriction; +} __packed;/* TX_REDUCED_POWER_API_S_VER_1 */ + +/** +* struct iwl_dev_tx_power_cmd - TX power reduction command +* REDUCE_TX_POWER_CMD = 0x9f +* @set_mode: 0 - MAC tx power, 1 - device tx power +* @mac_context_id: id of the mac ctx for which we are reducing TX power. +* @pwr_restriction: TX power restriction in 1/8 dBms. +* @dev_24: device TX power restriction in 1/8 dBms +* @dev_52_low: device TX power restriction upper band - low +* @dev_52_high: device TX power restriction upper band - high +*/ +struct iwl_dev_tx_power_cmd { +__le32 set_mode; +__le32 mac_context_id; +__le16 pwr_restriction; +__le16 dev_24; +__le16 dev_52_low; +__le16 dev_52_high; +} __packed;/* TX_REDUCED_POWER_API_S_VER_2 */ + +#define IWL_DEV_MAX_TX_POWER 0x7FFF + +/** * struct iwl_beacon_filter_cmd * REPLY_BEACON_FILTERING_CMD = 0xd2 (command) * @id_and_color: MAC contex identifier
drivers/net/wireless/iwlwifi/mvm/fw-api.h +0 -13
@@ -281,19 +281,6 @@ struct iwl_tx_ant_cfg_cmd {__le32 valid; } __packed; -/** -* struct iwl_reduce_tx_power_cmd - TX power reduction command -* REDUCE_TX_POWER_CMD = 0x9f -* @flags: (reserved for future implementation) -* @mac_context_id: id of the mac ctx for which we are reducing TX power. -* @pwr_restriction: TX power restriction in dBms. -*/ -struct iwl_reduce_tx_power_cmd { -u8 flags; -u8 mac_context_id; -__le16 pwr_restriction; -} __packed;/* TX_REDUCED_POWER_API_S_VER_1 */ -/* * Calibration control struct. * Sent as part of the phy configuration command.
drivers/net/wireless/iwlwifi/mvm/mac80211.c +22 -2
@@ -1471,8 +1471,8 @@ static struct iwl_mvm_phy_ctxt *iwl_mvm_get_free_phy_ctxt(struct iwl_mvm *mvm)return NULL ; } -static int iwl_mvm_set_tx_power (struct iwl_mvm *mvm,struct ieee80211_vif *vif, -s8 tx_power) +static int iwl_mvm_set_tx_power_old (struct iwl_mvm *mvm, +struct ieee80211_vif *vif,s8 tx_power) {/* FW is in charge of regulatory enforcement */ struct iwl_reduce_tx_power_cmd reduce_txpwr_cmd = {
@@ -1485,6 +1485,26 @@ static int iwl_mvm_set_tx_power(struct iwl_mvm *mvm, struct ieee80211_vif *vif, &reduce_txpwr_cmd); } +static int iwl_mvm_set_tx_power (struct iwl_mvm *mvm,struct ieee80211_vif *vif, +s16 tx_power) +{ +struct iwl_dev_tx_power_cmd cmd = { + .set_mode =0 , + .mac_context_id = +cpu_to_le32 (iwl_mvm_vif_from_mac80211 (vif)->id), + .pwr_restriction =cpu_to_le16 (8 * tx_power), + }; + +if (!(mvm->fw->ucode_capa.api[0 ] &IWL_UCODE_TLV_API_TX_POWER_DEV )) +return iwl_mvm_set_tx_power_old (mvm, vif, tx_power); + +if (tx_power ==IWL_DEFAULT_MAX_TX_POWER ) + cmd.pwr_restriction =cpu_to_le16 (IWL_DEV_MAX_TX_POWER ); + +return iwl_mvm_send_cmd_pdu (mvm,REDUCE_TX_POWER_CMD ,0 , +sizeof (cmd), &cmd); +} +static int iwl_mvm_mac_add_interface (struct ieee80211_hw *hw,struct ieee80211_vif *vif) {
Signature · 1 line
2.1.0
PATCH 2/8 iwlwifi: mvm: don't stop the FW monitor too early
In reply to Grumbach, EmmanuelWhen the delay paramatere is provided, we need to stop the collection only after the delay has elapsed.
--- drivers/net/wireless/iwlwifi/mvm/fw.c | 9 --------- drivers/net/wireless/iwlwifi/mvm/ops.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-)
drivers/net/wireless/iwlwifi/mvm/fw.c +0 -9
@@ -494,15 +494,6 @@ int iwl_mvm_fw_dbg_collect_desc(struct iwl_mvm *mvm, mvm->fw_dump_desc = desc; -/* stop recording */ -if (mvm->cfg->device_family ==IWL_DEVICE_FAMILY_7000 ) { -iwl_set_bits_prph (mvm->trans,MON_BUFF_SAMPLE_CTL ,0x100 ); - }else { -iwl_write_prph (mvm->trans,DBGC_IN_SAMPLE ,0 ); -/* wait before we collect the data till the DBGC stop */ -udelay (100 ); - } -queue_delayed_work (system_wq, &mvm->fw_dump_wk, delay);return 0 ;
drivers/net/wireless/iwlwifi/mvm/ops.c +10 -0
@@ -865,6 +865,16 @@ static void iwl_mvm_fw_error_dump_wk(struct work_struct *work)return ;mutex_lock (&mvm->mutex); + +/* stop recording */ +if (mvm->cfg->device_family ==IWL_DEVICE_FAMILY_7000 ) { +iwl_set_bits_prph (mvm->trans,MON_BUFF_SAMPLE_CTL ,0x100 ); + }else { +iwl_write_prph (mvm->trans,DBGC_IN_SAMPLE ,0 ); +/* wait before we collect the data till the DBGC stop */ +udelay (100 ); + } +iwl_mvm_fw_error_dump (mvm);/* start recording again if the firmware is not crashed */
Signature · 1 line
2.1.0
PATCH 3/8 iwlwifi: mvm: fix scan iteration complete notification handling
In reply to Grumbach, EmmanuelFrom: Avraham Stern <[email protected]>
Scan iteration complete notification handling uses the wrong FW API version (version 2 instead of version 3).
Fix that by removing version 2 API which is no longer used, and using only the updated version.
--- drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h | 44 ++------------------------ drivers/net/wireless/iwlwifi/mvm/scan.c | 2 +- 2 files changed, 3 insertions(+), 43 deletions(-)
drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h +2 -42
@@ -122,46 +122,6 @@ enum iwl_scan_complete_status { SCAN_COMP_STATUS_ERR_ALLOC_TE = 0x0C, }; -/** -* struct iwl_scan_results_notif - scan results for one channel -* ( SCAN_RESULTS_NOTIFICATION = 0x83 ) -* @channel: which channel the results are from -* @band: 0 for 5.2 GHz, 1 for 2.4 GHz -* @probe_status: SCAN_PROBE_STATUS_*, indicates success of probe request -* @num_probe_not_sent: # of request that weren't sent due to not enough time -* @duration: duration spent in channel, in usecs -* @statistics: statistics gathered for this channel -*/ -struct iwl_scan_results_notif { -u8 channel; -u8 band; -u8 probe_status; -u8 num_probe_not_sent; -__le32 duration; -__le32 statistics[SCAN_RESULTS_STATISTICS ]; -} __packed;/* SCAN_RESULT_NTF_API_S_VER_2 */ - -/** -* struct iwl_scan_complete_notif - notifies end of scanning (all channels) -* ( SCAN_COMPLETE_NOTIFICATION = 0x84 ) -* @scanned_channels: number of channels scanned (and number of valid results) -* @status: one of SCAN_COMP_STATUS_* -* @bt_status: BT on/off status -* @last_channel: last channel that was scanned -* @tsf_low: TSF timer (lower half) in usecs -* @tsf_high: TSF timer (higher half) in usecs -* @results: array of scan results, only "scanned_channels" of them are valid -*/ -struct iwl_scan_complete_notif { -u8 scanned_channels; -u8 status; -u8 bt_status; -u8 last_channel; -__le32 tsf_low; -__le32 tsf_high; -struct iwl_scan_results_notif results[]; -} __packed;/* SCAN_COMPLETE_NTF_API_S_VER_2 */ -/* scan offload */ #define IWL_SCAN_MAX_BLACKLIST_LEN 64#define IWL_SCAN_SHORT_BLACKLIST_LEN 16
@@ -554,7 +514,7 @@ struct iwl_scan_req_unified_lmac { } __packed;/** -* struct iwl_lmac_scan_results_notif - scan results for one channel - +* struct iwl_scan_results_notif - scan results for one channel - * SCAN_RESULT_NTF_API_S_VER_3 * @channel: which channel the results are from * @band: 0 for 5.2 GHz, 1 for 2.4 GHz
@@ -562,7 +522,7 @@ struct iwl_scan_req_unified_lmac {* @num_probe_not_sent: # of request that weren't sent due to not enough time * @duration: duration spent in channel, in usecs */ -struct iwl_lmac_scan_results_notif { +struct iwl_scan_results_notif {u8 channel;u8 band;u8 probe_status;
drivers/net/wireless/iwlwifi/mvm/scan.c +1 -1
@@ -319,7 +319,7 @@ int iwl_mvm_rx_scan_offload_iter_complete_notif(struct iwl_mvm *mvm, struct iwl_device_cmd *cmd) {struct iwl_rx_packet *pkt =rxb_addr (rxb); -struct iwl_scan_complete_notif *notif = (void *)pkt->data; +struct iwl_lmac_scan_complete_notif *notif = (void *)pkt->data; IWL_DEBUG_SCAN(mvm, "Scan offload iteration complete: status=0x%x scanned channels=%d\n",
Signature · 1 line
2.1.0
PATCH 4/8 iwlwifi: mvm: Avoid signal based decisions if ave beacon RSSI is 0
In reply to Grumbach, EmmanuelFrom: Alexander Bondar <[email protected]>
If for some reason statistics notification received from the firmware reports 0 in average beacon RSSI value, then skip it and avoid signal based decisions.
--- drivers/net/wireless/iwlwifi/mvm/rx.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/iwlwifi/mvm/rx.c +5 -0
@@ -478,6 +478,11 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac,if (vif->type !=NL80211_IFTYPE_STATION )return ; +if (sig ==0 ) { +IWL_DEBUG_RX (mvm,"RSSI is 0 - skip signal based decision\n" ); +return ; + } + mvmvif->bf_data.ave_beacon_signal = sig;/* BT Coex */
Signature · 1 line
2.1.0
PATCH 5/8 iwlwifi: pcie: prevent using unmapped memory in fw monitor
In reply to Grumbach, EmmanuelFrom: Liad Kaufman <[email protected]>
In the case of a DMA mapping error on the last iteration of the loop of the allocation of memory of the FW monitor we indeed free the pages, but don't NULL out the page variable thus allowing for the possibility of setting the FW monitor variables with invalid data to use.
--- drivers/net/wireless/iwlwifi/pcie/trans.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/wireless/iwlwifi/pcie/trans.c +6 -5
@@ -5,8 +5,8 @@* * GPL LICENSE SUMMARY * -* Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. -* Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH +* Copyright(c) 2007 - 2015 Intel Corporation. All rights reserved. +* Copyright(c) 2013 - 2015 Intel Mobile Communications 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
@@ -31,8 +31,8 @@* * BSD LICENSE * -* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. -* Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH +* Copyright(c) 2005 - 2015 Intel Corporation. All rights reserved. +* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -104,7 +104,7 @@ static void iwl_pcie_free_fw_monitor(struct iwl_trans *trans)static void iwl_pcie_alloc_fw_monitor (struct iwl_trans *trans) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); -struct page *page; +struct page *page =NULL ;dma_addr_t phys;u32 size;u8 power;
@@ -131,6 +131,7 @@ static void iwl_pcie_alloc_fw_monitor(struct iwl_trans *trans) DMA_FROM_DEVICE);if (dma_mapping_error (trans->dev, phys)) {__free_pages (page, order); + page =NULL ;continue ; } IWL_INFO(trans,
Signature · 1 line
2.1.0
PATCH 6/8 iwlwifi: mvm: don't power off the device between INIT and OPER firmwares
In reply to Grumbach, EmmanuelFrom: Eran Harary <[email protected]>
Our device needs two different firmwares: the INIT firmware and the operational (OPER) firmware. The first one is run when the driver loads and it returns calibrations results as well as the NVM. The second one implements the WiFi protocol.
If the wlan interface is not brought up, the device is put to low power state: no firmware will be running. When the interface is brought up, we would run the OPER firmware only and reuse the results of the run of the INIT firmware when the driver was loaded. This is changing with this patch.
We now run the INIT firmware every time mac80211 calls start(). The penalty for that is minimal since the INIT firwmare run fast. I now also avoid to power down the device between the INIT and OPER firmware on certains buses.
The motivation for this change is that there are components on the device (MFUART) that are triggered by the INIT firmware and need the device to be powered up in order to keep running. Powering the device down between the INIT and OPER firmware would stop these components and prevent them from running again since they are triggered by the INIT firmware only.
The new flow allows this and also allows to trigger these components again when the interface is brought up after it has been brought down.
--- drivers/net/wireless/iwlwifi/iwl-trans.h | 41 ++++++++++++++++++---------- drivers/net/wireless/iwlwifi/mvm/fw.c | 45 +++++++++++++++---------------- drivers/net/wireless/iwlwifi/mvm/mvm.h | 1 - drivers/net/wireless/iwlwifi/pcie/trans.c | 6 ++--- 4 files changed, 51 insertions(+), 42 deletions(-)
drivers/net/wireless/iwlwifi/iwl-trans.h +27 -14
@@ -6,7 +6,7 @@* GPL LICENSE SUMMARY * * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. -* Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH +* Copyright(c) 2013 - 2015 Intel Mobile Communications 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
@@ -32,7 +32,7 @@* BSD LICENSE * * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. -* Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH +* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -421,8 +421,9 @@ struct iwl_trans_txq_scd_cfg {* * All the handlers MUST be implemented * -* @start_hw: starts the HW- from that point on, the HW can send interrupts -* May sleep +* @start_hw: starts the HW. If low_power is true, the NIC needs to be taken +* out of a low power state. From that point on, the HW can send +* interrupts. May sleep. * @op_mode_leave: Turn off the HW RF kill indication if on * May sleep * @start_fw: allocates and inits all the resources for the transport
@@ -432,10 +433,11 @@ struct iwl_trans_txq_scd_cfg {* the SCD base address in SRAM, then provide it here, or 0 otherwise. * May sleep * @stop_device: stops the whole device (embedded CPU put to reset) and stops -* the HW. From that point on, the HW will be in low power but will still -* issue interrupt if the HW RF kill is triggered. This callback must do -* the right thing and not crash even if start_hw() was called but not -* start_fw(). May sleep +* the HW. If low_power is true, the NIC will be put in low power state. +* From that point on, the HW will be stopped but will still issue an +* interrupt if the HW RF kill switch is triggered. +* This callback must do the right thing and not crash even if %start_hw() +* was called but not &start_fw(). May sleep. * @d3_suspend: put the device into the correct mode for WoWLAN during * suspend. This is optional, if not implemented WoWLAN will not be * supported. This callback may sleep.
@@ -491,14 +493,14 @@ struct iwl_trans_txq_scd_cfg {*/ struct iwl_trans_ops { -int (*start_hw)(struct iwl_trans *iwl_trans); +int (*start_hw)(struct iwl_trans *iwl_trans,bool low_power);void (*op_mode_leave)(struct iwl_trans *iwl_trans);int (*start_fw)(struct iwl_trans *trans,const struct fw_img *fw,bool run_in_rfkill);int (*update_sf)(struct iwl_trans *trans,struct iwl_sf_region *st_fwrd_space);void (*fw_alive)(struct iwl_trans *trans,u32 scd_addr); -void (*stop_device)(struct iwl_trans *trans); +void (*stop_device)(struct iwl_trans *trans,bool low_power);void (*d3_suspend)(struct iwl_trans *trans,bool test); int (*d3_resume)(struct iwl_trans *trans, enum iwl_d3_status *status,
@@ -652,11 +654,16 @@ static inline void iwl_trans_configure(struct iwl_trans *trans, trans->ops->configure (trans, trans_cfg); } -static inline int iwl_trans_start_hw (struct iwl_trans *trans) +static inline int _iwl_trans_start_hw (struct iwl_trans *trans,bool low_power) {might_sleep (); -return trans->ops->start_hw (trans); +return trans->ops->start_hw (trans, low_power); +} + +static inline int iwl_trans_start_hw (struct iwl_trans *trans) +{ +return trans->ops->start_hw (trans, true); }static inline void iwl_trans_op_mode_leave (struct iwl_trans *trans)
@@ -703,15 +710,21 @@ static inline int iwl_trans_update_sf(struct iwl_trans *trans,return 0 ; } -static inline void iwl_trans_stop_device (struct iwl_trans *trans) +static inline void _iwl_trans_stop_device (struct iwl_trans *trans, +bool low_power) {might_sleep (); - trans->ops->stop_device (trans); + trans->ops->stop_device (trans, low_power); trans->state =IWL_TRANS_NO_FW ; } +static inline void iwl_trans_stop_device (struct iwl_trans *trans) +{ +_iwl_trans_stop_device (trans, true); +} +static inline void iwl_trans_d3_suspend (struct iwl_trans *trans,bool test) {might_sleep ();
drivers/net/wireless/iwlwifi/mvm/fw.c +21 -24
75 lines not on this page · raw message
drivers/net/wireless/iwlwifi/mvm/mvm.h +0 -1
@@ -603,7 +603,6 @@ struct iwl_mvm {enum iwl_ucode_type cur_ucode;bool ucode_loaded; -bool init_ucode_complete;bool calibrating;u32 error_event_table;u32 log_event_table;
drivers/net/wireless/iwlwifi/pcie/trans.c +3 -3
@@ -1021,7 +1021,7 @@ static void iwl_trans_pcie_fw_alive(struct iwl_trans *trans, u32 scd_addr)iwl_pcie_tx_start (trans, scd_addr); } -static void iwl_trans_pcie_stop_device (struct iwl_trans *trans) +static void iwl_trans_pcie_stop_device (struct iwl_trans *trans,bool low_power) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans);bool hw_rfkill, was_hw_rfkill;
@@ -1116,7 +1116,7 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)void iwl_trans_pcie_rf_kill (struct iwl_trans *trans,bool state) {if (iwl_op_mode_hw_rf_kill (trans->op_mode, state)) -iwl_trans_pcie_stop_device (trans); +iwl_trans_pcie_stop_device (trans, true); }static void iwl_trans_pcie_d3_suspend (struct iwl_trans *trans,bool test)
@@ -1201,7 +1201,7 @@ static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans,return 0 ; } -static int iwl_trans_pcie_start_hw (struct iwl_trans *trans) +static int iwl_trans_pcie_start_hw (struct iwl_trans *trans,bool low_power) {bool hw_rfkill;int err;
Signature · 1 line
2.1.0
PATCH 7/8 iwlwifi: mvm: fix typo in CONFIG option
In reply to Grumbach, EmmanuelI forgot to rename the CPTCFG_ prefix...
--- drivers/net/wireless/iwlwifi/mvm/d3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/d3.c +1 -1
@@ -1726,7 +1726,7 @@ iwl_mvm_netdetect_query_results(struct iwl_mvm *mvm, results->matched_profiles =le32_to_cpu (query->matched_profiles);memcpy (results->matches, query->matches,sizeof (results->matches)); -#ifdef CPTCFG_IWLWIFI_DEBUGFS +#ifdef CONFIG_IWLWIFI_DEBUGFS mvm->last_netdetect_scans =le32_to_cpu (query->n_scans_done);#endif
Signature · 1 line
2.1.0
PATCH 8/8 iwlwifi: mvm: force quota update update after FW restart
In reply to Grumbach, EmmanuelFrom: Johannes Berg <[email protected]>
During firmware restart, the quota command isn't calculated multiple times, but after the firmware restart it has to be sent, so force it. Otherwise the firmware crashes.
--- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/iwlwifi/mvm/mac80211.c +1 -1
@@ -1322,7 +1322,7 @@ static void iwl_mvm_restart_complete(struct iwl_mvm *mvm)clear_bit (IWL_MVM_STATUS_IN_HW_RESTART , &mvm->status);iwl_mvm_d0i3_enable_tx (mvm,NULL ); - ret =iwl_mvm_update_quotas (mvm, false,NULL ); + ret =iwl_mvm_update_quotas (mvm, true,NULL );if (ret)IWL_ERR (mvm,"Failed to update quotas after restart (%d)\n" , ret);
Signature · 1 line
2.1.0
Quoted 17 lines · Emmanuel
Here is the first round of fixes for 4.1.
As usual, this first round is slightly big. I hope things will settle down later.Please pull. Thanks!
The following changes since commit
6c373ca89399c5a3f7ef210ad8f63dc3437da345:Merge
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next(2015-04-15 09:00:47 -0700)are available in the git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git tags/iwlwifi-for-kalle-2015-04-28
for you to fetch changes up to
e7afe89fd67d40a7f5fff8130c5f925d99a94b1f:iwlwifi: mvm: force quota update update after FW restart (2015-04-28 15:02:25 +0300)
Quoted 8 lines
----------------------------------------------------------------
* fix firmware API for -13.ucode
* fix RSSI handling that avoid bad roaming decision
* fix firmware debug
* fix MFUART operation
* fix ASSERT while restart the hardware (because of another ASSERT e.g)----------------------------------------------------------------
Thanks, pulled.
Signature · 1 line
Kalle Valo