Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Mar 2008 01:35:49 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 136877 for review
Message-ID:  <200803050135.m251Zn2O081403@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=136877

Change 136877 by sam@sam_ebb on 2008/03/05 01:35:33

	v0.9.20.3 doesn't return maxTxPower settings for 5111 parts;
	fake it using the max regulatory power, the hal will cap any
	tx power above what the h/w can do

Affected files ...

.. //depot/projects/vap/sys/dev/ath/if_ath.c#40 edit

Differences ...

==== //depot/projects/vap/sys/dev/ath/if_ath.c#40 (text+ko) ====

@@ -5746,7 +5746,7 @@
 	int i, nhalchans, error;
 
 	halchans = malloc(IEEE80211_CHAN_MAX * sizeof(HAL_CHANNEL),
-			M_TEMP, M_NOWAIT);
+			M_TEMP, M_NOWAIT | M_ZERO);
 	if (halchans == NULL) {
 		device_printf(sc->sc_dev,
 		    "%s: unable to allocate channel table\n", __func__);
@@ -5771,8 +5771,10 @@
 		ichan->ic_ieee = ath_hal_mhz2ieee(ah, c->channel,
 					c->channelFlags);
 		if (bootverbose)
-			device_printf(sc->sc_dev, "hal channel %u/%x -> %u\n",
-			    c->channel, c->channelFlags, ichan->ic_ieee);
+			device_printf(sc->sc_dev, "hal channel %u/%x -> %u "
+			    "maxpow %d minpow %d maxreg %d\n",
+			    c->channel, c->channelFlags, ichan->ic_ieee,
+			    c->maxTxPower, c->minTxPower, c->maxRegTxPower);
 		ichan->ic_freq = c->channel;
 
 		if ((c->channelFlags & CHANNEL_PUREG) == CHANNEL_PUREG) {
@@ -5794,7 +5796,9 @@
 						    ichan->ic_flags);
 		}
 		ichan->ic_maxregpower = c->maxRegTxPower;	/* dBm */
-		ichan->ic_maxpower = c->maxTxPower;		/* 1/2 dBm */
+		/* XXX: old hal's don't provide maxTxPower for some parts */
+		ichan->ic_maxpower = (c->maxTxPower != 0) ?
+		    c->maxTxPower : 2*c->maxRegTxPower;		/* 1/2 dBm */
 		ichan->ic_minpower = c->minTxPower;		/* 1/2 dBm */
 	}
 	*nchans = nhalchans;



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