Setting txpower above the power of your card

Michael Smith msmith
Wed Oct 23 12:48:49 PDT 2002


On Sun, 20 Oct 2002, Scott Stapleton wrote:

> I then thought I'd try setting it to 150mW to see what happened. I never
> expected it to increase, but it did somewhat.

I was curious (I've been setting my txpower to 200 for months now, on
cards that only do 23 dBm :) so I did a quick grep and it looks like the
driver scales the value supplied by the user, in the range -43 to 20, to
the minimum and maximum values supported by the hardware.

ChangeLog:
2002-01-03
          current mapping: minimum power with 'iwconfig wlan0 txpower -43'
          and maximum with 'iwconfig wlan0 txpower 20'

hostap_ioctl.c:
static u16 prism2_txpower_dBm_to_hfa386x(int val)
{
        signed char tmp;

        if (val > 20)
                return 128;
        else if (val < -43)
                return 127;

        tmp = val;
        tmp = -12 - tmp;
        tmp <<= 2;

        return (unsigned char) tmp;
}





More information about the Hostap mailing list