Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256462
b: refs/heads/master
c: 9dff387
h: refs/heads/master
v: v3
  • Loading branch information
Mohammed Shafi Shajakhan authored and John W. Linville committed Jul 11, 2011
1 parent 5daac89 commit 3d600c3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 43bf8c245237b8309153aa39d4e8f1586cf56af0
refs/heads/master: 9dff387046ef20547236b75dd0d095904e4c0779
50 changes: 24 additions & 26 deletions trunk/drivers/net/wireless/ath/ath9k/rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,30 @@ static const struct ath_rate_table ar5416_11g_ratetable = {
};

static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
struct ieee80211_tx_rate *rate);
struct ieee80211_tx_rate *rate)
{
int rix = 0, i = 0;
static const int mcs_rix_off[] = { 7, 15, 20, 21, 22, 23 };

if (!(rate->flags & IEEE80211_TX_RC_MCS))
return rate->idx;

while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
rix++; i++;
}

rix += rate->idx + rate_table->mcs_start;

if ((rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH) &&
(rate->flags & IEEE80211_TX_RC_SHORT_GI))
rix = rate_table->info[rix].ht_index;
else if (rate->flags & IEEE80211_TX_RC_SHORT_GI)
rix = rate_table->info[rix].sgi_index;
else if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
rix = rate_table->info[rix].cw40index;

return rix;
}

static void ath_rc_sort_validrates(const struct ath_rate_table *rate_table,
struct ath_rate_priv *ath_rc_priv)
Expand Down Expand Up @@ -1080,31 +1103,6 @@ static void ath_rc_update_ht(struct ath_softc *sc,

}

static int ath_rc_get_rateindex(const struct ath_rate_table *rate_table,
struct ieee80211_tx_rate *rate)
{
int rix = 0, i = 0;
static const int mcs_rix_off[] = { 7, 15, 20, 21, 22, 23 };

if (!(rate->flags & IEEE80211_TX_RC_MCS))
return rate->idx;

while (i < ARRAY_SIZE(mcs_rix_off) && rate->idx > mcs_rix_off[i]) {
rix++; i++;
}

rix += rate->idx + rate_table->mcs_start;

if ((rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH) &&
(rate->flags & IEEE80211_TX_RC_SHORT_GI))
rix = rate_table->info[rix].ht_index;
else if (rate->flags & IEEE80211_TX_RC_SHORT_GI)
rix = rate_table->info[rix].sgi_index;
else if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
rix = rate_table->info[rix].cw40index;

return rix;
}

static void ath_rc_tx_status(struct ath_softc *sc,
struct ath_rate_priv *ath_rc_priv,
Expand Down

0 comments on commit 3d600c3

Please sign in to comment.