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

Commit 83626404 authored by Don Fry's avatar Don Fry Committed by John W. Linville
Browse files

iwlwifi: more status bit factoring



Continue splitting the status bits between transport and op_mode.
All but a few are separated.

Signed-off-by: default avatarDon Fry <donald.h.fry@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 9bdfbfad
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -51,7 +51,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)
	struct iwlagn_tx_power_dbm_cmd tx_power_cmd;
	struct iwlagn_tx_power_dbm_cmd tx_power_cmd;
	u8 tx_ant_cfg_cmd;
	u8 tx_ant_cfg_cmd;


	if (WARN_ONCE(test_bit(STATUS_SCAN_HW, &priv->shrd->status),
	if (WARN_ONCE(test_bit(STATUS_SCAN_HW, &priv->status),
		      "TX Power requested while scanning!\n"))
		      "TX Power requested while scanning!\n"))
		return -EAGAIN;
		return -EAGAIN;


@@ -575,7 +575,7 @@ static void iwlagn_bt_traffic_change_work(struct work_struct *work)
	 * STATUS_SCANNING to avoid race when queue_work two times from
	 * STATUS_SCANNING to avoid race when queue_work two times from
	 * different notifications, but quit and not perform any work at all.
	 * different notifications, but quit and not perform any work at all.
	 */
	 */
	if (test_bit(STATUS_SCAN_HW, &priv->shrd->status))
	if (test_bit(STATUS_SCAN_HW, &priv->status))
		goto out;
		goto out;


	iwl_update_chain_flags(priv);
	iwl_update_chain_flags(priv);
@@ -1291,9 +1291,9 @@ int iwlagn_suspend(struct iwl_priv *priv, struct cfg80211_wowlan *wowlan)


int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
int iwl_dvm_send_cmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
{
{
	if (iwl_is_rfkill(priv->shrd) || iwl_is_ctkill(priv)) {
	if (iwl_is_rfkill(priv) || iwl_is_ctkill(priv)) {
		IWL_WARN(priv, "Not sending command - %s KILL\n",
		IWL_WARN(priv, "Not sending command - %s KILL\n",
			 iwl_is_rfkill(priv->shrd) ? "RF" : "CT");
			 iwl_is_rfkill(priv) ? "RF" : "CT");
		return -EIO;
		return -EIO;
	}
	}


+9 −9
Original line number Original line Diff line number Diff line
@@ -159,7 +159,7 @@ static int iwlagn_rx_csa(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
	struct iwl_rxon_cmd *rxon = (void *)&ctx->active;
	struct iwl_rxon_cmd *rxon = (void *)&ctx->active;


	if (!test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->shrd->status))
	if (!test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
		return 0;
		return 0;


	if (!le32_to_cpu(csa->status) && csa->channel == priv->switch_channel) {
	if (!le32_to_cpu(csa->status) && csa->channel == priv->switch_channel) {
@@ -355,7 +355,7 @@ static void iwlagn_recover_from_statistics(struct iwl_priv *priv,
{
{
	unsigned int msecs;
	unsigned int msecs;


	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;
		return;


	msecs = jiffies_to_msecs(stamp - priv->rx_statistics_jiffies);
	msecs = jiffies_to_msecs(stamp - priv->rx_statistics_jiffies);
@@ -575,7 +575,7 @@ static int iwlagn_rx_statistics(struct iwl_priv *priv,


	priv->rx_statistics_jiffies = stamp;
	priv->rx_statistics_jiffies = stamp;


	set_bit(STATUS_STATISTICS, &priv->shrd->status);
	set_bit(STATUS_STATISTICS, &priv->status);


	/* Reschedule the statistics timer to occur in
	/* Reschedule the statistics timer to occur in
	 * reg_recalib_period seconds to ensure we get a
	 * reg_recalib_period seconds to ensure we get a
@@ -584,7 +584,7 @@ static int iwlagn_rx_statistics(struct iwl_priv *priv,
	mod_timer(&priv->statistics_periodic, jiffies +
	mod_timer(&priv->statistics_periodic, jiffies +
		  msecs_to_jiffies(reg_recalib_period * 1000));
		  msecs_to_jiffies(reg_recalib_period * 1000));


	if (unlikely(!test_bit(STATUS_SCANNING, &priv->shrd->status)) &&
	if (unlikely(!test_bit(STATUS_SCANNING, &priv->status)) &&
	    (pkt->hdr.cmd == STATISTICS_NOTIFICATION)) {
	    (pkt->hdr.cmd == STATISTICS_NOTIFICATION)) {
		iwlagn_rx_calc_noise(priv);
		iwlagn_rx_calc_noise(priv);
		queue_work(priv->workqueue, &priv->run_time_calib_work);
		queue_work(priv->workqueue, &priv->run_time_calib_work);
@@ -658,18 +658,18 @@ static int iwlagn_rx_card_state_notif(struct iwl_priv *priv,
		iwl_tt_exit_ct_kill(priv);
		iwl_tt_exit_ct_kill(priv);


	if (flags & HW_CARD_DISABLED)
	if (flags & HW_CARD_DISABLED)
		set_bit(STATUS_RF_KILL_HW, &priv->shrd->status);
		set_bit(STATUS_RF_KILL_HW, &priv->status);
	else
	else
		clear_bit(STATUS_RF_KILL_HW, &priv->shrd->status);
		clear_bit(STATUS_RF_KILL_HW, &priv->status);




	if (!(flags & RXON_CARD_DISABLED))
	if (!(flags & RXON_CARD_DISABLED))
		iwl_scan_cancel(priv);
		iwl_scan_cancel(priv);


	if ((test_bit(STATUS_RF_KILL_HW, &status) !=
	if ((test_bit(STATUS_RF_KILL_HW, &status) !=
	     test_bit(STATUS_RF_KILL_HW, &priv->shrd->status)))
	     test_bit(STATUS_RF_KILL_HW, &priv->status)))
		wiphy_rfkill_set_hw_state(priv->hw->wiphy,
		wiphy_rfkill_set_hw_state(priv->hw->wiphy,
			test_bit(STATUS_RF_KILL_HW, &priv->shrd->status));
			test_bit(STATUS_RF_KILL_HW, &priv->status));
	else
	else
		wake_up(&priv->shrd->wait_command_queue);
		wake_up(&priv->shrd->wait_command_queue);
	return 0;
	return 0;
@@ -691,7 +691,7 @@ static int iwlagn_rx_missed_beacon_notif(struct iwl_priv *priv,
		    le32_to_cpu(missed_beacon->total_missed_becons),
		    le32_to_cpu(missed_beacon->total_missed_becons),
		    le32_to_cpu(missed_beacon->num_recvd_beacons),
		    le32_to_cpu(missed_beacon->num_recvd_beacons),
		    le32_to_cpu(missed_beacon->num_expected_beacons));
		    le32_to_cpu(missed_beacon->num_expected_beacons));
		if (!test_bit(STATUS_SCANNING, &priv->shrd->status))
		if (!test_bit(STATUS_SCANNING, &priv->status))
			iwl_init_sensitivity(priv);
			iwl_init_sensitivity(priv);
	}
	}
	return 0;
	return 0;
+7 −7
Original line number Original line Diff line number Diff line
@@ -361,7 +361,7 @@ int iwlagn_set_pan_params(struct iwl_priv *priv)
		slot0 = bcnint / 2;
		slot0 = bcnint / 2;
		slot1 = bcnint - slot0;
		slot1 = bcnint - slot0;


		if (test_bit(STATUS_SCAN_HW, &priv->shrd->status) ||
		if (test_bit(STATUS_SCAN_HW, &priv->status) ||
		    (!ctx_bss->vif->bss_conf.idle &&
		    (!ctx_bss->vif->bss_conf.idle &&
		     !ctx_bss->vif->bss_conf.assoc)) {
		     !ctx_bss->vif->bss_conf.assoc)) {
			slot0 = dtim * bcnint * 3 - IWL_MIN_SLOT_TIME;
			slot0 = dtim * bcnint * 3 - IWL_MIN_SLOT_TIME;
@@ -377,7 +377,7 @@ int iwlagn_set_pan_params(struct iwl_priv *priv)
					ctx_pan->beacon_int;
					ctx_pan->beacon_int;
		slot1 = max_t(int, DEFAULT_BEACON_INTERVAL, slot1);
		slot1 = max_t(int, DEFAULT_BEACON_INTERVAL, slot1);


		if (test_bit(STATUS_SCAN_HW, &priv->shrd->status)) {
		if (test_bit(STATUS_SCAN_HW, &priv->status)) {
			slot0 = slot1 * 3 - IWL_MIN_SLOT_TIME;
			slot0 = slot1 * 3 - IWL_MIN_SLOT_TIME;
			slot1 = IWL_MIN_SLOT_TIME;
			slot1 = IWL_MIN_SLOT_TIME;
		}
		}
@@ -421,7 +421,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)


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


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


	/* This function hardcodes a bunch of dual-mode assumptions */
	/* This function hardcodes a bunch of dual-mode assumptions */
@@ -457,7 +457,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
	 * receive commit_rxon request
	 * receive commit_rxon request
	 * abort any previous channel switch if still in process
	 * abort any previous channel switch if still in process
	 */
	 */
	if (test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->shrd->status) &&
	if (test_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status) &&
	    (priv->switch_channel != ctx->staging.channel)) {
	    (priv->switch_channel != ctx->staging.channel)) {
		IWL_DEBUG_11H(priv, "abort channel switch on %d\n",
		IWL_DEBUG_11H(priv, "abort channel switch on %d\n",
			      le16_to_cpu(priv->switch_channel));
			      le16_to_cpu(priv->switch_channel));
@@ -551,12 +551,12 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)


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


	if (unlikely(test_bit(STATUS_SCANNING, &priv->shrd->status))) {
	if (unlikely(test_bit(STATUS_SCANNING, &priv->status))) {
		IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
		IWL_DEBUG_MAC80211(priv, "leave - scanning\n");
		goto out;
		goto out;
	}
	}


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


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


	if (unlikely(!iwl_is_ready(priv->shrd))) {
	if (unlikely(!iwl_is_ready(priv))) {
		IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
		IWL_DEBUG_MAC80211(priv, "leave - not ready\n");
		mutex_unlock(&priv->mutex);
		mutex_unlock(&priv->mutex);
		return;
		return;
+3 −3
Original line number Original line Diff line number Diff line
@@ -490,7 +490,7 @@ int iwl_remove_station(struct iwl_priv *priv, const u8 sta_id,
{
{
	u8 tid;
	u8 tid;


	if (!iwl_is_ready(priv->shrd)) {
	if (!iwl_is_ready(priv)) {
		IWL_DEBUG_INFO(priv,
		IWL_DEBUG_INFO(priv,
			"Unable to remove station %pM, device not ready.\n",
			"Unable to remove station %pM, device not ready.\n",
			addr);
			addr);
@@ -598,7 +598,7 @@ void iwl_restore_stations(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
	int ret;
	int ret;
	bool send_lq;
	bool send_lq;


	if (!iwl_is_ready(priv->shrd)) {
	if (!iwl_is_ready(priv)) {
		IWL_DEBUG_INFO(priv,
		IWL_DEBUG_INFO(priv,
			       "Not ready yet, not restoring any stations.\n");
			       "Not ready yet, not restoring any stations.\n");
		return;
		return;
@@ -997,7 +997,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv,
		      keyconf->keyidx);
		      keyconf->keyidx);


	memset(&ctx->wep_keys[keyconf->keyidx], 0, sizeof(ctx->wep_keys[0]));
	memset(&ctx->wep_keys[keyconf->keyidx], 0, sizeof(ctx->wep_keys[0]));
	if (iwl_is_rfkill(priv->shrd)) {
	if (iwl_is_rfkill(priv)) {
		IWL_DEBUG_WEP(priv,
		IWL_DEBUG_WEP(priv,
			"Not sending REPLY_WEPKEY command due to RFKILL.\n");
			"Not sending REPLY_WEPKEY command due to RFKILL.\n");
		/* but keys in device are clear anyway so return success */
		/* but keys in device are clear anyway so return success */
+10 −10
Original line number Original line Diff line number Diff line
@@ -174,7 +174,7 @@ static void iwl_tt_check_exit_ct_kill(unsigned long data)
	struct iwl_tt_mgmt *tt = &priv->thermal_throttle;
	struct iwl_tt_mgmt *tt = &priv->thermal_throttle;
	unsigned long flags;
	unsigned long flags;


	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;
		return;


	if (tt->state == IWL_TI_CT_KILL) {
	if (tt->state == IWL_TI_CT_KILL) {
@@ -225,7 +225,7 @@ static void iwl_tt_ready_for_ct_kill(unsigned long data)
	struct iwl_priv *priv = (struct iwl_priv *)data;
	struct iwl_priv *priv = (struct iwl_priv *)data;
	struct iwl_tt_mgmt *tt = &priv->thermal_throttle;
	struct iwl_tt_mgmt *tt = &priv->thermal_throttle;


	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;
		return;


	/* temperature timer expired, ready to go into CT_KILL state */
	/* temperature timer expired, ready to go into CT_KILL state */
@@ -504,10 +504,10 @@ static void iwl_bg_ct_enter(struct work_struct *work)
	struct iwl_priv *priv = container_of(work, struct iwl_priv, ct_enter);
	struct iwl_priv *priv = container_of(work, struct iwl_priv, ct_enter);
	struct iwl_tt_mgmt *tt = &priv->thermal_throttle;
	struct iwl_tt_mgmt *tt = &priv->thermal_throttle;


	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;
		return;


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


	if (tt->state != IWL_TI_CT_KILL) {
	if (tt->state != IWL_TI_CT_KILL) {
@@ -533,10 +533,10 @@ static void iwl_bg_ct_exit(struct work_struct *work)
	struct iwl_priv *priv = container_of(work, struct iwl_priv, ct_exit);
	struct iwl_priv *priv = container_of(work, struct iwl_priv, ct_exit);
	struct iwl_tt_mgmt *tt = &priv->thermal_throttle;
	struct iwl_tt_mgmt *tt = &priv->thermal_throttle;


	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;
		return;


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


	/* stop ct_kill_exit_tm timer */
	/* stop ct_kill_exit_tm timer */
@@ -563,7 +563,7 @@ static void iwl_bg_ct_exit(struct work_struct *work)


void iwl_tt_enter_ct_kill(struct iwl_priv *priv)
void iwl_tt_enter_ct_kill(struct iwl_priv *priv)
{
{
	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;
		return;


	IWL_DEBUG_TEMP(priv, "Queueing critical temperature enter.\n");
	IWL_DEBUG_TEMP(priv, "Queueing critical temperature enter.\n");
@@ -572,7 +572,7 @@ void iwl_tt_enter_ct_kill(struct iwl_priv *priv)


void iwl_tt_exit_ct_kill(struct iwl_priv *priv)
void iwl_tt_exit_ct_kill(struct iwl_priv *priv)
{
{
	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;
		return;


	IWL_DEBUG_TEMP(priv, "Queueing critical temperature exit.\n");
	IWL_DEBUG_TEMP(priv, "Queueing critical temperature exit.\n");
@@ -584,7 +584,7 @@ static void iwl_bg_tt_work(struct work_struct *work)
	struct iwl_priv *priv = container_of(work, struct iwl_priv, tt_work);
	struct iwl_priv *priv = container_of(work, struct iwl_priv, tt_work);
	s32 temp = priv->temperature; /* degrees CELSIUS except specified */
	s32 temp = priv->temperature; /* degrees CELSIUS except specified */


	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;
		return;


	if (!priv->thermal_throttle.advanced_tt)
	if (!priv->thermal_throttle.advanced_tt)
@@ -595,7 +595,7 @@ static void iwl_bg_tt_work(struct work_struct *work)


void iwl_tt_handler(struct iwl_priv *priv)
void iwl_tt_handler(struct iwl_priv *priv)
{
{
	if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
	if (test_bit(STATUS_EXIT_PENDING, &priv->status))
		return;
		return;


	IWL_DEBUG_TEMP(priv, "Queueing thermal throttling work.\n");
	IWL_DEBUG_TEMP(priv, "Queueing thermal throttling work.\n");
Loading