Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Oct 2008 23:28:24 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184272 - head/sys/net80211
Message-ID:  <200810252328.m9PNSOPI060249@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Sat Oct 25 23:28:24 2008
New Revision: 184272
URL: http://svn.freebsd.org/changeset/base/184272

Log:
  add debug msgs

Modified:
  head/sys/net80211/ieee80211_regdomain.c

Modified: head/sys/net80211/ieee80211_regdomain.c
==============================================================================
--- head/sys/net80211/ieee80211_regdomain.c	Sat Oct 25 23:28:04 2008	(r184271)
+++ head/sys/net80211/ieee80211_regdomain.c	Sat Oct 25 23:28:24 2008	(r184272)
@@ -327,12 +327,23 @@ ieee80211_setregdomain(struct ieee80211v
 	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 @@ ieee80211_setregdomain(struct ieee80211v
 	 */
 	for (i = 0; i < reg->chaninfo.ic_nchans; i++) {
 		c = &reg->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 @@ ieee80211_setregdomain(struct ieee80211v
 	    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;
 	}
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810252328.m9PNSOPI060249>