diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-03-28 19:33:33 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-04-08 15:05:56 -0400 |
commit | 98952d5decf8195b2cbb96d47572278335a8a8d8 (patch) | |
tree | d30ca579fd41eb76633dc1bce93ee15b740e7874 | |
parent | 38668c059f5202f5fd9612391f9aa1b38a97241b (diff) |
iwlwifi: eliminate conf_ht
This patch eliminates the use of conf_ht in iwlwifi driver, replacing it
with bss_info_changed.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 146 |
1 files changed, 63 insertions, 83 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 8d49ff4bd4db..826c912aea9a 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -6941,6 +6941,64 @@ static void iwl4965_mac_remove_interface(struct ieee80211_hw *hw, | |||
6941 | 6941 | ||
6942 | } | 6942 | } |
6943 | 6943 | ||
6944 | |||
6945 | #ifdef CONFIG_IWL4965_HT | ||
6946 | static void iwl4965_ht_conf(struct iwl_priv *priv, | ||
6947 | struct ieee80211_bss_conf *bss_conf) | ||
6948 | { | ||
6949 | struct ieee80211_ht_info *ht_conf = bss_conf->ht_conf; | ||
6950 | struct ieee80211_ht_bss_info *ht_bss_conf = bss_conf->ht_bss_conf; | ||
6951 | struct iwl_ht_info *iwl_conf = &priv->current_ht_config; | ||
6952 | |||
6953 | IWL_DEBUG_MAC80211("enter: \n"); | ||
6954 | |||
6955 | iwl_conf->is_ht = bss_conf->assoc_ht; | ||
6956 | |||
6957 | if (!iwl_conf->is_ht) | ||
6958 | return; | ||
6959 | |||
6960 | priv->ps_mode = (u8)((ht_conf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2); | ||
6961 | |||
6962 | if (ht_conf->cap & IEEE80211_HT_CAP_SGI_20) | ||
6963 | iwl_conf->sgf |= 0x1; | ||
6964 | if (ht_conf->cap & IEEE80211_HT_CAP_SGI_40) | ||
6965 | iwl_conf->sgf |= 0x2; | ||
6966 | |||
6967 | iwl_conf->is_green_field = !!(ht_conf->cap & IEEE80211_HT_CAP_GRN_FLD); | ||
6968 | iwl_conf->max_amsdu_size = | ||
6969 | !!(ht_conf->cap & IEEE80211_HT_CAP_MAX_AMSDU); | ||
6970 | |||
6971 | iwl_conf->supported_chan_width = | ||
6972 | !!(ht_conf->cap & IEEE80211_HT_CAP_SUP_WIDTH); | ||
6973 | iwl_conf->extension_chan_offset = | ||
6974 | ht_bss_conf->bss_cap & IEEE80211_HT_IE_CHA_SEC_OFFSET; | ||
6975 | /* If no above or below channel supplied disable FAT channel */ | ||
6976 | if (iwl_conf->extension_chan_offset != IWL_EXT_CHANNEL_OFFSET_ABOVE && | ||
6977 | iwl_conf->extension_chan_offset != IWL_EXT_CHANNEL_OFFSET_BELOW) | ||
6978 | iwl_conf->supported_chan_width = 0; | ||
6979 | |||
6980 | iwl_conf->tx_mimo_ps_mode = | ||
6981 | (u8)((ht_conf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2); | ||
6982 | memcpy(iwl_conf->supp_mcs_set, ht_conf->supp_mcs_set, 16); | ||
6983 | |||
6984 | iwl_conf->control_channel = ht_bss_conf->primary_channel; | ||
6985 | iwl_conf->tx_chan_width = | ||
6986 | !!(ht_bss_conf->bss_cap & IEEE80211_HT_IE_CHA_WIDTH); | ||
6987 | iwl_conf->ht_protection = | ||
6988 | ht_bss_conf->bss_op_mode & IEEE80211_HT_IE_HT_PROTECTION; | ||
6989 | iwl_conf->non_GF_STA_present = | ||
6990 | !!(ht_bss_conf->bss_op_mode & IEEE80211_HT_IE_NON_GF_STA_PRSNT); | ||
6991 | |||
6992 | IWL_DEBUG_MAC80211("control channel %d\n", iwl_conf->control_channel); | ||
6993 | IWL_DEBUG_MAC80211("leave\n"); | ||
6994 | } | ||
6995 | #else | ||
6996 | static inline void iwl4965_ht_conf(struct iwl_priv *priv, | ||
6997 | struct ieee80211_bss_conf *bss_conf) | ||
6998 | { | ||
6999 | } | ||
7000 | #endif | ||
7001 | |||
6944 | static void iwl4965_bss_info_changed(struct ieee80211_hw *hw, | 7002 | static void iwl4965_bss_info_changed(struct ieee80211_hw *hw, |
6945 | struct ieee80211_vif *vif, | 7003 | struct ieee80211_vif *vif, |
6946 | struct ieee80211_bss_conf *bss_conf, | 7004 | struct ieee80211_bss_conf *bss_conf, |
@@ -6962,6 +7020,11 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw, | |||
6962 | priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK; | 7020 | priv->staging_rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK; |
6963 | } | 7021 | } |
6964 | 7022 | ||
7023 | if (changes & BSS_CHANGED_HT) { | ||
7024 | iwl4965_ht_conf(priv, bss_conf); | ||
7025 | iwl4965_set_rxon_chain(priv); | ||
7026 | } | ||
7027 | |||
6965 | if (changes & BSS_CHANGED_ASSOC) { | 7028 | if (changes & BSS_CHANGED_ASSOC) { |
6966 | /* | 7029 | /* |
6967 | * TODO: | 7030 | * TODO: |
@@ -7358,88 +7421,6 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk | |||
7358 | return 0; | 7421 | return 0; |
7359 | } | 7422 | } |
7360 | 7423 | ||
7361 | #ifdef CONFIG_IWL4965_HT | ||
7362 | |||
7363 | static void iwl4965_ht_info_fill(struct ieee80211_conf *conf, | ||
7364 | struct iwl_priv *priv) | ||
7365 | { | ||
7366 | struct iwl_ht_info *iwl_conf = &priv->current_ht_config; | ||
7367 | struct ieee80211_ht_info *ht_conf = &conf->ht_conf; | ||
7368 | struct ieee80211_ht_bss_info *ht_bss_conf = &conf->ht_bss_conf; | ||
7369 | |||
7370 | IWL_DEBUG_MAC80211("enter: \n"); | ||
7371 | |||
7372 | if (!(conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE)) { | ||
7373 | iwl_conf->is_ht = 0; | ||
7374 | return; | ||
7375 | } | ||
7376 | |||
7377 | iwl_conf->is_ht = 1; | ||
7378 | priv->ps_mode = (u8)((ht_conf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2); | ||
7379 | |||
7380 | if (ht_conf->cap & IEEE80211_HT_CAP_SGI_20) | ||
7381 | iwl_conf->sgf |= 0x1; | ||
7382 | if (ht_conf->cap & IEEE80211_HT_CAP_SGI_40) | ||
7383 | iwl_conf->sgf |= 0x2; | ||
7384 | |||
7385 | iwl_conf->is_green_field = !!(ht_conf->cap & IEEE80211_HT_CAP_GRN_FLD); | ||
7386 | iwl_conf->max_amsdu_size = | ||
7387 | !!(ht_conf->cap & IEEE80211_HT_CAP_MAX_AMSDU); | ||
7388 | |||
7389 | iwl_conf->supported_chan_width = | ||
7390 | !!(ht_conf->cap & IEEE80211_HT_CAP_SUP_WIDTH); | ||
7391 | iwl_conf->extension_chan_offset = | ||
7392 | ht_bss_conf->bss_cap & IEEE80211_HT_IE_CHA_SEC_OFFSET; | ||
7393 | /* If no above or below channel supplied disable FAT channel */ | ||
7394 | if (iwl_conf->extension_chan_offset != IWL_EXT_CHANNEL_OFFSET_ABOVE && | ||
7395 | iwl_conf->extension_chan_offset != IWL_EXT_CHANNEL_OFFSET_BELOW) | ||
7396 | iwl_conf->supported_chan_width = 0; | ||
7397 | |||
7398 | iwl_conf->tx_mimo_ps_mode = | ||
7399 | (u8)((ht_conf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2); | ||
7400 | memcpy(iwl_conf->supp_mcs_set, ht_conf->supp_mcs_set, 16); | ||
7401 | |||
7402 | iwl_conf->control_channel = ht_bss_conf->primary_channel; | ||
7403 | iwl_conf->tx_chan_width = | ||
7404 | !!(ht_bss_conf->bss_cap & IEEE80211_HT_IE_CHA_WIDTH); | ||
7405 | iwl_conf->ht_protection = | ||
7406 | ht_bss_conf->bss_op_mode & IEEE80211_HT_IE_HT_PROTECTION; | ||
7407 | iwl_conf->non_GF_STA_present = | ||
7408 | !!(ht_bss_conf->bss_op_mode & IEEE80211_HT_IE_NON_GF_STA_PRSNT); | ||
7409 | |||
7410 | IWL_DEBUG_MAC80211("control channel %d\n", | ||
7411 | iwl_conf->control_channel); | ||
7412 | IWL_DEBUG_MAC80211("leave\n"); | ||
7413 | } | ||
7414 | |||
7415 | static int iwl4965_mac_conf_ht(struct ieee80211_hw *hw, | ||
7416 | struct ieee80211_conf *conf) | ||
7417 | { | ||
7418 | struct iwl_priv *priv = hw->priv; | ||
7419 | |||
7420 | IWL_DEBUG_MAC80211("enter: \n"); | ||
7421 | |||
7422 | iwl4965_ht_info_fill(conf, priv); | ||
7423 | iwl4965_set_rxon_chain(priv); | ||
7424 | |||
7425 | if (priv && priv->assoc_id && | ||
7426 | (priv->iw_mode == IEEE80211_IF_TYPE_STA)) { | ||
7427 | unsigned long flags; | ||
7428 | |||
7429 | spin_lock_irqsave(&priv->lock, flags); | ||
7430 | if (priv->beacon_int) | ||
7431 | queue_work(priv->workqueue, &priv->post_associate.work); | ||
7432 | else | ||
7433 | priv->call_post_assoc_from_beacon = 1; | ||
7434 | spin_unlock_irqrestore(&priv->lock, flags); | ||
7435 | } | ||
7436 | |||
7437 | IWL_DEBUG_MAC80211("leave:\n"); | ||
7438 | return 0; | ||
7439 | } | ||
7440 | |||
7441 | #endif /*CONFIG_IWL4965_HT*/ | ||
7442 | |||
7443 | /***************************************************************************** | 7424 | /***************************************************************************** |
7444 | * | 7425 | * |
7445 | * sysfs attributes | 7426 | * sysfs attributes |
@@ -7999,7 +7980,6 @@ static struct ieee80211_ops iwl4965_hw_ops = { | |||
7999 | .beacon_update = iwl4965_mac_beacon_update, | 7980 | .beacon_update = iwl4965_mac_beacon_update, |
8000 | .bss_info_changed = iwl4965_bss_info_changed, | 7981 | .bss_info_changed = iwl4965_bss_info_changed, |
8001 | #ifdef CONFIG_IWL4965_HT | 7982 | #ifdef CONFIG_IWL4965_HT |
8002 | .conf_ht = iwl4965_mac_conf_ht, | ||
8003 | .ampdu_action = iwl4965_mac_ampdu_action, | 7983 | .ampdu_action = iwl4965_mac_ampdu_action, |
8004 | #endif /* CONFIG_IWL4965_HT */ | 7984 | #endif /* CONFIG_IWL4965_HT */ |
8005 | .hw_scan = iwl4965_mac_hw_scan | 7985 | .hw_scan = iwl4965_mac_hw_scan |