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-4965.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-4965.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index bd856df5b04d..1ff465ad40d8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -1433,14 +1433,13 @@ static int iwl4965_send_rxon_assoc(struct iwl_priv *priv) | |||
1433 | return ret; | 1433 | return ret; |
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | #ifdef IEEE80211_CONF_CHANNEL_SWITCH | ||
1437 | static int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel) | 1436 | static int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel) |
1438 | { | 1437 | { |
1439 | int rc; | 1438 | int rc; |
1440 | u8 band = 0; | 1439 | u8 band = 0; |
1441 | bool is_ht40 = false; | 1440 | bool is_ht40 = false; |
1442 | u8 ctrl_chan_high = 0; | 1441 | u8 ctrl_chan_high = 0; |
1443 | struct iwl4965_channel_switch_cmd cmd = { 0 }; | 1442 | struct iwl4965_channel_switch_cmd cmd; |
1444 | const struct iwl_channel_info *ch_info; | 1443 | const struct iwl_channel_info *ch_info; |
1445 | 1444 | ||
1446 | band = priv->band == IEEE80211_BAND_2GHZ; | 1445 | band = priv->band == IEEE80211_BAND_2GHZ; |
@@ -1461,8 +1460,11 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel) | |||
1461 | cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time); | 1460 | cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time); |
1462 | if (ch_info) | 1461 | if (ch_info) |
1463 | cmd.expect_beacon = is_channel_radar(ch_info); | 1462 | cmd.expect_beacon = is_channel_radar(ch_info); |
1464 | else | 1463 | else { |
1465 | cmd.expect_beacon = 1; | 1464 | IWL_ERR(priv, "invalid channel switch from %u to %u\n", |
1465 | priv->active_rxon.channel, channel); | ||
1466 | return -EFAULT; | ||
1467 | } | ||
1466 | 1468 | ||
1467 | rc = iwl4965_fill_txpower_tbl(priv, band, channel, is_ht40, | 1469 | rc = iwl4965_fill_txpower_tbl(priv, band, channel, is_ht40, |
1468 | ctrl_chan_high, &cmd.tx_power); | 1470 | ctrl_chan_high, &cmd.tx_power); |
@@ -1474,7 +1476,6 @@ static int iwl4965_hw_channel_switch(struct iwl_priv *priv, u16 channel) | |||
1474 | rc = iwl_send_cmd_pdu(priv, REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd); | 1476 | rc = iwl_send_cmd_pdu(priv, REPLY_CHANNEL_SWITCH, sizeof(cmd), &cmd); |
1475 | return rc; | 1477 | return rc; |
1476 | } | 1478 | } |
1477 | #endif | ||
1478 | 1479 | ||
1479 | /** | 1480 | /** |
1480 | * iwl4965_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array | 1481 | * iwl4965_txq_update_byte_cnt_tbl - Set up entry in Tx byte-count array |
@@ -2171,6 +2172,7 @@ static struct iwl_lib_ops iwl4965_lib = { | |||
2171 | .load_ucode = iwl4965_load_bsm, | 2172 | .load_ucode = iwl4965_load_bsm, |
2172 | .dump_nic_event_log = iwl_dump_nic_event_log, | 2173 | .dump_nic_event_log = iwl_dump_nic_event_log, |
2173 | .dump_nic_error_log = iwl_dump_nic_error_log, | 2174 | .dump_nic_error_log = iwl_dump_nic_error_log, |
2175 | .set_channel_switch = iwl4965_hw_channel_switch, | ||
2174 | .apm_ops = { | 2176 | .apm_ops = { |
2175 | .init = iwl_apm_init, | 2177 | .init = iwl_apm_init, |
2176 | .stop = iwl_apm_stop, | 2178 | .stop = iwl_apm_stop, |