From owner-p4-projects@FreeBSD.ORG Tue Oct 21 18:57:39 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 997AB1065676; Tue, 21 Oct 2008 18:57:39 +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 5D6561065673 for ; Tue, 21 Oct 2008 18:57:39 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4BDE18FC12 for ; Tue, 21 Oct 2008 18:57:39 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m9LIvd9g049538 for ; Tue, 21 Oct 2008 18:57:39 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m9LIvdmP049536 for perforce@freebsd.org; Tue, 21 Oct 2008 18:57:39 GMT (envelope-from sam@freebsd.org) Date: Tue, 21 Oct 2008 18:57:39 GMT Message-Id: <200810211857.m9LIvdmP049536@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 Cc: Subject: PERFORCE change 151675 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: Tue, 21 Oct 2008 18:57:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=151675 Change 151675 by sam@sam_ebb on 2008/10/21 18:57:18 add debug support for setregdomain work under the "ioctl" knob Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_regdomain.c#14 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_regdomain.c#14 (text+ko) ==== @@ -327,12 +327,23 @@ int error, i; if (reg->rd.location != 'I' && reg->rd.location != 'O' && - reg->rd.location != ' ') + reg->rd.location != ' ') { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: invalid location 0x%x\n", __func__, reg->rd.location); return EINVAL; - if (reg->rd.isocc[0] == '\0' || reg->rd.isocc[1] == '\0') + } + if (reg->rd.isocc[0] == '\0' || reg->rd.isocc[1] == '\0') { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: invalid iso cc 0x%x:0x%x\n", __func__, + reg->rd.isocc[0], reg->rd.isocc[1]); return EINVAL; - if (reg->chaninfo.ic_nchans >= IEEE80211_CHAN_MAX) + } + if (reg->chaninfo.ic_nchans >= IEEE80211_CHAN_MAX) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: too many channels %u, max %u\n", __func__, + reg->chaninfo.ic_nchans, IEEE80211_CHAN_MAX); return EINVAL; + } /* * Calculate freq<->IEEE mapping and default max tx power * for channels not setup. The driver can override these @@ -340,10 +351,18 @@ */ for (i = 0; i < reg->chaninfo.ic_nchans; i++) { c = ®->chaninfo.ic_chans[i]; - if (c->ic_freq == 0 || c->ic_flags == 0) + if (c->ic_freq == 0 || c->ic_flags == 0) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: invalid channel spec at [%u]\n", __func__, i); return EINVAL; - if (c->ic_maxregpower == 0) + } + if (c->ic_maxregpower == 0) { + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: invalid channel spec, zero maxregpower, " + "freq %u flags 0x%x\n", __func__, + c->ic_freq, c->ic_flags); return EINVAL; + } if (c->ic_ieee == 0) c->ic_ieee = ieee80211_mhz2ieee(c->ic_freq,c->ic_flags); if (IEEE80211_IS_CHAN_HT40(c) && c->ic_extieee == 0) @@ -358,11 +377,15 @@ reg->chaninfo.ic_nchans, reg->chaninfo.ic_chans); if (error != 0) { IEEE80211_UNLOCK(ic); + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: driver rejected request, error %u\n", __func__, error); return error; } /* XXX bandaid; a running vap will likely crash */ if (!allvapsdown(ic)) { IEEE80211_UNLOCK(ic); + IEEE80211_DPRINTF(vap, IEEE80211_MSG_IOCTL, + "%s: reject: vaps are running\n", __func__); return EBUSY; } /*