diff options
author | Daniel C Halperin <daniel.c.halperin@intel.com> | 2009-08-13 16:30:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-20 11:33:12 -0400 |
commit | b261793da587160d12ce6d63db60493342ddce20 (patch) | |
tree | d6c8d01469cfadc1afffb8306ca5d8f73455ffe8 /drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |
parent | 28e6f48953f44f7eb615383efe6e7f17624a11bb (diff) |
iwlwifi: use station HT capabilities and BSS operating mode for Green-field
Green-field mode should be configured in the HT station table. This patch uses
both the per-station GF support flag as well as the current BSS HT operation
mode (non-GF stations present flag).
Added the "ht_greenfield_support" field to struct iwl_cfg to replace the
device-specific check in rs_use_green(). That check has been moved to
iwlcore_init_ht_hw_capab().
Signed-off-by: Daniel C Halperin <daniel.c.halperin@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/iwl-agn-rs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 3b1bbc394a49..fee110de5c6a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -657,19 +657,15 @@ static int rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags, | |||
657 | return 1; | 657 | return 1; |
658 | } | 658 | } |
659 | 659 | ||
660 | /* in 4965 we don't use greenfield at all */ | 660 | /** |
661 | static inline u8 rs_use_green(struct iwl_priv *priv, | 661 | * Green-field mode is valid if the station supports it and |
662 | struct ieee80211_conf *conf) | 662 | * there are no non-GF stations present in the BSS. |
663 | */ | ||
664 | static inline u8 rs_use_green(struct ieee80211_sta *sta, | ||
665 | struct iwl_ht_info *ht_conf) | ||
663 | { | 666 | { |
664 | u8 is_green; | 667 | return (sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) && |
665 | 668 | !(ht_conf->non_GF_STA_present); | |
666 | if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965) | ||
667 | is_green = 0; | ||
668 | else | ||
669 | is_green = (conf_is_ht(conf) && | ||
670 | priv->current_ht_config.is_green_field && | ||
671 | !priv->current_ht_config.non_GF_STA_present); | ||
672 | return is_green; | ||
673 | } | 669 | } |
674 | 670 | ||
675 | /** | 671 | /** |
@@ -2072,7 +2068,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
2072 | if (is_legacy(tbl->lq_type)) | 2068 | if (is_legacy(tbl->lq_type)) |
2073 | lq_sta->is_green = 0; | 2069 | lq_sta->is_green = 0; |
2074 | else | 2070 | else |
2075 | lq_sta->is_green = rs_use_green(priv, conf); | 2071 | lq_sta->is_green = rs_use_green(sta, &priv->current_ht_config); |
2076 | is_green = lq_sta->is_green; | 2072 | is_green = lq_sta->is_green; |
2077 | 2073 | ||
2078 | /* current tx rate */ | 2074 | /* current tx rate */ |
@@ -2430,7 +2426,7 @@ static void rs_initialize_lq(struct iwl_priv *priv, | |||
2430 | int rate_idx; | 2426 | int rate_idx; |
2431 | int i; | 2427 | int i; |
2432 | u32 rate; | 2428 | u32 rate; |
2433 | u8 use_green = rs_use_green(priv, conf); | 2429 | u8 use_green = rs_use_green(sta, &priv->current_ht_config); |
2434 | u8 active_tbl = 0; | 2430 | u8 active_tbl = 0; |
2435 | u8 valid_tx_ant; | 2431 | u8 valid_tx_ant; |
2436 | 2432 | ||
@@ -2627,7 +2623,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband, | |||
2627 | lq_sta->is_dup = 0; | 2623 | lq_sta->is_dup = 0; |
2628 | lq_sta->max_rate_idx = -1; | 2624 | lq_sta->max_rate_idx = -1; |
2629 | lq_sta->missed_rate_counter = IWL_MISSED_RATE_MAX; | 2625 | lq_sta->missed_rate_counter = IWL_MISSED_RATE_MAX; |
2630 | lq_sta->is_green = rs_use_green(priv, conf); | 2626 | lq_sta->is_green = rs_use_green(sta, &priv->current_ht_config); |
2631 | lq_sta->active_legacy_rate = priv->active_rate & ~(0x1000); | 2627 | lq_sta->active_legacy_rate = priv->active_rate & ~(0x1000); |
2632 | lq_sta->active_rate_basic = priv->active_rate_basic; | 2628 | lq_sta->active_rate_basic = priv->active_rate_basic; |
2633 | lq_sta->band = priv->band; | 2629 | lq_sta->band = priv->band; |