diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 385 |
1 files changed, 47 insertions, 338 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 3d1f6831cc20..1050f31d90a4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -90,153 +90,6 @@ MODULE_ALIAS("iwl4965"); | |||
90 | static int iwlagn_ant_coupling; | 90 | static int iwlagn_ant_coupling; |
91 | static bool iwlagn_bt_ch_announce = 1; | 91 | static bool iwlagn_bt_ch_announce = 1; |
92 | 92 | ||
93 | /** | ||
94 | * iwlagn_commit_rxon - commit staging_rxon to hardware | ||
95 | * | ||
96 | * The RXON command in staging_rxon is committed to the hardware and | ||
97 | * the active_rxon structure is updated with the new data. This | ||
98 | * function correctly transitions out of the RXON_ASSOC_MSK state if | ||
99 | * a HW tune is required based on the RXON structure changes. | ||
100 | */ | ||
101 | int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx) | ||
102 | { | ||
103 | /* cast away the const for active_rxon in this function */ | ||
104 | struct iwl_rxon_cmd *active_rxon = (void *)&ctx->active; | ||
105 | int ret; | ||
106 | bool new_assoc = | ||
107 | !!(ctx->staging.filter_flags & RXON_FILTER_ASSOC_MSK); | ||
108 | |||
109 | if (!iwl_is_alive(priv)) | ||
110 | return -EBUSY; | ||
111 | |||
112 | if (!ctx->is_active) | ||
113 | return 0; | ||
114 | |||
115 | /* always get timestamp with Rx frame */ | ||
116 | ctx->staging.flags |= RXON_FLG_TSF2HOST_MSK; | ||
117 | |||
118 | ret = iwl_check_rxon_cmd(priv, ctx); | ||
119 | if (ret) { | ||
120 | IWL_ERR(priv, "Invalid RXON configuration. Not committing.\n"); | ||
121 | return -EINVAL; | ||
122 | } | ||
123 | |||
124 | /* | ||
125 | * receive commit_rxon request | ||
126 | * abort any previous channel switch if still in process | ||
127 | */ | ||
128 | if (priv->switch_rxon.switch_in_progress && | ||
129 | (priv->switch_rxon.channel != ctx->staging.channel)) { | ||
130 | IWL_DEBUG_11H(priv, "abort channel switch on %d\n", | ||
131 | le16_to_cpu(priv->switch_rxon.channel)); | ||
132 | iwl_chswitch_done(priv, false); | ||
133 | } | ||
134 | |||
135 | /* If we don't need to send a full RXON, we can use | ||
136 | * iwl_rxon_assoc_cmd which is used to reconfigure filter | ||
137 | * and other flags for the current radio configuration. */ | ||
138 | if (!iwl_full_rxon_required(priv, ctx)) { | ||
139 | ret = iwl_send_rxon_assoc(priv, ctx); | ||
140 | if (ret) { | ||
141 | IWL_ERR(priv, "Error setting RXON_ASSOC (%d)\n", ret); | ||
142 | return ret; | ||
143 | } | ||
144 | |||
145 | memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon)); | ||
146 | iwl_print_rx_config_cmd(priv, ctx); | ||
147 | return 0; | ||
148 | } | ||
149 | |||
150 | /* If we are currently associated and the new config requires | ||
151 | * an RXON_ASSOC and the new config wants the associated mask enabled, | ||
152 | * we must clear the associated from the active configuration | ||
153 | * before we apply the new config */ | ||
154 | if (iwl_is_associated_ctx(ctx) && new_assoc) { | ||
155 | IWL_DEBUG_INFO(priv, "Toggling associated bit on current RXON\n"); | ||
156 | active_rxon->filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
157 | |||
158 | ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, | ||
159 | sizeof(struct iwl_rxon_cmd), | ||
160 | active_rxon); | ||
161 | |||
162 | /* If the mask clearing failed then we set | ||
163 | * active_rxon back to what it was previously */ | ||
164 | if (ret) { | ||
165 | active_rxon->filter_flags |= RXON_FILTER_ASSOC_MSK; | ||
166 | IWL_ERR(priv, "Error clearing ASSOC_MSK (%d)\n", ret); | ||
167 | return ret; | ||
168 | } | ||
169 | iwl_clear_ucode_stations(priv, ctx); | ||
170 | iwl_restore_stations(priv, ctx); | ||
171 | ret = iwl_restore_default_wep_keys(priv, ctx); | ||
172 | if (ret) { | ||
173 | IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret); | ||
174 | return ret; | ||
175 | } | ||
176 | } | ||
177 | |||
178 | IWL_DEBUG_INFO(priv, "Sending RXON\n" | ||
179 | "* with%s RXON_FILTER_ASSOC_MSK\n" | ||
180 | "* channel = %d\n" | ||
181 | "* bssid = %pM\n", | ||
182 | (new_assoc ? "" : "out"), | ||
183 | le16_to_cpu(ctx->staging.channel), | ||
184 | ctx->staging.bssid_addr); | ||
185 | |||
186 | iwl_set_rxon_hwcrypto(priv, ctx, !priv->cfg->mod_params->sw_crypto); | ||
187 | |||
188 | if (priv->cfg->ops->hcmd->set_pan_params) { | ||
189 | ret = priv->cfg->ops->hcmd->set_pan_params(priv); | ||
190 | if (ret) | ||
191 | return ret; | ||
192 | } | ||
193 | |||
194 | /* Apply the new configuration | ||
195 | * RXON unassoc clears the station table in uCode so restoration of | ||
196 | * stations is needed after it (the RXON command) completes | ||
197 | */ | ||
198 | if (!new_assoc) { | ||
199 | ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, | ||
200 | sizeof(struct iwl_rxon_cmd), &ctx->staging); | ||
201 | if (ret) { | ||
202 | IWL_ERR(priv, "Error setting new RXON (%d)\n", ret); | ||
203 | return ret; | ||
204 | } | ||
205 | IWL_DEBUG_INFO(priv, "Return from !new_assoc RXON.\n"); | ||
206 | memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon)); | ||
207 | iwl_clear_ucode_stations(priv, ctx); | ||
208 | iwl_restore_stations(priv, ctx); | ||
209 | ret = iwl_restore_default_wep_keys(priv, ctx); | ||
210 | if (ret) { | ||
211 | IWL_ERR(priv, "Failed to restore WEP keys (%d)\n", ret); | ||
212 | return ret; | ||
213 | } | ||
214 | } | ||
215 | if (new_assoc) { | ||
216 | priv->start_calib = 0; | ||
217 | /* Apply the new configuration | ||
218 | * RXON assoc doesn't clear the station table in uCode, | ||
219 | */ | ||
220 | ret = iwl_send_cmd_pdu(priv, ctx->rxon_cmd, | ||
221 | sizeof(struct iwl_rxon_cmd), &ctx->staging); | ||
222 | if (ret) { | ||
223 | IWL_ERR(priv, "Error setting new RXON (%d)\n", ret); | ||
224 | return ret; | ||
225 | } | ||
226 | memcpy(active_rxon, &ctx->staging, sizeof(*active_rxon)); | ||
227 | } | ||
228 | iwl_print_rx_config_cmd(priv, ctx); | ||
229 | |||
230 | iwl_init_sensitivity(priv); | ||
231 | |||
232 | /* If we issue a new RXON command which required a tune then we must | ||
233 | * send a new TXPOWER command or we won't be able to Tx any frames */ | ||
234 | ret = priv->cfg->ops->lib->send_tx_power(priv); | ||
235 | if (ret) | ||
236 | IWL_ERR(priv, "Error sending TX power (%d)\n", ret); | ||
237 | return ret; | ||
238 | } | ||
239 | |||
240 | void iwl_update_chain_flags(struct iwl_priv *priv) | 93 | void iwl_update_chain_flags(struct iwl_priv *priv) |
241 | { | 94 | { |
242 | struct iwl_rxon_context *ctx; | 95 | struct iwl_rxon_context *ctx; |
@@ -394,7 +247,8 @@ static unsigned int iwl_hw_get_beacon_cmd(struct iwl_priv *priv, | |||
394 | 247 | ||
395 | return sizeof(*tx_beacon_cmd) + frame_size; | 248 | return sizeof(*tx_beacon_cmd) + frame_size; |
396 | } | 249 | } |
397 | static int iwl_send_beacon_cmd(struct iwl_priv *priv) | 250 | |
251 | int iwlagn_send_beacon_cmd(struct iwl_priv *priv) | ||
398 | { | 252 | { |
399 | struct iwl_frame *frame; | 253 | struct iwl_frame *frame; |
400 | unsigned int frame_size; | 254 | unsigned int frame_size; |
@@ -644,7 +498,7 @@ static void iwl_bg_beacon_update(struct work_struct *work) | |||
644 | 498 | ||
645 | priv->beacon_skb = beacon; | 499 | priv->beacon_skb = beacon; |
646 | 500 | ||
647 | iwl_send_beacon_cmd(priv); | 501 | iwlagn_send_beacon_cmd(priv); |
648 | out: | 502 | out: |
649 | mutex_unlock(&priv->mutex); | 503 | mutex_unlock(&priv->mutex); |
650 | } | 504 | } |
@@ -3292,92 +3146,6 @@ static void iwl_bg_rx_replenish(struct work_struct *data) | |||
3292 | mutex_unlock(&priv->mutex); | 3146 | mutex_unlock(&priv->mutex); |
3293 | } | 3147 | } |
3294 | 3148 | ||
3295 | #define IWL_DELAY_NEXT_SCAN (HZ*2) | ||
3296 | |||
3297 | void iwl_post_associate(struct iwl_priv *priv, struct ieee80211_vif *vif) | ||
3298 | { | ||
3299 | struct iwl_rxon_context *ctx; | ||
3300 | struct ieee80211_conf *conf = NULL; | ||
3301 | int ret = 0; | ||
3302 | |||
3303 | if (!vif || !priv->is_open) | ||
3304 | return; | ||
3305 | |||
3306 | ctx = iwl_rxon_ctx_from_vif(vif); | ||
3307 | |||
3308 | if (vif->type == NL80211_IFTYPE_AP) { | ||
3309 | IWL_ERR(priv, "%s Should not be called in AP mode\n", __func__); | ||
3310 | return; | ||
3311 | } | ||
3312 | |||
3313 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
3314 | return; | ||
3315 | |||
3316 | iwl_scan_cancel_timeout(priv, 200); | ||
3317 | |||
3318 | conf = ieee80211_get_hw_conf(priv->hw); | ||
3319 | |||
3320 | ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
3321 | iwlcore_commit_rxon(priv, ctx); | ||
3322 | |||
3323 | ret = iwl_send_rxon_timing(priv, ctx); | ||
3324 | if (ret) | ||
3325 | IWL_WARN(priv, "RXON timing - " | ||
3326 | "Attempting to continue.\n"); | ||
3327 | |||
3328 | ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; | ||
3329 | |||
3330 | iwl_set_rxon_ht(priv, &priv->current_ht_config); | ||
3331 | |||
3332 | if (priv->cfg->ops->hcmd->set_rxon_chain) | ||
3333 | priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx); | ||
3334 | |||
3335 | ctx->staging.assoc_id = cpu_to_le16(vif->bss_conf.aid); | ||
3336 | |||
3337 | IWL_DEBUG_ASSOC(priv, "assoc id %d beacon interval %d\n", | ||
3338 | vif->bss_conf.aid, vif->bss_conf.beacon_int); | ||
3339 | |||
3340 | if (vif->bss_conf.use_short_preamble) | ||
3341 | ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; | ||
3342 | else | ||
3343 | ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK; | ||
3344 | |||
3345 | if (ctx->staging.flags & RXON_FLG_BAND_24G_MSK) { | ||
3346 | if (vif->bss_conf.use_short_slot) | ||
3347 | ctx->staging.flags |= RXON_FLG_SHORT_SLOT_MSK; | ||
3348 | else | ||
3349 | ctx->staging.flags &= ~RXON_FLG_SHORT_SLOT_MSK; | ||
3350 | } | ||
3351 | |||
3352 | iwlcore_commit_rxon(priv, ctx); | ||
3353 | |||
3354 | IWL_DEBUG_ASSOC(priv, "Associated as %d to: %pM\n", | ||
3355 | vif->bss_conf.aid, ctx->active.bssid_addr); | ||
3356 | |||
3357 | switch (vif->type) { | ||
3358 | case NL80211_IFTYPE_STATION: | ||
3359 | break; | ||
3360 | case NL80211_IFTYPE_ADHOC: | ||
3361 | iwl_send_beacon_cmd(priv); | ||
3362 | break; | ||
3363 | default: | ||
3364 | IWL_ERR(priv, "%s Should not be called in %d mode\n", | ||
3365 | __func__, vif->type); | ||
3366 | break; | ||
3367 | } | ||
3368 | |||
3369 | /* the chain noise calibration will enabled PM upon completion | ||
3370 | * If chain noise has already been run, then we need to enable | ||
3371 | * power management here */ | ||
3372 | if (priv->chain_noise_data.state == IWL_CHAIN_NOISE_DONE) | ||
3373 | iwl_power_update_mode(priv, false); | ||
3374 | |||
3375 | /* Enable Rx differential gain and sensitivity calibrations */ | ||
3376 | iwl_chain_noise_reset(priv); | ||
3377 | priv->start_calib = 1; | ||
3378 | |||
3379 | } | ||
3380 | |||
3381 | /***************************************************************************** | 3149 | /***************************************************************************** |
3382 | * | 3150 | * |
3383 | * mac80211 entry point functions | 3151 | * mac80211 entry point functions |
@@ -3457,7 +3225,7 @@ static int iwl_mac_setup_register(struct iwl_priv *priv, | |||
3457 | } | 3225 | } |
3458 | 3226 | ||
3459 | 3227 | ||
3460 | static int iwl_mac_start(struct ieee80211_hw *hw) | 3228 | int iwlagn_mac_start(struct ieee80211_hw *hw) |
3461 | { | 3229 | { |
3462 | struct iwl_priv *priv = hw->priv; | 3230 | struct iwl_priv *priv = hw->priv; |
3463 | int ret; | 3231 | int ret; |
@@ -3498,7 +3266,7 @@ out: | |||
3498 | return 0; | 3266 | return 0; |
3499 | } | 3267 | } |
3500 | 3268 | ||
3501 | static void iwl_mac_stop(struct ieee80211_hw *hw) | 3269 | void iwlagn_mac_stop(struct ieee80211_hw *hw) |
3502 | { | 3270 | { |
3503 | struct iwl_priv *priv = hw->priv; | 3271 | struct iwl_priv *priv = hw->priv; |
3504 | 3272 | ||
@@ -3520,7 +3288,7 @@ static void iwl_mac_stop(struct ieee80211_hw *hw) | |||
3520 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 3288 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
3521 | } | 3289 | } |
3522 | 3290 | ||
3523 | static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | 3291 | int iwlagn_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) |
3524 | { | 3292 | { |
3525 | struct iwl_priv *priv = hw->priv; | 3293 | struct iwl_priv *priv = hw->priv; |
3526 | 3294 | ||
@@ -3536,73 +3304,12 @@ static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
3536 | return NETDEV_TX_OK; | 3304 | return NETDEV_TX_OK; |
3537 | } | 3305 | } |
3538 | 3306 | ||
3539 | void iwl_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif) | 3307 | void iwlagn_mac_update_tkip_key(struct ieee80211_hw *hw, |
3540 | { | 3308 | struct ieee80211_vif *vif, |
3541 | struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif); | 3309 | struct ieee80211_key_conf *keyconf, |
3542 | int ret = 0; | 3310 | struct ieee80211_sta *sta, |
3543 | 3311 | u32 iv32, u16 *phase1key) | |
3544 | lockdep_assert_held(&priv->mutex); | ||
3545 | |||
3546 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
3547 | return; | ||
3548 | |||
3549 | /* The following should be done only at AP bring up */ | ||
3550 | if (!iwl_is_associated_ctx(ctx)) { | ||
3551 | |||
3552 | /* RXON - unassoc (to set timing command) */ | ||
3553 | ctx->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
3554 | iwlcore_commit_rxon(priv, ctx); | ||
3555 | |||
3556 | /* RXON Timing */ | ||
3557 | ret = iwl_send_rxon_timing(priv, ctx); | ||
3558 | if (ret) | ||
3559 | IWL_WARN(priv, "RXON timing failed - " | ||
3560 | "Attempting to continue.\n"); | ||
3561 | |||
3562 | /* AP has all antennas */ | ||
3563 | priv->chain_noise_data.active_chains = | ||
3564 | priv->hw_params.valid_rx_ant; | ||
3565 | iwl_set_rxon_ht(priv, &priv->current_ht_config); | ||
3566 | if (priv->cfg->ops->hcmd->set_rxon_chain) | ||
3567 | priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx); | ||
3568 | |||
3569 | ctx->staging.assoc_id = 0; | ||
3570 | |||
3571 | if (vif->bss_conf.use_short_preamble) | ||
3572 | ctx->staging.flags |= | ||
3573 | RXON_FLG_SHORT_PREAMBLE_MSK; | ||
3574 | else | ||
3575 | ctx->staging.flags &= | ||
3576 | ~RXON_FLG_SHORT_PREAMBLE_MSK; | ||
3577 | |||
3578 | if (ctx->staging.flags & RXON_FLG_BAND_24G_MSK) { | ||
3579 | if (vif->bss_conf.use_short_slot) | ||
3580 | ctx->staging.flags |= | ||
3581 | RXON_FLG_SHORT_SLOT_MSK; | ||
3582 | else | ||
3583 | ctx->staging.flags &= | ||
3584 | ~RXON_FLG_SHORT_SLOT_MSK; | ||
3585 | } | ||
3586 | /* need to send beacon cmd before committing assoc RXON! */ | ||
3587 | iwl_send_beacon_cmd(priv); | ||
3588 | /* restore RXON assoc */ | ||
3589 | ctx->staging.filter_flags |= RXON_FILTER_ASSOC_MSK; | ||
3590 | iwlcore_commit_rxon(priv, ctx); | ||
3591 | } | ||
3592 | iwl_send_beacon_cmd(priv); | ||
3593 | |||
3594 | /* FIXME - we need to add code here to detect a totally new | ||
3595 | * configuration, reset the AP, unassoc, rxon timing, assoc, | ||
3596 | * clear sta table, add BCAST sta... */ | ||
3597 | } | ||
3598 | |||
3599 | static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw, | ||
3600 | struct ieee80211_vif *vif, | ||
3601 | struct ieee80211_key_conf *keyconf, | ||
3602 | struct ieee80211_sta *sta, | ||
3603 | u32 iv32, u16 *phase1key) | ||
3604 | { | 3312 | { |
3605 | |||
3606 | struct iwl_priv *priv = hw->priv; | 3313 | struct iwl_priv *priv = hw->priv; |
3607 | struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; | 3314 | struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; |
3608 | 3315 | ||
@@ -3614,10 +3321,9 @@ static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw, | |||
3614 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 3321 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
3615 | } | 3322 | } |
3616 | 3323 | ||
3617 | static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 3324 | int iwlagn_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
3618 | struct ieee80211_vif *vif, | 3325 | struct ieee80211_vif *vif, struct ieee80211_sta *sta, |
3619 | struct ieee80211_sta *sta, | 3326 | struct ieee80211_key_conf *key) |
3620 | struct ieee80211_key_conf *key) | ||
3621 | { | 3327 | { |
3622 | struct iwl_priv *priv = hw->priv; | 3328 | struct iwl_priv *priv = hw->priv; |
3623 | struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; | 3329 | struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; |
@@ -3684,10 +3390,10 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3684 | return ret; | 3390 | return ret; |
3685 | } | 3391 | } |
3686 | 3392 | ||
3687 | static int iwl_mac_ampdu_action(struct ieee80211_hw *hw, | 3393 | int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw, |
3688 | struct ieee80211_vif *vif, | 3394 | struct ieee80211_vif *vif, |
3689 | enum ieee80211_ampdu_mlme_action action, | 3395 | enum ieee80211_ampdu_mlme_action action, |
3690 | struct ieee80211_sta *sta, u16 tid, u16 *ssn) | 3396 | struct ieee80211_sta *sta, u16 tid, u16 *ssn) |
3691 | { | 3397 | { |
3692 | struct iwl_priv *priv = hw->priv; | 3398 | struct iwl_priv *priv = hw->priv; |
3693 | int ret = -EINVAL; | 3399 | int ret = -EINVAL; |
@@ -3768,10 +3474,10 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw, | |||
3768 | return ret; | 3474 | return ret; |
3769 | } | 3475 | } |
3770 | 3476 | ||
3771 | static void iwl_mac_sta_notify(struct ieee80211_hw *hw, | 3477 | static void iwlagn_mac_sta_notify(struct ieee80211_hw *hw, |
3772 | struct ieee80211_vif *vif, | 3478 | struct ieee80211_vif *vif, |
3773 | enum sta_notify_cmd cmd, | 3479 | enum sta_notify_cmd cmd, |
3774 | struct ieee80211_sta *sta) | 3480 | struct ieee80211_sta *sta) |
3775 | { | 3481 | { |
3776 | struct iwl_priv *priv = hw->priv; | 3482 | struct iwl_priv *priv = hw->priv; |
3777 | struct iwl_station_priv *sta_priv = (void *)sta->drv_priv; | 3483 | struct iwl_station_priv *sta_priv = (void *)sta->drv_priv; |
@@ -3798,9 +3504,9 @@ static void iwl_mac_sta_notify(struct ieee80211_hw *hw, | |||
3798 | } | 3504 | } |
3799 | } | 3505 | } |
3800 | 3506 | ||
3801 | static int iwlagn_mac_sta_add(struct ieee80211_hw *hw, | 3507 | int iwlagn_mac_sta_add(struct ieee80211_hw *hw, |
3802 | struct ieee80211_vif *vif, | 3508 | struct ieee80211_vif *vif, |
3803 | struct ieee80211_sta *sta) | 3509 | struct ieee80211_sta *sta) |
3804 | { | 3510 | { |
3805 | struct iwl_priv *priv = hw->priv; | 3511 | struct iwl_priv *priv = hw->priv; |
3806 | struct iwl_station_priv *sta_priv = (void *)sta->drv_priv; | 3512 | struct iwl_station_priv *sta_priv = (void *)sta->drv_priv; |
@@ -3841,8 +3547,8 @@ static int iwlagn_mac_sta_add(struct ieee80211_hw *hw, | |||
3841 | return 0; | 3547 | return 0; |
3842 | } | 3548 | } |
3843 | 3549 | ||
3844 | static void iwl_mac_channel_switch(struct ieee80211_hw *hw, | 3550 | void iwlagn_mac_channel_switch(struct ieee80211_hw *hw, |
3845 | struct ieee80211_channel_switch *ch_switch) | 3551 | struct ieee80211_channel_switch *ch_switch) |
3846 | { | 3552 | { |
3847 | struct iwl_priv *priv = hw->priv; | 3553 | struct iwl_priv *priv = hw->priv; |
3848 | const struct iwl_channel_info *ch_info; | 3554 | const struct iwl_channel_info *ch_info; |
@@ -3939,10 +3645,10 @@ out_exit: | |||
3939 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 3645 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
3940 | } | 3646 | } |
3941 | 3647 | ||
3942 | static void iwlagn_configure_filter(struct ieee80211_hw *hw, | 3648 | void iwlagn_configure_filter(struct ieee80211_hw *hw, |
3943 | unsigned int changed_flags, | 3649 | unsigned int changed_flags, |
3944 | unsigned int *total_flags, | 3650 | unsigned int *total_flags, |
3945 | u64 multicast) | 3651 | u64 multicast) |
3946 | { | 3652 | { |
3947 | struct iwl_priv *priv = hw->priv; | 3653 | struct iwl_priv *priv = hw->priv; |
3948 | __le32 filter_or = 0, filter_nand = 0; | 3654 | __le32 filter_or = 0, filter_nand = 0; |
@@ -3988,7 +3694,7 @@ static void iwlagn_configure_filter(struct ieee80211_hw *hw, | |||
3988 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; | 3694 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; |
3989 | } | 3695 | } |
3990 | 3696 | ||
3991 | static void iwl_mac_flush(struct ieee80211_hw *hw, bool drop) | 3697 | void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop) |
3992 | { | 3698 | { |
3993 | struct iwl_priv *priv = hw->priv; | 3699 | struct iwl_priv *priv = hw->priv; |
3994 | 3700 | ||
@@ -4198,25 +3904,24 @@ static void iwl_uninit_drv(struct iwl_priv *priv) | |||
4198 | } | 3904 | } |
4199 | 3905 | ||
4200 | struct ieee80211_ops iwlagn_hw_ops = { | 3906 | struct ieee80211_ops iwlagn_hw_ops = { |
4201 | .tx = iwl_mac_tx, | 3907 | .tx = iwlagn_mac_tx, |
4202 | .start = iwl_mac_start, | 3908 | .start = iwlagn_mac_start, |
4203 | .stop = iwl_mac_stop, | 3909 | .stop = iwlagn_mac_stop, |
4204 | .add_interface = iwl_mac_add_interface, | 3910 | .add_interface = iwl_mac_add_interface, |
4205 | .remove_interface = iwl_mac_remove_interface, | 3911 | .remove_interface = iwl_mac_remove_interface, |
4206 | .config = iwl_mac_config, | 3912 | .config = iwlagn_mac_config, |
4207 | .configure_filter = iwlagn_configure_filter, | 3913 | .configure_filter = iwlagn_configure_filter, |
4208 | .set_key = iwl_mac_set_key, | 3914 | .set_key = iwlagn_mac_set_key, |
4209 | .update_tkip_key = iwl_mac_update_tkip_key, | 3915 | .update_tkip_key = iwlagn_mac_update_tkip_key, |
4210 | .conf_tx = iwl_mac_conf_tx, | 3916 | .conf_tx = iwl_mac_conf_tx, |
4211 | .reset_tsf = iwl_mac_reset_tsf, | 3917 | .bss_info_changed = iwlagn_bss_info_changed, |
4212 | .bss_info_changed = iwl_bss_info_changed, | 3918 | .ampdu_action = iwlagn_mac_ampdu_action, |
4213 | .ampdu_action = iwl_mac_ampdu_action, | ||
4214 | .hw_scan = iwl_mac_hw_scan, | 3919 | .hw_scan = iwl_mac_hw_scan, |
4215 | .sta_notify = iwl_mac_sta_notify, | 3920 | .sta_notify = iwlagn_mac_sta_notify, |
4216 | .sta_add = iwlagn_mac_sta_add, | 3921 | .sta_add = iwlagn_mac_sta_add, |
4217 | .sta_remove = iwl_mac_sta_remove, | 3922 | .sta_remove = iwl_mac_sta_remove, |
4218 | .channel_switch = iwl_mac_channel_switch, | 3923 | .channel_switch = iwlagn_mac_channel_switch, |
4219 | .flush = iwl_mac_flush, | 3924 | .flush = iwlagn_mac_flush, |
4220 | .tx_last_beacon = iwl_mac_tx_last_beacon, | 3925 | .tx_last_beacon = iwl_mac_tx_last_beacon, |
4221 | }; | 3926 | }; |
4222 | 3927 | ||
@@ -4287,6 +3992,9 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
4287 | dev_printk(KERN_DEBUG, &(pdev->dev), | 3992 | dev_printk(KERN_DEBUG, &(pdev->dev), |
4288 | "sw scan support is deprecated\n"); | 3993 | "sw scan support is deprecated\n"); |
4289 | iwlagn_hw_ops.hw_scan = NULL; | 3994 | iwlagn_hw_ops.hw_scan = NULL; |
3995 | #ifdef CONFIG_IWL4965 | ||
3996 | iwl4965_hw_ops.hw_scan = NULL; | ||
3997 | #endif | ||
4290 | } | 3998 | } |
4291 | 3999 | ||
4292 | hw = iwl_alloc_all(cfg); | 4000 | hw = iwl_alloc_all(cfg); |
@@ -4321,6 +4029,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
4321 | BIT(NL80211_IFTYPE_ADHOC); | 4029 | BIT(NL80211_IFTYPE_ADHOC); |
4322 | priv->contexts[IWL_RXON_CTX_BSS].interface_modes = | 4030 | priv->contexts[IWL_RXON_CTX_BSS].interface_modes = |
4323 | BIT(NL80211_IFTYPE_STATION); | 4031 | BIT(NL80211_IFTYPE_STATION); |
4032 | priv->contexts[IWL_RXON_CTX_BSS].ap_devtype = RXON_DEV_TYPE_AP; | ||
4324 | priv->contexts[IWL_RXON_CTX_BSS].ibss_devtype = RXON_DEV_TYPE_IBSS; | 4033 | priv->contexts[IWL_RXON_CTX_BSS].ibss_devtype = RXON_DEV_TYPE_IBSS; |
4325 | priv->contexts[IWL_RXON_CTX_BSS].station_devtype = RXON_DEV_TYPE_ESS; | 4034 | priv->contexts[IWL_RXON_CTX_BSS].station_devtype = RXON_DEV_TYPE_ESS; |
4326 | priv->contexts[IWL_RXON_CTX_BSS].unused_devtype = RXON_DEV_TYPE_ESS; | 4035 | priv->contexts[IWL_RXON_CTX_BSS].unused_devtype = RXON_DEV_TYPE_ESS; |