Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Merge branch 'iwlwifi-fixes' into iwlwifi-next

parents e111e968 060b4460
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -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) |
			BIT(IWL_DEFAULT_CMD_QUEUE_NUM));

	if (vif)
		scd_queues &= ~BIT(vif->hw_queue[IEEE80211_AC_VO]);

	IWL_DEBUG_TX_QUEUES(priv, "Flushing SCD queues: 0x%x\n", scd_queues);
	if (drop) {
		IWL_DEBUG_TX_QUEUES(priv, "Flushing SCD queues: 0x%x\n",
				    scd_queues);
		if (iwlagn_txfifo_flush(priv, scd_queues)) {
			IWL_ERR(priv, "flush request fail\n");
			goto done;
		}
	}

	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:
	mutex_unlock(&priv->mutex);
	IWL_DEBUG_MAC80211(priv, "leave\n");
+2 −1
Original line number Diff line number Diff line
@@ -579,7 +579,8 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac,
	if (!vif->bss_conf.assoc)
		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))
		smps_mode = IEEE80211_SMPS_AUTOMATIC;

+2 −1
Original line number Diff line number Diff line
@@ -891,7 +891,8 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac,
	if (!vif->bss_conf.assoc)
		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;

	IWL_DEBUG_COEX(data->mvm,
+35 −3
Original line number Diff line number Diff line
@@ -510,7 +510,10 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
		hw->wiphy->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 |=
				IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE;
	}
@@ -2385,6 +2388,18 @@ static void iwl_mvm_mac_cancel_hw_scan(struct ieee80211_hw *hw,

	mutex_lock(&mvm->mutex);

	/* 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);
@@ -2743,12 +2758,29 @@ static int iwl_mvm_mac_sched_scan_stop(struct ieee80211_hw *hw,
	int ret;

	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);
	mutex_unlock(&mvm->mutex);
	iwl_mvm_wait_for_async_handlers(mvm);

	return ret;

}

static int iwl_mvm_mac_set_key(struct ieee80211_hw *hw,
+6 −7
Original line number Diff line number Diff line
@@ -587,8 +587,10 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
	if (mvm->scan_status == IWL_MVM_SCAN_NONE)
		return 0;

	if (iwl_mvm_is_radio_killed(mvm))
	if (iwl_mvm_is_radio_killed(mvm)) {
		ret = 0;
		goto out;
	}

	iwl_init_notification_wait(&mvm->notif_wait, &wait_scan_done,
				   scan_done_notif,
@@ -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",
			       sched ? "offloaded " : "", ret);
		iwl_remove_notification(&mvm->notif_wait, &wait_scan_done);
		return ret;
		goto out;
	}

	IWL_DEBUG_SCAN(mvm, "Successfully sent stop %sscan\n",
		       sched ? "offloaded " : "");

	ret = iwl_wait_notification(&mvm->notif_wait, &wait_scan_done, 1 * HZ);
	if (ret)
		return ret;

out:
	/*
	 * 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
@@ -619,7 +619,6 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
	if (mvm->scan_status == IWL_MVM_SCAN_OS)
		iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN);

out:
	mvm->scan_status = IWL_MVM_SCAN_NONE;

	if (notify) {
@@ -629,7 +628,7 @@ int iwl_mvm_scan_offload_stop(struct iwl_mvm *mvm, bool notify)
			ieee80211_scan_completed(mvm->hw, true);
	}

	return 0;
	return ret;
}

static void iwl_mvm_unified_scan_fill_tx_cmd(struct iwl_mvm *mvm,
Loading