[Q] How to compile atrix wifi drivers? - Atrix 4G Q&A, Help & Troubleshooting

I am building an Atrix CM7 image with a kernel based on faux123's github kernel-MB860. That kernel builds and works fine. The wifi drivers however, are not working. I have also cloned faux123's atrix-wifi-dev project and built the dhd module by:
Code:
cd open-src/src/dhd/linux
make ANDROID_BUILD_TOP=~/projects/android/system LINUXSRCDIR=~/projects/android/kernel-MB860 BCM_INSTALLDIR=~/projects/android/system/device/motorola/olympus/modules CROSS_COMPILE=$CCOMPILER dhd-cdc-sdstd
I get "Error" from the enable wifi option in network settings. I tried insmod'ing the dhd.ko from the adb shell:
Code:
insmod /system/lib/modules/dhd.ko firmware_path=/system/etc/wl/sdio-ag-cdc-full11n-minioctl-roml-pno-wme-aoe-pktfilter-keepalive.bin nvram_path=/system/etc/wl/nvram.txt
insmod: init_module '/system/lib/modules/dhd.ko' failed (Invalid argument)
dmesg shows:
<4>[ 310.662019] Dongle Host Driver, version 4.218.248.31
<4>[ 310.662023] Compiled in /home/bricea/projects/android/atrix-wifi-module/open-src/src/dhd/linux/../.. on Feb 16 2012 at 11:30:24
<7>[ 310.972212] mmc1: queuing CIS tuple 0x91 length 3
<6>[ 310.972246] mmc1: new SDIO card at address 0001
<4>[ 322.653577] dhd_module_init: sdio_register_driver timeout
Am I building this correctly? Has anyone successfully rebuilt the kernel and dhd driver?

Did you ever figure this out?
Did you (or anyone) figure out how to build the wifi module for CM7? Where do you get the source?
I have successfully built both the kernel and the filesystem, but have not been able to get the wifi module built.

Okay, so apparently this is some sort of secret because I had no luck finding the proper way to build the driver module.
Well, I finally got tired of trying the same thing ('make dhd-cdc-sdstd') over and over only to get nowhere. I went into the makefile and looked around at what kind of options it had for building the module. Turns out there are about 2 dozen different options.
The default option is 'dhd-cdc-sdmmc-oob-gpl' and what it will build if you just type 'make' in the proper folder. Finding that it was probably just as likely as any other option, I did that.
It WORKED!
So the proper command is 'make dhd-cdc-sdmmc-oob-gpl' or just 'make'.
I hope no one minds me digging up an older thread, but I thought I might share if anyone else wanted to try cooking their own kernel. I flailed around with this issue for two days trying desperately to find the answer before I finally figured it out.

Related

[Q] Need help with compiling modules for Dell Streak Froyo stock kernel

Need help with compiling modules for Dell Streak kernel.
Because i could not find cifs.ko module for mounting network shares for Dell Streak stock Froyo 318, i decided to make it on my own.
I did not have any clue how can it be done, but with lot of googling and reading forum posts on xda and modaco, i got vague idea how i can do it.
There was lots of trial-and-error attempts until i learned how to use all comands and tools, and here is final list of things id did to make it:
Already had VMWare workstation with Ubuntu 10.10 instalation, i got Android Froyo source tree from net, replaced kernel with Dell Streak 3.09 kernel (from opensource.dell.com) which is also Froyo, i think, and is closest to my kernel version (318).
Got toolchains from codesourcery.com
Extracted my phone config from /proc/config.gz, renamed to .config, uncommented and changed option for CONFIG_CIFS=m. Did same for tun.ko module which i did not need, but just for comparison. Placed .config file in kernel root.
Did comand:
Code:
make ARCH=arm CROSS_COMPILE=/path-to-toolchains/bin/arm-none-eabi- modules
after confirming some options (irellevant to this), and some compiling in terminal, all went ok without errors and did produce modules in fs/cifs and drivers/net
i also did some debugging to reduce filesize, bud also had tried module without debugging with same result (see below)
transferred modules to my phone in /system/lib/modules and tried to load them via insmod.
loaded tun.ko without problem (i dunno whteher is working because i have no means to try it and have no need for it). i compiled it just to see whether it will be loaded in phone kernel. it DID load without error messages.
when tried to load cifs.ko via insmod cifs.ko, got this error message:
Code:
insmod: init_module 'cifs.ko' failed (no such file or directory)
dmesg provided following errors:
Code:
cifs: Unknown symbol slow_work_register_user
cifs: Unknown symbol slow_work_enqueue
found in similar thread for Galaky Tab that i need to compile slow_work module and load it before because of that dependancies, Found another thread with instructions for compiling slow-work, followed them:
copied all slow-work files in cifs, Remove the calls to round_jiffies in fs/cifs/slow-work.c: round_jiffies(jiffies + SLOW_WORK_CULL_TIMEOUT)); changed to
jiffies + SLOW_WORK_CULL_TIMEOUT); AND round_jiffies(jiffies + SLOW_WORK_OOM_TIMEOUT)); TO jiffies + SLOW_WORK_OOM_TIMEOUT);
edited fs/cifs/Makefile and added slow-work.o to the obj-$(CONFIG_CIFS) += cifs.o line: obj-$(CONFIG_CIFS) += cifs.o slow-work.o.
Ran make command from above, got both modules (cifs.ko and slow-work.ko) in fs/cifs directory without errors.
Copied them to phone, done insmod and got error for slow-work:
Code:
insmod: init_module 'slow-work.ko' failed (no such file or directory)
dmesg provided following message:
Code:
slow_work: module licese "unspecified" taints kernel
slow_work: Unknown symbol mutex_lock_nested
Now i'm clueless (like i haven't been all the time :-D).
All modules compiled without errors, tun.ko will load, cifs.ko apparently need slow-work to run, slow-work compiled, but can't load.
So, if somebody can help, or point me where is possible error, i will be very grateful.
UPDATE:
Found references for missing slow_work modules in cifsfs.c and misc.c, deleted them and ran make.
produced cifs.ko without error.
LOADED cifs in phone without error!!!! With lsmod it shows that module is loaded!
BUT, does not work! Cannot mount anything. When tried with cifsmanager or manually via terminal get error message "No such device" which points that there is no valid cifs.ko module in kernel.
So, module is produced and loaded in phone without errors, BUT DOES NOT WORK. It looks like Streak Froyo need slow-work module after all...
I'm desperate, please if somebody did compiling cifs.ko for Streak, or use cifs mounting with found module, share your thoughts and experiences.
Thanks everybody.
CIFS and Slow worked - compiled
I was able to successfully compile both the slow work module and the CIFS module for the most recent 4G EVO. Took me a couple of days, but I think I could walk you through the specifics fairly easily. Let me know if you want the details.
of course I do!
please write your way.
Sent from my Dell Streak using XDA Premium App
dmandic, did you ever get this working? I went through similar pains doing this for the xperia arc, and did manage to get it working. I have some thoughts about your situation if you want to discuss further.
please, any help is appreciated.
i'm open to any kind of suggestions.
write your thoughts here.
Sent from my Dell Streak using XDA Premium App
Hmm. I originally stumbled upon this thread because I was searching for others who compiled a cifs.ko against a kernel with version "2.6.32.9-perf" (from the android about phone menu), hoping to avoid going through figuring out how to do this. I saw that others with the Dell Streak also had this kernel, and then I found your thread.
Anyway, I was thinking that maybe the kernel you got from the dell website had a slightly different version than your phone (because your phone is 3.18 vs 3.09), and that's why you're getting runtime symbol errors. I thought maybe there's a chance you needed exactly 2.6.32.9-perf and I could offer you mine. However, I downloaded the dell 3.09 kernel source and found that it's also 2.6.32.9-perf... so I guess that idea's out the window. (By the way, is this what your phone shows?)
Well just for kicks, I actually compiled slow-work and cifs from the dell kernel and loaded it on my xperia arc phone and they worked (was able to use CIFSManager).
It's a long shot but just in case there's something about the way you're compiling them, I attached them here - give it a try. [Edit: Duh, I forgot I need your .config file. Email it to me and I'll re-post these]
I tried out the Xperia files from the thread [DEV]TUN, CIFS modules files on my Streak 5. It did not go well, these are my messages from dmesg.
Code:
<4>[ 341.187030] tun: Unknown symbol dynamic_debug_enabled
<4>[ 341.190600] tun: Unknown symbol dynamic_debug_enabled2
<4>[ 341.219513] slow_work: module license 'unspecified' taints kernel.
<4>[ 341.220411] slow_work: Unknown symbol mutex_lock
<4>[ 341.638099] cifs: Unknown symbol mem_section
<4>[ 341.638397] cifs: Unknown symbol mutex_lock
<4>[ 341.641609] cifs: Unknown symbol slow_work_register_user
<4>[ 341.642835] cifs: Unknown symbol slow_work_enqueue
Looks like the kernel is differently compiled and or still some modules missing.
I noticed that in another thread Samba/CIFS for Motorola defy froyo nls_utf8.ko also has been required, however I do not have the 2.6.32.9-perf version of this to try it out.
How has the progression been for you guys?

[Q] wifi module problem with faux123 kernel-MB860

I am trying an experiment with my Atrix in which I need to be able to build the kernel and have a working wifi module. I have successfully built the faux123's kernel-MB860 (thanks very much!).
I then downloaded faux123's atrix-wifi-module in order to get wifi working. I have built the module, and pushed it to /system/lib/modules. However, wifi doesn't work. Under settings, it just displays "error". dmesg doesn't show nearly as much as a kernel packaged by faux123. Here is my output:
Code:
<4>[ 24.504982] sdhci_tegra_wlan_detect Detecting WLAN
<4>[ 24.504998] mot_wifi_set_carddetect: Nobody to notify
<4>[ 24.507937]
<4>[ 24.507940] Dongle Host Driver, version 4.218.248.31
<4>[ 24.507944] Compiled in /home/kenny/android/atrix-wifi-module/open-src/src/dhd/linux/../.. on Apr 17 2012 at 06:54:15
<6>[ 24.724025] request_suspend_state: wakeup (3->0) at 13492036210 (2012-04-21 19:25:46.351491984 UTC)
<6>[ 24.725196] lm3532_brightness_set: lcd-backlight, 0x4c(76), webtop=0
<7>[ 25.088713] mmc1: queuing CIS tuple 0x91 length 3
<6>[ 25.088824] mmc1: new SDIO card at address 0001
<6>[ 25.534772] usb_ether_get_stats
Whereas, dmesg from a kernel/module packaged by faux123 displays:
Code:
[ 49.811365] sdhci_tegra_wlan_detect Detecting WLAN
[ 49.811403] mot_wifi_set_carddetect: Nobody to notify
[ 49.812815]
[ 49.812818] Dongle Host Driver, version 4.218.248.31
[ 49.812822] Compiled in /home/paul/Froyo/system/vendor/bcm/wlan/osrc/open-src/src/dhd/linux/../.. on Dec 17 2011 at 19:58:57
[ 50.108317] mmc1: queuing CIS tuple 0x91 length 3
[ 50.108350] mmc1: new SDIO card at address 0001
[ 50.136595] alloc static buf at e9980000!
[ 50.136975] F1 signature read @0x18000000=0x9934329
[ 50.139716] DHD: dongle ram size is set to 294912(orig 294912)
[ 50.143537] wl_iw_attach thr:6d0 started
[ 50.143598] wl_iw_bt_init thr:6d1 started
[ 50.143655] dhd_attach thr:6d2 started
[ 50.143706] dhd_attach thr:6d3 started
[ 50.143749] dhd_attach thr:6d4 started
[ 50.191722] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[ 50.273753] wifi_get_mac_addr
[ 50.274700] Firmware version = wl0: May 6 2011 13:09:01 version 4.218.248.31
[ 50.442416] eth0: Broadcom Dongle Host Driver mac=40:fc:89:13:a8:83
If I try to do a insmod, I get an invalid argument message.
Code:
# insmod /system/lib/modules/dhd.ko
insmod: init_module '/system/lib/modules/dhd.ko' failed (Invalid argument)
Can someone suggest what I might be missing or doing wrong?
as far as i've researched this problem, it's hardware related. i get the same error (and an accompanying reboot) every time i try to toggle wifi.
http://forum.xda-developers.com/showthread.php?t=1205775
if you have any more success please let me know.
dLo GSR said:
as far as i've researched this problem, it's hardware related.
Click to expand...
Click to collapse
I'm not convinced it is hardware related (other than maybe having the wrong driver), since wifi works great using a true faux123 kernel/module.
I suspect my problem has something to do with how I compiled module or other files that I need to put on the phone.
How did you build it? A little more background might help
Build process ... it works!?!?
First, the good news...the module now works. But I don't understand what I may have done differently this time other than do the builds consecutively.
I retrieved the source:
Code:
$ cd ~/android/faux123-olympus-cm7-kernel
$ git clone https://github.com/faux123/kernel-MB860.git
$ cd ~/android
$ git clone https://github.com/faux123/atrix-wifi-module.git
Then I built:
Code:
$ cd ~/android/faux123-olympus-cm7-kernel/kernel-MB860
$ make ARCH=arm tegra_olympus_cm7_defconfig
$ make ARCH=arm CROSS_COMPILE=/home/kenny/tools/arm-2011.09/bin/arm-none-eabi- -j1
$ cd ../../atrix-wifi-module/open-src/src/dhd/linux/
$ export LINUXSRCDIR=/home/kenny/android/faux123-olympus-cm7-kernel/kernel-MB860
$ make ARCH=arm CROSS_COMPILE=~/tools/arm-2011.09/bin/arm-none-eabi- -j1
$ adb push /home/kenny/android/faux123-olympus-cm7-kernel/kernel-MB860/vendor/bcm/wlan/osrc/open-src/src/dhd/linux/dhd.ko /system/lib/modules/dhd.ko
I had kernel built a few days before I had found the wifi module source. I then tried building the wifi module and pushing the module as shown above.
Since then (over last week or so), I have tried a number of things, including copying files (/etc/firmware/wifi/*) from another phone which has a faux123 kernel. Are these files required? Are there steps in here that I missed?

[HELP] Compiling RTL8187 Driver

I'm trying to compile the rtl8187 kernel module for my archos 101 g9, I've pulled the archos-gpl-gen9-kernel-ics git repository and I've used the android-ndk r8 to compile the modules. Everything looks perfectly fine (the vermagic is matching the other modules "3.0.8+ SMP preempt mod_unload ARMv7" no issues there) except when I try to insmod the eeprom_93cx6.ko (This module needs to be loaded before the rtl8187.ko) I get told in dmesg "eeprom_93cx6: unknown relocation: 27"
After googling around it hasn't really helped me any.
So hopefully you guys can help me out. Any ideas of whats causing the above error?
mcd1992 said:
Sorry if this should go in the other gen9 section of this forum, wan't really sure. Feel free to move it mods.
I'm trying to compile the rtl8187 kernel module for my archos 101 g9, I've pulled the archos-gpl-gen9-kernel-ics git repository and I've used the android-ndk r8 to compile the modules. Everything looks perfectly fine (the vermagic is matching the other modules "3.0.8+ SMP preempt mod_unload ARMv7" no issues there) except when I try to insmod the eeprom_93cx6 (This module needs to be loaded before the rtl8187.ko) I get told in dmesg "eeprom_93cx6: unknown relocation: 27"
After googling around it hasn't really helped me any. (Not sure what R_ARM_PLT32 and all that is)
So hopefully you guys can help me out. Any ideas of how to my realtek wifi dongle working?
Click to expand...
Click to collapse
Hi !
You can try to update :
sudo apt-get install build-essential
sudo apt-get install libssl-dev
...and now recompile the module ....and also you need to take a look at Module.symvers - look into it an see if export symbols !
surdu_petru said:
Hi !
You can try to update :
sudo apt-get install build-essential
sudo apt-get install libssl-dev
...and now recompile the module ....and also you need to take a look at Module.symvers - look into it an see if export symbols !
Click to expand...
Click to collapse
Thanks for replying.
I'm using the latest build-utils and libssl for my os and inside my Module.symver the modules does appear.
Code:
0x00000000 eeprom_93cx6_read drivers/misc/eeprom/eeprom_93cx6 (unknown)
0x00000000 eeprom_93cx6_multiread drivers/misc/eeprom/eeprom_93cx6 (unknown)
mcd1992 said:
Thanks for replying.
I'm using the latest build-utils and libssl for my os and inside my Module.symver the modules does appear.
Code:
0x00000000 eeprom_93cx6_read drivers/misc/eeprom/eeprom_93cx6 (unknown)
0x00000000 eeprom_93cx6_multiread drivers/misc/eeprom/eeprom_93cx6 (unknown)
Click to expand...
Click to collapse
Ok !
Seem to be good ! If you want I can try to compile for you ...but I need your source module ...I will take a look tomorrow if you upload it !
Digging deeper into google I actually found a solution, adding -fno-pic to the compiler flags stops the error.
Original post by the_zuck
EDIT:
Yesssssss, Originally inserting the realtek dongle was causing a backtrace to appear in the dmesg but unloading the built-in modules (compat, wl12xx*, mac80211, and then cfg80211) and then loading my compiled modules (cfg80211, lib80211, mac80211, eeprom_93cx6, and then rtl8187) has resulted in success
So finally got my tablet where I want it, arch linux chroot with aircrack-ng / kismet running on it nicely with my alfa dongle. Thanks for trying to help me solve my issue at least surdu_petru
Compiled Modules tested and working on surdu_petru's 4.0.7 rooted rom.
mcd1992 said:
Digging deeper into google I actually found a solution, adding -fno-pic to the compiler flags stops the error.
Original post by the_zuck
EDIT:
Yesssssss, Originally inserting the realtek dongle was causing a backtrace to appear in the dmesg but unloading the built-in modules (compat, wl12xx*, mac80211, and then cfg80211) and then loading my compiled modules (cfg80211, lib80211, mac80211, eeprom_93cx6, and then rtl8187) has resulted in success
So finally got my tablet where I want it, arch linux chroot with aircrack-ng / kismet running on it nicely with my alfa dongle. Thanks for trying to help me solve my issue at least surdu_petru
Compiled Modules tested and working on surdu_petru's 4.0.7 rooted rom.
Click to expand...
Click to collapse
Im trying to compile the rtl8187 driver for my s3 - could you point me in the right directions to try and compile it. My s3 is rooted running a custom kernel. Thanks.
mcd1992 said:
Digging deeper into google I actually found a solution, adding -fno-pic to the compiler flags stops the error.
Original post by the_zuck
EDIT:
Yesssssss, Originally inserting the realtek dongle was causing a backtrace to appear in the dmesg but unloading the built-in modules (compat, wl12xx*, mac80211, and then cfg80211) and then loading my compiled modules (cfg80211, lib80211, mac80211, eeprom_93cx6, and then rtl8187) has resulted in success
So finally got my tablet where I want it, arch linux chroot with aircrack-ng / kismet running on it nicely with my alfa dongle. Thanks for trying to help me solve my issue at least surdu_petru
Compiled Modules tested and working on surdu_petru's 4.0.7 rooted rom.
Click to expand...
Click to collapse
I was trying to download the rtl8187 for my device that you posted and the link is bad. Any chance I can get it from you? Im trying to get an 8187.ko to work on my MK808 TV Stick and the rtl8187.ko that I have is giving me an "exec format error" when I insmod.

[Q]cifs module for Jetstream

Hi mates,
Lately I got myself a HTC Jetsteam since it seems to be one of the most cost-effective tablets who support stylus. It has the latest stock rom (htc_jetstream_emr_update_1.30.502.1_us.exe) installed, rooted through cwm. So far I'm happy with it. However one feature I miss most is the ability to mount network drive. As I coundn't find cifs module for this model, I decide to compile myself. I download the kernel source from htcdev(tried both "puccini_lte_crc-2.6.35-4612ecf.tar.gz" and "puccini_lte_crc-2.6.35-4612ecf.tar.gz").
I manage to compile the modules (on ubuntu and osx) however I couldn't insert them. It throw "insmod: init_module 'cifs.ko' failed (Exec format error)". It seems I mismatched the kernel. Anyone have a clue? I really appreciate it. It's been a frustrating weekend...
I checked dmesg
the reason cifs.ko can't be insmod is:
<4>[ 7069.498929] cifs: Unknown symbol slow_work_register_user (err 0)
<4>[ 7069.499997] cifs: Unknown symbol slow_work_enqueue (err 0)
However no information in dmesg explains why slow-work.ko can't be insmod.
I attached files (kernel version: 2.6.35.10-g01487c4), maybe someone can give a try...
greetings
My mistake. I ignored one warning while make the module - turns out it matters.
Now the cifs module works properly on my tablet. Feel free to try.
cheers
whats a cifs module?
guru_shastri said:
whats a cifs module?
Click to expand...
Click to collapse
CIFS stands for common Internet file system. Samba utilizes this protocol for network file sharing. Many UNIX folks use Samba to access Windows files over their networks.
I am assuming that you can place these under /system/lib/modules and it will just work. Does anyone know any differently? I don't have a means of testing at the moment.
Normally on Linux you would insmod <module>, but the things are a little different on Android.

Q: KERNEL DTS for Cyclone x2 (mygica ATV1200?) (stvmx Meson6_G02ref) wifi_power

Hi
I have an old Cyclone x2 box that I was trying to use as an audio streamer, but the android version on it was so flakey and running spotify on the box was dubious to say the least. I saw a libreelec build for g02ref here https://forum.libreelec.tv/thread/1...f-g18ref-th2-prima-pm-6001-vs-ip166-vs-ip015/ and thought I'd give that a go, but it doesn't power on the usb wifi card, so no wifi.
I tried building my own custom kernel based on the patches found in that thread but (after much pain and headscratching to figure out how to get from AML's DTD files to a uimage file with dtb included) I eventually ended up with a kernel that boots but still won't power on the wifi.
The kernel outputs
[ [email protected]] wifi_dev_probe
[ [email protected]] wifi_dt : interrupt_pin=GPIOX_11
[ [email protected]] wifi_dt : irq_num=null
[ [email protected]] wifi_dt : irq_trigger_type=GPIO_IRQ_HIGH
[ [email protected]] wifi_dt : power_on_pin=GPIOC_7
[ [email protected]] interrupt_pin=52, irq_num=4, irq_trigger_type=0, power_on_pin=112,clock_32k_pin=53​
which matches the entry in the DTD but the DTD suggests it's for a broadcom chip and I have the rtl8192cu.
I enabled gpio_sysfs and wrote a script to skip through setting all the values manually but got nowhere, that may have been because some of the gpio pins are marked as not-exportable (I got messages like
pinmux-m6 pinmux: pin-125 (amlogic:gpio:125) status -22
sh: write error: Invalid argument
aml_sdio.0 is using the pin CARD_5 as pinmux
pinmux-m6 pinmux: request() failed for pin 126
pinmux-m6 pinmux: pin-126 (amlogic:gpio:126) status -22
sh: write error: Invalid argument
sh: write error: Device or resource busy
sh: write error: Device or resource busy
uart_ao is using the pin GPIOAO_0 as pinmux​
for quite a lot of them) or it may be that there's something else I need to do.
One thing I spotted is that an old working mxlinux kernel I did manage to boot writes
set pinmux c0820b00​to the console, and the wifi card appears in the list when the USB powers up there; does that give a hint?
Does anyone know which GPIO pin is actually used for wifi_power by these box? Or alternatively does anyone have a DTS or DTD file for stvmx? The atv1200 dts in the kernel sources doesn't have any info on wifi pins
I tried extracting a DTB from the mxlinux image but none of the tools I can find that claim to do that were able to find one
Thanks
Edit: I should clarify that the reason I want to run this version and not one of the older (and working) openelec builds is because of librespot - being able to DLNA-stream as well as use as a spotify streamer is the ultimate goal)
Is this your wifi module? https://www.aliexpress.com/item/32646318856.html
or are you trying to use an external USB WiFi dongle?, as it appear to be a USB module, im not sure it would have a gpio pin to switch on/off (thought that was handled with software) but im still learning alot and im very probably wrong

Categories

Resources