diff options
author | Kalle Valo <kvalo@codeaurora.org> | 2015-10-28 14:48:26 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-10-28 14:48:26 -0400 |
commit | b3bcb1b27203c24fbf181748cec6eec10419678d (patch) | |
tree | a6397d18891460721758501dcd61bfa33011630c | |
parent | 6d08f617872cc048173d59f1ce4660b030bab5a6 (diff) | |
parent | 2edb7a3372c76c9379d0fc00e4274ea8f018248a (diff) |
Merge tag 'iwlwifi-next-for-kalle-2015-10-25' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
* bug fix for TDLS
* fixes and cleanups in scan
* support of several scan plans
* improvements in FTM
* fixes in FW API
* improvements in the failure paths when the bus is dead
* other various small things here and there
20 files changed, 296 insertions, 101 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h b/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h index af5b3201492c..9dbe19cbb4dd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h | |||
@@ -86,6 +86,8 @@ | |||
86 | * Structured as &struct iwl_fw_error_dump_trigger_desc. | 86 | * Structured as &struct iwl_fw_error_dump_trigger_desc. |
87 | * @IWL_FW_ERROR_DUMP_RB: the content of an RB structured as | 87 | * @IWL_FW_ERROR_DUMP_RB: the content of an RB structured as |
88 | * &struct iwl_fw_error_dump_rb | 88 | * &struct iwl_fw_error_dump_rb |
89 | * @IWL_FW_ERROR_PAGING: UMAC's image memory segments which were | ||
90 | * paged to the DRAM. | ||
89 | */ | 91 | */ |
90 | enum iwl_fw_error_dump_type { | 92 | enum iwl_fw_error_dump_type { |
91 | /* 0 is deprecated */ | 93 | /* 0 is deprecated */ |
@@ -100,6 +102,7 @@ enum iwl_fw_error_dump_type { | |||
100 | IWL_FW_ERROR_DUMP_MEM = 9, | 102 | IWL_FW_ERROR_DUMP_MEM = 9, |
101 | IWL_FW_ERROR_DUMP_ERROR_INFO = 10, | 103 | IWL_FW_ERROR_DUMP_ERROR_INFO = 10, |
102 | IWL_FW_ERROR_DUMP_RB = 11, | 104 | IWL_FW_ERROR_DUMP_RB = 11, |
105 | IWL_FW_ERROR_DUMP_PAGING = 12, | ||
103 | 106 | ||
104 | IWL_FW_ERROR_DUMP_MAX, | 107 | IWL_FW_ERROR_DUMP_MAX, |
105 | }; | 108 | }; |
@@ -240,6 +243,19 @@ struct iwl_fw_error_dump_rb { | |||
240 | }; | 243 | }; |
241 | 244 | ||
242 | /** | 245 | /** |
246 | * struct iwl_fw_error_dump_paging - content of the UMAC's image page | ||
247 | * block on DRAM | ||
248 | * @index: the index of the page block | ||
249 | * @reserved: | ||
250 | * @data: the content of the page block | ||
251 | */ | ||
252 | struct iwl_fw_error_dump_paging { | ||
253 | __le32 index; | ||
254 | __le32 reserved; | ||
255 | u8 data[]; | ||
256 | }; | ||
257 | |||
258 | /** | ||
243 | * iwl_fw_error_next_data - advance fw error dump data pointer | 259 | * iwl_fw_error_next_data - advance fw error dump data pointer |
244 | * @data: previous data block | 260 | * @data: previous data block |
245 | * Returns: next data block | 261 | * Returns: next data block |
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/iwlwifi/iwl-fw-file.h index 72ddd4a163e6..08303db0000f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw-file.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw-file.h | |||
@@ -306,6 +306,8 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_capa_t; | |||
306 | * is supported. | 306 | * is supported. |
307 | * @IWL_UCODE_TLV_CAPA_BT_COEX_RRC: supports BT Coex RRC | 307 | * @IWL_UCODE_TLV_CAPA_BT_COEX_RRC: supports BT Coex RRC |
308 | * @IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT: supports gscan | 308 | * @IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT: supports gscan |
309 | * @IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE: extended DTS measurement | ||
310 | * @IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS: supports short PM timeouts | ||
309 | * | 311 | * |
310 | * @NUM_IWL_UCODE_TLV_CAPA: number of bits used | 312 | * @NUM_IWL_UCODE_TLV_CAPA: number of bits used |
311 | */ | 313 | */ |
@@ -330,6 +332,8 @@ enum iwl_ucode_tlv_capa { | |||
330 | IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC = (__force iwl_ucode_tlv_capa_t)29, | 332 | IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC = (__force iwl_ucode_tlv_capa_t)29, |
331 | IWL_UCODE_TLV_CAPA_BT_COEX_RRC = (__force iwl_ucode_tlv_capa_t)30, | 333 | IWL_UCODE_TLV_CAPA_BT_COEX_RRC = (__force iwl_ucode_tlv_capa_t)30, |
332 | IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT = (__force iwl_ucode_tlv_capa_t)31, | 334 | IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT = (__force iwl_ucode_tlv_capa_t)31, |
335 | IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE = (__force iwl_ucode_tlv_capa_t)64, | ||
336 | IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS = (__force iwl_ucode_tlv_capa_t)65, | ||
333 | 337 | ||
334 | NUM_IWL_UCODE_TLV_CAPA | 338 | NUM_IWL_UCODE_TLV_CAPA |
335 | #ifdef __CHECKER__ | 339 | #ifdef __CHECKER__ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index bb51b6f8002c..6f76525088f0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -409,6 +409,7 @@ enum iwl_d3_status { | |||
409 | * @STATUS_TRANS_GOING_IDLE: shutting down the trans, only special commands | 409 | * @STATUS_TRANS_GOING_IDLE: shutting down the trans, only special commands |
410 | * are sent | 410 | * are sent |
411 | * @STATUS_TRANS_IDLE: the trans is idle - general commands are not to be sent | 411 | * @STATUS_TRANS_IDLE: the trans is idle - general commands are not to be sent |
412 | * @STATUS_TRANS_DEAD: trans is dead - avoid any read/write operation | ||
412 | */ | 413 | */ |
413 | enum iwl_trans_status { | 414 | enum iwl_trans_status { |
414 | STATUS_SYNC_HCMD_ACTIVE, | 415 | STATUS_SYNC_HCMD_ACTIVE, |
@@ -419,6 +420,7 @@ enum iwl_trans_status { | |||
419 | STATUS_FW_ERROR, | 420 | STATUS_FW_ERROR, |
420 | STATUS_TRANS_GOING_IDLE, | 421 | STATUS_TRANS_GOING_IDLE, |
421 | STATUS_TRANS_IDLE, | 422 | STATUS_TRANS_IDLE, |
423 | STATUS_TRANS_DEAD, | ||
422 | }; | 424 | }; |
423 | 425 | ||
424 | /** | 426 | /** |
diff --git a/drivers/net/wireless/iwlwifi/mvm/constants.h b/drivers/net/wireless/iwlwifi/mvm/constants.h index a3ca6db0f303..5c21231e195d 100644 --- a/drivers/net/wireless/iwlwifi/mvm/constants.h +++ b/drivers/net/wireless/iwlwifi/mvm/constants.h | |||
@@ -71,6 +71,9 @@ | |||
71 | #define IWL_MVM_DEFAULT_PS_RX_DATA_TIMEOUT (100 * USEC_PER_MSEC) | 71 | #define IWL_MVM_DEFAULT_PS_RX_DATA_TIMEOUT (100 * USEC_PER_MSEC) |
72 | #define IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT (10 * USEC_PER_MSEC) | 72 | #define IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT (10 * USEC_PER_MSEC) |
73 | #define IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT (10 * USEC_PER_MSEC) | 73 | #define IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT (10 * USEC_PER_MSEC) |
74 | #define IWL_MVM_SHORT_PS_TX_DATA_TIMEOUT (2 * 1024) /* defined in TU */ | ||
75 | #define IWL_MVM_SHORT_PS_RX_DATA_TIMEOUT (40 * 1024) /* defined in TU */ | ||
76 | #define IWL_MVM_P2P_LOWLATENCY_PS_ENABLE 0 | ||
74 | #define IWL_MVM_UAPSD_RX_DATA_TIMEOUT (50 * USEC_PER_MSEC) | 77 | #define IWL_MVM_UAPSD_RX_DATA_TIMEOUT (50 * USEC_PER_MSEC) |
75 | #define IWL_MVM_UAPSD_TX_DATA_TIMEOUT (50 * USEC_PER_MSEC) | 78 | #define IWL_MVM_UAPSD_TX_DATA_TIMEOUT (50 * USEC_PER_MSEC) |
76 | #define IWL_MVM_UAPSD_QUEUES (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\ | 79 | #define IWL_MVM_UAPSD_QUEUES (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\ |
@@ -101,7 +104,6 @@ | |||
101 | #define IWL_MVM_FW_BCAST_FILTER_PASS_ALL 0 | 104 | #define IWL_MVM_FW_BCAST_FILTER_PASS_ALL 0 |
102 | #define IWL_MVM_QUOTA_THRESHOLD 4 | 105 | #define IWL_MVM_QUOTA_THRESHOLD 4 |
103 | #define IWL_MVM_RS_RSSI_BASED_INIT_RATE 0 | 106 | #define IWL_MVM_RS_RSSI_BASED_INIT_RATE 0 |
104 | #define IWL_MVM_RS_DISABLE_P2P_MIMO 0 | ||
105 | #define IWL_MVM_RS_80_20_FAR_RANGE_TWEAK 1 | 107 | #define IWL_MVM_RS_80_20_FAR_RANGE_TWEAK 1 |
106 | #define IWL_MVM_TOF_IS_RESPONDER 0 | 108 | #define IWL_MVM_TOF_IS_RESPONDER 0 |
107 | #define IWL_MVM_RS_NUM_TRY_BEFORE_ANT_TOGGLE 1 | 109 | #define IWL_MVM_RS_NUM_TRY_BEFORE_ANT_TOGGLE 1 |
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c index 398bef6f4f61..7904b41a04c6 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c | |||
@@ -715,11 +715,30 @@ static ssize_t iwl_dbgfs_tof_responder_params_write(struct ieee80211_vif *vif, | |||
715 | goto out; | 715 | goto out; |
716 | } | 716 | } |
717 | 717 | ||
718 | data = iwl_dbgfs_is_match("ctrl_ch_position=", buf); | 718 | data = iwl_dbgfs_is_match("center_freq=", buf); |
719 | if (data) { | 719 | if (data) { |
720 | struct iwl_tof_responder_config_cmd *cmd = | ||
721 | &mvm->tof_data.responder_cfg; | ||
722 | |||
720 | ret = kstrtou32(data, 10, &value); | 723 | ret = kstrtou32(data, 10, &value); |
721 | if (ret == 0) | 724 | if (ret == 0 && value) { |
722 | mvm->tof_data.responder_cfg.ctrl_ch_position = value; | 725 | enum ieee80211_band band = (cmd->channel_num <= 14) ? |
726 | IEEE80211_BAND_2GHZ : | ||
727 | IEEE80211_BAND_5GHZ; | ||
728 | struct ieee80211_channel chn = { | ||
729 | .band = band, | ||
730 | .center_freq = ieee80211_channel_to_frequency( | ||
731 | cmd->channel_num, band), | ||
732 | }; | ||
733 | struct cfg80211_chan_def chandef = { | ||
734 | .chan = &chn, | ||
735 | .center_freq1 = | ||
736 | ieee80211_channel_to_frequency(value, | ||
737 | band), | ||
738 | }; | ||
739 | |||
740 | cmd->ctrl_ch_position = iwl_mvm_get_ctrl_pos(&chandef); | ||
741 | } | ||
723 | goto out; | 742 | goto out; |
724 | } | 743 | } |
725 | 744 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c index 9b4fbb8b483a..05928fb4021d 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c | |||
@@ -85,7 +85,7 @@ static ssize_t iwl_dbgfs_tx_flush_write(struct iwl_mvm *mvm, char *buf, | |||
85 | IWL_ERR(mvm, "FLUSHING queues: scd_q_msk = 0x%x\n", scd_q_msk); | 85 | IWL_ERR(mvm, "FLUSHING queues: scd_q_msk = 0x%x\n", scd_q_msk); |
86 | 86 | ||
87 | mutex_lock(&mvm->mutex); | 87 | mutex_lock(&mvm->mutex); |
88 | ret = iwl_mvm_flush_tx_path(mvm, scd_q_msk, true) ? : count; | 88 | ret = iwl_mvm_flush_tx_path(mvm, scd_q_msk, 0) ? : count; |
89 | mutex_unlock(&mvm->mutex); | 89 | mutex_unlock(&mvm->mutex); |
90 | 90 | ||
91 | return ret; | 91 | return ret; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h index 660cc1c93e19..3a657e4b60ac 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h | |||
@@ -101,6 +101,7 @@ struct iwl_ssid_ie { | |||
101 | 101 | ||
102 | #define IWL_FULL_SCAN_MULTIPLIER 5 | 102 | #define IWL_FULL_SCAN_MULTIPLIER 5 |
103 | #define IWL_FAST_SCHED_SCAN_ITERATIONS 3 | 103 | #define IWL_FAST_SCHED_SCAN_ITERATIONS 3 |
104 | #define IWL_MAX_SCHED_SCAN_PLANS 2 | ||
104 | 105 | ||
105 | enum scan_framework_client { | 106 | enum scan_framework_client { |
106 | SCAN_CLIENT_SCHED_SCAN = BIT(0), | 107 | SCAN_CLIENT_SCHED_SCAN = BIT(0), |
@@ -359,7 +360,7 @@ struct iwl_scan_req_lmac { | |||
359 | /* SCAN_REQ_PERIODIC_PARAMS_API_S */ | 360 | /* SCAN_REQ_PERIODIC_PARAMS_API_S */ |
360 | __le32 iter_num; | 361 | __le32 iter_num; |
361 | __le32 delay; | 362 | __le32 delay; |
362 | struct iwl_scan_schedule_lmac schedule[2]; | 363 | struct iwl_scan_schedule_lmac schedule[IWL_MAX_SCHED_SCAN_PLANS]; |
363 | struct iwl_scan_channel_opt channel_opt[2]; | 364 | struct iwl_scan_channel_opt channel_opt[2]; |
364 | u8 data[]; | 365 | u8 data[]; |
365 | } __packed; | 366 | } __packed; |
@@ -582,7 +583,7 @@ struct iwl_scan_umac_schedule { | |||
582 | */ | 583 | */ |
583 | struct iwl_scan_req_umac_tail { | 584 | struct iwl_scan_req_umac_tail { |
584 | /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */ | 585 | /* SCAN_PERIODIC_PARAMS_API_S_VER_1 */ |
585 | struct iwl_scan_umac_schedule schedule[2]; | 586 | struct iwl_scan_umac_schedule schedule[IWL_MAX_SCHED_SCAN_PLANS]; |
586 | __le16 delay; | 587 | __le16 delay; |
587 | __le16 reserved; | 588 | __le16 reserved; |
588 | /* SCAN_PROBE_PARAMS_API_S_VER_1 */ | 589 | /* SCAN_PROBE_PARAMS_API_S_VER_1 */ |
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api.h b/drivers/net/wireless/iwlwifi/mvm/fw-api.h index 44ff6849b7a5..181590fbd3b3 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw-api.h +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api.h | |||
@@ -1524,6 +1524,69 @@ struct iwl_dts_measurement_cmd { | |||
1524 | } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */ | 1524 | } __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_CMD_S */ |
1525 | 1525 | ||
1526 | /** | 1526 | /** |
1527 | * enum iwl_dts_control_measurement_mode - DTS measurement type | ||
1528 | * @DTS_AUTOMATIC: Automatic mode (full SW control). Provide temperature read | ||
1529 | * back (latest value. Not waiting for new value). Use automatic | ||
1530 | * SW DTS configuration. | ||
1531 | * @DTS_REQUEST_READ: Request DTS read. Configure DTS with manual settings, | ||
1532 | * trigger DTS reading and provide read back temperature read | ||
1533 | * when available. | ||
1534 | * @DTS_OVER_WRITE: over-write the DTS temperatures in the SW until next read | ||
1535 | * @DTS_DIRECT_WITHOUT_MEASURE: DTS returns its latest temperature result, | ||
1536 | * without measurement trigger. | ||
1537 | */ | ||
1538 | enum iwl_dts_control_measurement_mode { | ||
1539 | DTS_AUTOMATIC = 0, | ||
1540 | DTS_REQUEST_READ = 1, | ||
1541 | DTS_OVER_WRITE = 2, | ||
1542 | DTS_DIRECT_WITHOUT_MEASURE = 3, | ||
1543 | }; | ||
1544 | |||
1545 | /** | ||
1546 | * enum iwl_dts_used - DTS to use or used for measurement in the DTS request | ||
1547 | * @DTS_USE_TOP: Top | ||
1548 | * @DTS_USE_CHAIN_A: chain A | ||
1549 | * @DTS_USE_CHAIN_B: chain B | ||
1550 | * @DTS_USE_CHAIN_C: chain C | ||
1551 | * @XTAL_TEMPERATURE - read temperature from xtal | ||
1552 | */ | ||
1553 | enum iwl_dts_used { | ||
1554 | DTS_USE_TOP = 0, | ||
1555 | DTS_USE_CHAIN_A = 1, | ||
1556 | DTS_USE_CHAIN_B = 2, | ||
1557 | DTS_USE_CHAIN_C = 3, | ||
1558 | XTAL_TEMPERATURE = 4, | ||
1559 | }; | ||
1560 | |||
1561 | /** | ||
1562 | * enum iwl_dts_bit_mode - bit-mode to use in DTS request read mode | ||
1563 | * @DTS_BIT6_MODE: bit 6 mode | ||
1564 | * @DTS_BIT8_MODE: bit 8 mode | ||
1565 | */ | ||
1566 | enum iwl_dts_bit_mode { | ||
1567 | DTS_BIT6_MODE = 0, | ||
1568 | DTS_BIT8_MODE = 1, | ||
1569 | }; | ||
1570 | |||
1571 | /** | ||
1572 | * iwl_ext_dts_measurement_cmd - request extended DTS temperature measurements | ||
1573 | * @control_mode: see &enum iwl_dts_control_measurement_mode | ||
1574 | * @temperature: used when over write DTS mode is selected | ||
1575 | * @sensor: set temperature sensor to use. See &enum iwl_dts_used | ||
1576 | * @avg_factor: average factor to DTS in request DTS read mode | ||
1577 | * @bit_mode: value defines the DTS bit mode to use. See &enum iwl_dts_bit_mode | ||
1578 | * @step_duration: step duration for the DTS | ||
1579 | */ | ||
1580 | struct iwl_ext_dts_measurement_cmd { | ||
1581 | __le32 control_mode; | ||
1582 | __le32 temperature; | ||
1583 | __le32 sensor; | ||
1584 | __le32 avg_factor; | ||
1585 | __le32 bit_mode; | ||
1586 | __le32 step_duration; | ||
1587 | } __packed; /* XVT_FW_DTS_CONTROL_MEASUREMENT_REQUEST_API_S */ | ||
1588 | |||
1589 | /** | ||
1527 | * iwl_dts_measurement_notif - notification received with the measurements | 1590 | * iwl_dts_measurement_notif - notification received with the measurements |
1528 | * | 1591 | * |
1529 | * @temp: the measured temperature | 1592 | * @temp: the measured temperature |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c index 9d36ba7295a5..ad7ad720d2e7 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | |||
@@ -843,6 +843,9 @@ static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm, | |||
843 | ctxt_sta->listen_interval = cpu_to_le32(mvm->hw->conf.listen_interval); | 843 | ctxt_sta->listen_interval = cpu_to_le32(mvm->hw->conf.listen_interval); |
844 | ctxt_sta->assoc_id = cpu_to_le32(vif->bss_conf.aid); | 844 | ctxt_sta->assoc_id = cpu_to_le32(vif->bss_conf.aid); |
845 | 845 | ||
846 | if (vif->probe_req_reg && vif->bss_conf.assoc && vif->p2p) | ||
847 | cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST); | ||
848 | |||
846 | return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); | 849 | return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); |
847 | } | 850 | } |
848 | 851 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index a38e07bb137f..1fb684693040 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -572,6 +572,14 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) | |||
572 | /* we create the 802.11 header and zero length SSID IE. */ | 572 | /* we create the 802.11 header and zero length SSID IE. */ |
573 | hw->wiphy->max_sched_scan_ie_len = | 573 | hw->wiphy->max_sched_scan_ie_len = |
574 | SCAN_OFFLOAD_PROBE_REQ_SIZE - 24 - 2; | 574 | SCAN_OFFLOAD_PROBE_REQ_SIZE - 24 - 2; |
575 | hw->wiphy->max_sched_scan_plans = IWL_MAX_SCHED_SCAN_PLANS; | ||
576 | hw->wiphy->max_sched_scan_plan_interval = U16_MAX; | ||
577 | |||
578 | /* | ||
579 | * the firmware uses u8 for num of iterations, but 0xff is saved for | ||
580 | * infinite loop, so the maximum number of iterations is actually 254. | ||
581 | */ | ||
582 | hw->wiphy->max_sched_scan_plan_iterations = 254; | ||
575 | 583 | ||
576 | hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN | | 584 | hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN | |
577 | NL80211_FEATURE_LOW_PRIORITY_SCAN | | 585 | NL80211_FEATURE_LOW_PRIORITY_SCAN | |
@@ -1129,6 +1137,12 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) | |||
1129 | 1137 | ||
1130 | lockdep_assert_held(&mvm->mutex); | 1138 | lockdep_assert_held(&mvm->mutex); |
1131 | 1139 | ||
1140 | /* there's no point in fw dump if the bus is dead */ | ||
1141 | if (test_bit(STATUS_TRANS_DEAD, &mvm->trans->status)) { | ||
1142 | IWL_ERR(mvm, "Skip fw error dump since bus is dead\n"); | ||
1143 | return; | ||
1144 | } | ||
1145 | |||
1132 | if (mvm->fw_dump_trig && | 1146 | if (mvm->fw_dump_trig && |
1133 | mvm->fw_dump_trig->mode & IWL_FW_DBG_TRIGGER_MONITOR_ONLY) | 1147 | mvm->fw_dump_trig->mode & IWL_FW_DBG_TRIGGER_MONITOR_ONLY) |
1134 | monitor_dump_only = true; | 1148 | monitor_dump_only = true; |
@@ -1192,6 +1206,13 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) | |||
1192 | if (sram2_len) | 1206 | if (sram2_len) |
1193 | file_len += sizeof(*dump_data) + sizeof(*dump_mem) + sram2_len; | 1207 | file_len += sizeof(*dump_data) + sizeof(*dump_mem) + sram2_len; |
1194 | 1208 | ||
1209 | /* Make room for fw's virtual image pages, if it exists */ | ||
1210 | if (mvm->fw->img[mvm->cur_ucode].paging_mem_size) | ||
1211 | file_len += mvm->num_of_paging_blk * | ||
1212 | (sizeof(*dump_data) + | ||
1213 | sizeof(struct iwl_fw_error_dump_paging) + | ||
1214 | PAGING_BLOCK_SIZE); | ||
1215 | |||
1195 | /* If we only want a monitor dump, reset the file length */ | 1216 | /* If we only want a monitor dump, reset the file length */ |
1196 | if (monitor_dump_only) { | 1217 | if (monitor_dump_only) { |
1197 | file_len = sizeof(*dump_file) + sizeof(*dump_data) + | 1218 | file_len = sizeof(*dump_file) + sizeof(*dump_data) + |
@@ -1302,6 +1323,26 @@ void iwl_mvm_fw_error_dump(struct iwl_mvm *mvm) | |||
1302 | dump_mem->data, IWL8260_ICCM_LEN); | 1323 | dump_mem->data, IWL8260_ICCM_LEN); |
1303 | } | 1324 | } |
1304 | 1325 | ||
1326 | /* Dump fw's virtual image */ | ||
1327 | if (mvm->fw->img[mvm->cur_ucode].paging_mem_size) { | ||
1328 | u32 i; | ||
1329 | |||
1330 | for (i = 1; i < mvm->num_of_paging_blk + 1; i++) { | ||
1331 | struct iwl_fw_error_dump_paging *paging; | ||
1332 | struct page *pages = | ||
1333 | mvm->fw_paging_db[i].fw_paging_block; | ||
1334 | |||
1335 | dump_data = iwl_fw_error_next_data(dump_data); | ||
1336 | dump_data->type = cpu_to_le32(IWL_FW_ERROR_DUMP_PAGING); | ||
1337 | dump_data->len = cpu_to_le32(sizeof(*paging) + | ||
1338 | PAGING_BLOCK_SIZE); | ||
1339 | paging = (void *)dump_data->data; | ||
1340 | paging->index = cpu_to_le32(i); | ||
1341 | memcpy(paging->data, page_address(pages), | ||
1342 | PAGING_BLOCK_SIZE); | ||
1343 | } | ||
1344 | } | ||
1345 | |||
1305 | dump_trans_data: | 1346 | dump_trans_data: |
1306 | fw_error_dump->trans_ptr = iwl_trans_dump_data(mvm->trans, | 1347 | fw_error_dump->trans_ptr = iwl_trans_dump_data(mvm->trans, |
1307 | mvm->fw_dump_trig); | 1348 | mvm->fw_dump_trig); |
@@ -1754,7 +1795,7 @@ static void iwl_mvm_prepare_mac_removal(struct iwl_mvm *mvm, | |||
1754 | * Flush them here. | 1795 | * Flush them here. |
1755 | */ | 1796 | */ |
1756 | mutex_lock(&mvm->mutex); | 1797 | mutex_lock(&mvm->mutex); |
1757 | iwl_mvm_flush_tx_path(mvm, tfd_msk, true); | 1798 | iwl_mvm_flush_tx_path(mvm, tfd_msk, 0); |
1758 | mutex_unlock(&mvm->mutex); | 1799 | mutex_unlock(&mvm->mutex); |
1759 | 1800 | ||
1760 | /* | 1801 | /* |
@@ -1955,6 +1996,27 @@ out: | |||
1955 | *total_flags = 0; | 1996 | *total_flags = 0; |
1956 | } | 1997 | } |
1957 | 1998 | ||
1999 | static void iwl_mvm_config_iface_filter(struct ieee80211_hw *hw, | ||
2000 | struct ieee80211_vif *vif, | ||
2001 | unsigned int filter_flags, | ||
2002 | unsigned int changed_flags) | ||
2003 | { | ||
2004 | struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); | ||
2005 | |||
2006 | /* We support only filter for probe requests */ | ||
2007 | if (!(changed_flags & FIF_PROBE_REQ)) | ||
2008 | return; | ||
2009 | |||
2010 | /* Supported only for p2p client interfaces */ | ||
2011 | if (vif->type != NL80211_IFTYPE_STATION || !vif->bss_conf.assoc || | ||
2012 | !vif->p2p) | ||
2013 | return; | ||
2014 | |||
2015 | mutex_lock(&mvm->mutex); | ||
2016 | iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); | ||
2017 | mutex_unlock(&mvm->mutex); | ||
2018 | } | ||
2019 | |||
1958 | #ifdef CONFIG_IWLWIFI_BCAST_FILTERING | 2020 | #ifdef CONFIG_IWLWIFI_BCAST_FILTERING |
1959 | struct iwl_bcast_iter_data { | 2021 | struct iwl_bcast_iter_data { |
1960 | struct iwl_mvm *mvm; | 2022 | struct iwl_mvm *mvm; |
@@ -3898,7 +3960,7 @@ static void iwl_mvm_mac_flush(struct ieee80211_hw *hw, | |||
3898 | } | 3960 | } |
3899 | 3961 | ||
3900 | if (drop) { | 3962 | if (drop) { |
3901 | if (iwl_mvm_flush_tx_path(mvm, msk, true)) | 3963 | if (iwl_mvm_flush_tx_path(mvm, msk, 0)) |
3902 | IWL_ERR(mvm, "flush request fail\n"); | 3964 | IWL_ERR(mvm, "flush request fail\n"); |
3903 | mutex_unlock(&mvm->mutex); | 3965 | mutex_unlock(&mvm->mutex); |
3904 | } else { | 3966 | } else { |
@@ -4135,6 +4197,7 @@ const struct ieee80211_ops iwl_mvm_hw_ops = { | |||
4135 | .config = iwl_mvm_mac_config, | 4197 | .config = iwl_mvm_mac_config, |
4136 | .prepare_multicast = iwl_mvm_prepare_multicast, | 4198 | .prepare_multicast = iwl_mvm_prepare_multicast, |
4137 | .configure_filter = iwl_mvm_configure_filter, | 4199 | .configure_filter = iwl_mvm_configure_filter, |
4200 | .config_iface_filter = iwl_mvm_config_iface_filter, | ||
4138 | .bss_info_changed = iwl_mvm_bss_info_changed, | 4201 | .bss_info_changed = iwl_mvm_bss_info_changed, |
4139 | .hw_scan = iwl_mvm_mac_hw_scan, | 4202 | .hw_scan = iwl_mvm_mac_hw_scan, |
4140 | .cancel_hw_scan = iwl_mvm_mac_cancel_hw_scan, | 4203 | .cancel_hw_scan = iwl_mvm_mac_cancel_hw_scan, |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index 16c5a6d7e0c9..c6327cd1d071 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h | |||
@@ -1036,7 +1036,7 @@ const char *iwl_mvm_get_tx_fail_reason(u32 status); | |||
1036 | #else | 1036 | #else |
1037 | static inline const char *iwl_mvm_get_tx_fail_reason(u32 status) { return ""; } | 1037 | static inline const char *iwl_mvm_get_tx_fail_reason(u32 status) { return ""; } |
1038 | #endif | 1038 | #endif |
1039 | int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk, bool sync); | 1039 | int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk, u32 flags); |
1040 | void iwl_mvm_async_handlers_purge(struct iwl_mvm *mvm); | 1040 | void iwl_mvm_async_handlers_purge(struct iwl_mvm *mvm); |
1041 | 1041 | ||
1042 | static inline void iwl_mvm_set_tx_cmd_ccmp(struct ieee80211_tx_info *info, | 1042 | static inline void iwl_mvm_set_tx_cmd_ccmp(struct ieee80211_tx_info *info, |
diff --git a/drivers/net/wireless/iwlwifi/mvm/nvm.c b/drivers/net/wireless/iwlwifi/mvm/nvm.c index 4e4a680f274a..2ee0f6fe56a1 100644 --- a/drivers/net/wireless/iwlwifi/mvm/nvm.c +++ b/drivers/net/wireless/iwlwifi/mvm/nvm.c | |||
@@ -483,6 +483,7 @@ static int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm) | |||
483 | ret = -ENOMEM; | 483 | ret = -ENOMEM; |
484 | break; | 484 | break; |
485 | } | 485 | } |
486 | kfree(mvm->nvm_sections[section_id].data); | ||
486 | mvm->nvm_sections[section_id].data = temp; | 487 | mvm->nvm_sections[section_id].data = temp; |
487 | mvm->nvm_sections[section_id].length = section_size; | 488 | mvm->nvm_sections[section_id].length = section_size; |
488 | 489 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c index 723b537341c4..bed9696ee410 100644 --- a/drivers/net/wireless/iwlwifi/mvm/power.c +++ b/drivers/net/wireless/iwlwifi/mvm/power.c | |||
@@ -348,7 +348,8 @@ static void iwl_mvm_power_config_skip_dtim(struct iwl_mvm *mvm, | |||
348 | 348 | ||
349 | static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, | 349 | static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, |
350 | struct ieee80211_vif *vif, | 350 | struct ieee80211_vif *vif, |
351 | struct iwl_mac_power_cmd *cmd) | 351 | struct iwl_mac_power_cmd *cmd, |
352 | bool host_awake) | ||
352 | { | 353 | { |
353 | int dtimper, bi; | 354 | int dtimper, bi; |
354 | int keep_alive; | 355 | int keep_alive; |
@@ -376,8 +377,13 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, | |||
376 | 377 | ||
377 | cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK); | 378 | cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK); |
378 | 379 | ||
379 | if (!vif->bss_conf.ps || !mvmvif->pm_enabled || | 380 | if (!vif->bss_conf.ps || !mvmvif->pm_enabled) |
380 | (iwl_mvm_vif_low_latency(mvmvif) && vif->p2p)) | 381 | return; |
382 | |||
383 | if (iwl_mvm_vif_low_latency(mvmvif) && vif->p2p && | ||
384 | (!fw_has_capa(&mvm->fw->ucode_capa, | ||
385 | IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS) || | ||
386 | !IWL_MVM_P2P_LOWLATENCY_PS_ENABLE)) | ||
381 | return; | 387 | return; |
382 | 388 | ||
383 | cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK); | 389 | cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK); |
@@ -389,19 +395,25 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, | |||
389 | cmd->lprx_rssi_threshold = POWER_LPRX_RSSI_THRESHOLD; | 395 | cmd->lprx_rssi_threshold = POWER_LPRX_RSSI_THRESHOLD; |
390 | } | 396 | } |
391 | 397 | ||
392 | iwl_mvm_power_config_skip_dtim(mvm, vif, cmd, | 398 | iwl_mvm_power_config_skip_dtim(mvm, vif, cmd, host_awake); |
393 | mvm->cur_ucode != IWL_UCODE_WOWLAN); | ||
394 | 399 | ||
395 | if (mvm->cur_ucode != IWL_UCODE_WOWLAN) { | 400 | if (!host_awake) { |
396 | cmd->rx_data_timeout = | 401 | cmd->rx_data_timeout = |
397 | cpu_to_le32(IWL_MVM_DEFAULT_PS_RX_DATA_TIMEOUT); | 402 | cpu_to_le32(IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT); |
398 | cmd->tx_data_timeout = | 403 | cmd->tx_data_timeout = |
399 | cpu_to_le32(IWL_MVM_DEFAULT_PS_TX_DATA_TIMEOUT); | 404 | cpu_to_le32(IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT); |
405 | } else if (iwl_mvm_vif_low_latency(mvmvif) && vif->p2p && | ||
406 | fw_has_capa(&mvm->fw->ucode_capa, | ||
407 | IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS)) { | ||
408 | cmd->tx_data_timeout = | ||
409 | cpu_to_le32(IWL_MVM_SHORT_PS_TX_DATA_TIMEOUT); | ||
410 | cmd->rx_data_timeout = | ||
411 | cpu_to_le32(IWL_MVM_SHORT_PS_RX_DATA_TIMEOUT); | ||
400 | } else { | 412 | } else { |
401 | cmd->rx_data_timeout = | 413 | cmd->rx_data_timeout = |
402 | cpu_to_le32(IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT); | 414 | cpu_to_le32(IWL_MVM_DEFAULT_PS_RX_DATA_TIMEOUT); |
403 | cmd->tx_data_timeout = | 415 | cmd->tx_data_timeout = |
404 | cpu_to_le32(IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT); | 416 | cpu_to_le32(IWL_MVM_DEFAULT_PS_TX_DATA_TIMEOUT); |
405 | } | 417 | } |
406 | 418 | ||
407 | if (iwl_mvm_power_allow_uapsd(mvm, vif)) | 419 | if (iwl_mvm_power_allow_uapsd(mvm, vif)) |
@@ -458,7 +470,8 @@ static int iwl_mvm_power_send_cmd(struct iwl_mvm *mvm, | |||
458 | { | 470 | { |
459 | struct iwl_mac_power_cmd cmd = {}; | 471 | struct iwl_mac_power_cmd cmd = {}; |
460 | 472 | ||
461 | iwl_mvm_power_build_cmd(mvm, vif, &cmd); | 473 | iwl_mvm_power_build_cmd(mvm, vif, &cmd, |
474 | mvm->cur_ucode != IWL_UCODE_WOWLAN); | ||
462 | iwl_mvm_power_log(mvm, &cmd); | 475 | iwl_mvm_power_log(mvm, &cmd); |
463 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 476 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
464 | memcpy(&iwl_mvm_vif_from_mac80211(vif)->mac_pwr_cmd, &cmd, sizeof(cmd)); | 477 | memcpy(&iwl_mvm_vif_from_mac80211(vif)->mac_pwr_cmd, &cmd, sizeof(cmd)); |
@@ -994,11 +1007,7 @@ int iwl_mvm_update_d0i3_power_mode(struct iwl_mvm *mvm, | |||
994 | if (!vif->bss_conf.assoc) | 1007 | if (!vif->bss_conf.assoc) |
995 | return 0; | 1008 | return 0; |
996 | 1009 | ||
997 | iwl_mvm_power_build_cmd(mvm, vif, &cmd); | 1010 | iwl_mvm_power_build_cmd(mvm, vif, &cmd, !enable); |
998 | |||
999 | /* when enabling D0i3, override the skip-over-dtim configuration */ | ||
1000 | if (enable) | ||
1001 | iwl_mvm_power_config_skip_dtim(mvm, vif, &cmd, false); | ||
1002 | 1011 | ||
1003 | iwl_mvm_power_log(mvm, &cmd); | 1012 | iwl_mvm_power_log(mvm, &cmd); |
1004 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 1013 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c index 34d98b26a215..d1ad10391b47 100644 --- a/drivers/net/wireless/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/iwlwifi/mvm/rs.c | |||
@@ -177,9 +177,6 @@ static bool rs_mimo_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | |||
177 | 177 | ||
178 | mvmsta = iwl_mvm_sta_from_mac80211(sta); | 178 | mvmsta = iwl_mvm_sta_from_mac80211(sta); |
179 | mvmvif = iwl_mvm_vif_from_mac80211(mvmsta->vif); | 179 | mvmvif = iwl_mvm_vif_from_mac80211(mvmsta->vif); |
180 | if (IWL_MVM_RS_DISABLE_P2P_MIMO && | ||
181 | iwl_mvm_vif_low_latency(mvmvif) && mvmsta->vif->p2p) | ||
182 | return false; | ||
183 | 180 | ||
184 | if (mvm->nvm_data->sku_cap_mimo_disabled) | 181 | if (mvm->nvm_data->sku_cap_mimo_disabled) |
185 | return false; | 182 | return false; |
@@ -3071,9 +3068,6 @@ void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | |||
3071 | else | 3068 | else |
3072 | rs_vht_init(mvm, sta, lq_sta, vht_cap); | 3069 | rs_vht_init(mvm, sta, lq_sta, vht_cap); |
3073 | 3070 | ||
3074 | if (IWL_MVM_RS_DISABLE_P2P_MIMO && sta_priv->vif->p2p) | ||
3075 | lq_sta->active_mimo2_rate = 0; | ||
3076 | |||
3077 | lq_sta->max_legacy_rate_idx = | 3071 | lq_sta->max_legacy_rate_idx = |
3078 | rs_get_max_rate_from_mask(lq_sta->active_legacy_rate); | 3072 | rs_get_max_rate_from_mask(lq_sta->active_legacy_rate); |
3079 | lq_sta->max_siso_rate_idx = | 3073 | lq_sta->max_siso_rate_idx = |
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index cee4f267ca66..d6e0c1b5c20c 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c | |||
@@ -131,7 +131,6 @@ struct iwl_mvm_scan_params { | |||
131 | int n_ssids; | 131 | int n_ssids; |
132 | struct cfg80211_ssid *ssids; | 132 | struct cfg80211_ssid *ssids; |
133 | struct ieee80211_channel **channels; | 133 | struct ieee80211_channel **channels; |
134 | u16 interval; /* interval between scans (in secs) */ | ||
135 | u32 flags; | 134 | u32 flags; |
136 | u8 *mac_addr; | 135 | u8 *mac_addr; |
137 | u8 *mac_addr_mask; | 136 | u8 *mac_addr_mask; |
@@ -140,7 +139,8 @@ struct iwl_mvm_scan_params { | |||
140 | int n_match_sets; | 139 | int n_match_sets; |
141 | struct iwl_scan_probe_req preq; | 140 | struct iwl_scan_probe_req preq; |
142 | struct cfg80211_match_set *match_sets; | 141 | struct cfg80211_match_set *match_sets; |
143 | u8 iterations[2]; | 142 | int n_scan_plans; |
143 | struct cfg80211_sched_scan_plan *scan_plans; | ||
144 | }; | 144 | }; |
145 | 145 | ||
146 | static u8 iwl_mvm_scan_rx_ant(struct iwl_mvm *mvm) | 146 | static u8 iwl_mvm_scan_rx_ant(struct iwl_mvm *mvm) |
@@ -474,7 +474,7 @@ iwl_mvm_config_sched_scan_profiles(struct iwl_mvm *mvm, | |||
474 | int ret; | 474 | int ret; |
475 | 475 | ||
476 | if (WARN_ON(req->n_match_sets > IWL_SCAN_MAX_PROFILES)) | 476 | if (WARN_ON(req->n_match_sets > IWL_SCAN_MAX_PROFILES)) |
477 | return -EIO; | 477 | return -EIO; |
478 | 478 | ||
479 | if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_SHORT_BL) | 479 | if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_SHORT_BL) |
480 | blacklist_len = IWL_SCAN_SHORT_BLACKLIST_LEN; | 480 | blacklist_len = IWL_SCAN_SHORT_BLACKLIST_LEN; |
@@ -737,8 +737,7 @@ static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids, | |||
737 | } | 737 | } |
738 | 738 | ||
739 | static inline bool iwl_mvm_scan_use_ebs(struct iwl_mvm *mvm, | 739 | static inline bool iwl_mvm_scan_use_ebs(struct iwl_mvm *mvm, |
740 | struct ieee80211_vif *vif, | 740 | struct ieee80211_vif *vif) |
741 | int n_iterations) | ||
742 | { | 741 | { |
743 | const struct iwl_ucode_capabilities *capa = &mvm->fw->ucode_capa; | 742 | const struct iwl_ucode_capabilities *capa = &mvm->fw->ucode_capa; |
744 | 743 | ||
@@ -753,11 +752,6 @@ static inline bool iwl_mvm_scan_use_ebs(struct iwl_mvm *mvm, | |||
753 | vif->type != NL80211_IFTYPE_P2P_DEVICE); | 752 | vif->type != NL80211_IFTYPE_P2P_DEVICE); |
754 | } | 753 | } |
755 | 754 | ||
756 | static int iwl_mvm_scan_total_iterations(struct iwl_mvm_scan_params *params) | ||
757 | { | ||
758 | return params->iterations[0] + params->iterations[1]; | ||
759 | } | ||
760 | |||
761 | static int iwl_mvm_scan_lmac_flags(struct iwl_mvm *mvm, | 755 | static int iwl_mvm_scan_lmac_flags(struct iwl_mvm *mvm, |
762 | struct iwl_mvm_scan_params *params) | 756 | struct iwl_mvm_scan_params *params) |
763 | { | 757 | { |
@@ -796,12 +790,15 @@ static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
796 | (void *)(cmd->data + sizeof(struct iwl_scan_channel_cfg_lmac) * | 790 | (void *)(cmd->data + sizeof(struct iwl_scan_channel_cfg_lmac) * |
797 | mvm->fw->ucode_capa.n_scan_channels); | 791 | mvm->fw->ucode_capa.n_scan_channels); |
798 | u32 ssid_bitmap = 0; | 792 | u32 ssid_bitmap = 0; |
799 | int n_iterations = iwl_mvm_scan_total_iterations(params); | 793 | int i; |
800 | 794 | ||
801 | lockdep_assert_held(&mvm->mutex); | 795 | lockdep_assert_held(&mvm->mutex); |
802 | 796 | ||
803 | memset(cmd, 0, ksize(cmd)); | 797 | memset(cmd, 0, ksize(cmd)); |
804 | 798 | ||
799 | if (WARN_ON(params->n_scan_plans > IWL_MAX_SCHED_SCAN_PLANS)) | ||
800 | return -EINVAL; | ||
801 | |||
805 | iwl_mvm_scan_lmac_dwell(mvm, cmd, params); | 802 | iwl_mvm_scan_lmac_dwell(mvm, cmd, params); |
806 | 803 | ||
807 | cmd->rx_chain_select = iwl_mvm_scan_rx_chain(mvm); | 804 | cmd->rx_chain_select = iwl_mvm_scan_rx_chain(mvm); |
@@ -821,14 +818,26 @@ static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
821 | /* this API uses bits 1-20 instead of 0-19 */ | 818 | /* this API uses bits 1-20 instead of 0-19 */ |
822 | ssid_bitmap <<= 1; | 819 | ssid_bitmap <<= 1; |
823 | 820 | ||
824 | cmd->schedule[0].delay = cpu_to_le16(params->interval); | 821 | for (i = 0; i < params->n_scan_plans; i++) { |
825 | cmd->schedule[0].iterations = params->iterations[0]; | 822 | struct cfg80211_sched_scan_plan *scan_plan = |
826 | cmd->schedule[0].full_scan_mul = 1; | 823 | ¶ms->scan_plans[i]; |
827 | cmd->schedule[1].delay = cpu_to_le16(params->interval); | 824 | |
828 | cmd->schedule[1].iterations = params->iterations[1]; | 825 | cmd->schedule[i].delay = |
829 | cmd->schedule[1].full_scan_mul = 1; | 826 | cpu_to_le16(scan_plan->interval); |
827 | cmd->schedule[i].iterations = scan_plan->iterations; | ||
828 | cmd->schedule[i].full_scan_mul = 1; | ||
829 | } | ||
830 | |||
831 | /* | ||
832 | * If the number of iterations of the last scan plan is set to | ||
833 | * zero, it should run infinitely. However, this is not always the case. | ||
834 | * For example, when regular scan is requested the driver sets one scan | ||
835 | * plan with one iteration. | ||
836 | */ | ||
837 | if (!cmd->schedule[i - 1].iterations) | ||
838 | cmd->schedule[i - 1].iterations = 0xff; | ||
830 | 839 | ||
831 | if (iwl_mvm_scan_use_ebs(mvm, vif, n_iterations)) { | 840 | if (iwl_mvm_scan_use_ebs(mvm, vif)) { |
832 | cmd->channel_opt[0].flags = | 841 | cmd->channel_opt[0].flags = |
833 | cpu_to_le16(IWL_SCAN_CHANNEL_FLAG_EBS | | 842 | cpu_to_le16(IWL_SCAN_CHANNEL_FLAG_EBS | |
834 | IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE | | 843 | IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE | |
@@ -892,7 +901,6 @@ static __le32 iwl_mvm_scan_config_rates(struct iwl_mvm *mvm) | |||
892 | 901 | ||
893 | int iwl_mvm_config_scan(struct iwl_mvm *mvm) | 902 | int iwl_mvm_config_scan(struct iwl_mvm *mvm) |
894 | { | 903 | { |
895 | |||
896 | struct iwl_scan_config *scan_config; | 904 | struct iwl_scan_config *scan_config; |
897 | struct ieee80211_supported_band *band; | 905 | struct ieee80211_supported_band *band; |
898 | int num_channels = | 906 | int num_channels = |
@@ -968,6 +976,12 @@ static int iwl_mvm_scan_uid_by_status(struct iwl_mvm *mvm, int status) | |||
968 | return -ENOENT; | 976 | return -ENOENT; |
969 | } | 977 | } |
970 | 978 | ||
979 | static inline bool iwl_mvm_is_regular_scan(struct iwl_mvm_scan_params *params) | ||
980 | { | ||
981 | return params->n_scan_plans == 1 && | ||
982 | params->scan_plans[0].iterations == 1; | ||
983 | } | ||
984 | |||
971 | static void iwl_mvm_scan_umac_dwell(struct iwl_mvm *mvm, | 985 | static void iwl_mvm_scan_umac_dwell(struct iwl_mvm *mvm, |
972 | struct iwl_scan_req_umac *cmd, | 986 | struct iwl_scan_req_umac *cmd, |
973 | struct iwl_mvm_scan_params *params) | 987 | struct iwl_mvm_scan_params *params) |
@@ -980,7 +994,7 @@ static void iwl_mvm_scan_umac_dwell(struct iwl_mvm *mvm, | |||
980 | cmd->scan_priority = | 994 | cmd->scan_priority = |
981 | iwl_mvm_scan_priority(mvm, IWL_SCAN_PRIORITY_EXT_6); | 995 | iwl_mvm_scan_priority(mvm, IWL_SCAN_PRIORITY_EXT_6); |
982 | 996 | ||
983 | if (iwl_mvm_scan_total_iterations(params) == 1) | 997 | if (iwl_mvm_is_regular_scan(params)) |
984 | cmd->ooc_priority = | 998 | cmd->ooc_priority = |
985 | iwl_mvm_scan_priority(mvm, IWL_SCAN_PRIORITY_EXT_6); | 999 | iwl_mvm_scan_priority(mvm, IWL_SCAN_PRIORITY_EXT_6); |
986 | else | 1000 | else |
@@ -1027,7 +1041,7 @@ static u32 iwl_mvm_scan_umac_flags(struct iwl_mvm *mvm, | |||
1027 | else | 1041 | else |
1028 | flags |= IWL_UMAC_SCAN_GEN_FLAGS_MATCH; | 1042 | flags |= IWL_UMAC_SCAN_GEN_FLAGS_MATCH; |
1029 | 1043 | ||
1030 | if (iwl_mvm_scan_total_iterations(params) > 1) | 1044 | if (!iwl_mvm_is_regular_scan(params)) |
1031 | flags |= IWL_UMAC_SCAN_GEN_FLAGS_PERIODIC; | 1045 | flags |= IWL_UMAC_SCAN_GEN_FLAGS_PERIODIC; |
1032 | 1046 | ||
1033 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 1047 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
@@ -1045,12 +1059,14 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
1045 | struct iwl_scan_req_umac_tail *sec_part = (void *)&cmd->data + | 1059 | struct iwl_scan_req_umac_tail *sec_part = (void *)&cmd->data + |
1046 | sizeof(struct iwl_scan_channel_cfg_umac) * | 1060 | sizeof(struct iwl_scan_channel_cfg_umac) * |
1047 | mvm->fw->ucode_capa.n_scan_channels; | 1061 | mvm->fw->ucode_capa.n_scan_channels; |
1048 | int uid; | 1062 | int uid, i; |
1049 | u32 ssid_bitmap = 0; | 1063 | u32 ssid_bitmap = 0; |
1050 | int n_iterations = iwl_mvm_scan_total_iterations(params); | ||
1051 | 1064 | ||
1052 | lockdep_assert_held(&mvm->mutex); | 1065 | lockdep_assert_held(&mvm->mutex); |
1053 | 1066 | ||
1067 | if (WARN_ON(params->n_scan_plans > IWL_MAX_SCHED_SCAN_PLANS)) | ||
1068 | return -EINVAL; | ||
1069 | |||
1054 | uid = iwl_mvm_scan_uid_by_status(mvm, 0); | 1070 | uid = iwl_mvm_scan_uid_by_status(mvm, 0); |
1055 | if (uid < 0) | 1071 | if (uid < 0) |
1056 | return uid; | 1072 | return uid; |
@@ -1067,7 +1083,7 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
1067 | if (type == IWL_MVM_SCAN_SCHED) | 1083 | if (type == IWL_MVM_SCAN_SCHED) |
1068 | cmd->flags = cpu_to_le32(IWL_UMAC_SCAN_FLAG_PREEMPTIVE); | 1084 | cmd->flags = cpu_to_le32(IWL_UMAC_SCAN_FLAG_PREEMPTIVE); |
1069 | 1085 | ||
1070 | if (iwl_mvm_scan_use_ebs(mvm, vif, n_iterations)) | 1086 | if (iwl_mvm_scan_use_ebs(mvm, vif)) |
1071 | cmd->channel_flags = IWL_SCAN_CHANNEL_FLAG_EBS | | 1087 | cmd->channel_flags = IWL_SCAN_CHANNEL_FLAG_EBS | |
1072 | IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE | | 1088 | IWL_SCAN_CHANNEL_FLAG_EBS_ACCURATE | |
1073 | IWL_SCAN_CHANNEL_FLAG_CACHE_ADD; | 1089 | IWL_SCAN_CHANNEL_FLAG_CACHE_ADD; |
@@ -1079,12 +1095,23 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
1079 | iwl_mvm_umac_scan_cfg_channels(mvm, params->channels, | 1095 | iwl_mvm_umac_scan_cfg_channels(mvm, params->channels, |
1080 | params->n_channels, ssid_bitmap, cmd); | 1096 | params->n_channels, ssid_bitmap, cmd); |
1081 | 1097 | ||
1082 | /* With UMAC we use only one schedule for now, so use the sum | 1098 | for (i = 0; i < params->n_scan_plans; i++) { |
1083 | * of the iterations (with a a maximum of 255). | 1099 | struct cfg80211_sched_scan_plan *scan_plan = |
1100 | ¶ms->scan_plans[i]; | ||
1101 | |||
1102 | sec_part->schedule[i].iter_count = scan_plan->iterations; | ||
1103 | sec_part->schedule[i].interval = | ||
1104 | cpu_to_le16(scan_plan->interval); | ||
1105 | } | ||
1106 | |||
1107 | /* | ||
1108 | * If the number of iterations of the last scan plan is set to | ||
1109 | * zero, it should run infinitely. However, this is not always the case. | ||
1110 | * For example, when regular scan is requested the driver sets one scan | ||
1111 | * plan with one iteration. | ||
1084 | */ | 1112 | */ |
1085 | sec_part->schedule[0].iter_count = | 1113 | if (!sec_part->schedule[i - 1].iter_count) |
1086 | (n_iterations > 255) ? 255 : n_iterations; | 1114 | sec_part->schedule[i - 1].iter_count = 0xff; |
1087 | sec_part->schedule[0].interval = cpu_to_le16(params->interval); | ||
1088 | 1115 | ||
1089 | sec_part->delay = cpu_to_le16(params->delay); | 1116 | sec_part->delay = cpu_to_le16(params->delay); |
1090 | sec_part->preq = params->preq; | 1117 | sec_part->preq = params->preq; |
@@ -1150,6 +1177,7 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
1150 | }; | 1177 | }; |
1151 | struct iwl_mvm_scan_params params = {}; | 1178 | struct iwl_mvm_scan_params params = {}; |
1152 | int ret; | 1179 | int ret; |
1180 | struct cfg80211_sched_scan_plan scan_plan = { .iterations = 1 }; | ||
1153 | 1181 | ||
1154 | lockdep_assert_held(&mvm->mutex); | 1182 | lockdep_assert_held(&mvm->mutex); |
1155 | 1183 | ||
@@ -1162,8 +1190,6 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
1162 | if (ret) | 1190 | if (ret) |
1163 | return ret; | 1191 | return ret; |
1164 | 1192 | ||
1165 | iwl_mvm_ref(mvm, IWL_MVM_REF_SCAN); | ||
1166 | |||
1167 | /* we should have failed registration if scan_cmd was NULL */ | 1193 | /* we should have failed registration if scan_cmd was NULL */ |
1168 | if (WARN_ON(!mvm->scan_cmd)) | 1194 | if (WARN_ON(!mvm->scan_cmd)) |
1169 | return -ENOMEM; | 1195 | return -ENOMEM; |
@@ -1175,7 +1201,6 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
1175 | params.flags = req->flags; | 1201 | params.flags = req->flags; |
1176 | params.n_channels = req->n_channels; | 1202 | params.n_channels = req->n_channels; |
1177 | params.delay = 0; | 1203 | params.delay = 0; |
1178 | params.interval = 0; | ||
1179 | params.ssids = req->ssids; | 1204 | params.ssids = req->ssids; |
1180 | params.channels = req->channels; | 1205 | params.channels = req->channels; |
1181 | params.mac_addr = req->mac_addr; | 1206 | params.mac_addr = req->mac_addr; |
@@ -1185,8 +1210,8 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
1185 | params.n_match_sets = 0; | 1210 | params.n_match_sets = 0; |
1186 | params.match_sets = NULL; | 1211 | params.match_sets = NULL; |
1187 | 1212 | ||
1188 | params.iterations[0] = 1; | 1213 | params.scan_plans = &scan_plan; |
1189 | params.iterations[1] = 0; | 1214 | params.n_scan_plans = 1; |
1190 | 1215 | ||
1191 | params.type = iwl_mvm_get_scan_type(mvm, vif, ¶ms); | 1216 | params.type = iwl_mvm_get_scan_type(mvm, vif, ¶ms); |
1192 | 1217 | ||
@@ -1205,21 +1230,20 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
1205 | return ret; | 1230 | return ret; |
1206 | 1231 | ||
1207 | ret = iwl_mvm_send_cmd(mvm, &hcmd); | 1232 | ret = iwl_mvm_send_cmd(mvm, &hcmd); |
1208 | if (!ret) { | 1233 | if (ret) { |
1209 | IWL_DEBUG_SCAN(mvm, "Scan request was sent successfully\n"); | ||
1210 | mvm->scan_status |= IWL_MVM_SCAN_REGULAR; | ||
1211 | } else { | ||
1212 | /* If the scan failed, it usually means that the FW was unable | 1234 | /* If the scan failed, it usually means that the FW was unable |
1213 | * to allocate the time events. Warn on it, but maybe we | 1235 | * to allocate the time events. Warn on it, but maybe we |
1214 | * should try to send the command again with different params. | 1236 | * should try to send the command again with different params. |
1215 | */ | 1237 | */ |
1216 | IWL_ERR(mvm, "Scan failed! ret %d\n", ret); | 1238 | IWL_ERR(mvm, "Scan failed! ret %d\n", ret); |
1239 | return ret; | ||
1217 | } | 1240 | } |
1218 | 1241 | ||
1219 | if (ret) | 1242 | IWL_DEBUG_SCAN(mvm, "Scan request was sent successfully\n"); |
1220 | iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN); | 1243 | mvm->scan_status |= IWL_MVM_SCAN_REGULAR; |
1244 | iwl_mvm_ref(mvm, IWL_MVM_REF_SCAN); | ||
1221 | 1245 | ||
1222 | return ret; | 1246 | return 0; |
1223 | } | 1247 | } |
1224 | 1248 | ||
1225 | int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, | 1249 | int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, |
@@ -1265,20 +1289,14 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, | |||
1265 | params.pass_all = iwl_mvm_scan_pass_all(mvm, req); | 1289 | params.pass_all = iwl_mvm_scan_pass_all(mvm, req); |
1266 | params.n_match_sets = req->n_match_sets; | 1290 | params.n_match_sets = req->n_match_sets; |
1267 | params.match_sets = req->match_sets; | 1291 | params.match_sets = req->match_sets; |
1292 | if (!req->n_scan_plans) | ||
1293 | return -EINVAL; | ||
1268 | 1294 | ||
1269 | params.iterations[0] = 0; | 1295 | params.n_scan_plans = req->n_scan_plans; |
1270 | params.iterations[1] = 0xff; | 1296 | params.scan_plans = req->scan_plans; |
1271 | 1297 | ||
1272 | params.type = iwl_mvm_get_scan_type(mvm, vif, ¶ms); | 1298 | params.type = iwl_mvm_get_scan_type(mvm, vif, ¶ms); |
1273 | 1299 | ||
1274 | if (req->scan_plans[0].interval > U16_MAX) { | ||
1275 | IWL_DEBUG_SCAN(mvm, | ||
1276 | "interval value is > 16-bits, set to max possible\n"); | ||
1277 | params.interval = U16_MAX; | ||
1278 | } else { | ||
1279 | params.interval = req->scan_plans[0].interval; | ||
1280 | } | ||
1281 | |||
1282 | /* In theory, LMAC scans can handle a 32-bit delay, but since | 1300 | /* In theory, LMAC scans can handle a 32-bit delay, but since |
1283 | * waiting for over 18 hours to start the scan is a bit silly | 1301 | * waiting for over 18 hours to start the scan is a bit silly |
1284 | * and to keep it aligned with UMAC scans (which only support | 1302 | * and to keep it aligned with UMAC scans (which only support |
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c index a9a3eb6a1f8a..300a249486e4 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/iwlwifi/mvm/sta.c | |||
@@ -255,7 +255,7 @@ static void iwl_mvm_tdls_sta_deinit(struct iwl_mvm *mvm, | |||
255 | /* disable the TDLS STA-specific queues */ | 255 | /* disable the TDLS STA-specific queues */ |
256 | sta_msk = mvmsta->tfd_queue_msk; | 256 | sta_msk = mvmsta->tfd_queue_msk; |
257 | for_each_set_bit(i, &sta_msk, sizeof(sta_msk) * BITS_PER_BYTE) | 257 | for_each_set_bit(i, &sta_msk, sizeof(sta_msk) * BITS_PER_BYTE) |
258 | iwl_mvm_disable_txq(mvm, i, i, 0, 0); | 258 | iwl_mvm_disable_txq(mvm, i, i, IWL_MAX_TID_COUNT, 0); |
259 | } | 259 | } |
260 | 260 | ||
261 | int iwl_mvm_add_sta(struct iwl_mvm *mvm, | 261 | int iwl_mvm_add_sta(struct iwl_mvm *mvm, |
@@ -474,7 +474,8 @@ void iwl_mvm_sta_drained_wk(struct work_struct *wk) | |||
474 | unsigned long i, msk = mvm->tfd_drained[sta_id]; | 474 | unsigned long i, msk = mvm->tfd_drained[sta_id]; |
475 | 475 | ||
476 | for_each_set_bit(i, &msk, sizeof(msk) * BITS_PER_BYTE) | 476 | for_each_set_bit(i, &msk, sizeof(msk) * BITS_PER_BYTE) |
477 | iwl_mvm_disable_txq(mvm, i, i, 0, 0); | 477 | iwl_mvm_disable_txq(mvm, i, i, |
478 | IWL_MAX_TID_COUNT, 0); | ||
478 | 479 | ||
479 | mvm->tfd_drained[sta_id] = 0; | 480 | mvm->tfd_drained[sta_id] = 0; |
480 | IWL_DEBUG_TDLS(mvm, "Drained sta %d, with queues %ld\n", | 481 | IWL_DEBUG_TDLS(mvm, "Drained sta %d, with queues %ld\n", |
@@ -501,7 +502,7 @@ int iwl_mvm_rm_sta(struct iwl_mvm *mvm, | |||
501 | if (ret) | 502 | if (ret) |
502 | return ret; | 503 | return ret; |
503 | /* flush its queues here since we are freeing mvm_sta */ | 504 | /* flush its queues here since we are freeing mvm_sta */ |
504 | ret = iwl_mvm_flush_tx_path(mvm, mvm_sta->tfd_queue_msk, true); | 505 | ret = iwl_mvm_flush_tx_path(mvm, mvm_sta->tfd_queue_msk, 0); |
505 | if (ret) | 506 | if (ret) |
506 | return ret; | 507 | return ret; |
507 | ret = iwl_trans_wait_tx_queue_empty(mvm->trans, | 508 | ret = iwl_trans_wait_tx_queue_empty(mvm->trans, |
@@ -1155,7 +1156,7 @@ int iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
1155 | 1156 | ||
1156 | if (old_state >= IWL_AGG_ON) { | 1157 | if (old_state >= IWL_AGG_ON) { |
1157 | iwl_mvm_drain_sta(mvm, mvmsta, true); | 1158 | iwl_mvm_drain_sta(mvm, mvmsta, true); |
1158 | if (iwl_mvm_flush_tx_path(mvm, BIT(txq_id), true)) | 1159 | if (iwl_mvm_flush_tx_path(mvm, BIT(txq_id), 0)) |
1159 | IWL_ERR(mvm, "Couldn't flush the AGG queue\n"); | 1160 | IWL_ERR(mvm, "Couldn't flush the AGG queue\n"); |
1160 | iwl_trans_wait_tx_queue_empty(mvm->trans, | 1161 | iwl_trans_wait_tx_queue_empty(mvm->trans, |
1161 | mvmsta->tfd_queue_msk); | 1162 | mvmsta->tfd_queue_msk); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/time-event.c b/drivers/net/wireless/iwlwifi/mvm/time-event.c index dbd7d544575d..7530eb23035d 100644 --- a/drivers/net/wireless/iwlwifi/mvm/time-event.c +++ b/drivers/net/wireless/iwlwifi/mvm/time-event.c | |||
@@ -129,7 +129,7 @@ void iwl_mvm_roc_done_wk(struct work_struct *wk) | |||
129 | * issue as it will have to complete before the next command is | 129 | * issue as it will have to complete before the next command is |
130 | * executed, and a new time event means a new command. | 130 | * executed, and a new time event means a new command. |
131 | */ | 131 | */ |
132 | iwl_mvm_flush_tx_path(mvm, queues, false); | 132 | iwl_mvm_flush_tx_path(mvm, queues, CMD_ASYNC); |
133 | } | 133 | } |
134 | 134 | ||
135 | static void iwl_mvm_roc_finished(struct iwl_mvm *mvm) | 135 | static void iwl_mvm_roc_finished(struct iwl_mvm *mvm) |
diff --git a/drivers/net/wireless/iwlwifi/mvm/tt.c b/drivers/net/wireless/iwlwifi/mvm/tt.c index 58b762f1e0b5..cadfc0460597 100644 --- a/drivers/net/wireless/iwlwifi/mvm/tt.c +++ b/drivers/net/wireless/iwlwifi/mvm/tt.c | |||
@@ -176,6 +176,9 @@ static int iwl_mvm_get_temp_cmd(struct iwl_mvm *mvm) | |||
176 | struct iwl_dts_measurement_cmd cmd = { | 176 | struct iwl_dts_measurement_cmd cmd = { |
177 | .flags = cpu_to_le32(DTS_TRIGGER_CMD_FLAGS_TEMP), | 177 | .flags = cpu_to_le32(DTS_TRIGGER_CMD_FLAGS_TEMP), |
178 | }; | 178 | }; |
179 | struct iwl_ext_dts_measurement_cmd extcmd = { | ||
180 | .control_mode = cpu_to_le32(DTS_AUTOMATIC), | ||
181 | }; | ||
179 | u32 cmdid; | 182 | u32 cmdid; |
180 | 183 | ||
181 | if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_WIDE_CMD_HDR)) | 184 | if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_WIDE_CMD_HDR)) |
@@ -183,8 +186,12 @@ static int iwl_mvm_get_temp_cmd(struct iwl_mvm *mvm) | |||
183 | PHY_OPS_GROUP, 0); | 186 | PHY_OPS_GROUP, 0); |
184 | else | 187 | else |
185 | cmdid = CMD_DTS_MEASUREMENT_TRIGGER; | 188 | cmdid = CMD_DTS_MEASUREMENT_TRIGGER; |
186 | return iwl_mvm_send_cmd_pdu(mvm, cmdid, 0, | 189 | |
187 | sizeof(cmd), &cmd); | 190 | if (!fw_has_capa(&mvm->fw->ucode_capa, |
191 | IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE)) | ||
192 | return iwl_mvm_send_cmd_pdu(mvm, cmdid, 0, sizeof(cmd), &cmd); | ||
193 | |||
194 | return iwl_mvm_send_cmd_pdu(mvm, cmdid, 0, sizeof(extcmd), &extcmd); | ||
188 | } | 195 | } |
189 | 196 | ||
190 | int iwl_mvm_get_temp(struct iwl_mvm *mvm) | 197 | int iwl_mvm_get_temp(struct iwl_mvm *mvm) |
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c index ff8b9bdef7e8..c652a66be803 100644 --- a/drivers/net/wireless/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/iwlwifi/mvm/tx.c | |||
@@ -1099,7 +1099,7 @@ out: | |||
1099 | * 2) flush the Tx path | 1099 | * 2) flush the Tx path |
1100 | * 3) wait for the transport queues to be empty | 1100 | * 3) wait for the transport queues to be empty |
1101 | */ | 1101 | */ |
1102 | int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk, bool sync) | 1102 | int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk, u32 flags) |
1103 | { | 1103 | { |
1104 | int ret; | 1104 | int ret; |
1105 | struct iwl_tx_path_flush_cmd flush_cmd = { | 1105 | struct iwl_tx_path_flush_cmd flush_cmd = { |
@@ -1107,8 +1107,6 @@ int iwl_mvm_flush_tx_path(struct iwl_mvm *mvm, u32 tfd_msk, bool sync) | |||
1107 | .flush_ctl = cpu_to_le16(DUMP_TX_FIFO_FLUSH), | 1107 | .flush_ctl = cpu_to_le16(DUMP_TX_FIFO_FLUSH), |
1108 | }; | 1108 | }; |
1109 | 1109 | ||
1110 | u32 flags = sync ? 0 : CMD_ASYNC; | ||
1111 | |||
1112 | ret = iwl_mvm_send_cmd_pdu(mvm, TXPATH_FLUSH, flags, | 1110 | ret = iwl_mvm_send_cmd_pdu(mvm, TXPATH_FLUSH, flags, |
1113 | sizeof(flush_cmd), &flush_cmd); | 1111 | sizeof(flush_cmd), &flush_cmd); |
1114 | if (ret) | 1112 | if (ret) |
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 6ba7d300b08f..90283453073c 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -592,10 +592,8 @@ static int iwl_pcie_prepare_card_hw(struct iwl_trans *trans) | |||
592 | 592 | ||
593 | do { | 593 | do { |
594 | ret = iwl_pcie_set_hw_ready(trans); | 594 | ret = iwl_pcie_set_hw_ready(trans); |
595 | if (ret >= 0) { | 595 | if (ret >= 0) |
596 | ret = 0; | 596 | return 0; |
597 | goto out; | ||
598 | } | ||
599 | 597 | ||
600 | usleep_range(200, 1000); | 598 | usleep_range(200, 1000); |
601 | t += 200; | 599 | t += 200; |
@@ -605,10 +603,6 @@ static int iwl_pcie_prepare_card_hw(struct iwl_trans *trans) | |||
605 | 603 | ||
606 | IWL_ERR(trans, "Couldn't prepare the card\n"); | 604 | IWL_ERR(trans, "Couldn't prepare the card\n"); |
607 | 605 | ||
608 | out: | ||
609 | iwl_clear_bit(trans, CSR_DBG_LINK_PWR_MGMT_REG, | ||
610 | CSR_RESET_LINK_PWR_MGMT_DISABLED); | ||
611 | |||
612 | return ret; | 606 | return ret; |
613 | } | 607 | } |
614 | 608 | ||