OpenWrt Forum Archive

Topic: Change channel 1 center frequency from 2412 MHz to 2382 MHz

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi All,

I am a newbie and am trying to change the operating frequency of WiFi card. I am using RB433AH and the WiFi card uses ath5k drivers. I want to change the channel 1 center frequency to 2382 MHz instead of 2412 MHz. I searched a little and found that it is possible (http://www.qsl.net/kb9mwr/projects/wireless/modify.html).

I am using attitude_adjustment 12.09. I tried seacrhing for the drivers that are resposible for the frequency and saw the frequency dependency only in hostapd, compat-wireless and iw3.6. The channel frequency is set in each of these drivers using

freq = 2407 + chan * 5;

I changed the value 2407 to 2377 (in iw3.6/util.c, compat-wireless-2014-01-23.1/include/linux/ieee80211.h and compat-wireless-2014-01-23.1/net/wireless/util.c) so that my channel 1 center frequency becomes 2382 MHz. I also set the value  caps->cap_range.range_2ghz_min = 2312 (which was 2412 by default) in compat-wireless-2014-01-23.1/drivers/net/wireless/ath/ath5k/caps.c

Now coming to the problem: The channel frequencies do get changed.
I added a printk(KERN_DEBUG "ieee80211_frequency_to_channel: freq = %d", freq) in the iw3.6/util.c

I set the channel to 1 in the /etc/config/wireless file.
When I enable wireless and restart the network, I get the following

ieee80211_frequency_to_channel: freq = 2382
ieee80211_frequency_to_channel: freq = 2387
ieee80211_frequency_to_channel: freq = 2392
ieee80211_frequency_to_channel: freq = 2397
ieee80211_frequency_to_channel: freq = 2402
ieee80211_frequency_to_channel: freq = 2407
ieee80211_frequency_to_channel: freq = 2412
ieee80211_frequency_to_channel: freq = 2417
ieee80211_frequency_to_channel: freq = 2422
ieee80211_frequency_to_channel: freq = 2427
ieee80211_frequency_to_channel: freq = 2432
ieee80211_frequency_to_channel: freq = 2437
ieee80211_frequency_to_channel: freq = 2442

However, now, if I check the list of frquencies, I get

iwlist frequency

wlan0     7 channels in total; available frequencies :
          Channel 07 : 2.412 GHz
          Channel 08 : 2.417 GHz
          Channel 09 : 2.422 GHz
          Channel 10 : 2.427 GHz
          Channel 11 : 2.432 GHz
          Channel 12 : 2.437 GHz
          Channel 13 : 2.442 GHz

Also, channel 1 by default sets to channel 7 (2412 MHz).

I tried this for a few other frequencies, and what's happening is when I set the channel to 1, the channel is set to the one which has frequency more than 2412 MHz. Channel 2 translates to channel 8, channel 3 to channel 9 and so on.

What am I missing? I tried searching for conditions in the driver to check if it prevents from changing the frequency but did not get any. Wherever the driver checked a condition such as freq >=2412, I replaced it with freq >=2312. Are there more files where I need to make changes?

Again, I am rather new to studying and modifying the drivers; so pardon me if I have made any obvious errors. Any help is sincerely appreciated.

Thanks,
Gaurang

regulatory problem?

what does

iw reg get

reports?

I haven't explored into the regulatory part.

This is the result i get for iw reg get

root@OpenWrt:/# iw reg get
country US:
        (2402 - 2472 @ 40), (3, 27)
        (5170 - 5250 @ 80), (3, 17)
        (5250 - 5330 @ 80), (3, 24), DFS
        (5490 - 5600 @ 80), (3, 24), DFS
        (5650 - 5710 @ 40), (3, 24), DFS
        (5735 - 5835 @ 80), (3, 30)
        (57240 - 63720 @ 2160), (N/A, 40)

Though, I dont know what to interpret.

Issue resolved.

I created a new regulatory domain with parameters : (2302000 KHz - 2402000 KHz @ 0 KHz), (300 mBi, 2000 mBm)

However, that alone is not sufficient. The reg domain was first set to US and then to the one I created. So, it is necessary to change the parameters of US to that as above. Once that is done, issue is resolved.

Thanks!
Gaurang

The discussion might have continued from here.