diff options
author | sam <sam@FreeBSD.org> | 2007-01-08 17:24:51 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2007-01-08 17:24:51 +0000 |
commit | fae048c8598d2452ea294b97092f230431c7d37c (patch) | |
tree | db2e192b629326cfac5f0245ca3a5e0ed3326978 /sys/net80211/ieee80211_node.c | |
parent | 6d67972dc50a1f716abce17b6a0a3c60b8df2449 (diff) | |
download | FreeBSD-src-fae048c8598d2452ea294b97092f230431c7d37c.zip FreeBSD-src-fae048c8598d2452ea294b97092f230431c7d37c.tar.gz |
Correct several issues with rate set negotiation:
o add IEEE80211_F_JOIN flag to ieee80211_fix_rate to indicate a station
is joining a BSS; this is used to control whether or not we over-write
the basic rate bit in the calculated rate set
o fix ieee80211_fix_rate to honor IEEE80211_F_DODEL when IEEE80211_F_DONEGO
is not specified (e.g. when joining an ibss network)
o on sta join always delete unusable rates from the negotiated rate set,
this was being done only ibss networks but is also needed for 11g bss
with mixed stations
o on sta join delete unusable rates from the bss node's rate set, not the
scan table entry's rate set
o when calculating a rate set for new neighbors in an ibss caculate a
negotiated rate set so drivers are not presented with rates they should
not use
Submitted by: Sepherosa Ziehau (w/ modifications)
Obtained from: DragonFly
MFC after: 1 month
Diffstat (limited to 'sys/net80211/ieee80211_node.c')
-rw-r--r-- | sys/net80211/ieee80211_node.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index 700d4b0..9c34c29 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -517,7 +517,8 @@ ieee80211_match_bss(struct ieee80211com *ic, struct ieee80211_node *ni) if (ni->ni_capinfo & IEEE80211_CAPINFO_PRIVACY) fail |= 0x04; } - rate = ieee80211_fix_rate(ni, IEEE80211_F_DONEGO | IEEE80211_F_DOFRATE); + rate = ieee80211_fix_rate(ni, + IEEE80211_F_JOIN | IEEE80211_F_DONEGO | IEEE80211_F_DOFRATE); if (rate & IEEE80211_RATE_BASIC) fail |= 0x08; if (ic->ic_des_esslen != 0 && @@ -803,11 +804,6 @@ ieee80211_sta_join(struct ieee80211com *ic, struct ieee80211_node *selbs) if (ic->ic_opmode == IEEE80211_M_IBSS) { struct ieee80211_node_table *nt; /* - * Delete unusable rates; we've already checked - * that the negotiated rate set is acceptable. - */ - ieee80211_fix_rate(selbs, IEEE80211_F_DODEL); - /* * Fillin the neighbor table; it will already * exist if we are simply switching mastership. * XXX ic_sta always setup so this is unnecessary? @@ -828,6 +824,13 @@ ieee80211_sta_join(struct ieee80211com *ic, struct ieee80211_node *selbs) copy_bss(selbs, obss); ieee80211_free_node(obss); } + + /* + * 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); + /* * Set the erp state (mostly the slot time) to deal with * the auto-select case; this should be redundant if the @@ -1295,7 +1298,9 @@ ieee80211_init_neighbor(struct ieee80211_node *ni, ieee80211_saveie(&ni->ni_wpa_ie, sp->wpa); /* NB: must be after ni_chan is setup */ - ieee80211_setup_rates(ni, sp->rates, sp->xrates, IEEE80211_F_DOSORT); + ieee80211_setup_rates(ni, sp->rates, sp->xrates, + IEEE80211_F_DOSORT | IEEE80211_F_DOFRATE | + IEEE80211_F_DONEGO | IEEE80211_F_DODEL); } /* |