FORUMS
Remove All Ads from XDA

A really FIX for ATRIX country codes in wifi drivers!!!

3 posts
Thanks Meter: 1
 
By ScorpionXII, Junior Member on 10th September 2012, 09:34 PM
Post Reply Email Thread
Hello XDA-Developers... that's my first post by the way but I think that we can do something very important to the ATRIX users.
I'm from Cuba, I got an Atrix about 2 weeks (I have a Samsung Focus too) but I decided take that Android phone thinking in the Atrix-Lapdock combination. Here I have the really bad issue of wifi problems with my country code operator, I tryed every fix out there in the internet and here like

[Solved] Fix for nonworking WiFi on Simunlocked ATT Atrix 4G http://forum.xda-developers.com/showthread.php?t=1058260
[FIX] Final fix for nonworking WIFI on unlocked ATT Atrix in some countries http://forum.xda-developers.com/showthread.php?t=1077329

but I did'nt have a success

Reading about that issue I think that the problem is just inside the code of ATRIX wifi drivers and I made my own decision of search in the source looking for country codes segment, do a modification and re-compile the drivers.

After a week digging in every files of wifi drivers source code I think that I finally found a solution but I need help. I'm a noob in Adroid world but I think that mybe with help of some developers from XDA we can do that job that we will appreciated for many users around the world.

Well, now the important thing. I donwloaded a atrix-wifi-module from Atrix Dev Team on github, after a few days looking the source I found that in \open-src\src\dhd\sys\dhd_custom_gpio.c file...

"dhd_custom_gpio.c" that C file can be our solution

and here a piece of code, the function with the list of countries

Code:
/* Customized Locale table : OPTIONAL feature */
const struct cntry_locales_custom translate_custom_table[] = {
/* Table should be filled out based on custom platform regulatory requirement */
#ifdef COUNTRY_REGIONS
	{"",   "XY", 4},   /* universal if Counry code is unknow or empty */
	{"US", "US", 69}, /* input ISO "US" to : US regrev 69 */
	{"CA", "US", 69}, /* input ISO "CA" to : US regrev 69 */
	{"EU", "EU", 5}, /* European union countries */
	{"AT", "EU", 5},
	{"BE", "EU", 5},
	{"BG", "EU", 5},
	{"CY", "EU", 5},
	{"CZ", "EU", 5},
	{"DK", "EU", 5},
	{"EE", "EU", 5},
	{"FI", "EU", 5},
	{"FR", "EU", 5},
	{"DE", "EU", 5},
	{"GR", "EU", 5},
	{"HU", "EU", 5},
	{"IE", "EU", 5},
	{"IT", "EU", 5},
	{"LV", "EU", 5},
	{"LI", "EU", 5},
	{"LT", "EU", 5},
	{"LU", "EU", 5},
	{"MT", "EU", 5},
	{"NL", "EU", 5},
	{"PL", "EU", 5},
	{"PT", "EU", 5},
	{"RO", "EU", 5},
	{"SK", "EU", 5},
	{"SI", "EU", 5},
	{"ES", "EU", 5},
	{"SE", "EU", 5},
	{"GB", "EU", 5}, /* input ISO "GB" to : EU regrev 05 */
	{"KR", "XY", 3},
	{"AU", "XY", 3},
	{"CN", "XY", 3}, /* input ISO "CN" to : XY regrev 03 */
	{"TW", "XY", 3},
	{"AR", "XY", 3},
	{"MX", "XY", 3}
#endif /* COUNTRY_REGIONS */
};
At the end of the file are another important function

Code:
/* Customized Locale convertor
*  input : ISO 3166-1 country abbreviation
*  output: customized cspec
*/
void get_customized_country_code(char *country_iso_code, wl_country_t *cspec)
{
	int size, i;

	size = ARRAYSIZE(translate_custom_table);

	if (cspec == 0)
		 return;

	if (size == 0)
		 return;

	for (i = 0; i < size; i++) {
	if (strcmp(country_iso_code, translate_custom_table[i].iso_abbrev) == 0) {
		memcpy(cspec->ccode,  translate_custom_table[i].custom_locale, WLC_CNTRY_BUF_SZ);
		cspec->rev = translate_custom_table[i].custom_locale_rev;
			return;
		}
	}
#ifdef COUNTRY_REGIONS
	/* if no country code matched return first universal code from translate_custom_table */
	memcpy(cspec->ccode, translate_custom_table[0].custom_locale, WLC_CNTRY_BUF_SZ);
	cspec->rev = translate_custom_table[0].custom_locale_rev;
#endif /* COUNTRY_REGIONS */
	return;
}
And finally we can see that comment

/* if no country code matched return first universal code from translate_custom_table */

I hope we can recompile it changing universalcode {"", "XY", 4} and put {"", "US", 69}
then if the country code of our provider is not in the list the wifi driver will act like we are in US and that can solve the wifi problems for every users...

I need help to do that work please... Developers from XDA help me!!!!
The Following User Says Thank You to ScorpionXII For This Useful Post: [ View ] Gift ScorpionXII Ad-Free
 
 
11th September 2012, 10:15 AM |#2  
Senior Member
Thanks Meter: 396
 
More
are you running 2.2 or 2.3 or even 4.0? The lg drivers only work with 2.2,, if you are on 2.2 i suggest you unlock your bootloader and flash cm7.2 and try if wifi works than. Another thing is the consideration that the wifi chip is broken (i doubt it though), can you do a dmesg and a logcat and post them here while you try connecting to wifi?
Have you tried the fix where you edit the database to US and make it read only than, if so did it work?
With editing and recompiling those drivers/modules i cant really help you since its not my domain of knowledge, but your idea seems reasonable and probably doable. I dont have access to my atrix now, so i cant test or anything for you, possibly i could compile/crosscompile that module for you, i would need the full sources for the driver/kernels with the makefile and the properly edited file as you suggested.
27th January 2019, 09:02 PM |#3  
Senior Member
Flag Castle Rock, Wa
Thanks Meter: 408
 
Donate to Me
More
Quote:
Originally Posted by ScorpionXII

Hello XDA-Developers... that's my first post by the way but I think that we can do something very important to the ATRIX users.
I'm from Cuba, I got an Atrix about 2 weeks (I have a Samsung Focus too) but I decided take that Android phone thinking in the Atrix-Lapdock combination. Here I have the really bad issue of wifi problems with my country code operator, I tryed every fix out there in the internet and here like

[Solved] Fix for nonworking WiFi on Simunlocked ATT Atrix 4G http://forum.xda-developers.com/show....php?t=1058260
[FIX] Final fix for nonworking WIFI on unlocked ATT Atrix in some countries http://forum.xda-developers.com/show....php?t=1077329

but I did'nt have a success

Reading about that issue I think that the problem is just inside the code of ATRIX wifi drivers and I made my own decision of search in the source looking for country codes segment, do a modification and re-compile the drivers.

After a week digging in every files of wifi drivers source code I think that I finally found a solution but I need help. I'm a noob in Adroid world but I think that mybe with help of some developers from XDA we can do that job that we will appreciated for many users around the world.

Well, now the important thing. I donwloaded a atrix-wifi-module from Atrix Dev Team on github, after a few days looking the source I found that in \open-src\src\dhd\sys\dhd_custom_gpio.c file...

"dhd_custom_gpio.c" that C file can be our solution

and here a piece of code, the function with the list of countries



At the end of the file are another important function



And finally we can see that comment

/* if no country code matched return first universal code from translate_custom_table */

I hope we can recompile it changing universalcode {"", "XY", 4} and put {"", "US", 69}
then if the country code of our provider is not in the list the wifi driver will act like we are in US and that can solve the wifi problems for every users...

I need help to do that work please... Developers from XDA help me!!!!

@ripee, list of codes
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes