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

Commit 7f1f9742 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville
Browse files

iwlegacy: refactor iwl4965_mac_channel_switch



Use less indentions and remove uneeded irq-save flags.

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0d01550f
Loading
Loading
Loading
Loading
+55 −56
Original line number Diff line number Diff line
@@ -2510,7 +2510,6 @@ void iwl4965_mac_channel_switch(struct ieee80211_hw *hw,

	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
	u16 ch;
	unsigned long flags = 0;

	IWL_DEBUG_MAC80211(priv, "enter\n");

@@ -2527,18 +2526,20 @@ void iwl4965_mac_channel_switch(struct ieee80211_hw *hw,
	if (!iwl_legacy_is_associated_ctx(ctx))
		goto out;

	if (priv->cfg->ops->lib->set_channel_switch) {
	if (priv->cfg->ops->lib->set_channel_switch)
		goto out;

	ch = channel->hw_value;
		if (le16_to_cpu(ctx->active.channel) != ch) {
			ch_info = iwl_legacy_get_channel_info(priv,
						       channel->band,
						       ch);
	if (le16_to_cpu(ctx->active.channel) == ch)
		goto out;

	ch_info = iwl_legacy_get_channel_info(priv, channel->band, ch);
	if (!iwl_legacy_is_channel_valid(ch_info)) {
		IWL_DEBUG_MAC80211(priv, "invalid channel\n");
		goto out;
	}
			spin_lock_irqsave(&priv->lock, flags);

	spin_lock(&priv->lock);

	priv->current_ht_config.smps = conf->smps_mode;

@@ -2566,9 +2567,9 @@ void iwl4965_mac_channel_switch(struct ieee80211_hw *hw,

	iwl_legacy_set_rxon_channel(priv, channel, ctx);
	iwl_legacy_set_rxon_ht(priv, ht_conf);
			iwl_legacy_set_flags_for_band(priv, ctx, channel->band,
					       ctx->vif);
			spin_unlock_irqrestore(&priv->lock, flags);
	iwl_legacy_set_flags_for_band(priv, ctx, channel->band, ctx->vif);

	spin_unlock_irq(&priv->lock);

	iwl_legacy_set_rate(priv);
	/*
@@ -2578,13 +2579,11 @@ void iwl4965_mac_channel_switch(struct ieee80211_hw *hw,
	set_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status);
	priv->switch_channel = cpu_to_le16(ch);
	if (priv->cfg->ops->lib->set_channel_switch(priv, ch_switch)) {
				clear_bit(STATUS_CHANNEL_SWITCH_PENDING,
					  &priv->status);
		clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status);
		priv->switch_channel = 0;
		ieee80211_chswitch_done(ctx->vif, false);
	}
		}
	}

out:
	mutex_unlock(&priv->mutex);
	IWL_DEBUG_MAC80211(priv, "leave\n");