Commit 208d271a authored by Emmanuel Grumbach's avatar Emmanuel Grumbach

Merge branch 'iwlwifi-fixes' into iwlwifi-next

parents e111e968 060b4460
...@@ -1114,16 +1114,17 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -1114,16 +1114,17 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
scd_queues &= ~(BIT(IWL_IPAN_CMD_QUEUE_NUM) | scd_queues &= ~(BIT(IWL_IPAN_CMD_QUEUE_NUM) |
BIT(IWL_DEFAULT_CMD_QUEUE_NUM)); BIT(IWL_DEFAULT_CMD_QUEUE_NUM));
if (vif) if (drop) {
scd_queues &= ~BIT(vif->hw_queue[IEEE80211_AC_VO]); IWL_DEBUG_TX_QUEUES(priv, "Flushing SCD queues: 0x%x\n",
scd_queues);
IWL_DEBUG_TX_QUEUES(priv, "Flushing SCD queues: 0x%x\n", scd_queues); if (iwlagn_txfifo_flush(priv, scd_queues)) {
if (iwlagn_txfifo_flush(priv, scd_queues)) { IWL_ERR(priv, "flush request fail\n");
IWL_ERR(priv, "flush request fail\n"); goto done;
goto done; }
} }
IWL_DEBUG_TX_QUEUES(priv, "wait transmit/flush all frames\n"); IWL_DEBUG_TX_QUEUES(priv, "wait transmit/flush all frames\n");
iwl_trans_wait_tx_queue_empty(priv->trans, 0xffffffff); iwl_trans_wait_tx_queue_empty(priv->trans, scd_queues);
done: done:
mutex_unlock(&priv->mutex); mutex_unlock(&priv->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n"); IWL_DEBUG_MAC80211(priv, "leave\n");
......
...@@ -579,7 +579,8 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac, ...@@ -579,7 +579,8 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac,
if (!vif->bss_conf.assoc) if (!vif->bss_conf.assoc)
smps_mode = IEEE80211_SMPS_AUTOMATIC; smps_mode = IEEE80211_SMPS_AUTOMATIC;
if (IWL_COEX_IS_RRC_ON(mvm->last_bt_notif.ttc_rrc_status, if (mvmvif->phy_ctxt &&
IWL_COEX_IS_RRC_ON(mvm->last_bt_notif.ttc_rrc_status,
mvmvif->phy_ctxt->id)) mvmvif->phy_ctxt->id))
smps_mode = IEEE80211_SMPS_AUTOMATIC; smps_mode = IEEE80211_SMPS_AUTOMATIC;
......
...@@ -891,7 +891,8 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac, ...@@ -891,7 +891,8 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac,
if (!vif->bss_conf.assoc) if (!vif->bss_conf.assoc)
smps_mode = IEEE80211_SMPS_AUTOMATIC; smps_mode = IEEE80211_SMPS_AUTOMATIC;
if (data->notif->rrc_enabled & BIT(mvmvif->phy_ctxt->id)) if (mvmvif->phy_ctxt &&
data->notif->rrc_enabled & BIT(mvmvif->phy_ctxt->id))
smps_mode = IEEE80211_SMPS_AUTOMATIC; smps_mode = IEEE80211_SMPS_AUTOMATIC;
IWL_DEBUG_COEX(data->mvm, IWL_DEBUG_COEX(data->mvm,
......
...@@ -510,7 +510,10 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) ...@@ -510,7 +510,10 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
hw->wiphy->bands[IEEE80211_BAND_5GHZ] = hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
&mvm->nvm_data->bands[IEEE80211_BAND_5GHZ]; &mvm->nvm_data->bands[IEEE80211_BAND_5GHZ];
if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_BEAMFORMER) if ((mvm->fw->ucode_capa.capa[0] &
IWL_UCODE_TLV_CAPA_BEAMFORMER) &&
(mvm->fw->ucode_capa.api[0] &
IWL_UCODE_TLV_API_LQ_SS_PARAMS))
hw->wiphy->bands[IEEE80211_BAND_5GHZ]->vht_cap.cap |= hw->wiphy->bands[IEEE80211_BAND_5GHZ]->vht_cap.cap |=
IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE; IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE;
} }
...@@ -2385,7 +2388,19 @@ static void iwl_mvm_mac_cancel_hw_scan(struct ieee80211_hw *hw, ...@@ -2385,7 +2388,19 @@ static void iwl_mvm_mac_cancel_hw_scan(struct ieee80211_hw *hw,
mutex_lock(&mvm->mutex); mutex_lock(&mvm->mutex);
iwl_mvm_cancel_scan(mvm); /* Due to a race condition, it's possible that mac80211 asks
* us to stop a hw_scan when it's already stopped. This can
* happen, for instance, if we stopped the scan ourselves,
* called ieee80211_scan_completed() and the userspace called
* cancel scan scan before ieee80211_scan_work() could run.
* To handle that, simply return if the scan is not running.
*/
/* FIXME: for now, we ignore this race for UMAC scans, since
* they don't set the scan_status.
*/
if ((mvm->scan_status == IWL_MVM_SCAN_OS) ||
(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN))
iwl_mvm_cancel_scan(mvm);
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
} }
...@@ -2743,12 +2758,29 @@ static int iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw, ...@@ -2743,12 +2758,29 @@ static int iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw,
int ret; int ret;
mutex_lock(&mvm->mutex); mutex_lock(&mvm->mutex);
/* Due to a race condition, it's possible that mac80211 asks
* us to stop a sched_scan when it's already stopped. This
* can happen, for instance, if we stopped the scan ourselves,
* called ieee80211_sched_scan_stopped() and the userspace called
* stop sched scan scan before ieee80211_sched_scan_stopped_work()
* could run. To handle this, simply return if the scan is
* not running.
*/
/* FIXME: for now, we ignore this race for UMAC scans, since
* they don't set the scan_status.
*/
if (mvm->scan_status != IWL_MVM_SCAN_SCHED &&
!(mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN)) {
mutex_unlock(&mvm->mutex);
return 0;
}
ret = iwl_mvm_scan_offload_stop(mvm, false); ret = iwl_mvm_scan_offload_stop(mvm, false);
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
iwl_mvm_wait_for_async_handlers(mvm); iwl_mvm_wait_for_async_handlers(mvm);
return ret; return ret;
} }
static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw, static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
......
...@@ -587,8 +587,10 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify) ...@@ -587,8 +587,10 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
if (mvm->scan_status == IWL_MVM_SCAN_NONE) if (mvm->scan_status == IWL_MVM_SCAN_NONE)
return 0; return 0;
if (iwl_mvm_is_radio_killed(mvm)) if (iwl_mvm_is_radio_killed(mvm)) {
ret = 0;
goto out; goto out;
}
iwl_init_notification_wait(&mvm->notif_wait, &wait_scan_done, iwl_init_notification_wait(&mvm->notif_wait, &wait_scan_done,
scan_done_notif, scan_done_notif,
...@@ -600,16 +602,14 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify) ...@@ -600,16 +602,14 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
IWL_DEBUG_SCAN(mvm, "Send stop %sscan failed %d\n", IWL_DEBUG_SCAN(mvm, "Send stop %sscan failed %d\n",
sched ? "offloaded " : "", ret); sched ? "offloaded " : "", ret);
iwl_remove_notification(&mvm->notif_wait, &wait_scan_done); iwl_remove_notification(&mvm->notif_wait, &wait_scan_done);
return ret; goto out;
} }
IWL_DEBUG_SCAN(mvm, "Successfully sent stop %sscan\n", IWL_DEBUG_SCAN(mvm, "Successfully sent stop %sscan\n",
sched ? "offloaded " : ""); sched ? "offloaded " : "");
ret = iwl_wait_notification(&mvm->notif_wait, &wait_scan_done, 1 * HZ); ret = iwl_wait_notification(&mvm->notif_wait, &wait_scan_done, 1 * HZ);
if (ret) out:
return ret;
/* /*
* Clear the scan status so the next scan requests will succeed. This * Clear the scan status so the next scan requests will succeed. This
* also ensures the Rx handler doesn't do anything, as the scan was * also ensures the Rx handler doesn't do anything, as the scan was
...@@ -619,7 +619,6 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify) ...@@ -619,7 +619,6 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
if (mvm->scan_status == IWL_MVM_SCAN_OS) if (mvm->scan_status == IWL_MVM_SCAN_OS)
iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN); iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);
out:
mvm->scan_status = IWL_MVM_SCAN_NONE; mvm->scan_status = IWL_MVM_SCAN_NONE;
if (notify) { if (notify) {
...@@ -629,7 +628,7 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify) ...@@ -629,7 +628,7 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
ieee80211_scan_completed(mvm->hw, true); ieee80211_scan_completed(mvm->hw, true);
} }
return 0; return ret;
} }
static void iwl_mvm_unified_scan_fill_tx_cmd(struct iwl_mvm *mvm, static void iwl_mvm_unified_scan_fill_tx_cmd(struct iwl_mvm *mvm,
......
...@@ -197,6 +197,8 @@ iwl_mvm_te_handle_notify_csa(struct iwl_mvm *mvm, ...@@ -197,6 +197,8 @@ iwl_mvm_te_handle_notify_csa(struct iwl_mvm *mvm,
struct iwl_time_event_notif *notif) struct iwl_time_event_notif *notif)
{ {
if (!le32_to_cpu(notif->status)) { if (!le32_to_cpu(notif->status)) {
if (te_data->vif->type == NL80211_IFTYPE_STATION)
ieee80211_connection_loss(te_data->vif);
IWL_DEBUG_TE(mvm, "CSA time event failed to start\n"); IWL_DEBUG_TE(mvm, "CSA time event failed to start\n");
iwl_mvm_te_clear_data(mvm, te_data); iwl_mvm_te_clear_data(mvm, te_data);
return; return;
...@@ -756,8 +758,7 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm) ...@@ -756,8 +758,7 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm)
* request * request
*/ */
list_for_each_entry(te_data, &mvm->time_event_list, list) { list_for_each_entry(te_data, &mvm->time_event_list, list) {
if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE && if (te_data->vif->type == NL80211_IFTYPE_P2P_DEVICE) {
te_data->running) {
mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif); mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
is_p2p = true; is_p2p = true;
goto remove_te; goto remove_te;
...@@ -772,10 +773,8 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm) ...@@ -772,10 +773,8 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm)
* request * request
*/ */
list_for_each_entry(te_data, &mvm->aux_roc_te_list, list) { list_for_each_entry(te_data, &mvm->aux_roc_te_list, list) {
if (te_data->running) { mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif);
mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif); goto remove_te;
goto remove_te;
}
} }
remove_te: remove_te:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment