diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-2000.c')
| -rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-2000.c | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c index 86feec86d130..2282279cffc4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-2000.c +++ b/drivers/net/wireless/iwlwifi/iwl-2000.c | |||
| @@ -177,79 +177,6 @@ static int iwl2000_hw_set_hw_params(struct iwl_priv *priv) | |||
| 177 | return 0; | 177 | return 0; |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | static int iwl2030_hw_channel_switch(struct iwl_priv *priv, | ||
| 181 | struct ieee80211_channel_switch *ch_switch) | ||
| 182 | { | ||
| 183 | /* | ||
| 184 | * MULTI-FIXME | ||
| 185 | * See iwl_mac_channel_switch. | ||
| 186 | */ | ||
| 187 | struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS]; | ||
| 188 | struct iwl6000_channel_switch_cmd cmd; | ||
| 189 | const struct iwl_channel_info *ch_info; | ||
| 190 | u32 switch_time_in_usec, ucode_switch_time; | ||
| 191 | u16 ch; | ||
| 192 | u32 tsf_low; | ||
| 193 | u8 switch_count; | ||
| 194 | u16 beacon_interval = le16_to_cpu(ctx->timing.beacon_interval); | ||
| 195 | struct ieee80211_vif *vif = ctx->vif; | ||
| 196 | struct iwl_host_cmd hcmd = { | ||
| 197 | .id = REPLY_CHANNEL_SWITCH, | ||
| 198 | .len = { sizeof(cmd), }, | ||
| 199 | .flags = CMD_SYNC, | ||
| 200 | .data = { &cmd, }, | ||
| 201 | }; | ||
| 202 | |||
| 203 | cmd.band = priv->band == IEEE80211_BAND_2GHZ; | ||
| 204 | ch = ch_switch->channel->hw_value; | ||
| 205 | IWL_DEBUG_11H(priv, "channel switch from %u to %u\n", | ||
| 206 | ctx->active.channel, ch); | ||
| 207 | cmd.channel = cpu_to_le16(ch); | ||
| 208 | cmd.rxon_flags = ctx->staging.flags; | ||
| 209 | cmd.rxon_filter_flags = ctx->staging.filter_flags; | ||
| 210 | switch_count = ch_switch->count; | ||
| 211 | tsf_low = ch_switch->timestamp & 0x0ffffffff; | ||
| 212 | /* | ||
| 213 | * calculate the ucode channel switch time | ||
| 214 | * adding TSF as one of the factor for when to switch | ||
| 215 | */ | ||
| 216 | if ((priv->ucode_beacon_time > tsf_low) && beacon_interval) { | ||
| 217 | if (switch_count > ((priv->ucode_beacon_time - tsf_low) / | ||
| 218 | beacon_interval)) { | ||
| 219 | switch_count -= (priv->ucode_beacon_time - | ||
| 220 | tsf_low) / beacon_interval; | ||
| 221 | } else | ||
| 222 | switch_count = 0; | ||
| 223 | } | ||
| 224 | if (switch_count <= 1) | ||
| 225 | cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time); | ||
| 226 | else { | ||
| 227 | switch_time_in_usec = | ||
| 228 | vif->bss_conf.beacon_int * switch_count * TIME_UNIT; | ||
| 229 | ucode_switch_time = iwl_usecs_to_beacons(priv, | ||
| 230 | switch_time_in_usec, | ||
| 231 | beacon_interval); | ||
| 232 | cmd.switch_time = iwl_add_beacon_time(priv, | ||
| 233 | priv->ucode_beacon_time, | ||
| 234 | ucode_switch_time, | ||
| 235 | beacon_interval); | ||
| 236 | } | ||
| 237 | IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n", | ||
| 238 | cmd.switch_time); | ||
| 239 | ch_info = iwl_get_channel_info(priv, priv->band, ch); | ||
| 240 | if (ch_info) | ||
| 241 | cmd.expect_beacon = is_channel_radar(ch_info); | ||
| 242 | else { | ||
| 243 | IWL_ERR(priv, "invalid channel switch from %u to %u\n", | ||
| 244 | ctx->active.channel, ch); | ||
| 245 | return -EFAULT; | ||
| 246 | } | ||
| 247 | priv->switch_rxon.channel = cmd.channel; | ||
| 248 | priv->switch_rxon.switch_in_progress = true; | ||
| 249 | |||
| 250 | return iwl_send_cmd_sync(priv, &hcmd); | ||
| 251 | } | ||
| 252 | |||
| 253 | static struct iwl_lib_ops iwl2000_lib = { | 180 | static struct iwl_lib_ops iwl2000_lib = { |
| 254 | .set_hw_params = iwl2000_hw_set_hw_params, | 181 | .set_hw_params = iwl2000_hw_set_hw_params, |
| 255 | .rx_handler_setup = iwlagn_rx_handler_setup, | 182 | .rx_handler_setup = iwlagn_rx_handler_setup, |
| @@ -258,7 +185,6 @@ static struct iwl_lib_ops iwl2000_lib = { | |||
| 258 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, | 185 | .is_valid_rtc_data_addr = iwlagn_hw_valid_rtc_data_addr, |
| 259 | .send_tx_power = iwlagn_send_tx_power, | 186 | .send_tx_power = iwlagn_send_tx_power, |
| 260 | .update_chain_flags = iwl_update_chain_flags, | 187 | .update_chain_flags = iwl_update_chain_flags, |
| 261 | .set_channel_switch = iwl2030_hw_channel_switch, | ||
| 262 | .apm_ops = { | 188 | .apm_ops = { |
| 263 | .init = iwl_apm_init, | 189 | .init = iwl_apm_init, |
| 264 | .config = iwl2000_nic_config, | 190 | .config = iwl2000_nic_config, |
