Wifi driver for h5000 devices

From: Michal Panczyk <mpanczyk_at_gmail.com>
Date: Thu, 27 Mar 2008 23:46:32 -0000

Hi all,
Due to recent developments in angstrom distribution the idea of
getting the wifi on to work on h5000 devices is back. It has been
ages since it worked (2.4 kernel I think). Thanks to Milan Plizk and
Koen Kooi some people were able to get the wifi working, using ugly
hack (devmem2 operations on the memory).
In first comment at [1] Milan explains how to control the wifi
operations: power on the USB and the wifi module. It can be done using
devem2 package - as described in comment 5.
The old h5400_wifi driver used to take care of the whole process -
including the USB control, but the main part of turning on the module
was done in the lines :
samcop_set_gpio_b (dev->parent, SAMCOP_GPIO_GPB_RF_POWER_ON |
SAMCOP_GPIO_GPB_WLAN_POWER_ON,
                           SAMCOP_GPIO_GPB_RF_POWER_ON |
SAMCOP_GPIO_GPB_WLAN_POWER_ON);

I have played a while with the code and adopted the driver to the 2.6
kernel. It stripped it to maximum - only to get it working.
Currently I see following issues:
1) sometimes the wifi loads incorrectly - resulting in kernel oopses
2) GPBDAT register is not reseted in the initization process
3) at the current state module does not relay on other modules - is
can be unloaded, crashing the wifi

I would like to get some help (hints at least), to get the driver
working. That includes:
1) testing
2) tips how to write a decent driver
3) ideas how to manage the power consumption

As it goes for testing - I can't do it all by myself - I can't test
all possible scenarios. So I bitbaked a test image available at [2],
that includes modified kernel, modules, firmware and the devmem2
package. It got the wifi working by following procedure:
modprobe h5400-wifi
modprobe ohci_hcd
and the rest - firmware loading and getting the wifi0 up - was done
automatically.
I have no test procedure ready, yet. I hope to figure one out once the
bugs start arriving.

I guess the driver should be converted to platform device style. I
have spotted a acx wireless drivers as examples (let's say
hx4700_acx.c). I also guess that this way it would be possible to get
wifi working without loading and unloading the driver - just
controlled by userspace. In future it could get included in the main
h5400.c file.

Power consumption is a bit harder issue - I have seen it pointed as a
problem somewhere else by Milan. Once the ipaq goes to sleep the usb
needs to be powered off to save power. This results in bringing down
the wifi, so once the device is brought back from sleep the wifi0
won't be available. So the whole procedure of configuring the network
has to be redone.
The problem of resetting the GPBDAT should be handled here too.
Also in this section - it would be nice to see wifi0 always in the
configuration (ifconfig -a), but activate it (read supply power to it)
only when it is up. I have not figured out if it is possible or not,
yet....

I attach diffs of the files I modified to show the changes that I have
made. I made the diff against files included in r15 of the angstrom
kernel version. It is for general information purpose - not ready to
apply to cvs. I also attach clear h5400_wifi.c - as for some people it
is easier to operate on small, original file that on unreadable diff.

I would be more than happy to hear some ideas, comments or bug reports...

[1] http://bugs.openembedded.net/show_bug.cgi?id=3161
[2] http://delta-9-thc.czuby.net/~yans/hh/h5000/

-- 
Best regards
Michal Panczyk




Received on Thu Mar 27 2008 - 18:46:31 EST

This archive was generated by hypermail 2.2.0 : Wed May 21 2008 - 16:32:13 EDT