From owner-svn-src-all@FreeBSD.ORG Wed Jan 28 19:18:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D018B1065673; Wed, 28 Jan 2009 19:18:58 +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 B3C838FC08; Wed, 28 Jan 2009 19:18:58 +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 n0SJIwmx030019; Wed, 28 Jan 2009 19:18:58 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0SJIwRc030018; Wed, 28 Jan 2009 19:18:58 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901281918.n0SJIwRc030018@svn.freebsd.org> From: Sam Leffler Date: Wed, 28 Jan 2009 19:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187842 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2009 19:18:59 -0000 Author: sam Date: Wed Jan 28 19:18:58 2009 New Revision: 187842 URL: http://svn.freebsd.org/changeset/base/187842 Log: improve debug msgs for regdomain operations; print channel flags symbolically so it's easier to identify channels and why they are added (or not) Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Wed Jan 28 19:15:52 2009 (r187841) +++ head/sbin/ifconfig/ifieee80211.c Wed Jan 28 19:18:58 2009 (r187842) @@ -1823,9 +1823,13 @@ regdomain_addchans(struct ieee80211req_c (chanFlags & (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_5GHZ))); LIST_FOREACH(nb, bands, next) { b = nb->band; - if (verbose) - printf("%s: chanFlags 0x%x b %p\n", - __func__, chanFlags, b); + if (verbose) { + printf("%s:", __func__); + printb(" chanFlags", chanFlags, IEEE80211_CHAN_BITS); + printb(" bandFlags", nb->flags | b->flags, + IEEE80211_CHAN_BITS); + putchar('\n'); + } prev = NULL; for (freq = b->freqStart; freq <= b->freqEnd; freq += b->chanSep) { uint32_t flags = nb->flags | b->flags; @@ -1839,8 +1843,12 @@ regdomain_addchans(struct ieee80211req_c */ 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); + if (verbose) { + printf("%u: skip, ", freq); + printb("flags", chanFlags, + IEEE80211_CHAN_BITS); + printf(" not available\n"); + } continue; } if ((flags & IEEE80211_CHAN_HALF) && !hasHalfChans) { @@ -1861,13 +1869,15 @@ regdomain_addchans(struct ieee80211req_c 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) { @@ -1890,7 +1900,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++]; @@ -1902,10 +1913,12 @@ regdomain_addchans(struct ieee80211req_c c->ic_maxregpower = nb->maxPowerDFS; else c->ic_maxregpower = nb->maxPower; - if (verbose) - printf("[%3d] add freq %u flags 0x%x power %u\n", - ci->ic_nchans-1, c->ic_freq, c->ic_flags, - c->ic_maxregpower); + if (verbose) { + printf("[%3d] add freq %u ", + ci->ic_nchans-1, c->ic_freq); + printb("flags", c->ic_flags, IEEE80211_CHAN_BITS); + printf(" power %u\n", c->ic_maxregpower); + } /* NB: kernel fills in other fields */ prev = c; }