diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2008-09-02 23:26:21 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-08 14:23:13 -0400 |
commit | cd56d3313dedaf68ec393974339edaacab74f82f (patch) | |
tree | de2ee2db5f072af17286879e7af571b823cff276 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | 701b9cb37bae3d50dbe5f345a7cdbd2648bf7df6 (diff) |
iwlwifi : Added bss_info_changed callback to 3945
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@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 | 74 |
1 files changed, 68 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index cee3045f1606..7e3e5bfed681 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6320,11 +6320,8 @@ static void iwl3945_bg_rx_replenish(struct work_struct *data) | |||
6320 | 6320 | ||
6321 | #define IWL_DELAY_NEXT_SCAN (HZ*2) | 6321 | #define IWL_DELAY_NEXT_SCAN (HZ*2) |
6322 | 6322 | ||
6323 | static void iwl3945_bg_post_associate(struct work_struct *data) | 6323 | static void iwl3945_post_associate(struct iwl3945_priv *priv) |
6324 | { | 6324 | { |
6325 | struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv, | ||
6326 | post_associate.work); | ||
6327 | |||
6328 | int rc = 0; | 6325 | int rc = 0; |
6329 | struct ieee80211_conf *conf = NULL; | 6326 | struct ieee80211_conf *conf = NULL; |
6330 | DECLARE_MAC_BUF(mac); | 6327 | DECLARE_MAC_BUF(mac); |
@@ -6342,8 +6339,6 @@ static void iwl3945_bg_post_associate(struct work_struct *data) | |||
6342 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | 6339 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) |
6343 | return; | 6340 | return; |
6344 | 6341 | ||
6345 | mutex_lock(&priv->mutex); | ||
6346 | |||
6347 | if (!priv->vif || !priv->is_open) { | 6342 | if (!priv->vif || !priv->is_open) { |
6348 | mutex_unlock(&priv->mutex); | 6343 | mutex_unlock(&priv->mutex); |
6349 | return; | 6344 | return; |
@@ -6419,6 +6414,15 @@ static void iwl3945_bg_post_associate(struct work_struct *data) | |||
6419 | 6414 | ||
6420 | /* we have just associated, don't start scan too early */ | 6415 | /* we have just associated, don't start scan too early */ |
6421 | priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN; | 6416 | priv->next_scan_jiffies = jiffies + IWL_DELAY_NEXT_SCAN; |
6417 | } | ||
6418 | |||
6419 | static void iwl3945_bg_post_associate(struct work_struct *data) | ||
6420 | { | ||
6421 | struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv, | ||
6422 | post_associate.work); | ||
6423 | |||
6424 | mutex_lock(&priv->mutex); | ||
6425 | iwl3945_post_associate(priv); | ||
6422 | mutex_unlock(&priv->mutex); | 6426 | mutex_unlock(&priv->mutex); |
6423 | } | 6427 | } |
6424 | 6428 | ||
@@ -6948,6 +6952,63 @@ static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, | |||
6948 | IWL_DEBUG_MAC80211("leave\n"); | 6952 | IWL_DEBUG_MAC80211("leave\n"); |
6949 | } | 6953 | } |
6950 | 6954 | ||
6955 | #define IWL_DELAY_NEXT_SCAN_AFTER_ASSOC (HZ*6) | ||
6956 | |||
6957 | static void iwl3945_bss_info_changed(struct ieee80211_hw *hw, | ||
6958 | struct ieee80211_vif *vif, | ||
6959 | struct ieee80211_bss_conf *bss_conf, | ||
6960 | u32 changes) | ||
6961 | { | ||
6962 | struct iwl3945_priv *priv = hw->priv; | ||
6963 | |||
6964 | IWL_DEBUG_MAC80211("changes = 0x%X\n", changes); | ||
6965 | |||
6966 | if (changes & BSS_CHANGED_ERP_PREAMBLE) { | ||
6967 | IWL_DEBUG_MAC80211("ERP_PREAMBLE %d\n", | ||
6968 | bss_conf->use_short_preamble); | ||
6969 | if (bss_conf->use_short_preamble) | ||
6970 | priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; | ||
6971 | else | ||
6972 | priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK; | ||
6973 | } | ||
6974 | |||
6975 | if (changes & BSS_CHANGED_ERP_CTS_PROT) { | ||
6976 | IWL_DEBUG_MAC80211("ERP_CTS %d\n", bss_conf->use_cts_prot); | ||
6977 | if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ)) | ||
6978 | priv->staging_rxon.flags |= RXON_FLG_TGG_PROTECT_MSK; | ||
6979 | else | ||
6980 | priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK; | ||
6981 | } | ||
6982 | |||
6983 | if (changes & BSS_CHANGED_ASSOC) { | ||
6984 | IWL_DEBUG_MAC80211("ASSOC %d\n", bss_conf->assoc); | ||
6985 | /* This should never happen as this function should | ||
6986 | * never be called from interrupt context. */ | ||
6987 | if (WARN_ON_ONCE(in_interrupt())) | ||
6988 | return; | ||
6989 | if (bss_conf->assoc) { | ||
6990 | priv->assoc_id = bss_conf->aid; | ||
6991 | priv->beacon_int = bss_conf->beacon_int; | ||
6992 | priv->timestamp0 = bss_conf->timestamp & 0xFFFFFFFF; | ||
6993 | priv->timestamp1 = (bss_conf->timestamp >> 32) & | ||
6994 | 0xFFFFFFFF; | ||
6995 | priv->assoc_capability = bss_conf->assoc_capability; | ||
6996 | priv->next_scan_jiffies = jiffies + | ||
6997 | IWL_DELAY_NEXT_SCAN_AFTER_ASSOC; | ||
6998 | mutex_lock(&priv->mutex); | ||
6999 | iwl3945_post_associate(priv); | ||
7000 | mutex_unlock(&priv->mutex); | ||
7001 | } else { | ||
7002 | priv->assoc_id = 0; | ||
7003 | IWL_DEBUG_MAC80211("DISASSOC %d\n", bss_conf->assoc); | ||
7004 | } | ||
7005 | } else if (changes && iwl3945_is_associated(priv) && priv->assoc_id) { | ||
7006 | IWL_DEBUG_MAC80211("Associated Changes %d\n", changes); | ||
7007 | iwl3945_send_rxon_assoc(priv); | ||
7008 | } | ||
7009 | |||
7010 | } | ||
7011 | |||
6951 | static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len) | 7012 | static int iwl3945_mac_hw_scan(struct ieee80211_hw *hw, u8 *ssid, size_t len) |
6952 | { | 7013 | { |
6953 | int rc = 0; | 7014 | int rc = 0; |
@@ -7828,6 +7889,7 @@ static struct ieee80211_ops iwl3945_hw_ops = { | |||
7828 | .conf_tx = iwl3945_mac_conf_tx, | 7889 | .conf_tx = iwl3945_mac_conf_tx, |
7829 | .get_tsf = iwl3945_mac_get_tsf, | 7890 | .get_tsf = iwl3945_mac_get_tsf, |
7830 | .reset_tsf = iwl3945_mac_reset_tsf, | 7891 | .reset_tsf = iwl3945_mac_reset_tsf, |
7892 | .bss_info_changed = iwl3945_bss_info_changed, | ||
7831 | .hw_scan = iwl3945_mac_hw_scan | 7893 | .hw_scan = iwl3945_mac_hw_scan |
7832 | }; | 7894 | }; |
7833 | 7895 | ||