Dear all,

First, let me say a big hello to everyone here. I've been out of this
list for almost three years... Just came back less than a week ago and
Chuck Yerkes is sorely missing...

I don't know if this question will be better answered here or on [EMAIL 
PROTECTED]

After reading an email about power management on ral devices, took
a look in the following piece of code, from if_wi.c.

It seems to suggest that power output, using wi devices, is limited.
Anything greater than 20dBm will be treated as 20dBm.

I'm waiting the arrival of some senao cards, capable of 200mW (23dBm)
output. Is the wi driver capable of handling this amount of power?


STATIC int
wi_set_txpower(struct wi_softc *sc, struct ieee80211_txpower *txpower)
{
       u_int16_t       cmd;
       u_int16_t       power;
       int8_t          tmp;
       int             error;
       int             alc;

       if (txpower == NULL) {
               if (!(sc->wi_flags & WI_FLAGS_TXPOWER))
                       return (EINVAL);
               alc = 0;                /* disable ALC */
       } else {
               if (txpower->i_mode == IEEE80211_TXPOWER_MODE_AUTO) {
                       alc = 1;        /* enable ALC */
                       sc->wi_flags &= ~WI_FLAGS_TXPOWER;
               } else {
                       alc = 0;        /* disable ALC */
                       sc->wi_flags |= WI_FLAGS_TXPOWER;
                       sc->wi_txpower = txpower->i_val;
               }
       }

       /* Set ALC */
       cmd = WI_CMD_DEBUG | (WI_DEBUG_CONFBITS << 8);
       if ((error = wi_cmd(sc, cmd, alc, 0x8, 0)) != 0)
               return (error);

       /* No need to set the TX power value if ALC is enabled */
       if (alc)
               return (0);

       /* Convert dBM to internal TX power value */
       if (sc->wi_txpower > 20)
               power = 128;
       else if (sc->wi_txpower < -43)
               power = 127;
       else {
               tmp = sc->wi_txpower;
               tmp = -12 - tmp;
               tmp <<= 2;

               power = (u_int16_t)tmp;
       }

       /* Set manual TX power */
       cmd = WI_CMD_WRITE_MIF;
       if ((error = wi_cmd(sc, cmd,
                WI_HFA384X_CR_MANUAL_TX_POWER, power, 0)) != 0)
               return (error);

       if (sc->sc_ic.ic_if.if_flags & IFF_DEBUG)
               printf("%s: %u (%d dBm)\n", sc->sc_dev.dv_xname, power,
                   sc->wi_txpower);

       return (0);
}

Reply via email to