From owner-p4-projects@FreeBSD.ORG Thu Aug 9 14:59:49 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 820FB16A46C; Thu, 9 Aug 2007 14:59:49 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 404C116A469 for ; Thu, 9 Aug 2007 14:59:49 +0000 (UTC) (envelope-from avatar@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 301F513C46C for ; Thu, 9 Aug 2007 14:59:49 +0000 (UTC) (envelope-from avatar@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l79Exiqn056823 for ; Thu, 9 Aug 2007 14:59:49 GMT (envelope-from avatar@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l79Exhuq056820 for perforce@freebsd.org; Thu, 9 Aug 2007 14:59:43 GMT (envelope-from avatar@freebsd.org) Date: Thu, 9 Aug 2007 14:59:43 GMT Message-Id: <200708091459.l79Exhuq056820@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to avatar@freebsd.org using -f From: Tai-hwa Liang To: Perforce Change Reviews Cc: Subject: PERFORCE change 124956 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Aug 2007 14:59:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=124956 Change 124956 by avatar@avatar_t40 on 2007/08/09 14:59:34 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 MFP4 after: 2 weeks Affected files ... .. //depot/projects/wifi/sys/dev/an/if_an.c#16 edit Differences ... ==== //depot/projects/wifi/sys/dev/an/if_an.c#16 (text+ko) ==== @@ -1862,6 +1862,7 @@ 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 @@ } 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,