diff options
author | sam <sam@FreeBSD.org> | 2007-03-11 07:22:21 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2007-03-11 07:22:21 +0000 |
commit | 63f1cc9c738cf124815b9f2b3c983f6c212a9715 (patch) | |
tree | 62a74870d86a2e134567630ca296bacbe0a35ffe /sys/net80211 | |
parent | a0ffc0834867892a7aace699b65132a9ee33110d (diff) | |
download | FreeBSD-src-63f1cc9c738cf124815b9f2b3c983f6c212a9715.zip FreeBSD-src-63f1cc9c738cf124815b9f2b3c983f6c212a9715.tar.gz |
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
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_input.c | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.c | 5 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 5 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.h | 3 |
4 files changed, 8 insertions, 7 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 3b0c92b..2da0172 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -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 diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 0408c33..eb30e62 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -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 diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index de2db52..91574f3 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -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) { /* diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h index f089970..30f52d5 100644 --- a/sys/net80211/ieee80211_proto.h +++ b/sys/net80211/ieee80211_proto.h @@ -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. |