diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-10-23 16:42:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:50:02 -0400 |
commit | 4a56e9652ec2ffce87b099aa2fc5b4eb2d5b2666 (patch) | |
tree | ea7e79e72e86a49c38b73466397013f1dea64998 /drivers/net/wireless/iwlwifi/iwl-6000.c | |
parent | 480e8407dc0bccdd8d7cfe29b8fcaaa21dd20e68 (diff) |
iwlwifi: add channel switch support to 5000 series and up
Support "channel switch" request by issue "channel switch" host command
to uCode.
There is no separated "channel switch" indication from mac80211,
when detected "IEEE80211_CONF_CHANGE_CHANNEL" flag in iwl_mac_config(),
if the station is in "associated" state, then assume "channel switch
announcement" IE was received by mac80211.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-6000.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-6000.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index f5855293c767..f5639b47668a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -172,6 +172,37 @@ static int iwl6000_hw_set_hw_params(struct iwl_priv *priv) | |||
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | static int iwl6000_hw_channel_switch(struct iwl_priv *priv, u16 channel) | ||
176 | { | ||
177 | struct iwl6000_channel_switch_cmd cmd; | ||
178 | const struct iwl_channel_info *ch_info; | ||
179 | struct iwl_host_cmd hcmd = { | ||
180 | .id = REPLY_CHANNEL_SWITCH, | ||
181 | .len = sizeof(cmd), | ||
182 | .flags = CMD_SIZE_HUGE, | ||
183 | .data = &cmd, | ||
184 | }; | ||
185 | |||
186 | IWL_DEBUG_11H(priv, "channel switch from %d to %d\n", | ||
187 | priv->active_rxon.channel, channel); | ||
188 | |||
189 | cmd.band = priv->band == IEEE80211_BAND_2GHZ; | ||
190 | cmd.channel = cpu_to_le16(channel); | ||
191 | cmd.rxon_flags = priv->active_rxon.flags; | ||
192 | cmd.rxon_filter_flags = priv->active_rxon.filter_flags; | ||
193 | cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time); | ||
194 | ch_info = iwl_get_channel_info(priv, priv->band, channel); | ||
195 | if (ch_info) | ||
196 | cmd.expect_beacon = is_channel_radar(ch_info); | ||
197 | else { | ||
198 | IWL_ERR(priv, "invalid channel switch from %u to %u\n", | ||
199 | priv->active_rxon.channel, channel); | ||
200 | return -EFAULT; | ||
201 | } | ||
202 | |||
203 | return iwl_send_cmd_sync(priv, &hcmd); | ||
204 | } | ||
205 | |||
175 | static struct iwl_lib_ops iwl6000_lib = { | 206 | static struct iwl_lib_ops iwl6000_lib = { |
176 | .set_hw_params = iwl6000_hw_set_hw_params, | 207 | .set_hw_params = iwl6000_hw_set_hw_params, |
177 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, | 208 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, |
@@ -192,6 +223,7 @@ static struct iwl_lib_ops iwl6000_lib = { | |||
192 | .alive_notify = iwl5000_alive_notify, | 223 | .alive_notify = iwl5000_alive_notify, |
193 | .send_tx_power = iwl5000_send_tx_power, | 224 | .send_tx_power = iwl5000_send_tx_power, |
194 | .update_chain_flags = iwl_update_chain_flags, | 225 | .update_chain_flags = iwl_update_chain_flags, |
226 | .set_channel_switch = iwl6000_hw_channel_switch, | ||
195 | .apm_ops = { | 227 | .apm_ops = { |
196 | .init = iwl_apm_init, | 228 | .init = iwl_apm_init, |
197 | .stop = iwl_apm_stop, | 229 | .stop = iwl_apm_stop, |