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 | |
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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-1000.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-6000.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 26 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 1 |
9 files changed, 32 insertions, 22 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index 9bb6a287eaee..a95caa014143 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -158,5 +158,6 @@ struct iwl_cfg iwl1000_bgn_cfg = { | |||
158 | .need_pll_cfg = true, | 158 | .need_pll_cfg = true, |
159 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, | 159 | .max_ll_items = OTP_MAX_LL_ITEMS_1000, |
160 | .shadow_ram_support = false, | 160 | .shadow_ram_support = false, |
161 | .ht_greenfield_support = true, | ||
161 | }; | 162 | }; |
162 | 163 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index ba5ef832d770..b5a4d2ecdd2d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -2889,7 +2889,8 @@ static struct iwl_cfg iwl3945_bg_cfg = { | |||
2889 | .eeprom_ver = EEPROM_3945_EEPROM_VERSION, | 2889 | .eeprom_ver = EEPROM_3945_EEPROM_VERSION, |
2890 | .ops = &iwl3945_ops, | 2890 | .ops = &iwl3945_ops, |
2891 | .mod_params = &iwl3945_mod_params, | 2891 | .mod_params = &iwl3945_mod_params, |
2892 | .use_isr_legacy = true | 2892 | .use_isr_legacy = true, |
2893 | .ht_greenfield_support = false, | ||
2893 | }; | 2894 | }; |
2894 | 2895 | ||
2895 | static struct iwl_cfg iwl3945_abg_cfg = { | 2896 | static struct iwl_cfg iwl3945_abg_cfg = { |
@@ -2902,7 +2903,8 @@ static struct iwl_cfg iwl3945_abg_cfg = { | |||
2902 | .eeprom_ver = EEPROM_3945_EEPROM_VERSION, | 2903 | .eeprom_ver = EEPROM_3945_EEPROM_VERSION, |
2903 | .ops = &iwl3945_ops, | 2904 | .ops = &iwl3945_ops, |
2904 | .mod_params = &iwl3945_mod_params, | 2905 | .mod_params = &iwl3945_mod_params, |
2905 | .use_isr_legacy = true | 2906 | .use_isr_legacy = true, |
2907 | .ht_greenfield_support = false, | ||
2906 | }; | 2908 | }; |
2907 | 2909 | ||
2908 | struct pci_device_id iwl3945_hw_card_ids[] = { | 2910 | struct pci_device_id iwl3945_hw_card_ids[] = { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index e427a8937ed8..6a13bfbc9d98 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2344,7 +2344,8 @@ struct iwl_cfg iwl4965_agn_cfg = { | |||
2344 | .eeprom_calib_ver = EEPROM_4965_TX_POWER_VERSION, | 2344 | .eeprom_calib_ver = EEPROM_4965_TX_POWER_VERSION, |
2345 | .ops = &iwl4965_ops, | 2345 | .ops = &iwl4965_ops, |
2346 | .mod_params = &iwl4965_mod_params, | 2346 | .mod_params = &iwl4965_mod_params, |
2347 | .use_isr_legacy = true | 2347 | .use_isr_legacy = true, |
2348 | .ht_greenfield_support = false, | ||
2348 | }; | 2349 | }; |
2349 | 2350 | ||
2350 | /* Module firmware */ | 2351 | /* Module firmware */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 755c184b3ecb..e1e862eb5aca 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -1652,6 +1652,7 @@ struct iwl_cfg iwl5300_agn_cfg = { | |||
1652 | .valid_tx_ant = ANT_ABC, | 1652 | .valid_tx_ant = ANT_ABC, |
1653 | .valid_rx_ant = ANT_ABC, | 1653 | .valid_rx_ant = ANT_ABC, |
1654 | .need_pll_cfg = true, | 1654 | .need_pll_cfg = true, |
1655 | .ht_greenfield_support = true, | ||
1655 | }; | 1656 | }; |
1656 | 1657 | ||
1657 | struct iwl_cfg iwl5100_bg_cfg = { | 1658 | struct iwl_cfg iwl5100_bg_cfg = { |
@@ -1668,6 +1669,7 @@ struct iwl_cfg iwl5100_bg_cfg = { | |||
1668 | .valid_tx_ant = ANT_B, | 1669 | .valid_tx_ant = ANT_B, |
1669 | .valid_rx_ant = ANT_AB, | 1670 | .valid_rx_ant = ANT_AB, |
1670 | .need_pll_cfg = true, | 1671 | .need_pll_cfg = true, |
1672 | .ht_greenfield_support = true, | ||
1671 | }; | 1673 | }; |
1672 | 1674 | ||
1673 | struct iwl_cfg iwl5100_abg_cfg = { | 1675 | struct iwl_cfg iwl5100_abg_cfg = { |
@@ -1684,6 +1686,7 @@ struct iwl_cfg iwl5100_abg_cfg = { | |||
1684 | .valid_tx_ant = ANT_B, | 1686 | .valid_tx_ant = ANT_B, |
1685 | .valid_rx_ant = ANT_AB, | 1687 | .valid_rx_ant = ANT_AB, |
1686 | .need_pll_cfg = true, | 1688 | .need_pll_cfg = true, |
1689 | .ht_greenfield_support = true, | ||
1687 | }; | 1690 | }; |
1688 | 1691 | ||
1689 | struct iwl_cfg iwl5100_agn_cfg = { | 1692 | struct iwl_cfg iwl5100_agn_cfg = { |
@@ -1700,6 +1703,7 @@ struct iwl_cfg iwl5100_agn_cfg = { | |||
1700 | .valid_tx_ant = ANT_B, | 1703 | .valid_tx_ant = ANT_B, |
1701 | .valid_rx_ant = ANT_AB, | 1704 | .valid_rx_ant = ANT_AB, |
1702 | .need_pll_cfg = true, | 1705 | .need_pll_cfg = true, |
1706 | .ht_greenfield_support = true, | ||
1703 | }; | 1707 | }; |
1704 | 1708 | ||
1705 | struct iwl_cfg iwl5350_agn_cfg = { | 1709 | struct iwl_cfg iwl5350_agn_cfg = { |
@@ -1716,6 +1720,7 @@ struct iwl_cfg iwl5350_agn_cfg = { | |||
1716 | .valid_tx_ant = ANT_ABC, | 1720 | .valid_tx_ant = ANT_ABC, |
1717 | .valid_rx_ant = ANT_ABC, | 1721 | .valid_rx_ant = ANT_ABC, |
1718 | .need_pll_cfg = true, | 1722 | .need_pll_cfg = true, |
1723 | .ht_greenfield_support = true, | ||
1719 | }; | 1724 | }; |
1720 | 1725 | ||
1721 | struct iwl_cfg iwl5150_agn_cfg = { | 1726 | struct iwl_cfg iwl5150_agn_cfg = { |
@@ -1732,6 +1737,7 @@ struct iwl_cfg iwl5150_agn_cfg = { | |||
1732 | .valid_tx_ant = ANT_A, | 1737 | .valid_tx_ant = ANT_A, |
1733 | .valid_rx_ant = ANT_AB, | 1738 | .valid_rx_ant = ANT_AB, |
1734 | .need_pll_cfg = true, | 1739 | .need_pll_cfg = true, |
1740 | .ht_greenfield_support = true, | ||
1735 | }; | 1741 | }; |
1736 | 1742 | ||
1737 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); | 1743 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 0b731fd5ad1c..383177db7de7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -171,6 +171,7 @@ struct iwl_cfg iwl6000h_2agn_cfg = { | |||
171 | .pa_type = IWL_PA_HYBRID, | 171 | .pa_type = IWL_PA_HYBRID, |
172 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 172 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
173 | .shadow_ram_support = true, | 173 | .shadow_ram_support = true, |
174 | .ht_greenfield_support = true, | ||
174 | }; | 175 | }; |
175 | 176 | ||
176 | /* | 177 | /* |
@@ -193,6 +194,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = { | |||
193 | .pa_type = IWL_PA_INTERNAL, | 194 | .pa_type = IWL_PA_INTERNAL, |
194 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 195 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
195 | .shadow_ram_support = true, | 196 | .shadow_ram_support = true, |
197 | .ht_greenfield_support = true, | ||
196 | }; | 198 | }; |
197 | 199 | ||
198 | struct iwl_cfg iwl6050_2agn_cfg = { | 200 | struct iwl_cfg iwl6050_2agn_cfg = { |
@@ -212,6 +214,7 @@ struct iwl_cfg iwl6050_2agn_cfg = { | |||
212 | .pa_type = IWL_PA_SYSTEM, | 214 | .pa_type = IWL_PA_SYSTEM, |
213 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 215 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
214 | .shadow_ram_support = true, | 216 | .shadow_ram_support = true, |
217 | .ht_greenfield_support = true, | ||
215 | }; | 218 | }; |
216 | 219 | ||
217 | struct iwl_cfg iwl6000_3agn_cfg = { | 220 | struct iwl_cfg iwl6000_3agn_cfg = { |
@@ -231,6 +234,7 @@ struct iwl_cfg iwl6000_3agn_cfg = { | |||
231 | .pa_type = IWL_PA_SYSTEM, | 234 | .pa_type = IWL_PA_SYSTEM, |
232 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 235 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
233 | .shadow_ram_support = true, | 236 | .shadow_ram_support = true, |
237 | .ht_greenfield_support = true, | ||
234 | }; | 238 | }; |
235 | 239 | ||
236 | struct iwl_cfg iwl6050_3agn_cfg = { | 240 | struct iwl_cfg iwl6050_3agn_cfg = { |
@@ -250,6 +254,7 @@ struct iwl_cfg iwl6050_3agn_cfg = { | |||
250 | .pa_type = IWL_PA_SYSTEM, | 254 | .pa_type = IWL_PA_SYSTEM, |
251 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, | 255 | .max_ll_items = OTP_MAX_LL_ITEMS_6x00, |
252 | .shadow_ram_support = true, | 256 | .shadow_ram_support = true, |
257 | .ht_greenfield_support = true, | ||
253 | }; | 258 | }; |
254 | 259 | ||
255 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); | 260 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); |
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; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index b845cf30e1bc..62aa87b4358a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -394,7 +394,8 @@ static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, | |||
394 | 394 | ||
395 | ht_info->ht_supported = true; | 395 | ht_info->ht_supported = true; |
396 | 396 | ||
397 | ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD; | 397 | if (priv->cfg->ht_greenfield_support) |
398 | ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD; | ||
398 | ht_info->cap |= IEEE80211_HT_CAP_SGI_20; | 399 | ht_info->cap |= IEEE80211_HT_CAP_SGI_20; |
399 | ht_info->cap |= (IEEE80211_HT_CAP_SM_PS & | 400 | ht_info->cap |= (IEEE80211_HT_CAP_SM_PS & |
400 | (WLAN_HT_CAP_SM_PS_DISABLED << 2)); | 401 | (WLAN_HT_CAP_SM_PS_DISABLED << 2)); |
@@ -2391,8 +2392,6 @@ static void iwl_ht_conf(struct iwl_priv *priv, | |||
2391 | } | 2392 | } |
2392 | ht_conf = &sta->ht_cap; | 2393 | ht_conf = &sta->ht_cap; |
2393 | 2394 | ||
2394 | iwl_conf->is_green_field = !!(ht_conf->cap & IEEE80211_HT_CAP_GRN_FLD); | ||
2395 | |||
2396 | iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2); | 2395 | iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2); |
2397 | 2396 | ||
2398 | memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16); | 2397 | memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 509683487e0e..4ca025a34daf 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -251,6 +251,7 @@ struct iwl_cfg { | |||
251 | enum iwl_pa_type pa_type; | 251 | enum iwl_pa_type pa_type; |
252 | const u16 max_ll_items; | 252 | const u16 max_ll_items; |
253 | const bool shadow_ram_support; | 253 | const bool shadow_ram_support; |
254 | const bool ht_greenfield_support; | ||
254 | }; | 255 | }; |
255 | 256 | ||
256 | /*************************** | 257 | /*************************** |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index e6a1c6ff44de..0178734499f0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -507,7 +507,6 @@ struct iwl_ht_info { | |||
507 | u8 is_ht; | 507 | u8 is_ht; |
508 | u8 supported_chan_width; | 508 | u8 supported_chan_width; |
509 | u8 sm_ps; | 509 | u8 sm_ps; |
510 | u8 is_green_field; | ||
511 | struct ieee80211_mcs_info mcs; | 510 | struct ieee80211_mcs_info mcs; |
512 | /* BSS related data */ | 511 | /* BSS related data */ |
513 | u8 extension_chan_offset; | 512 | u8 extension_chan_offset; |