Jump to content

Add channel 12,13


chputney
 Share

Recommended Posts

OK, the last info was wrong. Here is some better stuff.

For radio1, you can temporarily allow channels 12 and 13 by the command “iw reg set NZ”.

A permanent solution is to edit the file /etc/config/wireless (using WinSCP) and add the following line.

config wifi-device 'radio1'

. . .

. . .

option country 'NZ' ß------- add this

This change now will show activity on the Site Survey infusion.

I don't have radio0 working on channel 13 yet.

Link to comment
Share on other sites

In my search to get wlan0 to be able to use Channel 12 and 13, I found that wlan0 uses the country stored in the EEPROM and this is not over-ridden by the /etc/config/wireless file.

The cfg80211 code first uses the “world” reg rule and then uses the country in the /etc/config/wireless, but whatever the country, it cannot be have more tx power or channels than the “world” reg rule or the US rule. I decided to change the “world” and US definitions in cfg80211.ko to be less restrictive so that the country definition in /etc/config/wireless would be obeyed.

Looking at cfg80211.c, we see that the “world” reg rule and the others are defined like:

45 static const struct ieee80211_regdomain mwifiex_world_regdom_custom = { 46 .n_reg_rules = 7, 47 .alpha2 = "99", 48 .reg_rules = { 49 /* Channel 1 - 11 */ 50 REG_RULE(2412-10, 2462+10, 40, 3, 20, 0), 51

The channels extend from 2402 MHz to 2472 MHz and the Tx power is 20dBm, so we will just patch the end frequency from 2472 MHz to 2482 MHz and and patch the Tx power to 30dBm. The value is stored in kHz so 2472 Mhz is 2472000 or in hex 0x0025b840. We need to change two world definitions and the US definition to 2482 MHz or 0x25df50. The Tx power is stored as dBm*100 or 2000 or 0x000007d0 and we need to change this to 3000 or 0x00000bb8.

Use WinSCP to get the file “/lib/modules/3.3.8/cfg80211.ko” into a hex editor.

Change these addresses:

0x23344: was: 0x0025b840, is: 0x0025dff0 // 2472000 to 2482000

0x23350: was: 0x000007d0, is: 0x00000bb8 // 2000 to 3000

0x23df4: was: 0x0025b840, is: 0x0025dff0 // 2472000 to 2482000

0x23e00: was: 0x000007d0, is: 0x00000bb8 // 2000 to 3000

0x26ac4: was: 0x0025b840, is: 0x0025dff0 // 2472000 to 2482000

0x26ad0: was: 0x00000a8c, is: 0x00000bb8 // 2700 to 3000

After making these patches, use WinSCP to put the cfg80211.ko back in /lib/modules/3.3.8/cfg80211.ko.

Add your country to the /etc/config/wireless file as:

uci set wireless.@wifi-device[0].country=NZ; uci commit wireless

uci set wireless.@wifi-device[1].country=NZ; uci commit wireless

Reboot, and check that your channels are present with:

iwlist wlan0 channel

iwlist wlan1 channel

I have attached the modified cfg80211.ko as a zip.

I think in the future the way to resolve this issue is to build Openwrt with: CONFIG_ATH_USER_REGD=y

I think that this will default to the US allowed settings, but will allow a county code to be used. I got this from

http://sadevil.org/blog/2013/04/29/openwrt-atheros-channel-availability/

Here are some other references:

http://wireless.kernel.org/en/developers/Regulatory#CRDA

http://wireless.kernel.org/en/developers/Documentation/cfg80211#Regulatorysupport

http://wireless.kernel.org/en/developers/Regulatory/processing_rules

http://wireless.kernel.org/en/users/Drivers/ath

http://lxr.free-electrons.com/source/drivers/net/wireless/mwifiex/cfg80211.c

http://lxr.free-electrons.com/source/drivers/net/wireless/mwifiex/cfg80211.h

http://lxr.free-electrons.com/source/include/net/regulatory.h

http://lxr.free-electrons.com/source/net/wireless/reg.c

cfg80211.zip

Link to comment
Share on other sites

There isn't any real need to edit any of the default configuration prior to reboot.

the easiest way to manage this on the fly is to use the 'iw reg set' command for one of the dip switch configuration fields in the web gui.

e.g.

for people located in Belize!

iw reg set BZ

This if usefull if you know you are going to be pen testing in different regions and are required to ensure you comply with the local

regulatory domain requirements.

p.s

Belize allows tx power to be set @ 1 Watt (i.e. 30 dBm) and use of channels 1-13 :rolleyes:

w_to_dBm.png

Link to comment
Share on other sites

Also, if you just want to see if the command works ok open the advanced tab in the web gui in execute 'iwconfig; iw reg set BZ; iwconfg' to see the the before and after effects to your tx power.

There isn't any real need to edit any of the default configuration prior to reboot.

the easiest way to manage this on the fly is to use the 'iw reg set' command for one of the dip switch configuration fields in the web gui.

e.g.

for people located in Belize!

iw reg set BZ

This if usefull if you know you are going to be pen testing in different regions and are required to ensure you comply with the local

regulatory domain requirements.

p.s

Belize allows tx power to be set @ 1 Watt (i.e. 30 dBm) and use of channels 1-13 :rolleyes:

w_to_dBm.png

Thank You mate ill give it a shot And let You know my results and I appreciate all the hard work you put in to research it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...