summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_input.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2007-06-30 21:23:23 +0000
committerthompsa <thompsa@FreeBSD.org>2007-06-30 21:23:23 +0000
commit03a3b230428af3dfad8a2660809025cc47b938c6 (patch)
treeef8ffae136509b04a3591b2f9fd5c7b6b3d2cc99 /sys/net80211/ieee80211_input.c
parent59be299a4e0e2fe099e874859863a1c5971b06cb (diff)
downloadFreeBSD-src-03a3b230428af3dfad8a2660809025cc47b938c6.zip
FreeBSD-src-03a3b230428af3dfad8a2660809025cc47b938c6.tar.gz
Change the channel number in the scan results struct to be a pointer to the
operating channel and use this in the scan cache rather than directly using ic_curchan. Some firmware cards can only do a full scan and so ic_curchan does not have the correct value. Also add IEEE80211_CHAN2IEEE to directly dereference ic_ieee from the channel to be used in the fast path. Reviewed by: sam, sephe Approved by: re (kensmith)
Diffstat (limited to 'sys/net80211/ieee80211_input.c')
-rw-r--r--sys/net80211/ieee80211_input.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index a5b5341..d756041 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -2090,8 +2090,8 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
scan.tstamp = frm; frm += 8;
scan.bintval = le16toh(*(uint16_t *)frm); frm += 2;
scan.capinfo = le16toh(*(uint16_t *)frm); frm += 2;
- scan.bchan = ieee80211_chan2ieee(ic, ic->ic_curchan);
- scan.chan = scan.bchan;
+ scan.bchan = IEEE80211_CHAN2IEEE(ic->ic_curchan);
+ scan.curchan = ic->ic_curchan;
while (efrm - frm > 1) {
IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2, return);
@@ -2108,7 +2108,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
case IEEE80211_ELEMID_FHPARMS:
if (ic->ic_phytype == IEEE80211_T_FH) {
scan.fhdwell = LE_READ_2(&frm[2]);
- scan.chan = IEEE80211_FH_CHAN(frm[4], frm[5]);
+ scan.bchan = IEEE80211_FH_CHAN(frm[4], frm[5]);
scan.fhindex = frm[6];
}
break;
@@ -2118,7 +2118,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
* is problematic for multi-mode devices.
*/
if (ic->ic_phytype != IEEE80211_T_FH)
- scan.chan = frm[2];
+ scan.bchan = frm[2];
break;
case IEEE80211_ELEMID_TIM:
/* XXX ATIM? */
@@ -2194,7 +2194,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
return;
}
#endif
- if (scan.chan != scan.bchan &&
+ if (IEEE80211_CHAN2IEEE(scan.curchan) != scan.bchan &&
ic->ic_phytype != IEEE80211_T_FH) {
/*
* Frame was received on a channel different from the
@@ -2210,7 +2210,8 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
IEEE80211_MSG_ELEMID | IEEE80211_MSG_INPUT,
wh, ieee80211_mgt_subtype_name[subtype >>
IEEE80211_FC0_SUBTYPE_SHIFT],
- "for off-channel %u", scan.chan);
+ "for off-channel %u",
+ IEEE80211_CHAN2IEEE(scan.curchan));
ic->ic_stats.is_rx_chanmismatch++;
return;
}
OpenPOWER on IntegriCloud