diff options
author | sam <sam@FreeBSD.org> | 2005-07-22 17:29:03 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-07-22 17:29:03 +0000 |
commit | f661a632a685b7c22eb499e9c4f0c30248ad5e11 (patch) | |
tree | 755e2d7305683712ee93e1f333d13fc03976ce5b /sys/net80211 | |
parent | 5531f8a2116efe546e15b1761eaebe544cb4ce3a (diff) | |
download | FreeBSD-src-f661a632a685b7c22eb499e9c4f0c30248ad5e11.zip FreeBSD-src-f661a632a685b7c22eb499e9c4f0c30248ad5e11.tar.gz |
simplify rate set api's by removing ic parameter (implicit in node reference)
MFC after: 3 days
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_input.c | 17 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.c | 5 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 3 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.h | 4 |
4 files changed, 16 insertions, 13 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 3eeca1b..4c433b3 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -815,10 +815,11 @@ ieee80211_decap(struct ieee80211com *ic, struct mbuf *m, int hdrlen) /* * Install received rate set information in the node's state block. */ -static int -ieee80211_setup_rates(struct ieee80211com *ic, struct ieee80211_node *ni, - u_int8_t *rates, u_int8_t *xrates, int flags) +int +ieee80211_setup_rates(struct ieee80211_node *ni, + const u_int8_t *rates, const u_int8_t *xrates, int flags) { + struct ieee80211com *ic = ni->ni_ic; struct ieee80211_rateset *rs = &ni->ni_rates; memset(rs, 0, sizeof(*rs)); @@ -841,7 +842,7 @@ ieee80211_setup_rates(struct ieee80211com *ic, struct ieee80211_node *ni, memcpy(rs->rs_rates + rs->rs_nrates, xrates+2, nxrates); rs->rs_nrates += nxrates; } - return ieee80211_fix_rate(ic, ni, flags); + return ieee80211_fix_rate(ni, flags); } static void @@ -2036,7 +2037,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, if (wpa != NULL) ieee80211_saveie(&ni->ni_wpa_ie, wpa); /* NB: must be after ni_chan is setup */ - ieee80211_setup_rates(ic, ni, rates, xrates, IEEE80211_F_DOSORT); + ieee80211_setup_rates(ni, rates, xrates, IEEE80211_F_DOSORT); break; } @@ -2106,7 +2107,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, "[%s] recv probe req\n", ether_sprintf(wh->i_addr2)); ni->ni_rssi = rssi; ni->ni_rstamp = rstamp; - rate = ieee80211_setup_rates(ic, ni, rates, xrates, + rate = ieee80211_setup_rates(ni, rates, xrates, IEEE80211_F_DOSORT | IEEE80211_F_DOFRATE | IEEE80211_F_DONEGO | IEEE80211_F_DODEL); if (rate & IEEE80211_RATE_BASIC) { @@ -2332,7 +2333,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, ic->ic_stats.is_rx_assoc_capmismatch++; return; } - rate = ieee80211_setup_rates(ic, ni, rates, xrates, + rate = ieee80211_setup_rates(ni, rates, xrates, IEEE80211_F_DOSORT | IEEE80211_F_DOFRATE | IEEE80211_F_DONEGO | IEEE80211_F_DODEL); /* @@ -2453,7 +2454,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0, } IEEE80211_VERIFY_ELEMENT(rates, IEEE80211_RATE_MAXSIZE); - rate = ieee80211_setup_rates(ic, ni, rates, xrates, + rate = ieee80211_setup_rates(ni, rates, xrates, IEEE80211_F_DOSORT | IEEE80211_F_DOFRATE | IEEE80211_F_DONEGO | IEEE80211_F_DODEL); if (rate & IEEE80211_RATE_BASIC) { diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index b085855..28e0ef5 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -487,8 +487,7 @@ ieee80211_match_bss(struct ieee80211com *ic, struct ieee80211_node *ni) if (ni->ni_capinfo & IEEE80211_CAPINFO_PRIVACY) fail |= 0x04; } - rate = ieee80211_fix_rate(ic, ni, - IEEE80211_F_DONEGO | IEEE80211_F_DOFRATE); + rate = ieee80211_fix_rate(ni, IEEE80211_F_DONEGO | IEEE80211_F_DOFRATE); if (rate & IEEE80211_RATE_BASIC) fail |= 0x08; if (ic->ic_des_esslen != 0 && @@ -772,7 +771,7 @@ 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, selbs, IEEE80211_F_DODEL); + ieee80211_fix_rate(selbs, IEEE80211_F_DODEL); /* * Fillin the neighbor table; it will already * exist if we are simply switching mastership. diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 76ef0b5..2ab0e38 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -319,9 +319,10 @@ ieee80211_dump_pkt(const u_int8_t *buf, int len, int rate, int rssi) } int -ieee80211_fix_rate(struct ieee80211com *ic, struct ieee80211_node *ni, int flags) +ieee80211_fix_rate(struct ieee80211_node *ni, int flags) { #define RV(v) ((v) & IEEE80211_RATE_VAL) + struct ieee80211com *ic = ni->ni_ic; int i, j, ignore, error; int okrate, badrate, fixedrate; struct ieee80211_rateset *srs, *nrs; diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h index bd6a222..4cdca5a 100644 --- a/sys/net80211/ieee80211_proto.h +++ b/sys/net80211/ieee80211_proto.h @@ -59,6 +59,8 @@ void ieee80211_proto_detach(struct ieee80211com *); struct ieee80211_node; int ieee80211_input(struct ieee80211com *, struct mbuf *, struct ieee80211_node *, int, u_int32_t); +int ieee80211_setup_rates(struct ieee80211_node *ni, + const u_int8_t *rates, const u_int8_t *xrates, int flags); void ieee80211_recv_mgmt(struct ieee80211com *, struct mbuf *, struct ieee80211_node *, int, int, u_int32_t); int ieee80211_send_nulldata(struct ieee80211com *, struct ieee80211_node *); @@ -163,7 +165,7 @@ const struct ieee80211_aclator *ieee80211_aclator_get(const char *name); #define IEEE80211_F_DOFRATE 0x00000002 /* use fixed rate */ #define IEEE80211_F_DONEGO 0x00000004 /* calc negotiated rate */ #define IEEE80211_F_DODEL 0x00000008 /* delete ignore rate */ -int ieee80211_fix_rate(struct ieee80211com *, struct ieee80211_node *, int); +int ieee80211_fix_rate(struct ieee80211_node *, int); /* * WME/WMM support. |