diff options
author | avatar <avatar@FreeBSD.org> | 2007-09-10 12:53:34 +0000 |
---|---|---|
committer | avatar <avatar@FreeBSD.org> | 2007-09-10 12:53:34 +0000 |
commit | 28b3aed3c3a6cc31fb990c4bc8edadf186ad2c37 (patch) | |
tree | c930f92f0fd5f66a52ff813052b66d0e9a7984fb | |
parent | 495285abf0a922aa3f28157a917bd105f1b70cc3 (diff) | |
download | FreeBSD-src-28b3aed3c3a6cc31fb990c4bc8edadf186ad2c37.zip FreeBSD-src-28b3aed3c3a6cc31fb990c4bc8edadf186ad2c37.tar.gz |
Fixing invalid channel display in ifconfig(8) by implementing required
ioctl().
Note that other information provided by ifconfig(8) such like "list chan"
or "list ap" are still not available at this moment.
Before an(4) is connected to wlan(4), users are encouraged to use
ancontrol(8) to retrieve aforementioned information.
Reported by: dhw (http://lists.freebsd.org/pipermail/freebsd-current/2007-July/074848.html)
Reviewed by: ambrisko
Tested by: dhw
Approved by: re (bmah)
-rw-r--r-- | sys/dev/an/if_an.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index 372fcb4..7cbdcaf 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -1862,6 +1862,7 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data) struct ifreq *ifr; struct thread *td = curthread; struct ieee80211req *ireq; + struct ieee80211_channel ch; u_int8_t tmpstr[IEEE80211_NWID_LEN*2]; u_int8_t *tmpptr; struct an_ltv_genconfig *config; @@ -2217,6 +2218,22 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t data) } ireq->i_val = status->an_cur_channel; break; + case IEEE80211_IOC_CURCHAN: + sc->areq.an_type = AN_RID_STATUS; + if (an_read_record(sc, + (struct an_ltv_gen *)&sc->areq)) { + error = EINVAL; + break; + } + bzero(&ch, sizeof(ch)); + ch.ic_freq = ieee80211_ieee2mhz(status->an_cur_channel, + IEEE80211_CHAN_B); + ch.ic_flags = IEEE80211_CHAN_B; + ch.ic_ieee = status->an_cur_channel; + AN_UNLOCK(sc); + error = copyout(&ch, ireq->i_data, sizeof(ch)); + AN_LOCK(sc); + break; case IEEE80211_IOC_POWERSAVE: sc->areq.an_type = AN_RID_ACTUALCFG; if (an_read_record(sc, |