change ieee80211_fix_rate to take a rate set instead of using

ni_rates; this lets us re-use the code to check 11n HT rates

MFC after:	2 weeks
This commit is contained in:
Sam Leffler 2007-03-11 07:22:21 +00:00
parent a000d7c202
commit 70e28b9a2d
4 changed files with 8 additions and 7 deletions

View File

@ -828,7 +828,7 @@ ieee80211_setup_rates(struct ieee80211_node *ni,
memcpy(rs->rs_rates + rs->rs_nrates, xrates+2, nxrates);
rs->rs_nrates += nxrates;
}
return ieee80211_fix_rate(ni, flags);
return ieee80211_fix_rate(ni, rs, flags);
}
static void

View File

@ -513,7 +513,7 @@ ieee80211_match_bss(struct ieee80211com *ic, struct ieee80211_node *ni)
if (ni->ni_capinfo & IEEE80211_CAPINFO_PRIVACY)
fail |= 0x04;
}
rate = ieee80211_fix_rate(ni,
rate = ieee80211_fix_rate(ni, &ni->ni_rates,
IEEE80211_F_JOIN | IEEE80211_F_DONEGO | IEEE80211_F_DOFRATE);
if (rate & IEEE80211_RATE_BASIC)
fail |= 0x08;
@ -825,7 +825,8 @@ ieee80211_sta_join(struct ieee80211com *ic, struct ieee80211_node *selbs)
* Delete unusable rates; we've already checked
* that the negotiated rate set is acceptable.
*/
ieee80211_fix_rate(ic->ic_bss, IEEE80211_F_DODEL | IEEE80211_F_JOIN);
ieee80211_fix_rate(ic->ic_bss, &ic->ic_bss->ni_rates,
IEEE80211_F_DODEL | IEEE80211_F_JOIN);
/*
* Set the erp state (mostly the slot time) to deal with

View File

@ -344,14 +344,14 @@ findrix(const struct ieee80211_rateset *rs, int r)
}
int
ieee80211_fix_rate(struct ieee80211_node *ni, int flags)
ieee80211_fix_rate(struct ieee80211_node *ni,
struct ieee80211_rateset *nrs, int flags)
{
#define RV(v) ((v) & IEEE80211_RATE_VAL)
struct ieee80211com *ic = ni->ni_ic;
int i, j, rix, error;
int okrate, badrate, fixedrate;
const struct ieee80211_rateset *srs;
struct ieee80211_rateset *nrs;
u_int8_t r;
/*
@ -364,7 +364,6 @@ ieee80211_fix_rate(struct ieee80211_node *ni, int flags)
error = 0;
okrate = badrate = fixedrate = 0;
srs = ieee80211_get_suprates(ic, ni->ni_chan);
nrs = &ni->ni_rates;
for (i = 0; i < nrs->rs_nrates; ) {
if (flags & IEEE80211_F_DOSORT) {
/*

View File

@ -181,7 +181,8 @@ const struct ieee80211_aclator *ieee80211_aclator_get(const char *name);
#define IEEE80211_F_DONEGO 0x00000004 /* calc negotiated rate */
#define IEEE80211_F_DODEL 0x00000008 /* delete ignore rate */
#define IEEE80211_F_JOIN 0x00000010 /* sta joining our bss */
int ieee80211_fix_rate(struct ieee80211_node *, int);
int ieee80211_fix_rate(struct ieee80211_node *,
struct ieee80211_rateset *, int);
/*
* WME/WMM support.