From owner-svn-src-user@FreeBSD.ORG Wed Jan 21 00:54:48 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9BC6106566B; Wed, 21 Jan 2009 00:54:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9A588FC0C; Wed, 21 Jan 2009 00:54:48 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0L0sm7j061881; Wed, 21 Jan 2009 00:54:48 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0L0smg9061880; Wed, 21 Jan 2009 00:54:48 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901210054.n0L0smg9061880@svn.freebsd.org> From: Sam Leffler Date: Wed, 21 Jan 2009 00:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187507 - user/sam/wifi/sbin/ifconfig X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 00:54:49 -0000 Author: sam Date: Wed Jan 21 00:54:48 2009 New Revision: 187507 URL: http://svn.freebsd.org/changeset/base/187507 Log: Fixup gsm handling after 1/2 and 1/4 width channel fix and to mesh with hal changes: o the frequency mapping now happens entirely in the driver so we will never find 900MHz frequencies in the master channel list passed back by the kernel; hack it for gsm channels (just add the channel and the kernel will reject if the mapped value is invalid) o don't ignore 1/2 and 1/4 width channel attribute mismatch; we now get called explicitly to construct them Still getting dup'd channel entries; fix separately. Modified: user/sam/wifi/sbin/ifconfig/ifieee80211.c Modified: user/sam/wifi/sbin/ifconfig/ifieee80211.c ============================================================================== --- user/sam/wifi/sbin/ifconfig/ifieee80211.c Wed Jan 21 00:26:45 2009 (r187506) +++ user/sam/wifi/sbin/ifconfig/ifieee80211.c Wed Jan 21 00:54:48 2009 (r187507) @@ -1781,47 +1781,54 @@ regdomain_addchans(struct ieee80211req_c LIST_FOREACH(nb, bands, next) { b = nb->band; if (verbose) - printf("%s: chanFlags 0x%x b %p\n", - __func__, chanFlags, b); + printf("%s: chanFlags 0x%x bandFlags 0x%x\n", + __func__, chanFlags, nb->flags | b->flags); prev = NULL; for (freq = b->freqStart; freq <= b->freqEnd; freq += b->chanSep) { uint32_t flags = nb->flags | b->flags; /* check if device can operate on this frequency */ - if (chanlookup(avail->ic_chans, avail->ic_nchans, freq, chanFlags) == NULL) { + /* + * XXX GSM frequency mapping is handled in the kernel + * so we cannot find them in the calibration table; + * just construct the list and the kernel will reject + * if it's wrong. + */ + if (chanlookup(avail->ic_chans, avail->ic_nchans, freq, chanFlags) == NULL && + (flags & IEEE80211_CHAN_GSM) == 0) { if (verbose) - printf("%u: skip, flags 0x%x not available\n", freq, chanFlags); + printf("%u: skip, flags 0x%x not " + "available\n", freq, chanFlags); continue; } - /* - * NB: don't enforce 1/2 and 1/4 rate channels being - * specified in the device's calibration list for - * 900MHz cards because most are not self-identifying. - */ if ((flags & IEEE80211_CHAN_HALF) && - ((chanFlags & IEEE80211_CHAN_HALF) == 0 && - (flags & IEEE80211_CHAN_GSM) == 0)) { + (chanFlags & IEEE80211_CHAN_HALF) == 0) { if (verbose) - printf("%u: skip, device does not support half-rate channels\n", freq); + printf("%u: skip, device does not " + "support half-rate channel\n", + freq); continue; } if ((flags & IEEE80211_CHAN_QUARTER) && - ((chanFlags & IEEE80211_CHAN_QUARTER) == 0 && - (flags & IEEE80211_CHAN_GSM) == 0)) { + (chanFlags & IEEE80211_CHAN_QUARTER) == 0) { if (verbose) - printf("%u: skip, device does not support quarter-rate channels\n", freq); + printf("%u: skip, device does not " + "support quarter-rate channel\n", + freq); continue; } if ((flags & IEEE80211_CHAN_HT20) && (chanFlags & IEEE80211_CHAN_HT20) == 0) { if (verbose) - printf("%u: skip, device does not support HT20 operation\n", freq); + printf("%u: skip, device does not " + "support HT20 operation\n", freq); continue; } if ((flags & IEEE80211_CHAN_HT40) && (chanFlags & IEEE80211_CHAN_HT40) == 0) { if (verbose) - printf("%u: skip, device does not support HT40 operation\n", freq); + printf("%u: skip, device does not " + "support HT40 operation\n", freq); continue; } if ((flags & REQ_ECM) && !reg->ecm) { @@ -1844,7 +1851,8 @@ regdomain_addchans(struct ieee80211req_c } if (ci->ic_nchans == IEEE80211_CHAN_MAX) { if (verbose) - printf("%u: skip, channel table full\n", freq); + printf("%u: skip, channel table full\n", + freq); break; } c = &ci->ic_chans[ci->ic_nchans++];