add debug msgs

This commit is contained in:
Sam Leffler 2008-10-25 23:28:24 +00:00
parent 6ff2e10a56
commit fad0f46d20

View File

@ -327,12 +327,23 @@ ieee80211_setregdomain(struct ieee80211vap *vap,
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 ieee80211vap *vap,
*/
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 ieee80211vap *vap,
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;
}
/*