Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rofl0r opened this issue Jan 28, 2016 · 4 comments
Open

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

rofl0r opened this issue Jan 28, 2016 · 4 comments

Comments

@rofl0r
Copy link

rofl0r commented 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 ?

@rofl0r
Copy link
Author

rofl0r commented 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
Copy link
Author

rofl0r commented 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.

@serendependy
Copy link

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...

@rofl0r
Copy link
Author

rofl0r commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants