diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2009-04-08 14:26:35 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:41 -0400 |
commit | 5bbe233b9bafabc08a5404d54b9fa086e8390fc7 (patch) | |
tree | f0a4a015d2429d9b2aac4c198543e483494d9214 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | de2b3e864aa908e613dd9912def88af7877d85f3 (diff) |
iwl3945: use iwl_bss_info_changed
3945 can use iwl_bss_info_changed.
A new lib op is created for post_assoicate to distinguish between
3945 and iwlwifi's post_associate operations.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@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/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 116 |
1 files changed, 6 insertions, 110 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index ed31030c7643..6f44abc2dce0 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -233,50 +233,6 @@ u8 iwl3945_add_station(struct iwl_priv *priv, const u8 *addr, int is_ap, u8 flag | |||
233 | 233 | ||
234 | } | 234 | } |
235 | 235 | ||
236 | static int iwl3945_send_rxon_assoc(struct iwl_priv *priv) | ||
237 | { | ||
238 | int rc = 0; | ||
239 | struct iwl_rx_packet *res = NULL; | ||
240 | struct iwl3945_rxon_assoc_cmd rxon_assoc; | ||
241 | struct iwl_host_cmd cmd = { | ||
242 | .id = REPLY_RXON_ASSOC, | ||
243 | .len = sizeof(rxon_assoc), | ||
244 | .meta.flags = CMD_WANT_SKB, | ||
245 | .data = &rxon_assoc, | ||
246 | }; | ||
247 | const struct iwl_rxon_cmd *rxon1 = &priv->staging_rxon; | ||
248 | const struct iwl_rxon_cmd *rxon2 = &priv->active_rxon; | ||
249 | |||
250 | if ((rxon1->flags == rxon2->flags) && | ||
251 | (rxon1->filter_flags == rxon2->filter_flags) && | ||
252 | (rxon1->cck_basic_rates == rxon2->cck_basic_rates) && | ||
253 | (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) { | ||
254 | IWL_DEBUG_INFO(priv, "Using current RXON_ASSOC. Not resending.\n"); | ||
255 | return 0; | ||
256 | } | ||
257 | |||
258 | rxon_assoc.flags = priv->staging_rxon.flags; | ||
259 | rxon_assoc.filter_flags = priv->staging_rxon.filter_flags; | ||
260 | rxon_assoc.ofdm_basic_rates = priv->staging_rxon.ofdm_basic_rates; | ||
261 | rxon_assoc.cck_basic_rates = priv->staging_rxon.cck_basic_rates; | ||
262 | rxon_assoc.reserved = 0; | ||
263 | |||
264 | rc = iwl_send_cmd_sync(priv, &cmd); | ||
265 | if (rc) | ||
266 | return rc; | ||
267 | |||
268 | res = (struct iwl_rx_packet *)cmd.meta.u.skb->data; | ||
269 | if (res->hdr.flags & IWL_CMD_FAILED_MSK) { | ||
270 | IWL_ERR(priv, "Bad return from REPLY_RXON_ASSOC command\n"); | ||
271 | rc = -EIO; | ||
272 | } | ||
273 | |||
274 | priv->alloc_rxb_skb--; | ||
275 | dev_kfree_skb_any(cmd.meta.u.skb); | ||
276 | |||
277 | return rc; | ||
278 | } | ||
279 | |||
280 | /** | 236 | /** |
281 | * iwl3945_get_antenna_flags - Get antenna flags for RXON command | 237 | * iwl3945_get_antenna_flags - Get antenna flags for RXON command |
282 | * @priv: eeprom and antenna fields are used to determine antenna flags | 238 | * @priv: eeprom and antenna fields are used to determine antenna flags |
@@ -352,7 +308,7 @@ static int iwl3945_commit_rxon(struct iwl_priv *priv) | |||
352 | * iwl3945_rxon_assoc_cmd which is used to reconfigure filter | 308 | * iwl3945_rxon_assoc_cmd which is used to reconfigure filter |
353 | * and other flags for the current radio configuration. */ | 309 | * and other flags for the current radio configuration. */ |
354 | if (!iwl_full_rxon_required(priv)) { | 310 | if (!iwl_full_rxon_required(priv)) { |
355 | rc = iwl3945_send_rxon_assoc(priv); | 311 | rc = iwl_send_rxon_assoc(priv); |
356 | if (rc) { | 312 | if (rc) { |
357 | IWL_ERR(priv, "Error setting RXON_ASSOC " | 313 | IWL_ERR(priv, "Error setting RXON_ASSOC " |
358 | "configuration (%d).\n", rc); | 314 | "configuration (%d).\n", rc); |
@@ -3450,9 +3406,11 @@ static void iwl3945_bg_rx_replenish(struct work_struct *data) | |||
3450 | mutex_unlock(&priv->mutex); | 3406 | mutex_unlock(&priv->mutex); |
3451 | } | 3407 | } |
3452 | 3408 | ||
3409 | static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed); | ||
3410 | |||
3453 | #define IWL_DELAY_NEXT_SCAN (HZ*2) | 3411 | #define IWL_DELAY_NEXT_SCAN (HZ*2) |
3454 | 3412 | ||
3455 | static void iwl3945_post_associate(struct iwl_priv *priv) | 3413 | void iwl3945_post_associate(struct iwl_priv *priv) |
3456 | { | 3414 | { |
3457 | int rc = 0; | 3415 | int rc = 0; |
3458 | struct ieee80211_conf *conf = NULL; | 3416 | struct ieee80211_conf *conf = NULL; |
@@ -3542,8 +3500,6 @@ static void iwl3945_post_associate(struct iwl_priv *priv) | |||
3542 | priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN; | 3500 | priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN; |
3543 | } | 3501 | } |
3544 | 3502 | ||
3545 | static int iwl3945_mac_config(struct ieee80211_hw *hw, u32 changed); | ||
3546 | |||
3547 | /***************************************************************************** | 3503 | /***************************************************************************** |
3548 | * | 3504 | * |
3549 | * mac80211 entry point functions | 3505 | * mac80211 entry point functions |
@@ -3982,66 +3938,6 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, | |||
3982 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 3938 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
3983 | } | 3939 | } |
3984 | 3940 | ||
3985 | #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) | ||
3986 | |||
3987 | static void iwl3945_bss_info_changed(struct ieee80211_hw *hw, | ||
3988 | struct ieee80211_vif *vif, | ||
3989 | struct ieee80211_bss_conf *bss_conf, | ||
3990 | u32 changes) | ||
3991 | { | ||
3992 | struct iwl_priv *priv = hw->priv; | ||
3993 | |||
3994 | IWL_DEBUG_MAC80211(priv, "changes = 0x%X\n", changes); | ||
3995 | |||
3996 | if (changes & BSS_CHANGED_ERP_PREAMBLE) { | ||
3997 | IWL_DEBUG_MAC80211(priv, "ERP_PREAMBLE %d\n", | ||
3998 | bss_conf->use_short_preamble); | ||
3999 | if (bss_conf->use_short_preamble) | ||
4000 | priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; | ||
4001 | else | ||
4002 | priv->staging_rxon.flags &= | ||
4003 | ~RXON_FLG_SHORT_PREAMBLE_MSK; | ||
4004 | } | ||
4005 | |||
4006 | if (changes & BSS_CHANGED_ERP_CTS_PROT) { | ||
4007 | IWL_DEBUG_MAC80211(priv, "ERP_CTS %d\n", | ||
4008 | bss_conf->use_cts_prot); | ||
4009 | if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ)) | ||
4010 | priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK; | ||
4011 | else | ||
4012 | priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK; | ||
4013 | } | ||
4014 | |||
4015 | if (changes & BSS_CHANGED_ASSOC) { | ||
4016 | IWL_DEBUG_MAC80211(priv, "ASSOC %d\n", bss_conf->assoc); | ||
4017 | /* This should never happen as this function should | ||
4018 | * never be called from interrupt context. */ | ||
4019 | if (WARN_ON_ONCE(in_interrupt())) | ||
4020 | return; | ||
4021 | if (bss_conf->assoc) { | ||
4022 | priv->assoc_id = bss_conf->aid; | ||
4023 | priv->beacon_int = bss_conf->beacon_int; | ||
4024 | priv->timestamp = bss_conf->timestamp; | ||
4025 | priv->assoc_capability = bss_conf->assoc_capability; | ||
4026 | priv->power_data.dtim_period = bss_conf->dtim_period; | ||
4027 | priv->next_scan_jiffies = jiffies + | ||
4028 | IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; | ||
4029 | mutex_lock(&priv->mutex); | ||
4030 | iwl3945_post_associate(priv); | ||
4031 | mutex_unlock(&priv->mutex); | ||
4032 | } else { | ||
4033 | priv->assoc_id = 0; | ||
4034 | IWL_DEBUG_MAC80211(priv, | ||
4035 | "DISASSOC %d\n", bss_conf->assoc); | ||
4036 | } | ||
4037 | } else if (changes && iwl_is_associated(priv) && priv->assoc_id) { | ||
4038 | IWL_DEBUG_MAC80211(priv, | ||
4039 | "Associated Changes %d\n", changes); | ||
4040 | iwl3945_send_rxon_assoc(priv); | ||
4041 | } | ||
4042 | |||
4043 | } | ||
4044 | |||
4045 | static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 3941 | static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
4046 | struct ieee80211_vif *vif, | 3942 | struct ieee80211_vif *vif, |
4047 | struct ieee80211_sta *sta, | 3943 | struct ieee80211_sta *sta, |
@@ -4227,7 +4123,7 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk | |||
4227 | 4123 | ||
4228 | iwl_reset_qos(priv); | 4124 | iwl_reset_qos(priv); |
4229 | 4125 | ||
4230 | iwl3945_post_associate(priv); | 4126 | priv->cfg->ops->lib->post_associate(priv); |
4231 | 4127 | ||
4232 | 4128 | ||
4233 | return 0; | 4129 | return 0; |
@@ -4765,7 +4661,7 @@ static struct ieee80211_ops iwl3945_hw_ops = { | |||
4765 | .get_tx_stats = iwl3945_mac_get_tx_stats, | 4661 | .get_tx_stats = iwl3945_mac_get_tx_stats, |
4766 | .conf_tx = iwl_mac_conf_tx, | 4662 | .conf_tx = iwl_mac_conf_tx, |
4767 | .reset_tsf = iwl3945_mac_reset_tsf, | 4663 | .reset_tsf = iwl3945_mac_reset_tsf, |
4768 | .bss_info_changed = iwl3945_bss_info_changed, | 4664 | .bss_info_changed = iwl_bss_info_changed, |
4769 | .hw_scan = iwl_mac_hw_scan | 4665 | .hw_scan = iwl_mac_hw_scan |
4770 | }; | 4666 | }; |
4771 | 4667 | ||