From owner-p4-projects@FreeBSD.ORG Tue Nov 23 23:25:10 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7F68A16A4D0; Tue, 23 Nov 2004 23:25:10 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A68F16A4CE for ; Tue, 23 Nov 2004 23:25:10 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48E8043D2F for ; Tue, 23 Nov 2004 23:25:10 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iANNPA5w079892 for ; Tue, 23 Nov 2004 23:25:10 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iANNP9op079889 for perforce@freebsd.org; Tue, 23 Nov 2004 23:25:09 GMT (envelope-from sam@freebsd.org) Date: Tue, 23 Nov 2004 23:25:09 GMT Message-Id: <200411232325.iANNP9op079889@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 65754 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2004 23:25:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=65754 Change 65754 by sam@sam_ebb on 2004/11/23 23:24:09 o return all channels, not just active ones, for get chan info o add in get chan list to retrieve active channel list Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#19 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#19 (text+ko) ==== @@ -866,6 +866,15 @@ } static int +ieee80211_ioctl_getchanlist(struct ieee80211com *ic, struct ieee80211req *ireq) +{ + + if (sizeof(ic->ic_chan_active) > ireq->i_len) + ireq->i_len = sizeof(ic->ic_chan_active); + return copyout(&ic->ic_chan_active, ireq->i_data, ireq->i_len); +} + +static int ieee80211_ioctl_getchaninfo(struct ieee80211com *ic, struct ieee80211req *ireq) { struct ieee80211req_chaninfo chans; /* XXX off stack? */ @@ -881,7 +890,7 @@ i = 0; memset(&chans, 0, sizeof(chans)); for (; i <= IEEE80211_CHAN_MAX; i++) - if (isset(ic->ic_chan_active, i)) { + if (isset(ic->ic_chan_avail, i)) { struct ieee80211_channel *c = &ic->ic_channels[i]; chans.ic_chans[chans.ic_nchans].ic_freq = c->ic_freq; chans.ic_chans[chans.ic_nchans].ic_flags = c->ic_flags; @@ -1307,6 +1316,9 @@ break; } break; + case IEEE80211_IOC_CHANLIST: + error = ieee80211_ioctl_getchanlist(ic, ireq); + break; case IEEE80211_IOC_ROAMING: ireq->i_val = ic->ic_roaming; break; @@ -1638,7 +1650,7 @@ ieee80211_ioctl_setchanlist(struct ieee80211com *ic, struct ieee80211req *ireq) { struct ieee80211req_chanlist list; - u_char chanlist[roundup(IEEE80211_CHAN_MAX, NBBY)]; + u_char chanlist[IEEE80211_CHAN_BYTES]; int i, j, error; if (ireq->i_len != sizeof(list))