Commit 845a9c0d authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by John W. Linville
Browse files

iwlagn: move all iwl_is_XXX helpers to iwl-shared.h



Logic move after all priv->status moved to struct iwl_shared

Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@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 effcea16
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -426,7 +426,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
		return -EINVAL;

	if (!iwl_is_alive(priv))
	if (!iwl_is_alive(priv->shrd))
		return -EBUSY;

	/* This function hardcodes a bunch of dual-mode assumptions */
@@ -544,7 +544,7 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
		goto out;
	}

	if (!iwl_is_ready(priv)) {
	if (!iwl_is_ready(priv->shrd)) {
		IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
		goto out;
	}
@@ -794,7 +794,7 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,

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

	if (unlikely(!iwl_is_ready(priv))) {
	if (unlikely(!iwl_is_ready(priv->shrd))) {
		IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
		mutex_unlock(&priv->shrd->mutex);
		return;
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
		      keyconf->keyidx);

	memset(&ctx->wep_keys[keyconf->keyidx], 0, sizeof(ctx->wep_keys[0]));
	if (iwl_is_rfkill(priv)) {
	if (iwl_is_rfkill(priv->shrd)) {
		IWL_DEBUG_WEP(priv, "Not sending REPLY_WEPKEY command due to RFKILL.\n");
		/* but keys in device are clear anyway so return success */
		return 0;
+2 −2
Original line number Diff line number Diff line
@@ -511,7 +511,7 @@ static void iwl_bg_ct_enter(struct work_struct *work)
	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
		return;

	if (!iwl_is_ready(priv))
	if (!iwl_is_ready(priv->shrd))
		return;

	if (tt->state != IWL_TI_CT_KILL) {
@@ -540,7 +540,7 @@ static void iwl_bg_ct_exit(struct work_struct *work)
	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
		return;

	if (!iwl_is_ready(priv))
	if (!iwl_is_ready(priv->shrd))
		return;

	/* stop ct_kill_exit_tm timer */
+1 −1
Original line number Diff line number Diff line
@@ -338,7 +338,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
		ctx = iwl_rxon_ctx_from_vif(info->control.vif);

	spin_lock_irqsave(&priv->shrd->lock, flags);
	if (iwl_is_rfkill(priv)) {
	if (iwl_is_rfkill(priv->shrd)) {
		IWL_DEBUG_DROP(priv, "Dropping - RF KILL\n");
		goto drop_unlock_priv;
	}
+9 −9
Original line number Diff line number Diff line
@@ -251,7 +251,7 @@ static void iwl_bg_bt_runtime_config(struct work_struct *work)
		return;

	/* dont send host command if rf-kill is on */
	if (!iwl_is_ready_rf(priv))
	if (!iwl_is_ready_rf(priv->shrd))
		return;
	iwlagn_send_advance_bt_config(priv);
}
@@ -268,7 +268,7 @@ static void iwl_bg_bt_full_concurrency(struct work_struct *work)
		goto out;

	/* dont send host command if rf-kill is on */
	if (!iwl_is_ready_rf(priv))
	if (!iwl_is_ready_rf(priv->shrd))
		goto out;

	IWL_DEBUG_INFO(priv, "BT coex in %s mode\n",
@@ -307,7 +307,7 @@ static void iwl_bg_statistics_periodic(unsigned long data)
		return;

	/* dont send host command if rf-kill is on */
	if (!iwl_is_ready_rf(priv))
	if (!iwl_is_ready_rf(priv->shrd))
		return;

	iwl_send_statistics_request(priv, CMD_ASYNC, false);
@@ -444,7 +444,7 @@ static void iwl_bg_tx_flush(struct work_struct *work)
		return;

	/* do nothing if rf-kill is on */
	if (!iwl_is_ready_rf(priv))
	if (!iwl_is_ready_rf(priv->shrd))
		return;

	IWL_DEBUG_INFO(priv, "device request: flush all tx frames\n");
@@ -510,7 +510,7 @@ static ssize_t show_temperature(struct device *d,
	struct iwl_shared *shrd = dev_get_drvdata(d);
	struct iwl_priv *priv = shrd->priv;

	if (!iwl_is_alive(priv))
	if (!iwl_is_alive(priv->shrd))
		return -EAGAIN;

	return sprintf(buf, "%d\n", priv->temperature);
@@ -523,7 +523,7 @@ static ssize_t show_tx_power(struct device *d,
{
	struct iwl_priv *priv = dev_get_drvdata(d);

	if (!iwl_is_ready_rf(priv))
	if (!iwl_is_ready_rf(priv->shrd))
		return sprintf(buf, "off\n");
	else
		return sprintf(buf, "%d\n", priv->tx_power_user_lmt);
@@ -1412,7 +1412,7 @@ int iwl_alive_start(struct iwl_priv *priv)
	/* Enable watchdog to monitor the driver tx queues */
	iwl_setup_watchdog(priv);

	if (iwl_is_rfkill(priv))
	if (iwl_is_rfkill(priv->shrd))
		return -ERFKILL;

	/* download priority table before any calibration request */
@@ -2701,7 +2701,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,

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

	if (iwl_is_rfkill(priv))
	if (iwl_is_rfkill(priv->shrd))
		goto out;

	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status) ||
@@ -2836,7 +2836,7 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop)
		IWL_DEBUG_TX(priv, "Aborting flush due to device shutdown\n");
		goto done;
	}
	if (iwl_is_rfkill(priv)) {
	if (iwl_is_rfkill(priv->shrd)) {
		IWL_DEBUG_TX(priv, "Aborting flush due to RF Kill\n");
		goto done;
	}
Loading