PERFORCE change 136877 for review

Sam Leffler sam at FreeBSD.org
Wed Mar 5 01:35:50 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=136877

Change 136877 by sam at 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;


More information about the p4-projects mailing list