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

Commit b1eea297 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

iwlwifi: move mutex out of shared



Now the mutex no longer needs to be
shared, so move it into iwl_priv.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2cc39c94
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -246,7 +246,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control)

void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
{
	mutex_lock(&priv->shrd->mutex);
	mutex_lock(&priv->mutex);
	ieee80211_stop_queues(priv->hw);
	if (iwlagn_txfifo_flush(priv, IWL_DROP_ALL)) {
		IWL_ERR(priv, "flush request fail\n");
@@ -256,7 +256,7 @@ void iwlagn_dev_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
	iwl_trans_wait_tx_queue_empty(trans(priv));
done:
	ieee80211_wake_queues(priv->hw);
	mutex_unlock(&priv->shrd->mutex);
	mutex_unlock(&priv->mutex);
}

/*
@@ -453,7 +453,7 @@ void iwlagn_bt_adjust_rssi_monitor(struct iwl_priv *priv, bool rssi_ena)
	struct iwl_rxon_context *ctx, *found_ctx = NULL;
	bool found_ap = false;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	/* Check whether AP or GO mode is active. */
	if (rssi_ena) {
@@ -566,7 +566,7 @@ static void iwlagn_bt_traffic_change_work(struct work_struct *work)
		break;
	}

	mutex_lock(&priv->shrd->mutex);
	mutex_lock(&priv->mutex);

	/*
	 * We can not send command to firmware while scanning. When the scan
@@ -594,7 +594,7 @@ static void iwlagn_bt_traffic_change_work(struct work_struct *work)
	 */
	iwlagn_bt_coex_rssi_monitor(priv);
out:
	mutex_unlock(&priv->shrd->mutex);
	mutex_unlock(&priv->mutex);
}

/*
@@ -969,7 +969,7 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw,
	u16 p1k[IWLAGN_P1K_SIZE];
	int ret, i;

	mutex_lock(&priv->shrd->mutex);
	mutex_lock(&priv->mutex);

	if ((key->cipher == WLAN_CIPHER_SUITE_WEP40 ||
	     key->cipher == WLAN_CIPHER_SUITE_WEP104) &&
@@ -1075,7 +1075,7 @@ static void iwlagn_wowlan_program_keys(struct ieee80211_hw *hw,
		break;
	}

	mutex_unlock(&priv->shrd->mutex);
	mutex_unlock(&priv->mutex);
}

int iwlagn_send_patterns(struct iwl_priv *priv,
@@ -1222,11 +1222,11 @@ int iwlagn_suspend(struct iwl_priv *priv,
		 * constraints. Since we're in the suspend path
		 * that isn't really a problem though.
		 */
		mutex_unlock(&priv->shrd->mutex);
		mutex_unlock(&priv->mutex);
		ieee80211_iter_keys(priv->hw, ctx->vif,
				    iwlagn_wowlan_program_keys,
				    &key_data);
		mutex_lock(&priv->shrd->mutex);
		mutex_lock(&priv->mutex);
		if (key_data.error) {
			ret = -EIO;
			goto out;
@@ -1304,7 +1304,7 @@ int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
	 * (or more) synchronous commands at a time.
	 */
	if (cmd->flags & CMD_SYNC)
		lockdep_assert_held(&priv->shrd->mutex);
		lockdep_assert_held(&priv->mutex);

	return iwl_trans_send_cmd(trans(priv), cmd);
}
+10 −10
Original line number Diff line number Diff line
@@ -131,7 +131,7 @@ static void iwlagn_update_qos(struct iwl_priv *priv,
static int iwlagn_update_beacon(struct iwl_priv *priv,
				struct ieee80211_vif *vif)
{
	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	dev_kfree_skb(priv->beacon_skb);
	priv->beacon_skb = ieee80211_beacon_get(priv->hw, vif);
@@ -313,7 +313,7 @@ int iwlagn_set_pan_params(struct iwl_priv *priv)

	BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2);

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	ctx_bss = &priv->contexts[IWL_RXON_CTX_BSS];
	ctx_pan = &priv->contexts[IWL_RXON_CTX_PAN];
@@ -418,7 +418,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
	bool new_assoc = !!(ctx->staging.filter_flags & RXON_FILTER_ASSOC_MSK);
	int ret;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	if (!iwl_is_alive(priv->shrd))
		return -EBUSY;
@@ -549,7 +549,7 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)

	IWL_DEBUG_MAC80211(priv, "enter: changed %#x", changed);

	mutex_lock(&priv->shrd->mutex);
	mutex_lock(&priv->mutex);

	if (unlikely(test_bit(STATUS_SCANNING, &priv->shrd->status))) {
		IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
@@ -650,7 +650,7 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
		iwlagn_commit_rxon(priv, ctx);
	}
 out:
	mutex_unlock(&priv->shrd->mutex);
	mutex_unlock(&priv->mutex);
	IWL_DEBUG_MAC80211(priv, "leave\n");

	return ret;
@@ -667,7 +667,7 @@ static void iwlagn_check_needed_chains(struct iwl_priv *priv,
	struct ieee80211_sta_ht_cap *ht_cap;
	bool need_multiple;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	switch (vif->type) {
	case NL80211_IFTYPE_STATION:
@@ -792,17 +792,17 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
	int ret;
	bool force = false;

	mutex_lock(&priv->shrd->mutex);
	mutex_lock(&priv->mutex);

	if (unlikely(!iwl_is_ready(priv->shrd))) {
		IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
		mutex_unlock(&priv->shrd->mutex);
		mutex_unlock(&priv->mutex);
		return;
        }

	if (unlikely(!ctx->vif)) {
		IWL_DEBUG_MAC80211(priv, "leave - vif is NULL\n");
		mutex_unlock(&priv->shrd->mutex);
		mutex_unlock(&priv->mutex);
		return;
	}

@@ -931,7 +931,7 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
			IWL_ERR(priv, "Error sending IBSS beacon\n");
	}

	mutex_unlock(&priv->shrd->mutex);
	mutex_unlock(&priv->mutex);
}

void iwlagn_post_scan(struct iwl_priv *priv)
+9 −9
Original line number Diff line number Diff line
@@ -811,7 +811,7 @@ void iwl_sta_fill_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
	u32 rate_flags = 0;
	__le32 rate_n_flags;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	memset(link_cmd, 0, sizeof(*link_cmd));

@@ -978,7 +978,7 @@ static int iwl_send_static_wepkey_cmd(struct iwl_priv *priv,
int iwl_restore_default_wep_keys(struct iwl_priv *priv,
				 struct iwl_rxon_context *ctx)
{
	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	return iwl_send_static_wepkey_cmd(priv, ctx, false);
}
@@ -989,7 +989,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
{
	int ret;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n",
		      keyconf->keyidx);
@@ -1014,7 +1014,7 @@ int iwl_set_default_wep_key(struct iwl_priv *priv,
{
	int ret;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	if (keyconf->keylen != WEP_KEY_LEN_128 &&
	    keyconf->keylen != WEP_KEY_LEN_64) {
@@ -1166,7 +1166,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
	if (sta_id == IWL_INVALID_STATION)
		return 0;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	ctx->key_mapping_keys--;

@@ -1206,7 +1206,7 @@ int iwl_set_dynamic_key(struct iwl_priv *priv,
	if (sta_id == IWL_INVALID_STATION)
		return -EINVAL;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	keyconf->hw_key_idx = iwl_get_free_ucode_key_offset(priv);
	if (keyconf->hw_key_idx == WEP_INVALID_OFFSET)
@@ -1340,7 +1340,7 @@ int iwl_sta_tx_modify_enable_tid(struct iwl_priv *priv, int sta_id, int tid)
{
	struct iwl_addsta_cmd sta_cmd;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	/* Remove "disable" flag, to enable Tx for this TID */
	spin_lock_bh(&priv->sta_lock);
@@ -1359,7 +1359,7 @@ int iwl_sta_rx_agg_start(struct iwl_priv *priv, struct ieee80211_sta *sta,
	int sta_id;
	struct iwl_addsta_cmd sta_cmd;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	sta_id = iwl_sta_id(sta);
	if (sta_id == IWL_INVALID_STATION)
@@ -1383,7 +1383,7 @@ int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta,
	int sta_id;
	struct iwl_addsta_cmd sta_cmd;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	sta_id = iwl_sta_id(sta);
	if (sta_id == IWL_INVALID_STATION) {
+4 −4
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ static void iwl_legacy_tt_handler(struct iwl_priv *priv, s32 temp, bool force)
			tt->tt_power_mode = IWL_POWER_INDEX_5;
			break;
		}
		mutex_lock(&priv->shrd->mutex);
		mutex_lock(&priv->mutex);
		if (old_state == IWL_TI_CT_KILL)
			clear_bit(STATUS_CT_KILL, &priv->shrd->status);
		if (tt->state != IWL_TI_CT_KILL &&
@@ -341,7 +341,7 @@ static void iwl_legacy_tt_handler(struct iwl_priv *priv, s32 temp, bool force)
			IWL_DEBUG_TEMP(priv, "Power Index change to %u\n",
					tt->tt_power_mode);
		}
		mutex_unlock(&priv->shrd->mutex);
		mutex_unlock(&priv->mutex);
	}
}

@@ -451,7 +451,7 @@ static void iwl_advance_tt_handler(struct iwl_priv *priv, s32 temp, bool force)
			 * in case get disabled before */
			iwl_set_rxon_ht(priv, &priv->current_ht_config);
		}
		mutex_lock(&priv->shrd->mutex);
		mutex_lock(&priv->mutex);
		if (old_state == IWL_TI_CT_KILL)
			clear_bit(STATUS_CT_KILL, &priv->shrd->status);
		if (tt->state != IWL_TI_CT_KILL &&
@@ -486,7 +486,7 @@ static void iwl_advance_tt_handler(struct iwl_priv *priv, s32 temp, bool force)
				iwl_perform_ct_kill_task(priv, false);
			}
		}
		mutex_unlock(&priv->shrd->mutex);
		mutex_unlock(&priv->mutex);
	}
}

+16 −16
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
	 * beacon contents.
	 */

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	if (!priv->beacon_ctx) {
		IWL_ERR(priv, "trying to build beacon w/o beacon context!\n");
@@ -206,7 +206,7 @@ static void iwl_bg_beacon_update(struct work_struct *work)
		container_of(work, struct iwl_priv, beacon_update);
	struct sk_buff *beacon;

	mutex_lock(&priv->shrd->mutex);
	mutex_lock(&priv->mutex);
	if (!priv->beacon_ctx) {
		IWL_ERR(priv, "updating beacon w/o beacon context!\n");
		goto out;
@@ -236,7 +236,7 @@ static void iwl_bg_beacon_update(struct work_struct *work)

	iwlagn_send_beacon_cmd(priv);
 out:
	mutex_unlock(&priv->shrd->mutex);
	mutex_unlock(&priv->mutex);
}

static void iwl_bg_bt_runtime_config(struct work_struct *work)
@@ -259,7 +259,7 @@ static void iwl_bg_bt_full_concurrency(struct work_struct *work)
		container_of(work, struct iwl_priv, bt_full_concurrency);
	struct iwl_rxon_context *ctx;

	mutex_lock(&priv->shrd->mutex);
	mutex_lock(&priv->mutex);

	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
		goto out;
@@ -283,7 +283,7 @@ static void iwl_bg_bt_full_concurrency(struct work_struct *work)

	iwlagn_send_advance_bt_config(priv);
out:
	mutex_unlock(&priv->shrd->mutex);
	mutex_unlock(&priv->mutex);
}

/**
@@ -774,7 +774,7 @@ void iwl_down(struct iwl_priv *priv)

	IWL_DEBUG_INFO(priv, DRV_NAME " is going down\n");

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	iwl_scan_cancel_timeout(priv, 200);

@@ -844,11 +844,11 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
	struct iwl_priv *priv = container_of(work, struct iwl_priv,
			run_time_calib_work);

	mutex_lock(&priv->shrd->mutex);
	mutex_lock(&priv->mutex);

	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status) ||
	    test_bit(STATUS_SCANNING, &priv->shrd->status)) {
		mutex_unlock(&priv->shrd->mutex);
		mutex_unlock(&priv->mutex);
		return;
	}

@@ -857,7 +857,7 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
		iwl_sensitivity_calibration(priv);
	}

	mutex_unlock(&priv->shrd->mutex);
	mutex_unlock(&priv->mutex);
}

void iwlagn_prepare_restart(struct iwl_priv *priv)
@@ -869,7 +869,7 @@ void iwlagn_prepare_restart(struct iwl_priv *priv)
	u8 bt_status;
	bool bt_is_sco;

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	for_each_context(priv, ctx)
		ctx->vif = NULL;
@@ -907,9 +907,9 @@ static void iwl_bg_restart(struct work_struct *data)
		return;

	if (test_and_clear_bit(STATUS_FW_ERROR, &priv->shrd->status)) {
		mutex_lock(&priv->shrd->mutex);
		mutex_lock(&priv->mutex);
		iwlagn_prepare_restart(priv);
		mutex_unlock(&priv->shrd->mutex);
		mutex_unlock(&priv->mutex);
		iwl_cancel_deferred_work(priv);
		ieee80211_restart_hw(priv->hw);
	} else {
@@ -924,7 +924,7 @@ void iwlagn_disable_roc(struct iwl_priv *priv)
{
	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_PAN];

	lockdep_assert_held(&priv->shrd->mutex);
	lockdep_assert_held(&priv->mutex);

	if (!priv->hw_roc_setup)
		return;
@@ -947,9 +947,9 @@ static void iwlagn_disable_roc_work(struct work_struct *work)
	struct iwl_priv *priv = container_of(work, struct iwl_priv,
					     hw_roc_disable_work.work);

	mutex_lock(&priv->shrd->mutex);
	mutex_lock(&priv->mutex);
	iwlagn_disable_roc(priv);
	mutex_unlock(&priv->shrd->mutex);
	mutex_unlock(&priv->mutex);
}

/*****************************************************************************
@@ -1036,7 +1036,7 @@ static int iwl_init_drv(struct iwl_priv *priv)

	spin_lock_init(&priv->sta_lock);

	mutex_init(&priv->shrd->mutex);
	mutex_init(&priv->mutex);

	INIT_LIST_HEAD(&priv->calib_results);

Loading