built-in WIRELESS device is restricted to channels 1-11 #2

Open
opened 2026-01-30 21:30:53 +00:00 by claunia · 4 comments
Owner

Originally created by @rofl0r on GitHub (Jan 28, 2016).

it took quite a while for me to figure out why suddenly my efika's built-in WIFI couldnt see my AP anymore (whose auto-channel-switch-algorithm decided that 13 would be a good choice).
this seems to be due to a restriction to US regulations (in EUROPE its OK to use channel 12 and 13).
how can i fix that ?

Originally created by @rofl0r on GitHub (Jan 28, 2016). it took quite a while for me to figure out why suddenly my efika's built-in WIFI couldnt see my AP anymore (whose auto-channel-switch-algorithm decided that 13 would be a good choice). this seems to be due to a restriction to US regulations (in EUROPE its OK to use channel 12 and 13). how can i fix that ?
Author
Owner

@rofl0r commented on GitHub (Jan 30, 2016):

# drivers/staging/rt2860/common/cmm_sync.c
# @ void BuildChannelList(struct rt_rtmp_adapter *pAd)
# - switch (pAd->CommonCfg.CountryRegion & 0x7f) {
# + switch (31 /* now we're in japan */) {
@rofl0r commented on GitHub (Jan 30, 2016): ``` # drivers/staging/rt2860/common/cmm_sync.c # @ void BuildChannelList(struct rt_rtmp_adapter *pAd) # - switch (pAd->CommonCfg.CountryRegion & 0x7f) { # + switch (31 /* now we're in japan */) { ```
Author
Owner

@rofl0r commented on GitHub (Jan 30, 2016):

it's not possible to workaround the problem in another way since wext has no method to change regulatory domain, and the driver is wext-only, so iw reg set doesnt have any effect on it.

@rofl0r commented on GitHub (Jan 30, 2016): it's not possible to workaround the problem in another way since wext has no method to change regulatory domain, and the driver is wext-only, so `iw reg set` doesnt have any effect on it.
Author
Owner

@serendependy commented on GitHub (Jan 30, 2016):

I'm not associated with the project any more so I can't be of help, but I wanted to congratulate you for working this out. I spent months on it with no success...

@serendependy commented on GitHub (Jan 30, 2016): I'm not associated with the project any more so I can't be of help, but I wanted to congratulate you for working this out. I spent months on it with no success...
Author
Owner

@rofl0r commented on GitHub (Feb 2, 2016):

@steev on IRC now pointed out that there may be another way, apparently the driver tries to read a configuration file : RT2870STA.dat

# Copy this file to /etc/Wireless/RT2870STA/RT2870STA.dat
# This file is a binary file and will be read on loading rt.o module.
#
# Use "vi RT2870STA.dat" to modify settings according to your need.
# 
# 1.) set NetworkType to "Adhoc" for using Adhoc-mode, otherwise using Infrastructure
# 2.) set Channel to "0" for auto-select on Infrastructure mode
# 3.) set SSID for connecting to your Accss-point.
# 4.) AuthMode can be "WEPAUTO", "OPEN", "SHARED", "WPAPSK", "WPA2PSK", "WPANONE"
# 5.) EncrypType can be "NONE", "WEP", "TKIP", "AES"
# for more information refer to the Readme file.
# 
#The word of "Default" must not be removed
Default
CountryRegion=5
CountryRegionABand=7
CountryCode=
SSID=Dennis2860AP
NetworkType=Infra
WirelessMode=9
Channel=0
BeaconPeriod=100
TxPower=100
BGProtection=0
TxPreamble=0
RTSThreshold=2347
FragThreshold=2346
TxBurst=1
WmmCapable=0
AckPolicy=0;0;0;0
AuthMode=OPEN
EncrypType=NONE
WPAPSK=
DefaultKeyID=1
Key1Type=0
Key1Str=
Key2Type=0
Key2Str=
Key3Type=0
Key3Str=
Key4Type=0
Key4Str=
PSMode=CAM
FastRoaming=0
RoamThreshold=70
HT_RDG=1
HT_EXTCHA=0
HT_OpMode=1
HT_MpduDensity=4
HT_BW=1
HT_AutoBA=1
HT_BADecline=0
HT_AMSDU=0
HT_BAWinSize=64
HT_GI=1
HT_MCS=33
HT_MIMOPSMode=3
IEEE80211H=0
TGnWifiTest=0
WirelessEvent=0
CarrierDetect=0

i didn't try it since my solution is now autoloaded on start

(
cd /tmp
/root/kmem_sym_dump BuildChannelList > /dev/null || { echo couldnt dump func ; exit 1 ; }
[ $(md5sum /tmp/dump.bin | cut -d " " -f 1) = 0111dfecb6260682f69f05af6359659c ] || {
        echo checksum mismatch
        exit 1
}
rm -f /tmp/dump.bin
/root/kmem_sym_patch BuildChannelList 1f50a0e3 88

# drivers/staging/rt2860/common/cmm_sync.c
# @ void BuildChannelList(struct rt_rtmp_adapter *pAd)
# - switch (pAd->CommonCfg.CountryRegion & 0x7f) {
# + switch (31 /* now we're in japan */) {
# the patch 1f50a0e3 changes the arm insn at offset 88
# - and r5, r5, 0x7f
# + mov r5, 0x1f
)

using the tools https://github.com/rofl0r/hardcore-utils/blob/master/kmem_sym_patch.c and https://github.com/rofl0r/hardcore-utils/blob/master/kmem_sym_dump.c

@rofl0r commented on GitHub (Feb 2, 2016): @steev on IRC now pointed out that there may be another way, apparently the driver tries to read a configuration file : RT2870STA.dat ``` # Copy this file to /etc/Wireless/RT2870STA/RT2870STA.dat # This file is a binary file and will be read on loading rt.o module. # # Use "vi RT2870STA.dat" to modify settings according to your need. # # 1.) set NetworkType to "Adhoc" for using Adhoc-mode, otherwise using Infrastructure # 2.) set Channel to "0" for auto-select on Infrastructure mode # 3.) set SSID for connecting to your Accss-point. # 4.) AuthMode can be "WEPAUTO", "OPEN", "SHARED", "WPAPSK", "WPA2PSK", "WPANONE" # 5.) EncrypType can be "NONE", "WEP", "TKIP", "AES" # for more information refer to the Readme file. # #The word of "Default" must not be removed Default CountryRegion=5 CountryRegionABand=7 CountryCode= SSID=Dennis2860AP NetworkType=Infra WirelessMode=9 Channel=0 BeaconPeriod=100 TxPower=100 BGProtection=0 TxPreamble=0 RTSThreshold=2347 FragThreshold=2346 TxBurst=1 WmmCapable=0 AckPolicy=0;0;0;0 AuthMode=OPEN EncrypType=NONE WPAPSK= DefaultKeyID=1 Key1Type=0 Key1Str= Key2Type=0 Key2Str= Key3Type=0 Key3Str= Key4Type=0 Key4Str= PSMode=CAM FastRoaming=0 RoamThreshold=70 HT_RDG=1 HT_EXTCHA=0 HT_OpMode=1 HT_MpduDensity=4 HT_BW=1 HT_AutoBA=1 HT_BADecline=0 HT_AMSDU=0 HT_BAWinSize=64 HT_GI=1 HT_MCS=33 HT_MIMOPSMode=3 IEEE80211H=0 TGnWifiTest=0 WirelessEvent=0 CarrierDetect=0 ``` i didn't try it since my solution is now autoloaded on start ``` ( cd /tmp /root/kmem_sym_dump BuildChannelList > /dev/null || { echo couldnt dump func ; exit 1 ; } [ $(md5sum /tmp/dump.bin | cut -d " " -f 1) = 0111dfecb6260682f69f05af6359659c ] || { echo checksum mismatch exit 1 } rm -f /tmp/dump.bin /root/kmem_sym_patch BuildChannelList 1f50a0e3 88 # drivers/staging/rt2860/common/cmm_sync.c # @ void BuildChannelList(struct rt_rtmp_adapter *pAd) # - switch (pAd->CommonCfg.CountryRegion & 0x7f) { # + switch (31 /* now we're in japan */) { # the patch 1f50a0e3 changes the arm insn at offset 88 # - and r5, r5, 0x7f # + mov r5, 0x1f ) ``` using the tools https://github.com/rofl0r/hardcore-utils/blob/master/kmem_sym_patch.c and https://github.com/rofl0r/hardcore-utils/blob/master/kmem_sym_dump.c
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/linux-legacy#2