#include "core.h"
#include "../net/mac80211/rate.h"
-static u_int32_t tx_triglevel_max;
+static u32 tx_triglevel_max;
static struct ath_rate_table ar5416_11na_ratetable = {
42,
WLAN_RC_HT_FLAG, /* Phy rates allowed initially */
};
- /* TRUE_ALL - valid for 20/40/Legacy,
- * TRUE - Legacy only,
- * TRUE_20 - HT 20 only,
- * TRUE_40 - HT 40 only */
+/* TRUE_ALL - valid for 20/40/Legacy,
+ * TRUE - Legacy only,
+ * TRUE_20 - HT 20 only,
+ * TRUE_40 - HT 40 only */
- /* 4ms frame limit not used for NG mode. The values filled
- * for HT are the 64K max aggregate limit */
+/* 4ms frame limit not used for NG mode. The values filled
+ * for HT are the 64K max aggregate limit */
static struct ath_rate_table ar5416_11ng_ratetable = {
46,
}
static void ath_rc_sort_validrates(const struct ath_rate_table *rate_table,
- struct ath_tx_ratectrl *rate_ctrl)
+ struct ath_tx_ratectrl *rate_ctrl)
{
- u_int8_t i, j, idx, idx_next;
+ u8 i, j, idx, idx_next;
for (i = rate_ctrl->max_valid_rate - 1; i > 0; i--) {
for (j = 0; j <= i-1; j++) {
-
idx = rate_ctrl->valid_rate_index[j];
idx_next = rate_ctrl->valid_rate_index[j+1];
if (rate_table->info[idx].ratekbps >
rate_table->info[idx_next].ratekbps) {
-
rate_ctrl->valid_rate_index[j] = idx_next;
rate_ctrl->valid_rate_index[j+1] = idx;
}
static void ath_rc_init_valid_txmask(struct ath_tx_ratectrl *rate_ctrl)
{
- u_int8_t i;
+ u8 i;
for (i = 0; i < rate_ctrl->rate_table_size; i++)
rate_ctrl->valid_rate_index[i] = FALSE;
}
static inline void ath_rc_set_valid_txmask(struct ath_tx_ratectrl *rate_ctrl,
- u_int8_t index, int valid_tx_rate)
+ u8 index, int valid_tx_rate)
{
ASSERT(index <= rate_ctrl->rate_table_size);
rate_ctrl->valid_rate_index[index] = valid_tx_rate ? TRUE : FALSE;
}
static inline int ath_rc_isvalid_txmask(struct ath_tx_ratectrl *rate_ctrl,
- u_int8_t index)
+ u8 index)
{
ASSERT(index <= rate_ctrl->rate_table_size);
return rate_ctrl->valid_rate_index[index];
}
/* Iterators for valid_txrate_mask */
-static inline int ath_rc_get_nextvalid_txrate(
- const struct ath_rate_table *rate_table,
- struct ath_tx_ratectrl *rate_ctrl,
- u_int8_t cur_valid_txrate,
- u_int8_t *next_idx)
+static inline int
+ath_rc_get_nextvalid_txrate(const struct ath_rate_table *rate_table,
+ struct ath_tx_ratectrl *rate_ctrl,
+ u8 cur_valid_txrate,
+ u8 *next_idx)
{
- u_int8_t i;
+ u8 i;
for (i = 0; i < rate_ctrl->max_valid_rate - 1; i++) {
if (rate_ctrl->valid_rate_index[i] == cur_valid_txrate) {
/* Return true only for single stream */
-static int ath_rc_valid_phyrate(u_int32_t phy, u_int32_t capflag, int ignore_cw)
+static int ath_rc_valid_phyrate(u32 phy, u32 capflag, int ignore_cw)
{
if (WLAN_RC_PHY_HT(phy) & !(capflag & WLAN_RC_HT_FLAG))
return FALSE;
return TRUE;
}
-static inline int ath_rc_get_nextlowervalid_txrate(
- const struct ath_rate_table *rate_table,
- struct ath_tx_ratectrl *rate_ctrl,
- u_int8_t cur_valid_txrate, u_int8_t *next_idx)
+static inline int
+ath_rc_get_nextlowervalid_txrate(const struct ath_rate_table *rate_table,
+ struct ath_tx_ratectrl *rate_ctrl,
+ u8 cur_valid_txrate, u8 *next_idx)
{
int8_t i;
/*
* Initialize the Valid Rate Index from valid entries in Rate Table
*/
-static u_int8_t ath_rc_sib_init_validrates(struct ath_rate_node *ath_rc_priv,
- const struct ath_rate_table *rate_table,
- u_int32_t capflag)
+static u8
+ath_rc_sib_init_validrates(struct ath_rate_node *ath_rc_priv,
+ const struct ath_rate_table *rate_table,
+ u32 capflag)
{
struct ath_tx_ratectrl *rate_ctrl;
- u_int8_t i, hi = 0;
- u_int32_t valid;
+ u8 i, hi = 0;
+ u32 valid;
rate_ctrl = (struct ath_tx_ratectrl *)(ath_rc_priv);
for (i = 0; i < rate_table->rate_cnt; i++) {
rate_table->info[i].valid_single_stream :
rate_table->info[i].valid);
if (valid == TRUE) {
- u_int32_t phy = rate_table->info[i].phy;
- u_int8_t valid_rate_count = 0;
+ u32 phy = rate_table->info[i].phy;
+ u8 valid_rate_count = 0;
if (!ath_rc_valid_phyrate(phy, capflag, FALSE))
continue;
/*
* Initialize the Valid Rate Index from Rate Set
*/
-static u_int8_t ath_rc_sib_setvalid_rates(struct ath_rate_node *ath_rc_priv,
- const struct ath_rate_table *rate_table,
- struct ath_rateset *rateset,
- u_int32_t capflag)
+static u8
+ath_rc_sib_setvalid_rates(struct ath_rate_node *ath_rc_priv,
+ const struct ath_rate_table *rate_table,
+ struct ath_rateset *rateset,
+ u32 capflag)
{
/* XXX: Clean me up and make identation friendly */
- u_int8_t i, j, hi = 0;
+ u8 i, j, hi = 0;
struct ath_tx_ratectrl *rate_ctrl =
(struct ath_tx_ratectrl *)(ath_rc_priv);
/* Use intersection of working rates and valid rates */
for (i = 0; i < rateset->rs_nrates; i++) {
for (j = 0; j < rate_table->rate_cnt; j++) {
- u_int32_t phy = rate_table->info[j].phy;
- u_int32_t valid = (ath_rc_priv->single_stream ?
+ u32 phy = rate_table->info[j].phy;
+ u32 valid = (ath_rc_priv->single_stream ?
rate_table->info[j].valid_single_stream :
rate_table->info[j].valid);
WLAN_RC_CAP_MODE(capflag)) &&
!WLAN_RC_PHY_HT(phy)) {
- u_int8_t valid_rate_count = 0;
+ u8 valid_rate_count = 0;
if (!ath_rc_valid_phyrate(phy, capflag, FALSE))
continue;
return hi;
}
-static u_int8_t ath_rc_sib_setvalid_htrates(struct ath_rate_node *ath_rc_priv,
- const struct ath_rate_table *rate_table,
- u_int8_t *mcs_set, u_int32_t capflag)
+static u8
+ath_rc_sib_setvalid_htrates(struct ath_rate_node *ath_rc_priv,
+ const struct ath_rate_table *rate_table,
+ u8 *mcs_set, u32 capflag)
{
- u_int8_t i, j, hi = 0;
+ u8 i, j, hi = 0;
struct ath_tx_ratectrl *rate_ctrl =
(struct ath_tx_ratectrl *)(ath_rc_priv);
/* Use intersection of working rates and valid rates */
for (i = 0; i < ((struct ath_rateset *)mcs_set)->rs_nrates; i++) {
for (j = 0; j < rate_table->rate_cnt; j++) {
- u_int32_t phy = rate_table->info[j].phy;
- u_int32_t valid = (ath_rc_priv->single_stream ?
+ u32 phy = rate_table->info[j].phy;
+ u32 valid = (ath_rc_priv->single_stream ?
rate_table->info[j].valid_single_stream :
rate_table->info[j].valid);
}
static struct ath_rate_node *ath_rate_node_alloc(struct ath_vap *avp,
- struct ath_rate_softc *rsc,
- gfp_t gfp)
+ struct ath_rate_softc *rsc,
+ gfp_t gfp)
{
struct ath_rate_node *anode;
anode->avp = avp;
anode->asc = rsc;
+ avp->rc_node = anode;
+
return anode;
}
kfree(asc);
}
-u_int8_t ath_rate_findrateix(struct ath_softc *sc,
- u_int8_t dot11rate)
+u8 ath_rate_findrateix(struct ath_softc *sc,
+ u8 dot11rate)
{
const struct ath_rate_table *ratetable;
struct ath_rate_softc *rsc = sc->sc_rc;
return 0;
for (i = 0; i < ratetable->rate_cnt; i++) {
- if ((ratetable->info[i].dot11rate & 0x7f) ==
- (dot11rate & 0x7f))
+ if ((ratetable->info[i].dot11rate & 0x7f) == (dot11rate & 0x7f))
return i;
}
+
return 0;
}
* with an AP. Otherwise this gets called, for example, when
* the we transition to run state when operating as an AP.
*/
-void ath_rate_newstate(struct ath_softc *sc, struct ath_vap *avp, int up)
+void ath_rate_newstate(struct ath_softc *sc, struct ath_vap *avp)
{
struct ath_rate_softc *asc = sc->sc_rc;
}
}
-static u_int8_t ath_rc_ratefind_ht(struct ath_softc *sc,
- struct ath_rate_node *ath_rc_priv,
- const struct ath_rate_table *rate_table,
- int probe_allowed, int *is_probing, int is_retry)
+static u8 ath_rc_ratefind_ht(struct ath_softc *sc,
+ struct ath_rate_node *ath_rc_priv,
+ const struct ath_rate_table *rate_table,
+ int probe_allowed, int *is_probing,
+ int is_retry)
{
- u_int32_t dt, best_thruput, this_thruput, now_msec;
- u_int8_t rate, next_rate, best_rate, maxindex, minindex;
+ u32 dt, best_thruput, this_thruput, now_msec;
+ u8 rate, next_rate, best_rate, maxindex, minindex;
int8_t rssi_last, rssi_reduce = 0, index = 0;
struct ath_tx_ratectrl *rate_ctrl = NULL;
rate_ctrl = (struct ath_tx_ratectrl *)(ath_rc_priv ?
- (ath_rc_priv) : NULL);
+ (ath_rc_priv) : NULL);
*is_probing = FALSE;
- rssi_last = median(rate_ctrl->rssi_last,
- rate_ctrl->rssi_last_prev,
- rate_ctrl->rssi_last_prev2);
+ rssi_last = median(rate_ctrl->rssi_last,
+ rate_ctrl->rssi_last_prev,
+ rate_ctrl->rssi_last_prev2);
/*
* Age (reduce) last ack rssi based on how old it is.
if (dt >= 185)
rssi_reduce = 10;
else if (dt >= 25)
- rssi_reduce = (u_int8_t)((dt - 25) >> 4);
+ rssi_reduce = (u8)((dt - 25) >> 4);
/* Now reduce rssi_last by rssi_reduce */
if (rssi_last < rssi_reduce)
*/
best_thruput = 0;
- maxindex = rate_ctrl->max_valid_rate-1;
+ maxindex = rate_ctrl->max_valid_rate-1;
+
+ minindex = 0;
+ best_rate = minindex;
- minindex = 0;
- best_rate = minindex;
/*
* Try the higher rate first. It will reduce memory moving time
* if we have very good channel characteristics.
*/
-
for (index = maxindex; index >= minindex ; index--) {
- u_int8_t per_thres;
+ u8 per_thres;
rate = rate_ctrl->valid_rate_index[index];
-
if (rate > rate_ctrl->rate_max_phy)
continue;
*/
if (rate >= rate_ctrl->rate_max_phy && probe_allowed) {
-
rate = rate_ctrl->rate_max_phy;
/* Probe the next allowed phy state */
/* FIXME:XXXX Check to make sure ratMax is checked properly */
if (ath_rc_get_nextvalid_txrate(rate_table,
- rate_ctrl, rate, &next_rate) &&
- (now_msec - rate_ctrl->probe_time >
- rate_table->probe_interval) &&
- (rate_ctrl->hw_maxretry_pktcnt >= 1)) {
- rate = next_rate;
- rate_ctrl->probe_rate = rate;
- rate_ctrl->probe_time = now_msec;
+ rate_ctrl, rate, &next_rate) &&
+ (now_msec - rate_ctrl->probe_time >
+ rate_table->probe_interval) &&
+ (rate_ctrl->hw_maxretry_pktcnt >= 1)) {
+ rate = next_rate;
+ rate_ctrl->probe_rate = rate;
+ rate_ctrl->probe_time = now_msec;
rate_ctrl->hw_maxretry_pktcnt = 0;
- *is_probing = TRUE;
+ *is_probing = TRUE;
}
}
}
static void ath_rc_rate_set_series(const struct ath_rate_table *rate_table ,
- struct ath_rc_series *series, u_int8_t tries, u_int8_t rix,
- int rtsctsenable)
+ struct ath_rc_series *series,
+ u8 tries,
+ u8 rix,
+ int rtsctsenable)
{
series->tries = tries;
series->flags = (rtsctsenable? ATH_RC_RTSCTS_FLAG : 0) |
(WLAN_RC_PHY_DS(rate_table->info[rix].phy) ?
- ATH_RC_DS_FLAG : 0) |
+ ATH_RC_DS_FLAG : 0) |
(WLAN_RC_PHY_40(rate_table->info[rix].phy) ?
- ATH_RC_CW40_FLAG : 0) |
+ ATH_RC_CW40_FLAG : 0) |
(WLAN_RC_PHY_SGI(rate_table->info[rix].phy) ?
- ATH_RC_SGI_FLAG : 0);
+ ATH_RC_SGI_FLAG : 0);
series->rix = rate_table->info[rix].base_index;
series->max_4ms_framelen = rate_table->info[rix].max_4ms_framelen;
}
-static u_int8_t ath_rc_rate_getidx(struct ath_softc *sc,
- struct ath_rate_node *ath_rc_priv,
- const struct ath_rate_table *rate_table,
- u_int8_t rix, u_int16_t stepdown, u_int16_t min_rate)
+static u8 ath_rc_rate_getidx(struct ath_softc *sc,
+ struct ath_rate_node *ath_rc_priv,
+ const struct ath_rate_table *rate_table,
+ u8 rix, u16 stepdown,
+ u16 min_rate)
{
- u_int32_t j;
- u_int8_t nextindex;
+ u32 j;
+ u8 nextindex;
struct ath_tx_ratectrl *rate_ctrl =
(struct ath_tx_ratectrl *)(ath_rc_priv);
}
static void ath_rc_ratefind(struct ath_softc *sc,
- struct ath_rate_node *ath_rc_priv,
- int num_tries, int num_rates, unsigned int rcflag,
- struct ath_rc_series series[], int *is_probe, int is_retry)
+ struct ath_rate_node *ath_rc_priv,
+ int num_tries, int num_rates, unsigned int rcflag,
+ struct ath_rc_series series[], int *is_probe,
+ int is_retry)
{
- u_int8_t try_per_rate = 0, i = 0, rix, nrix;
+ u8 try_per_rate = 0, i = 0, rix, nrix;
struct ath_rate_softc *asc = (struct ath_rate_softc *)sc->sc_rc;
struct ath_rate_table *rate_table;
/* Fill in the other rates for multirate retry */
for ( ; i < num_rates; i++) {
- u_int8_t try_num;
- u_int8_t min_rate;
+ u8 try_num;
+ u8 min_rate;
- try_num = ((i + 1) == num_rates) ?
+ try_num = ((i + 1) == num_rates) ?
num_tries - (try_per_rate * i) : try_per_rate ;
min_rate = (((i + 1) == num_rates) &&
(rcflag & ATH_RC_MINRATE_LASTRATE)) ? 1 : 0;
if ((sc->sc_curmode == WIRELESS_MODE_11NG_HT20) ||
(sc->sc_curmode == WIRELESS_MODE_11NG_HT40PLUS) ||
(sc->sc_curmode == WIRELESS_MODE_11NG_HT40MINUS)) {
- u_int8_t dot11rate = rate_table->info[rix].dot11rate;
- u_int8_t phy = rate_table->info[rix].phy;
+ u8 dot11rate = rate_table->info[rix].dot11rate;
+ u8 phy = rate_table->info[rix].phy;
if (i == 4 &&
((dot11rate == 2 && phy == WLAN_RC_PHY_HT_40_SS) ||
(dot11rate == 3 && phy == WLAN_RC_PHY_HT_20_SS))) {
/*
* Return the Tx rate series.
*/
-
-
void ath_rate_findrate(struct ath_softc *sc,
- struct ath_rate_node *ath_rc_priv,
- int num_tries,
- int num_rates,
- unsigned int rcflag,
- struct ath_rc_series series[],
- int *is_probe,
- int is_retry
- )
+ struct ath_rate_node *ath_rc_priv,
+ int num_tries,
+ int num_rates,
+ unsigned int rcflag,
+ struct ath_rc_series series[],
+ int *is_probe,
+ int is_retry)
{
- struct ath_vap *avp = ath_rc_priv->avp;
+ struct ath_vap *avp = ath_rc_priv->avp;
DPRINTF(sc, ATH_DBG_RATE, "%s", __func__);
if (!num_rates || !num_tries)
} else {
/* Fixed rate */
int idx;
- u_int8_t flags;
- u_int32_t rix;
+ u8 flags;
+ u32 rix;
struct ath_rate_softc *asc = ath_rc_priv->asc;
struct ath_rate_table *rate_table;
for (idx = 0; idx < 4; idx++) {
unsigned int mcs;
- u_int8_t series_rix = 0;
+ u8 series_rix = 0;
series[idx].tries =
IEEE80211_RATE_IDX_ENTRY(
int tx_rate, int xretries, int retries)
{
struct ath_tx_ratectrl *rate_ctrl;
- u_int32_t now_msec = jiffies_to_msecs(jiffies);
+ u32 now_msec = jiffies_to_msecs(jiffies);
int state_change = FALSE, rate, count;
- u_int8_t last_per;
+ u8 last_per;
struct ath_rate_softc *asc = (struct ath_rate_softc *)sc->sc_rc;
struct ath_rate_table *rate_table =
(struct ath_rate_table *)asc->hw_rate_table[sc->sc_curmode];
- static u_int32_t nretry_to_per_lookup[10] = {
+ static u32 nretry_to_per_lookup[10] = {
100 * 0 / 1,
100 * 1 / 4,
100 * 1 / 2,
rate_ctrl->state[tx_rate].per += 30;
if (rate_ctrl->state[tx_rate].per > 100)
rate_ctrl->state[tx_rate].per = 100;
-
} else {
/* xretries == 2 */
count = sizeof(nretry_to_per_lookup) /
retries = count - 1;
/* new_PER = 7/8*old_PER + 1/8*(currentPER) */
rate_ctrl->state[tx_rate].per =
- (u_int8_t)(rate_ctrl->state[tx_rate].per -
+ (u8)(rate_ctrl->state[tx_rate].per -
(rate_ctrl->state[tx_rate].per >> 3) +
((100) >> 3));
}
rate_ctrl->probe_rate = 0;
} else { /* xretries == 0 */
-
/* Update the PER. */
/* Make sure it doesn't index out of array's bounds. */
count = sizeof(nretry_to_per_lookup) /
*/
if (info_priv->n_frames > 0)
rate_ctrl->state[tx_rate].per
- = (u_int8_t)
+ = (u8)
(rate_ctrl->state[tx_rate].per -
(rate_ctrl->state[tx_rate].per >> 3) +
((100*(retries*info_priv->n_frames +
} else {
/* new_PER = 7/8*old_PER + 1/8*(currentPER) */
- rate_ctrl->state[tx_rate].per = (u_int8_t)
+ rate_ctrl->state[tx_rate].per = (u8)
(rate_ctrl->state[tx_rate].per -
(rate_ctrl->state[tx_rate].per >> 3) +
(nretry_to_per_lookup[retries] >> 3));
rate_ctrl->rssi_last_prev2 = rate_ctrl->rssi_last_prev;
rate_ctrl->rssi_last_prev = rate_ctrl->rssi_last;
- rate_ctrl->rssi_last = info_priv->tx.ts_rssi;
- rate_ctrl->rssi_time = now_msec;
+ rate_ctrl->rssi_last = info_priv->tx.ts_rssi;
+ rate_ctrl->rssi_time = now_msec;
/*
* If we got at most one retry then increase the max rate if
*/
rate_ctrl->probe_rate = 0;
} else {
- u_int8_t probe_rate = 0;
+ u8 probe_rate = 0;
rate_ctrl->rate_max_phy = rate_ctrl->probe_rate;
probe_rate = rate_ctrl->probe_rate;
}
}
-
/* For all cases */
/*
rate_table->info[tx_rate].ratekbps <=
rate_table->info[rate_ctrl->rate_max_phy].ratekbps) {
ath_rc_get_nextlowervalid_txrate(rate_table, rate_ctrl,
- (u_int8_t) tx_rate, &rate_ctrl->rate_max_phy);
+ (u8) tx_rate, &rate_ctrl->rate_max_phy);
/* Don't probe for a little while. */
rate_ctrl->probe_time = now_msec;
* the status of previous frames.
*/
static void ath_rc_update(struct ath_softc *sc,
- struct ath_rate_node *ath_rc_priv,
- struct ath_tx_info_priv *info_priv, int final_ts_idx,
- int xretries, int long_retry)
+ struct ath_rate_node *ath_rc_priv,
+ struct ath_tx_info_priv *info_priv, int final_ts_idx,
+ int xretries, int long_retry)
{
struct ath_rate_softc *asc = (struct ath_rate_softc *)sc->sc_rc;
struct ath_rate_table *rate_table;
struct ath_tx_ratectrl *rate_ctrl;
struct ath_rc_series rcs[4];
- u_int8_t flags;
- u_int32_t series = 0, rix;
+ u8 flags;
+ u32 series = 0, rix;
memcpy(rcs, info_priv->rcs, 4 * sizeof(rcs[0]));
rate_table = (struct ath_rate_table *)
* are intermediate rate failures to be processed.
*/
if (final_ts_idx != 0) {
-
/* Process intermediate rates that failed.*/
for (series = 0; series < final_ts_idx ; series++) {
if (rcs[series].tries != 0) {
/*
* Process a tx descriptor for a completed transmit (success or failure).
*/
-
static void ath_rate_tx_complete(struct ath_softc *sc,
- struct ath_node *an, struct ath_rate_node *rc_priv,
- struct ath_tx_info_priv *info_priv)
+ struct ath_node *an,
+ struct ath_rate_node *rc_priv,
+ struct ath_tx_info_priv *info_priv)
{
int final_ts_idx = info_priv->tx.ts_rateindex;
int tx_status = 0, is_underrun = 0;
tx_status = 1;
ath_rc_update(sc, rc_priv, info_priv, final_ts_idx, tx_status,
- (is_underrun) ? ATH_11N_TXMAXTRY
- :info_priv->tx.ts_longretry);
+ (is_underrun) ? ATH_11N_TXMAXTRY :
+ info_priv->tx.ts_longretry);
}
* It will determine which rates are valid for use.
*/
static void ath_rc_sib_update(struct ath_softc *sc,
- struct ath_rate_node *ath_rc_priv,
- u_int32_t capflag, int keep_state,
- struct ath_rateset *negotiated_rates,
- struct ath_rateset *negotiated_htrates)
+ struct ath_rate_node *ath_rc_priv,
+ u32 capflag, int keep_state,
+ struct ath_rateset *negotiated_rates,
+ struct ath_rateset *negotiated_htrates)
{
struct ath_rate_table *rate_table = NULL;
struct ath_rate_softc *asc = (struct ath_rate_softc *)sc->sc_rc;
struct ath_rateset *rateset = negotiated_rates;
- u_int8_t *ht_mcs = (u_int8_t *)negotiated_htrates;
+ u8 *ht_mcs = (u8 *)negotiated_htrates;
struct ath_tx_ratectrl *rate_ctrl = (struct ath_tx_ratectrl *)
(ath_rc_priv);
- u_int8_t i, j, k, hi = 0, hthi = 0;
+ u8 i, j, k, hi = 0, hthi = 0;
rate_table = (struct ath_rate_table *)
asc->hw_rate_table[sc->sc_curmode];
for (i = 0 ; (i < rate_ctrl->rate_table_size) && (!keep_state); i++) {
rate_ctrl->state[i].rssi_thres =
rate_table->info[i].rssi_ack_validmin;
- rate_ctrl->state[i].per = 0;
+ rate_ctrl->state[i].per = 0;
}
/* Determine the valid rates */
} else {
/* Use intersection of working rates and valid rates */
hi = ath_rc_sib_setvalid_rates(ath_rc_priv, rate_table,
- rateset, capflag);
+ rateset, capflag);
if (capflag & WLAN_RC_HT_FLAG) {
hthi = ath_rc_sib_setvalid_htrates(ath_rc_priv,
- rate_table, ht_mcs, capflag);
+ rate_table,
+ ht_mcs,
+ capflag);
}
hi = A_MAX(hi, hthi);
}
}
if (!ath_rc_valid_phyrate(i, rate_table->initial_ratemax, TRUE)
- || !rate_ctrl->valid_phy_ratecnt[i])
+ || !rate_ctrl->valid_phy_ratecnt[i])
continue;
rate_ctrl->rate_max_phy = rate_ctrl->valid_phy_rateidx[i][j-1];
* Update rate-control state on station associate/reassociate.
*/
static int ath_rate_newassoc(struct ath_softc *sc,
- struct ath_rate_node *ath_rc_priv,
- unsigned int capflag,
- struct ath_rateset *negotiated_rates,
- struct ath_rateset *negotiated_htrates)
+ struct ath_rate_node *ath_rc_priv,
+ unsigned int capflag,
+ struct ath_rateset *negotiated_rates,
+ struct ath_rateset *negotiated_htrates)
{
((capflag & ATH_RC_CW40_FLAG) ? WLAN_RC_40_FLAG : 0);
ath_rc_sib_update(sc, ath_rc_priv, ath_rc_priv->ht_cap, 0,
- negotiated_rates, negotiated_htrates);
+ negotiated_rates, negotiated_htrates);
return 0;
}
rc_priv->neg_rates.rs_nrates = j;
}
-static void ath_rc_node_update(struct ieee80211_hw *hw,
- struct ath_rate_node *rc_priv)
+void ath_rc_node_update(struct ieee80211_hw *hw, struct ath_rate_node *rc_priv)
{
struct ath_softc *sc = hw->priv;
- u_int32_t capflag = 0;
+ u32 capflag = 0;
if (hw->conf.ht_conf.ht_supported) {
capflag |= ATH_RC_HT_FLAG | ATH_RC_DS_FLAG;
- if (sc->sc_ht_info.tx_chan_width == HAL_HT_MACMODE_2040)
+ if (sc->sc_ht_info.tx_chan_width == ATH9K_HT_MACMODE_2040)
capflag |= ATH_RC_CW40_FLAG;
}
}
static void ath_rate_init(void *priv, void *priv_sta,
- struct ieee80211_local *local,
- struct sta_info *sta)
+ struct ieee80211_local *local,
+ struct sta_info *sta)
{
struct ieee80211_supported_band *sband;
struct ieee80211_hw *hw = local_to_hw(local);