Commit cc66880b authored by Johannes Berg's avatar Johannes Berg

iwlwifi: use mac80211 channel for radar check

In channel switch, instead of relying on our internal
channel database, just use the mac80211 channel that
we filled with that information on startup.
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent d9b9d940
...@@ -455,7 +455,6 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv, ...@@ -455,7 +455,6 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
*/ */
struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
struct iwl5000_channel_switch_cmd cmd; struct iwl5000_channel_switch_cmd cmd;
const struct iwl_channel_info *ch_info;
u32 switch_time_in_usec, ucode_switch_time; u32 switch_time_in_usec, ucode_switch_time;
u16 ch; u16 ch;
u32 tsf_low; u32 tsf_low;
...@@ -505,14 +504,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv, ...@@ -505,14 +504,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
} }
IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n", IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
cmd.switch_time); cmd.switch_time);
ch_info = iwl_get_channel_info(priv, priv->band, ch); cmd.expect_beacon = ch_switch->channel->flags & IEEE80211_CHAN_RADAR;
if (ch_info)
cmd.expect_beacon = is_channel_radar(ch_info);
else {
IWL_ERR(priv, "invalid channel switch from %u to %u\n",
ctx->active.channel, ch);
return -EFAULT;
}
return iwl_dvm_send_cmd(priv, &hcmd); return iwl_dvm_send_cmd(priv, &hcmd);
} }
...@@ -654,7 +646,6 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, ...@@ -654,7 +646,6 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
*/ */
struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
struct iwl6000_channel_switch_cmd cmd; struct iwl6000_channel_switch_cmd cmd;
const struct iwl_channel_info *ch_info;
u32 switch_time_in_usec, ucode_switch_time; u32 switch_time_in_usec, ucode_switch_time;
u16 ch; u16 ch;
u32 tsf_low; u32 tsf_low;
...@@ -704,14 +695,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv, ...@@ -704,14 +695,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
} }
IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n", IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
cmd.switch_time); cmd.switch_time);
ch_info = iwl_get_channel_info(priv, priv->band, ch); cmd.expect_beacon = ch_switch->channel->flags & IEEE80211_CHAN_RADAR;
if (ch_info)
cmd.expect_beacon = is_channel_radar(ch_info);
else {
IWL_ERR(priv, "invalid channel switch from %u to %u\n",
ctx->active.channel, ch);
return -EFAULT;
}
return iwl_dvm_send_cmd(priv, &hcmd); return iwl_dvm_send_cmd(priv, &hcmd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment