Removing TX-Power Limits On ArchLinux

DISLAIMER: IT IS ILLEGAL TO CHANGE YOUR DBM SETTING TO HIGHER THAN WHAT YOUR COUNTRY ALLOWS THIS IS FOR EDUCATIONAL PURPOSES ONLY

I was recently trying to change the dBm of my wireless card to a level higher than 20, I was unable to do this at all and tried all known methods. I had installed crda and utilized a custom regulatory database, however I still has having issues. So whats the next best thing? Hacking the driver itself to not throw errors and just do my bidding.

Download the compat-wireless-patched drivers from AUR http://aur.archlinux.org/packages.php?ID=41472

Extract the package

tar xvf compat-wireless-patched.tar.gz

and then cd into the directory

cd compat-wireless-patched

Make the package

makepkg

or as root

makepkg --asroot

Once the package finishes cd into src/compat-wireless-3.5-rc5-1

cd src/compat-wireless-3.5-rc5-1/

We are going to modify two files, net/mac80211/cfg.c and net/80211/main.c ( If your familiar with ArchLinux and PKGBUILDS you do not need to run makepkg first, and can just download src manually, but you already knew that didn't you? )

Open up net/mac80211/cfg.c in your favorite editior

vi net/mac80211/cfg.c

Look for the following code:

if (MBM_TO_DBM(mbm) > chan->max_power)

return -EINVAL;

Comment out the -EINVAL it should look like below:

if (MBM_TO_DBM(mbm) > chan->max_power)

//return -EINVAL;

Save your changes and close the file.

Now lets open up net/mac80211/main.c

vi net/mac80211/main.c

Look for the following code:

if (local->user_power_level >= 0)

power = min(power, local->user_power_level);

Change it to:

if (local->user_power_level >= 0)

//power = min(power, local->user_power_level);

power = local->user_power_level;

Save your changes and close the file

cd into the parent directory where PKGBUILD is located

cd ../../

Remake package

makepkg -f

or as root

makepkg -f --asroot

Install the package

pacman -U compat-wireless-patched-3.5_rc5_1-3-i686.pkg.tar.gz

Reboot your machine and test it out

iwconfig wlan1 txpower 30