diff options
author | Zhu Yi <yi.zhu@intel.com> | 2007-09-26 23:27:40 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:25 -0400 |
commit | 02dede04f280a2ea249025414ddb4b1da1fca770 (patch) | |
tree | a6604de597ae7f36b847b890d89523819f34ca8a /drivers/net/wireless/iwlwifi | |
parent | 588263515fecd926ea82950e5b7752b8696b595c (diff) |
[PATCH] iwlwifi: add supp_rates to rate scale sta private data
This patch adds supp_rate bit mask to rate scale sta private data structre
and thus removes sta from the argument list in helper functions.
Signed-off-by: Tomas Winkler <tomas.winkler@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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c index b9d7ad8b70e5..bad746613f5b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c | |||
@@ -115,6 +115,7 @@ struct iwl_rate_scale_priv { | |||
115 | u8 is_dup; | 115 | u8 is_dup; |
116 | u8 phymode; | 116 | u8 phymode; |
117 | u8 ibss_sta_added; | 117 | u8 ibss_sta_added; |
118 | u32 supp_rates; | ||
118 | u16 active_rate; | 119 | u16 active_rate; |
119 | u16 active_siso_rate; | 120 | u16 active_siso_rate; |
120 | u16 active_mimo_rate; | 121 | u16 active_mimo_rate; |
@@ -132,8 +133,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
132 | struct sta_info *sta); | 133 | struct sta_info *sta); |
133 | static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, | 134 | static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, |
134 | struct iwl_rate *tx_mcs, | 135 | struct iwl_rate *tx_mcs, |
135 | struct iwl_link_quality_cmd *tbl, | 136 | struct iwl_link_quality_cmd *tbl); |
136 | struct sta_info *sta); | ||
137 | 137 | ||
138 | 138 | ||
139 | static s32 expected_tpt_A[IWL_RATE_COUNT] = { | 139 | static s32 expected_tpt_A[IWL_RATE_COUNT] = { |
@@ -542,14 +542,13 @@ static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type) | |||
542 | 542 | ||
543 | static int rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data, | 543 | static int rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data, |
544 | struct iwl_scale_tbl_info *tbl, u8 scale_index, | 544 | struct iwl_scale_tbl_info *tbl, u8 scale_index, |
545 | u8 ht_possible, struct iwl_rate *mcs_rate, | 545 | u8 ht_possible, struct iwl_rate *mcs_rate) |
546 | struct sta_info *sta) | ||
547 | { | 546 | { |
548 | u8 is_green = lq_data->is_green; | ||
549 | s32 low; | 547 | s32 low; |
550 | u16 rate_mask; | 548 | u16 rate_mask; |
551 | u16 high_low; | 549 | u16 high_low; |
552 | u8 switch_to_legacy = 0; | 550 | u8 switch_to_legacy = 0; |
551 | u8 is_green = lq_data->is_green; | ||
553 | 552 | ||
554 | /* check if we need to switch from HT to legacy rates. | 553 | /* check if we need to switch from HT to legacy rates. |
555 | * assumption is that mandatory rates (1Mbps or 6Mbps) | 554 | * assumption is that mandatory rates (1Mbps or 6Mbps) |
@@ -576,9 +575,9 @@ static int rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data, | |||
576 | if (is_legacy(tbl->lq_type)) { | 575 | if (is_legacy(tbl->lq_type)) { |
577 | if (lq_data->phymode == (u8) MODE_IEEE80211A) | 576 | if (lq_data->phymode == (u8) MODE_IEEE80211A) |
578 | rate_mask = (u16)(rate_mask & | 577 | rate_mask = (u16)(rate_mask & |
579 | (sta->supp_rates << IWL_FIRST_OFDM_RATE)); | 578 | (lq_data->supp_rates << IWL_FIRST_OFDM_RATE)); |
580 | else | 579 | else |
581 | rate_mask = (u16)(rate_mask & sta->supp_rates); | 580 | rate_mask = (u16)(rate_mask & lq_data->supp_rates); |
582 | } | 581 | } |
583 | 582 | ||
584 | /* if we did switched from HT to legacy check current rate */ | 583 | /* if we did switched from HT to legacy check current rate */ |
@@ -1391,10 +1390,10 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1391 | if (is_legacy(tbl->lq_type)) { | 1390 | if (is_legacy(tbl->lq_type)) { |
1392 | if (lq_data->phymode == (u8) MODE_IEEE80211A) | 1391 | if (lq_data->phymode == (u8) MODE_IEEE80211A) |
1393 | rate_scale_index_msk = (u16) (rate_mask & | 1392 | rate_scale_index_msk = (u16) (rate_mask & |
1394 | (sta->supp_rates << IWL_FIRST_OFDM_RATE)); | 1393 | (lq_data->supp_rates << IWL_FIRST_OFDM_RATE)); |
1395 | else | 1394 | else |
1396 | rate_scale_index_msk = (u16) (rate_mask & | 1395 | rate_scale_index_msk = (u16) (rate_mask & |
1397 | sta->supp_rates); | 1396 | lq_data->supp_rates); |
1398 | 1397 | ||
1399 | } else | 1398 | } else |
1400 | rate_scale_index_msk = rate_mask; | 1399 | rate_scale_index_msk = rate_mask; |
@@ -1434,7 +1433,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1434 | rs_stay_in_table(lq_data); | 1433 | rs_stay_in_table(lq_data); |
1435 | if (update_lq) { | 1434 | if (update_lq) { |
1436 | rs_mcs_from_tbl(&mcs_rate, tbl, index, is_green); | 1435 | rs_mcs_from_tbl(&mcs_rate, tbl, index, is_green); |
1437 | rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq, sta); | 1436 | rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq); |
1438 | rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC); | 1437 | rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC); |
1439 | } | 1438 | } |
1440 | goto out; | 1439 | goto out; |
@@ -1558,7 +1557,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1558 | lq_update: | 1557 | lq_update: |
1559 | if (update_lq) { | 1558 | if (update_lq) { |
1560 | rs_mcs_from_tbl(&mcs_rate, tbl, index, is_green); | 1559 | rs_mcs_from_tbl(&mcs_rate, tbl, index, is_green); |
1561 | rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq, sta); | 1560 | rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq); |
1562 | rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC); | 1561 | rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC); |
1563 | } | 1562 | } |
1564 | rs_stay_in_table(lq_data); | 1563 | rs_stay_in_table(lq_data); |
@@ -1584,7 +1583,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1584 | IWL_DEBUG_HT("Switch current mcs: %X index: %d\n", | 1583 | IWL_DEBUG_HT("Switch current mcs: %X index: %d\n", |
1585 | tbl->current_rate.rate_n_flags, index); | 1584 | tbl->current_rate.rate_n_flags, index); |
1586 | rs_fill_link_cmd(lq_data, &tbl->current_rate, | 1585 | rs_fill_link_cmd(lq_data, &tbl->current_rate, |
1587 | &(lq_data->lq), sta); | 1586 | &lq_data->lq); |
1588 | rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC); | 1587 | rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC); |
1589 | } | 1588 | } |
1590 | tbl1 = &(lq_data->lq_info[lq_data->active_tbl]); | 1589 | tbl1 = &(lq_data->lq_info[lq_data->active_tbl]); |
@@ -1680,7 +1679,7 @@ static void rs_initialize_lq(struct iwl_priv *priv, | |||
1680 | rs_mcs_from_tbl(&mcs_rate, tbl, rate_idx, use_green); | 1679 | rs_mcs_from_tbl(&mcs_rate, tbl, rate_idx, use_green); |
1681 | tbl->current_rate.rate_n_flags = mcs_rate.rate_n_flags; | 1680 | tbl->current_rate.rate_n_flags = mcs_rate.rate_n_flags; |
1682 | rs_get_expected_tpt_table(lq, tbl); | 1681 | rs_get_expected_tpt_table(lq, tbl); |
1683 | rs_fill_link_cmd(lq, &mcs_rate, &(lq->lq), sta); | 1682 | rs_fill_link_cmd(lq, &mcs_rate, &lq->lq); |
1684 | rs_send_lq_cmd(priv, &lq->lq, CMD_ASYNC); | 1683 | rs_send_lq_cmd(priv, &lq->lq, CMD_ASYNC); |
1685 | out: | 1684 | out: |
1686 | return; | 1685 | return; |
@@ -1799,6 +1798,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, | |||
1799 | struct iwl_rate_scale_priv *crl = priv_sta; | 1798 | struct iwl_rate_scale_priv *crl = priv_sta; |
1800 | 1799 | ||
1801 | crl->flush_timer = 0; | 1800 | crl->flush_timer = 0; |
1801 | crl->supp_rates = sta->supp_rates; | ||
1802 | sta->txrate = 3; | 1802 | sta->txrate = 3; |
1803 | for (j = 0; j < LQ_SIZE; j++) | 1803 | for (j = 0; j < LQ_SIZE; j++) |
1804 | for (i = 0; i < IWL_RATE_COUNT; i++) | 1804 | for (i = 0; i < IWL_RATE_COUNT; i++) |
@@ -1875,8 +1875,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, | |||
1875 | 1875 | ||
1876 | static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, | 1876 | static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, |
1877 | struct iwl_rate *tx_mcs, | 1877 | struct iwl_rate *tx_mcs, |
1878 | struct iwl_link_quality_cmd *lq_cmd, | 1878 | struct iwl_link_quality_cmd *lq_cmd) |
1879 | struct sta_info *sta) | ||
1880 | { | 1879 | { |
1881 | int index = 0; | 1880 | int index = 0; |
1882 | int rc = 0; | 1881 | int rc = 0; |
@@ -1934,7 +1933,7 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, | |||
1934 | lq_cmd->general_params.mimo_delimiter = index; | 1933 | lq_cmd->general_params.mimo_delimiter = index; |
1935 | 1934 | ||
1936 | rs_get_lower_rate(lq_data, &tbl_type, rate_idx, | 1935 | rs_get_lower_rate(lq_data, &tbl_type, rate_idx, |
1937 | use_ht_possible, &new_rate, sta); | 1936 | use_ht_possible, &new_rate); |
1938 | 1937 | ||
1939 | if (is_legacy(tbl_type.lq_type)) { | 1938 | if (is_legacy(tbl_type.lq_type)) { |
1940 | if (ant_toggle_count < NUM_TRY_BEFORE_ANTENNA_TOGGLE) | 1939 | if (ant_toggle_count < NUM_TRY_BEFORE_ANTENNA_TOGGLE) |