aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-5000.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-10-23 16:42:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:50:02 -0400
commit4a56e9652ec2ffce87b099aa2fc5b4eb2d5b2666 (patch)
treeea7e79e72e86a49c38b73466397013f1dea64998 /drivers/net/wireless/iwlwifi/iwl-5000.c
parent480e8407dc0bccdd8d7cfe29b8fcaaa21dd20e68 (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-5000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index a6e347b9799a..d256fecc6cda 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -1382,6 +1382,36 @@ IWL5000_UCODE_GET(init_size);
1382IWL5000_UCODE_GET(init_data_size); 1382IWL5000_UCODE_GET(init_data_size);
1383IWL5000_UCODE_GET(boot_size); 1383IWL5000_UCODE_GET(boot_size);
1384 1384
1385static int iwl5000_hw_channel_switch(struct iwl_priv *priv, u16 channel)
1386{
1387 struct iwl5000_channel_switch_cmd cmd;
1388 const struct iwl_channel_info *ch_info;
1389 struct iwl_host_cmd hcmd = {
1390 .id = REPLY_CHANNEL_SWITCH,
1391 .len = sizeof(cmd),
1392 .flags = CMD_SIZE_HUGE,
1393 .data = &cmd,
1394 };
1395
1396 IWL_DEBUG_11H(priv, "channel switch from %d to %d\n",
1397 priv->active_rxon.channel, channel);
1398 cmd.band = priv->band == IEEE80211_BAND_2GHZ;
1399 cmd.channel = cpu_to_le16(channel);
1400 cmd.rxon_flags = priv->active_rxon.flags;
1401 cmd.rxon_filter_flags = priv->active_rxon.filter_flags;
1402 cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
1403 ch_info = iwl_get_channel_info(priv, priv->band, channel);
1404 if (ch_info)
1405 cmd.expect_beacon = is_channel_radar(ch_info);
1406 else {
1407 IWL_ERR(priv, "invalid channel switch from %u to %u\n",
1408 priv->active_rxon.channel, channel);
1409 return -EFAULT;
1410 }
1411
1412 return iwl_send_cmd_sync(priv, &hcmd);
1413}
1414
1385struct iwl_hcmd_ops iwl5000_hcmd = { 1415struct iwl_hcmd_ops iwl5000_hcmd = {
1386 .rxon_assoc = iwl5000_send_rxon_assoc, 1416 .rxon_assoc = iwl5000_send_rxon_assoc,
1387 .commit_rxon = iwl_commit_rxon, 1417 .commit_rxon = iwl_commit_rxon,
@@ -1429,6 +1459,7 @@ struct iwl_lib_ops iwl5000_lib = {
1429 .alive_notify = iwl5000_alive_notify, 1459 .alive_notify = iwl5000_alive_notify,
1430 .send_tx_power = iwl5000_send_tx_power, 1460 .send_tx_power = iwl5000_send_tx_power,
1431 .update_chain_flags = iwl_update_chain_flags, 1461 .update_chain_flags = iwl_update_chain_flags,
1462 .set_channel_switch = iwl5000_hw_channel_switch,
1432 .apm_ops = { 1463 .apm_ops = {
1433 .init = iwl_apm_init, 1464 .init = iwl_apm_init,
1434 .stop = iwl_apm_stop, 1465 .stop = iwl_apm_stop,
@@ -1480,6 +1511,7 @@ static struct iwl_lib_ops iwl5150_lib = {
1480 .alive_notify = iwl5000_alive_notify, 1511 .alive_notify = iwl5000_alive_notify,
1481 .send_tx_power = iwl5000_send_tx_power, 1512 .send_tx_power = iwl5000_send_tx_power,
1482 .update_chain_flags = iwl_update_chain_flags, 1513 .update_chain_flags = iwl_update_chain_flags,
1514 .set_channel_switch = iwl5000_hw_channel_switch,
1483 .apm_ops = { 1515 .apm_ops = {
1484 .init = iwl_apm_init, 1516 .init = iwl_apm_init,
1485 .stop = iwl_apm_stop, 1517 .stop = iwl_apm_stop,