Author Topic: WDLXTV_G2 - WIFI ZYDAS 1201 /1211 / 1211B - Successful Integration - Working!  (Read 15739 times)

March 10, 2010, 10:34:37 AM
Read 15739 times

d3udp

  • Newbie

  • Offline
  • *

  • 10
Hello WDTV maniacs,

First of all, congrats b-rad.cc you've made a tremendous job with WDLXTV for Gen1 and now Gen2!!!


Help out linux saavy!

I am trying add a new ZYDAS1211 wireless modules in WDLXTV_G2, so then yesterday I successfully cross-compiled two new kernel modules zd1211rw & zd1201 including dependencies using the provided kernel and cross-compiling tool package Penthouse_GPL_code_package.2009.10.26 from WD.

As you already know the kernel provided by WD is 2.6.22.19-19.

As indicated in the kernel the zd1211rw module require external firmware files which are loaded to USB Wireless dongle once module is initialized.
The ZD1211 firmware files need to be installed and which can be found here http://zd1211.ath.cx/get-firmware

I've copied all firmware files obtained for the ZD1211 within /lib/firmware/zd1211/* which is linked to /tmp/.root/lib/firmware/zd1211

Then after loading the zd1211rw.ko modules and dependencies, I am still getting a complain from the zd1211rw module that the firmware files cannot be found.


# lsmod
zd1211rw 59568 0 - Live 0xc0134000 (F)
ieee80211softmac 36672 1 zd1211rw, Live 0xc00f4000 (F)

usb 1-2: reset high speed USB device using tangox-ehci-hcd and address 3
#usb 1-2: Could not load firmware file zd1211/zd1211b_ub. Error number -2
zd1211rw 1-2:1.0: couldn't load firmware. Error number -2


Then I've tried to place the firmware files within the following directories without any success.

/lib/firmware/zd1211/*
/lib/firmware/hotplug/*
/lib/firmware/
/lib/firmware/hotplug/zd1211/*
/lib/firmware/2.6.22.19-19/zd1211/*


I've looked at the source of the zd1211rw module but only the following constant are to be found but not the full path!
#define FW_ZD1211_PREFIX        "zd1211/zd1211_"
#define FW_ZD1211B_PREFIX       "zd1211/zd1211b_"
 

Here are the dependancies for ZD1211RW as per Kconfig
config ZD1211RW
        tristate "ZyDAS ZD1211/ZD1211B USB-wireless support"
        depends on USB && IEEE80211_SOFTMAC && WLAN_80211 && EXPERIMENTAL
        select WIRELESS_EXT
        select FW_LOADER


Any of you guys know where would I need to put the firmware files so that the ZD1211 module can find them?

I am almost there I need to find the correct path!

Any ideas?!

Thanks.
D3UDP
« Last Edit: March 12, 2010, 10:53:41 PM by d3udp »

March 10, 2010, 06:43:19 PM
Reply #1

b-rad.cc

  • Hero Member

  • Offline
  • *****

  • 833
  • Personal Text
    FW Hacker
    • B-RAD

March 11, 2010, 03:35:18 AM
Reply #2

d3udp

  • Newbie

  • Offline
  • *

  • 10
b-rad.cc, using a process debugger is indeed a good idea.

Although, because I'm trying to debug a kernel module I am unsure on which process to bind the debugger since most of the kernel threads disssalow strace.

Where would you attach strace to follow a kernel module I/O operations?

Another question that poped up yesterday is if mdev support firmware loading since it's the hotplug loader in busybox. Did busybox 1.41.1 mdev got compiled to support firmware loading?

Thanks for your thoughs and idea!
D3UDP

BusyBox  --->
  Linux System Utilities  --->
    
  • mdev
  •   Support loading of firmwares



# strace -p 719 &
# attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted

  PID USER       VSZ STAT COMMAND
    1 root      3712 S    /bin/sh /init
    2 root         0 SW   [kthreadd]
    3 root         0 SWN  [ksoftirqd/0]
    4 root         0 SW   [events/0]
    5 root         0 SW   [khelper]
   36 root         0 SW   [kblockd/0]
   37 root         0 SW   [ata/0]
   38 root         0 SW   [ata_aux]
   41 root         0 SW   [khubd]
   43 root         0 SW   [kseriod]
   56 root         0 SW   [pdflush]
   57 root         0 SW   [pdflush]
   58 root         0 SW   [kswapd0]
   59 root         0 SW   [aio/0]
   60 root         0 SW   [cifsoplockd]
   61 root         0 SW   [cifsdnotifyd]
  664 root         0 SW   [scsi_eh_0]
  668 root         0 SW   [scsi_eh_1]
  704 root         0 SW   [scsi_eh_2]
  705 root         0 SW   [usb-storage]
  719 root         0 SW   [sigmblockd]
  752 root         0 SW   [sigm_write_cach]
  802 root      4560 S    /sbin/config_tool -l -m 10
  806 root         0 SW<  [loop0]
  893 root         0 SW   [ledd]
  899 root         0 SW   [drop_cache_thre]
  918 root      3648 S    syslogd -O /tmp/messages.txt
  920 root      3648 S    klogd

March 11, 2010, 08:36:03 AM
Reply #3

b-rad.cc

  • Hero Member

  • Offline
  • *****

  • 833
  • Personal Text
    FW Hacker
    • B-RAD
no, strace the modprobe xxxx command. it'll tell you exactly where its not finding the firmware files.

March 11, 2010, 09:59:20 AM
Reply #4

d3udp

  • Newbie

  • Offline
  • *

  • 10
b-rad.cc,

I thought about that yesterday after your reply but I should have specified in my previous post that the firmware zd1211rw loading error occurs only when the ZyDAS device is being plugged-in and not when I try to insert module into the kernel using modprobe or insmod therefore modprobe has been exited out already. I will try to plugin-in the ZyDAS device before inserting the module and see if I can trace the I/O i'm looking for.

One other though would be to trace mdev as its being called in the userspace once an hotplug device is hooked. But again I assume that mdev is being called as a child process of /sbin/init therefore might be hard to trace?  I believe that mdev is responsible for loading the firmware files of /lib/firmware and copy them to device tree under /sys/class/firmware/ if needed since it's the hotplug helper of busybox. Im starting to think it has something to do with a process under userspace maybe with mdev.

I am unsure how to confirm if the current mdev was compiled to support loading of device firmware any ideas?

Do you know any other hotplug devices that needed to load firmware files so far under WDLXTV_G2?

Cheers
D3UDP

March 11, 2010, 10:07:08 AM
Reply #5

b-rad.cc

  • Hero Member

  • Offline
  • *****

  • 833
  • Personal Text
    FW Hacker
    • B-RAD
ok, understand now. it matters not how mdev was compiled, its the driver loading the firmware from where its been compiled to look. The files in /lib/firmware are sigma specific, the wireless config files for the RTxxxx drivers on Live are in /etc and not in /lib/firmware like debian/ubuntu. You just need to pore through the code and find where its loading from, or do a strings on the module and look for file locations.

Why haven't you posted your compiled modules / etc ? Others with the same adapter might be able to help.

March 11, 2010, 07:58:46 PM
Reply #6

d3udp

  • Newbie

  • Offline
  • *

  • 10
b-rad.cc,

I finally managed it to make it work, MDEV my friend ;)

usb 1-2: configuration #1 chosen from 1 choice
usb 1-2: reset high speed USB device using tangox-ehci-hcd and address 7
zd1211rw 1-2:1.0: firmware version 4725
zd1211rw 1-2:1.0: zd1211b chip 050d:705c v4810 high 00-1c-df AL2230_RF pa0 g--NS
zd1211rw 1-2:1.0: eth0
Symbol usb_register_driver is being used by a non-GPL module, which will not be allowed in the future
Please see the file Documentation/feature-removal-schedule.txt in the kernel source tree for more details.
Symbol usb_deregister is being used by a non-GPL module, which will not be allowed in the future
Please see the file Documentation/feature-removal-schedule.txt in the kernel source tree for more details.
« Last Edit: March 12, 2010, 10:51:16 PM by d3udp »

March 12, 2010, 10:44:54 PM
Reply #7

d3udp

  • Newbie

  • Offline
  • *

  • 10
WDTV Maniacs,

The Wireless Chipset ZYDAS1211B and ZYDAS1211 can now be used on the WDLXTV_G2.

I'm having a great performance, it runs smooth on NFS and CIFS/SMB shares using huge files so big streams. I had to recompile new Wireless_Tools v29 since iwpriv can't be used with the ZYDAS familly.

So far I tested it with WPA2-PSK CCMP TKIP encryption but WPA and WEP shouldn't be a problem. I have started to make an app.bin package for thoses interested.

B-rad.cc, just as a thought net.mount is being started before the RC scripts of the crazymount app.bin package which isn't really convenient when you want to implement new wireless drivers which aren't build-in to your wdtvhd.bin cramfs image... Unless I missed something I would need to kickoff the RC of the app.bin before net.mount! I still managed it to make it work but it's not as clean as I would like it do be.

Is there anyway to kickoff App.bin RCs before /init -> net.mount?

Anyone interested?
Cheers
D3UDP



March 13, 2010, 12:44:44 PM
Reply #8

b-rad.cc

  • Hero Member

  • Offline
  • *****

  • 833
  • Personal Text
    FW Hacker
    • B-RAD
WDTV Maniacs,

The Wireless Chipset ZYDAS1211B and ZYDAS1211 can now be used on the WDLXTV_G2.

I'm having a great performance, it runs smooth on NFS and CIFS/SMB shares using huge files so big streams. I had to recompile new Wireless_Tools v29 since iwpriv can't be used with the ZYDAS familly.

So far I tested it with WPA2-PSK CCMP TKIP encryption but WPA and WEP shouldn't be a problem. I have started to make an app.bin package for thoses interested.

B-rad.cc, just as a thought net.mount is being started before the RC scripts of the crazymount app.bin package which isn't really convenient when you want to implement new wireless drivers which aren't build-in to your wdtvhd.bin cramfs image... Unless I missed something I would need to kickoff the RC of the app.bin before net.mount! I still managed it to make it work but it's not as clean as I would like it do be.

Is there anyway to kickoff App.bin RCs before /init -> net.mount?

Anyone interested?
Cheers
D3UDP

net.config is sourced after crazymount, any modules you provide in an app.bin are linked to /lib/modules/2.6.22.19-19-4 by crazymount, therefore insmod/modprobe them in net.config like any other driver. You can have whatever commands you want in net.config, you just need to be sure they're ok with running more than once--as the file is sourced twice.

http://wiki.wdlxtv.com/Creating_an_app_bin.
« Last Edit: March 13, 2010, 01:28:29 PM by b-rad.cc »

March 16, 2010, 10:47:55 AM
Reply #9

marice

  • Newbie

  • Offline
  • *

  • 2
WDTV Maniacs,

The Wireless Chipset ZYDAS1211B and ZYDAS1211 can now be used on the WDLXTV_G2.

I'm having a great performance, it runs smooth on NFS and CIFS/SMB shares using huge files so big streams. I had to recompile new Wireless_Tools v29 since iwpriv can't be used with the ZYDAS familly.

So far I tested it with WPA2-PSK CCMP TKIP encryption but WPA and WEP shouldn't be a problem. I have started to make an app.bin package for thoses interested.

B-rad.cc, just as a thought net.mount is being started before the RC scripts of the crazymount app.bin package which isn't really convenient when you want to implement new wireless drivers which aren't build-in to your wdtvhd.bin cramfs image... Unless I missed something I would need to kickoff the RC of the app.bin before net.mount! I still managed it to make it work but it's not as clean as I would like it do be.

Is there anyway to kickoff App.bin RCs before /init -> net.mount?

Anyone interested?
Cheers
D3UDP




Dear d3udp..

Have you made an app.bin of the ZYDAS1211B driver?
I bought a cheap wifi-usbstick from dealextreme and it has this ZYDAS1211B chipset..
but i couldn't figure out how to make it work :S

If you have this app.bin file, could you please publish it... it would be awesome.. :D

Greets!

EDIT: Oops, i have a WDTV live, not a WDTV LIVE G2, does this matter?? (hope not :P )
« Last Edit: March 16, 2010, 10:53:42 AM by marice »

March 16, 2010, 11:06:01 AM
Reply #10

cybercam

  • Newbie

  • Offline
  • *

  • 8
WDTV Maniacs,

The Wireless Chipset ZYDAS1211B and ZYDAS1211 can now be used on the WDLXTV_G2.

I'm having a great performance, it runs smooth on NFS and CIFS/SMB shares using huge files so big streams. I had to recompile new Wireless_Tools v29 since iwpriv can't be used with the ZYDAS familly.

So far I tested it with WPA2-PSK CCMP TKIP encryption but WPA and WEP shouldn't be a problem. I have started to make an app.bin package for thoses interested.

B-rad.cc, just as a thought net.mount is being started before the RC scripts of the crazymount app.bin package which isn't really convenient when you want to implement new wireless drivers which aren't build-in to your wdtvhd.bin cramfs image... Unless I missed something I would need to kickoff the RC of the app.bin before net.mount! I still managed it to make it work but it's not as clean as I would like it do be.

Is there anyway to kickoff App.bin RCs before /init -> net.mount?

Anyone interested?
Cheers
D3UDP





YESSS!  I am interested! I have a GEN2 (NOT LIVE) I dont know why b-rad moved the message...

March 16, 2010, 09:02:34 PM
Reply #11

d3udp

  • Newbie

  • Offline
  • *

  • 10
Guys,

As requested here the first BETA app.bin package for WDLXTV_G2 and ZYDAS wireless chipset familly. Keep me posted here for your results and tests let me know if this is working with your lovely ZYDAS.

This package has been tested with WDLXTV_G2 since I dont have the live version I can't confirm if its working although wouldnt be hard to integrate with WDTV Live.

http://www.megaupload.com/?d=3YRQ37HM

Cheers
D3UDP




March 17, 2010, 05:16:19 AM
Reply #12

marice

  • Newbie

  • Offline
  • *

  • 2
Bummer... Its doesn't work on a WDTV live (g1) :S

i did an ifconfig (while the wdtv was hooked up on ethernet) with the wifi adapter inserted.
but it only showed the ethernet adress, nothing about the wifi adapter :S


March 17, 2010, 09:03:35 AM
Reply #13

d3udp

  • Newbie

  • Offline
  • *

  • 10
Bummer... Its doesn't work on a WDTV live (g1) :S

i did an ifconfig (while the wdtv was hooked up on ethernet) with the wifi adapter inserted.
but it only showed the ethernet adress, nothing about the wifi adapter :S



Marice,

I would need to chat with you in order to find out why its not working on the WDTV Live. As I said, I did this package for the WDLXTV_G2 but it should be very easy to make one for WDTV Live.

I am willing to help you out when I get a chance, check for my contact info in the README and send me your IM information... 


March 17, 2010, 04:02:52 PM
Reply #14

b-rad.cc

  • Hero Member

  • Offline
  • *****

  • 833
  • Personal Text
    FW Hacker
    • B-RAD
it won't work on wdtv live. dmaosd will not be looking for the adapter and will just say you are offline, regardless if you are online or not.

@d3udp: there is nothing wrong with the order of execution or rcS being executed before net.mounts. It works how its intended and in the most sensical way. app.bin rcS's are executed in numerical order. S90net.mounts is not executed until almost the end of the boot cycle, you can have an infinite number of rcS's executed before it.

if you need to link firmware files into /lib/firmware then you can do that inside of net.config. net.config can be a full fledged program for that matter. You do inside of net.config anything that has to happen before rcS.

you do some stuff in your script that doesn't make sense either. hotplug is hyjaacked/disabled by dmaosd as soon as it starts, you'll see I already echo hotplug into the proper place pretty much right off in /init. also you don't need to call depmod, that is just adding unnecessary time to the boot. what you do is provide your own modules.dep and it will be cat'd onto the system version.

I'll add these drivers into wdlxtv-g2 in the next version.