diff options
author | Daniel C Halperin <daniel.c.halperin@intel.com> | 2009-08-13 16:30:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-20 11:33:12 -0400 |
commit | 28e6f48953f44f7eb615383efe6e7f17624a11bb (patch) | |
tree | ab22bdd91b0f064ed654dbb6f559dae3520fe840 /drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |
parent | 28bd723bbaddba4e145d25117649bb6da5fafad7 (diff) |
iwlwifi: check short GI support per-station rather than globally
Short guard interval support is a local per-station parameter not a global
per-NIC parameter. (mac80211 will correctly remove SGI support from station
capabilities if the BSS does not permit it). This patch removes the short GI
support bitfield from the global iwl_ht_info struct and properly uses
per-station HT capabilities during rate selection.
Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
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 | 69 |
1 files changed, 15 insertions, 54 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 551c4ba3f178..3b1bbc394a49 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -1225,18 +1225,6 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv, | |||
1225 | else | 1225 | else |
1226 | tbl->is_ht40 = 0; | 1226 | tbl->is_ht40 = 0; |
1227 | 1227 | ||
1228 | /* FIXME: - don't toggle SGI here | ||
1229 | if (tbl->is_ht40) { | ||
1230 | if (priv->current_ht_config.sgf & HT_SHORT_GI_40MHZ_ONLY) | ||
1231 | tbl->is_SGI = 1; | ||
1232 | else | ||
1233 | tbl->is_SGI = 0; | ||
1234 | } else if (priv->current_ht_config.sgf & HT_SHORT_GI_20MHZ_ONLY) | ||
1235 | tbl->is_SGI = 1; | ||
1236 | else | ||
1237 | tbl->is_SGI = 0; | ||
1238 | */ | ||
1239 | |||
1240 | rs_set_expected_tpt_table(lq_sta, tbl); | 1228 | rs_set_expected_tpt_table(lq_sta, tbl); |
1241 | 1229 | ||
1242 | rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index); | 1230 | rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index); |
@@ -1291,18 +1279,6 @@ static int rs_switch_to_mimo3(struct iwl_priv *priv, | |||
1291 | else | 1279 | else |
1292 | tbl->is_ht40 = 0; | 1280 | tbl->is_ht40 = 0; |
1293 | 1281 | ||
1294 | /* FIXME: - don't toggle SGI here | ||
1295 | if (tbl->is_ht40) { | ||
1296 | if (priv->current_ht_config.sgf & HT_SHORT_GI_40MHZ_ONLY) | ||
1297 | tbl->is_SGI = 1; | ||
1298 | else | ||
1299 | tbl->is_SGI = 0; | ||
1300 | } else if (priv->current_ht_config.sgf & HT_SHORT_GI_20MHZ_ONLY) | ||
1301 | tbl->is_SGI = 1; | ||
1302 | else | ||
1303 | tbl->is_SGI = 0; | ||
1304 | */ | ||
1305 | |||
1306 | rs_set_expected_tpt_table(lq_sta, tbl); | 1282 | rs_set_expected_tpt_table(lq_sta, tbl); |
1307 | 1283 | ||
1308 | rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index); | 1284 | rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index); |
@@ -1350,18 +1326,6 @@ static int rs_switch_to_siso(struct iwl_priv *priv, | |||
1350 | else | 1326 | else |
1351 | tbl->is_ht40 = 0; | 1327 | tbl->is_ht40 = 0; |
1352 | 1328 | ||
1353 | /* FIXME: - don't toggle SGI here | ||
1354 | if (tbl->is_ht40) { | ||
1355 | if (priv->current_ht_config.sgf & HT_SHORT_GI_40MHZ_ONLY) | ||
1356 | tbl->is_SGI = 1; | ||
1357 | else | ||
1358 | tbl->is_SGI = 0; | ||
1359 | } else if (priv->current_ht_config.sgf & HT_SHORT_GI_20MHZ_ONLY) | ||
1360 | tbl->is_SGI = 1; | ||
1361 | else | ||
1362 | tbl->is_SGI = 0; | ||
1363 | */ | ||
1364 | |||
1365 | if (is_green) | 1329 | if (is_green) |
1366 | tbl->is_SGI = 0; /*11n spec: no SGI in SISO+Greenfield*/ | 1330 | tbl->is_SGI = 0; /*11n spec: no SGI in SISO+Greenfield*/ |
1367 | 1331 | ||
@@ -1530,6 +1494,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv, | |||
1530 | struct iwl_scale_tbl_info *search_tbl = | 1494 | struct iwl_scale_tbl_info *search_tbl = |
1531 | &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); | 1495 | &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); |
1532 | struct iwl_rate_scale_data *window = &(tbl->win[index]); | 1496 | struct iwl_rate_scale_data *window = &(tbl->win[index]); |
1497 | struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap; | ||
1533 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1498 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1534 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1499 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1535 | u8 start_action = tbl->action; | 1500 | u8 start_action = tbl->action; |
@@ -1589,13 +1554,11 @@ static int rs_move_siso_to_other(struct iwl_priv *priv, | |||
1589 | goto out; | 1554 | goto out; |
1590 | break; | 1555 | break; |
1591 | case IWL_SISO_SWITCH_GI: | 1556 | case IWL_SISO_SWITCH_GI: |
1592 | if (!tbl->is_ht40 && | 1557 | if (!tbl->is_ht40 && !(ht_cap->cap & |
1593 | !(priv->current_ht_config.sgf & | 1558 | IEEE80211_HT_CAP_SGI_20)) |
1594 | HT_SHORT_GI_20MHZ)) | ||
1595 | break; | 1559 | break; |
1596 | if (tbl->is_ht40 && | 1560 | if (tbl->is_ht40 && !(ht_cap->cap & |
1597 | !(priv->current_ht_config.sgf & | 1561 | IEEE80211_HT_CAP_SGI_40)) |
1598 | HT_SHORT_GI_40MHZ)) | ||
1599 | break; | 1562 | break; |
1600 | 1563 | ||
1601 | IWL_DEBUG_RATE(priv, "LQ: SISO toggle SGI/NGI\n"); | 1564 | IWL_DEBUG_RATE(priv, "LQ: SISO toggle SGI/NGI\n"); |
@@ -1669,6 +1632,7 @@ static int rs_move_mimo2_to_other(struct iwl_priv *priv, | |||
1669 | struct iwl_scale_tbl_info *search_tbl = | 1632 | struct iwl_scale_tbl_info *search_tbl = |
1670 | &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); | 1633 | &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); |
1671 | struct iwl_rate_scale_data *window = &(tbl->win[index]); | 1634 | struct iwl_rate_scale_data *window = &(tbl->win[index]); |
1635 | struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap; | ||
1672 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1636 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1673 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1637 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1674 | u8 start_action = tbl->action; | 1638 | u8 start_action = tbl->action; |
@@ -1729,13 +1693,11 @@ static int rs_move_mimo2_to_other(struct iwl_priv *priv, | |||
1729 | break; | 1693 | break; |
1730 | 1694 | ||
1731 | case IWL_MIMO2_SWITCH_GI: | 1695 | case IWL_MIMO2_SWITCH_GI: |
1732 | if (!tbl->is_ht40 && | 1696 | if (!tbl->is_ht40 && !(ht_cap->cap & |
1733 | !(priv->current_ht_config.sgf & | 1697 | IEEE80211_HT_CAP_SGI_20)) |
1734 | HT_SHORT_GI_20MHZ)) | ||
1735 | break; | 1698 | break; |
1736 | if (tbl->is_ht40 && | 1699 | if (tbl->is_ht40 && !(ht_cap->cap & |
1737 | !(priv->current_ht_config.sgf & | 1700 | IEEE80211_HT_CAP_SGI_40)) |
1738 | HT_SHORT_GI_40MHZ)) | ||
1739 | break; | 1701 | break; |
1740 | 1702 | ||
1741 | IWL_DEBUG_RATE(priv, "LQ: MIMO2 toggle SGI/NGI\n"); | 1703 | IWL_DEBUG_RATE(priv, "LQ: MIMO2 toggle SGI/NGI\n"); |
@@ -1811,6 +1773,7 @@ static int rs_move_mimo3_to_other(struct iwl_priv *priv, | |||
1811 | struct iwl_scale_tbl_info *search_tbl = | 1773 | struct iwl_scale_tbl_info *search_tbl = |
1812 | &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); | 1774 | &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); |
1813 | struct iwl_rate_scale_data *window = &(tbl->win[index]); | 1775 | struct iwl_rate_scale_data *window = &(tbl->win[index]); |
1776 | struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap; | ||
1814 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1777 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1815 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1778 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1816 | u8 start_action = tbl->action; | 1779 | u8 start_action = tbl->action; |
@@ -1893,13 +1856,11 @@ static int rs_move_mimo3_to_other(struct iwl_priv *priv, | |||
1893 | break; | 1856 | break; |
1894 | 1857 | ||
1895 | case IWL_MIMO3_SWITCH_GI: | 1858 | case IWL_MIMO3_SWITCH_GI: |
1896 | if (!tbl->is_ht40 && | 1859 | if (!tbl->is_ht40 && !(ht_cap->cap & |
1897 | !(priv->current_ht_config.sgf & | 1860 | IEEE80211_HT_CAP_SGI_20)) |
1898 | HT_SHORT_GI_20MHZ)) | ||
1899 | break; | 1861 | break; |
1900 | if (tbl->is_ht40 && | 1862 | if (tbl->is_ht40 && !(ht_cap->cap & |
1901 | !(priv->current_ht_config.sgf & | 1863 | IEEE80211_HT_CAP_SGI_40)) |
1902 | HT_SHORT_GI_40MHZ)) | ||
1903 | break; | 1864 | break; |
1904 | 1865 | ||
1905 | IWL_DEBUG_RATE(priv, "LQ: MIMO3 toggle SGI/NGI\n"); | 1866 | IWL_DEBUG_RATE(priv, "LQ: MIMO3 toggle SGI/NGI\n"); |