summaryrefslogtreecommitdiffstats
path: root/sys/dev/wi
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/dev/wi
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/dev/wi')
-rw-r--r--sys/dev/wi/if_wi.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 16f2d9f..86f8b96 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -3098,7 +3098,7 @@ wi_scan_result(struct wi_softc *sc, int fid, int cnt)
memcpy(wh.i_addr2, ws_dat.wi_bssid, sizeof(ap->bssid));
memcpy(wh.i_addr3, ws_dat.wi_bssid, sizeof(ap->bssid));
- sp.chan = ap->channel = le16toh(ws_dat.wi_chid);
+ ap->channel = le16toh(ws_dat.wi_chid);
ap->signal = le16toh(ws_dat.wi_signal);
ap->noise = le16toh(ws_dat.wi_noise);
ap->quality = ap->signal - ap->noise;
@@ -3114,6 +3114,12 @@ wi_scan_result(struct wi_softc *sc, int fid, int cnt)
sp.ssid = (uint8_t *)&ssid[0];
memcpy(sp.ssid + 2, ap->name, ap->namelen);
sp.ssid[1] = ap->namelen;
+ sp.bchan = ap->channel;
+ sp.curchan = ieee80211_find_channel(ic,
+ ieee80211_ieee2mhz(ap->channel, IEEE80211_CHAN_B),
+ IEEE80211_CHAN_B);
+ if (sp.curchan == NULL)
+ sp.curchan = &ic->ic_channels[0];
sp.rates = &rates[0];
sp.tstamp = (uint8_t *)&rstamp;
printf("calling add_scan \n");
OpenPOWER on IntegriCloud