Skip to content

Commit

Permalink
rtlwifi: rtl8821ae: Switch to use common rate control routine
Browse files Browse the repository at this point in the history
With this change, all of the drivers now use the common routine. As this
driver has VHT capability, an additional parameter is needed, thus all the
drivers had to be modified.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Larry Finger authored and Kalle Valo committed Dec 24, 2014
1 parent a160ba0 commit fd3cb22
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 242 deletions.
76 changes: 74 additions & 2 deletions drivers/net/wireless/rtlwifi/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,84 @@ static u8 _rtl_get_highest_n_rate(struct ieee80211_hw *hw,
* N rate:
* (rx_status->flag & RX_FLAG_HT) = 1,
* DESC_RATEMCS0-->DESC_RATEMCS15 ==> idx is 0-->15
*
* VHT rates:
* DESC_RATEVHT1SS_MCS0-->DESC_RATEVHT1SS_MCS9 ==> idx is 0-->9
* DESC_RATEVHT2SS_MCS0-->DESC_RATEVHT2SS_MCS9 ==> idx is 0-->9
*/
int rtlwifi_rate_mapping(struct ieee80211_hw *hw,
bool isht, u8 desc_rate)
int rtlwifi_rate_mapping(struct ieee80211_hw *hw, bool isht, bool isvht,
u8 desc_rate)
{
int rate_idx;

if (isvht) {
switch (desc_rate) {
case DESC_RATEVHT1SS_MCS0:
rate_idx = 0;
break;
case DESC_RATEVHT1SS_MCS1:
rate_idx = 1;
break;
case DESC_RATEVHT1SS_MCS2:
rate_idx = 2;
break;
case DESC_RATEVHT1SS_MCS3:
rate_idx = 3;
break;
case DESC_RATEVHT1SS_MCS4:
rate_idx = 4;
break;
case DESC_RATEVHT1SS_MCS5:
rate_idx = 5;
break;
case DESC_RATEVHT1SS_MCS6:
rate_idx = 6;
break;
case DESC_RATEVHT1SS_MCS7:
rate_idx = 7;
break;
case DESC_RATEVHT1SS_MCS8:
rate_idx = 8;
break;
case DESC_RATEVHT1SS_MCS9:
rate_idx = 9;
break;
case DESC_RATEVHT2SS_MCS0:
rate_idx = 0;
break;
case DESC_RATEVHT2SS_MCS1:
rate_idx = 1;
break;
case DESC_RATEVHT2SS_MCS2:
rate_idx = 2;
break;
case DESC_RATEVHT2SS_MCS3:
rate_idx = 3;
break;
case DESC_RATEVHT2SS_MCS4:
rate_idx = 4;
break;
case DESC_RATEVHT2SS_MCS5:
rate_idx = 5;
break;
case DESC_RATEVHT2SS_MCS6:
rate_idx = 6;
break;
case DESC_RATEVHT2SS_MCS7:
rate_idx = 7;
break;
case DESC_RATEVHT2SS_MCS8:
rate_idx = 8;
break;
case DESC_RATEVHT2SS_MCS9:
rate_idx = 9;
break;
default:
rate_idx = 0;
break;
}
return rate_idx;
}
if (false == isht) {
if (IEEE80211_BAND_2GHZ == hw->conf.chandef.chan->band) {
switch (desc_rate) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/rtlwifi/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ void rtl_watch_dog_timer_callback(unsigned long data);
void rtl_deinit_deferred_work(struct ieee80211_hw *hw);

bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx);
int rtlwifi_rate_mapping(struct ieee80211_hw *hw,
bool isht, u8 desc_rate);
int rtlwifi_rate_mapping(struct ieee80211_hw *hw, bool isht,
bool isvht, u8 desc_rate);
bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb);
u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8188ee/trx.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ bool rtl88ee_rx_query_desc(struct ieee80211_hw *hw,
* Notice: this is diff with windows define
*/
rx_status->rate_idx = rtlwifi_rate_mapping(hw, status->is_ht,
status->rate);
false, status->rate);

rx_status->mactime = status->timestamp_low;
if (phystatus == true) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
* Notice: this is diff with windows define
*/
rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats->is_ht,
stats->rate);
false, stats->rate);

rx_status->mactime = stats->timestamp_low;
if (phystatus) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
if (stats->decrypted)
rx_status->flag |= RX_FLAG_DECRYPTED;
rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats->is_ht,
stats->rate);
false, stats->rate);
rx_status->mactime = GET_RX_DESC_TSFL(pdesc);
if (phystatus) {
p_drvinfo = (struct rx_fwinfo_92c *)(skb->data +
Expand Down Expand Up @@ -407,7 +407,7 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb)
rx_status->flag |= RX_FLAG_HT;
/* Data rate */
rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats.is_ht,
stats.rate);
false, stats.rate);
/* There is a phy status after this rx descriptor. */
if (GET_RX_DESC_PHY_STATUS(rxdesc)) {
p_drvinfo = (struct rx_fwinfo_92c *)(rxdesc + RTL_RX_DESC_SIZE);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8192de/trx.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ bool rtl92de_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
if (stats->decrypted)
rx_status->flag |= RX_FLAG_DECRYPTED;
rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats->is_ht,
stats->rate);
false, stats->rate);
rx_status->mactime = GET_RX_DESC_TSFL(pdesc);
if (phystatus) {
p_drvinfo = (struct rx_fwinfo_92d *)(skb->data +
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8192ee/trx.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ bool rtl92ee_rx_query_desc(struct ieee80211_hw *hw,
* Notice: this is diff with windows define
*/
rx_status->rate_idx = rtlwifi_rate_mapping(hw, status->is_ht,
status->rate);
false, status->rate);

rx_status->mactime = status->timestamp_low;
if (phystatus) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8192se/trx.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
}

rx_status->rate_idx = rtlwifi_rate_mapping(hw, stats->is_ht,
stats->rate);
false, stats->rate);

rx_status->mactime = stats->timestamp_low;
if (phystatus) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ bool rtl8723e_rx_query_desc(struct ieee80211_hw *hw,
* Notice: this is diff with windows define
*/
rx_status->rate_idx = rtlwifi_rate_mapping(hw, status->is_ht,
status->rate);
false, status->rate);

rx_status->mactime = status->timestamp_low;
if (phystatus == true) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/rtlwifi/rtl8723be/trx.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ bool rtl8723be_rx_query_desc(struct ieee80211_hw *hw,
* are use (RX_FLAG_HT)
*/
rx_status->rate_idx = rtlwifi_rate_mapping(hw, status->is_ht,
status->rate);
false, status->rate);

rx_status->mactime = status->timestamp_low;
if (phystatus) {
Expand Down
Loading

0 comments on commit fd3cb22

Please sign in to comment.