diff options
author | sam <sam@FreeBSD.org> | 2008-10-25 23:32:24 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2008-10-25 23:32:24 +0000 |
commit | 514df7862ade63d3a0328363565b840215d9488d (patch) | |
tree | bcae641d7d5b223e910d2135d93ecde149e97c92 /sys | |
parent | f6c797f98760c5e3df2bd5d21f2461c238f7e697 (diff) | |
download | FreeBSD-src-514df7862ade63d3a0328363565b840215d9488d.zip FreeBSD-src-514df7862ade63d3a0328363565b840215d9488d.tar.gz |
change ieee80211_sta_join to take an explicit channel instead of
using the value in the scan parameters; this will be used to fix
issues with 11b operation
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/ieee80211_ioctl.c | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.c | 4 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.h | 2 | ||||
-rw-r--r-- | sys/net80211/ieee80211_scan_sta.c | 17 |
4 files changed, 18 insertions, 7 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index cab8b33..ae39fd6 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -1463,7 +1463,7 @@ setmlme_assoc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], if (lookup.se == NULL) return ENOENT; mlmedebug(vap, mac, IEEE80211_MLME_ASSOC, 0); - if (!ieee80211_sta_join(vap, lookup.se)) + if (!ieee80211_sta_join(vap, lookup.se->se_chan, lookup.se)) return EIO; /* XXX unique but could be better */ return 0; } diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c index f7aa3a9..5f8bd2e 100644 --- a/sys/net80211/ieee80211_node.c +++ b/sys/net80211/ieee80211_node.c @@ -687,7 +687,7 @@ ieee80211_sta_join1(struct ieee80211_node *selbs) } int -ieee80211_sta_join(struct ieee80211vap *vap, +ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan, const struct ieee80211_scan_entry *se) { struct ieee80211com *ic = vap->iv_ic; @@ -709,7 +709,7 @@ ieee80211_sta_join(struct ieee80211vap *vap, ni->ni_tstamp.tsf = se->se_tstamp.tsf; ni->ni_intval = se->se_intval; ni->ni_capinfo = se->se_capinfo; - ni->ni_chan = se->se_chan; + ni->ni_chan = chan; ni->ni_timoff = se->se_timoff; ni->ni_fhdwell = se->se_fhdwell; ni->ni_fhindex = se->se_fhindex; diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 2aaec0a..37d6372 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -282,7 +282,7 @@ void ieee80211_sync_curchan(struct ieee80211com *); void ieee80211_setcurchan(struct ieee80211com *, struct ieee80211_channel *); int ieee80211_ibss_merge(struct ieee80211_node *); struct ieee80211_scan_entry; -int ieee80211_sta_join(struct ieee80211vap *, +int ieee80211_sta_join(struct ieee80211vap *, struct ieee80211_channel *, const struct ieee80211_scan_entry *); void ieee80211_sta_leave(struct ieee80211_node *); void ieee80211_node_deauth(struct ieee80211_node *, int); diff --git a/sys/net80211/ieee80211_scan_sta.c b/sys/net80211/ieee80211_scan_sta.c index 6b5bf88..386d8de 100644 --- a/sys/net80211/ieee80211_scan_sta.c +++ b/sys/net80211/ieee80211_scan_sta.c @@ -1014,6 +1014,7 @@ sta_pick_bss(struct ieee80211_scan_state *ss, struct ieee80211vap *vap) { struct sta_table *st = ss->ss_priv; struct sta_entry *selbs; + struct ieee80211_channel *chan; KASSERT(vap->iv_opmode == IEEE80211_M_STA, ("wrong mode %u", vap->iv_opmode)); @@ -1056,7 +1057,10 @@ notfound: selbs = select_bss(ss, vap, IEEE80211_MSG_SCAN); if (ss->ss_flags & IEEE80211_SCAN_NOJOIN) return (selbs != NULL); - if (selbs == NULL || !ieee80211_sta_join(vap, &selbs->base)) + if (selbs == NULL) + goto notfound; + chan = selbs->base.se_chan; + if (!ieee80211_sta_join(vap, chan, &selbs->base)) goto notfound; return 1; /* terminate scan */ } @@ -1138,12 +1142,16 @@ sta_roam_check(struct ieee80211_scan_state *ss, struct ieee80211vap *vap) se->base.se_rssi = curRssi; selbs = select_bss(ss, vap, IEEE80211_MSG_ROAM); if (selbs != NULL && selbs != se) { + struct ieee80211_channel *chan; + IEEE80211_DPRINTF(vap, IEEE80211_MSG_ROAM | IEEE80211_MSG_DEBUG, "%s: ROAM: curRate %u, roamRate %u, " "curRssi %d, roamRssi %d\n", __func__, curRate, roamRate, curRssi, roamRssi); - ieee80211_sta_join(vap, &selbs->base); + + chan = selbs->base.se_chan; + (void) ieee80211_sta_join(vap, chan, &selbs->base); } } } @@ -1419,7 +1427,10 @@ notfound: selbs = select_bss(ss, vap, IEEE80211_MSG_SCAN); if (ss->ss_flags & IEEE80211_SCAN_NOJOIN) return (selbs != NULL); - if (selbs == NULL || !ieee80211_sta_join(vap, &selbs->base)) + if (selbs == NULL) + goto notfound; + chan = selbs->base.se_chan; + if (!ieee80211_sta_join(vap, chan, &selbs->base)) goto notfound; return 1; /* terminate scan */ } |