Skip to content

Commit

Permalink
iwlwifi: use mac80211 channel for radar check
Browse files Browse the repository at this point in the history
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: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Jun 6, 2012
1 parent d9b9d94 commit cc66880
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions drivers/net/wireless/iwlwifi/iwl-agn-devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 iwl5000_channel_switch_cmd cmd;
const struct iwl_channel_info *ch_info;
u32 switch_time_in_usec, ucode_switch_time;
u16 ch;
u32 tsf_low;
Expand Down Expand Up @@ -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",
cmd.switch_time);
ch_info = iwl_get_channel_info(priv, priv->band, ch);
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;
}
cmd.expect_beacon = ch_switch->channel->flags & IEEE80211_CHAN_RADAR;

return iwl_dvm_send_cmd(priv, &hcmd);
}
Expand Down Expand Up @@ -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 iwl6000_channel_switch_cmd cmd;
const struct iwl_channel_info *ch_info;
u32 switch_time_in_usec, ucode_switch_time;
u16 ch;
u32 tsf_low;
Expand Down Expand Up @@ -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",
cmd.switch_time);
ch_info = iwl_get_channel_info(priv, priv->band, ch);
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;
}
cmd.expect_beacon = ch_switch->channel->flags & IEEE80211_CHAN_RADAR;

return iwl_dvm_send_cmd(priv, &hcmd);
}
Expand Down

0 comments on commit cc66880

Please sign in to comment.