Sunday, 29 April 2007

Details about setting up Wifi

As promised ...

In order to get the wifi working I got the driver provided by Kohjinsha and
searched in it, and found that it was compiled in a Fedora Core 4 environment,
so I decided to install that (I have no real preference for any particular
distribution), so I'm happy with that one.

After installation of Fedora I tried to insmod the module, but it complains
with:

[root@kohji ~]# insmod /home/angelv/kohji_drivers/wifi/w89c35-wpa37_Linux26/w35und.ko
insmod: error inserting '/home/angelv/kohji_drivers/wifi/w89c35-wpa37_Linux26/w35und.ko': -1 Invalid module format
[root@kohji ~]#

It turns out that cannot load it because the "version magic" in the driver is
different to what is expected, so I just opened the binary file with an editor
and changed one number

I get this in /var/log/messages:
kohji kernel: w35und: version magic '2.6.11-1.1369_FC4 686 REGPARM 4KSTACKS gcc-4.0' should be '2.6.11-1.1369_FC4 586 REGPARM 4KSTACKS gcc-4.0'

So I have to change the 686 in the driver file to 586. (Is this dangerous? Well,
I don't know for sure, but let's continue).

With the changed file, we can now do:

[root@kohji ~]# insmod /home/angelv/kohji_drivers/wifi/w89c35-wpa37_Linux26/w35und_test.ko
[root@kohji ~]#


And in /var/log/messages I get:

Apr 29 19:11:53 kohji kernel: Adapter =d0240280
Apr 29 19:11:53 kohji kernel: WbWLanInitialize(1)
Apr 29 19:11:53 kohji kernel: ******BB3c is 00000000
Apr 29 19:11:54 kohji kernel: WbWLanInitialize(2)
Apr 29 19:11:54 kohji kernel: usbcore: registered new driver w35und
Apr 29 19:11:54 kohji kernel: SIOCSIWESSID test

So all looks fine.

For the moment I have one problem. If I do this when the WIFI option (Fn+F4) is
off, and then I try to switch it on, then I cannot get it to work, but that's
easy. After switching it on, I just remove the module and load it again and all
is good:

[root@kohji ~]# rmmod w35und
[root@kohji ~]# insmod /home/angelv/kohji_drivers/wifi/w89c35-wpa37_Linux26/w35und_test.ko

in /var/log/messages:

Apr 29 19:16:19 kohji kernel: Adapter =d06b0280
Apr 29 19:16:19 kohji kernel: WbWLanInitialize(1)
Apr 29 19:16:19 kohji kernel: ******BB3c is 00000000
Apr 29 19:16:20 kohji kernel: WbWLanInitialize(2)
Apr 29 19:16:20 kohji kernel: usbcore: registered new driver w35und
Apr 29 19:16:20 kohji kernel: SIOCSIWESSID test
Apr 29 19:16:25 kohji dhclient: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
Apr 29 19:16:32 kohji dhclient: DHCPREQUEST on wlan0 to 255.255.255.255 port 67
Apr 29 19:16:32 kohji dhclient: DHCPACK from 192.168.0.1
Apr 29 19:16:32 kohji NET[3270]: /sbin/dhclient-script : updated /etc/resolv.conf
Apr 29 19:16:32 kohji dhclient: bound to 192.168.0.130 -- renewal in 38903 seconds.

[root@kohji ~]# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:0D:F0:2D:DF:8C
inet addr:192.168.0.130 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20d:f0ff:fe2d:df8c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:44 errors:0 dropped:0 overruns:0 frame:0
TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7770 (7.5 KiB) TX bytes:4970 (4.8 KiB)


If someone is curious, the wlan0 configuration file reads:
[root@kohji ~]# cat /etc/sysconfig/network-scripts/ifcfg-wlan0
DEVICE=wlan0
USERCTL=yes
BOOTPROTO=dhcp

TYPE=Wireless
MODE=Managed
ESSID=SpeedTouch0CEAA4
RATE=54Mb/s

NETMASK=
DHCP_HOSTNAME=
IPADDR=
DOMAIN=
HWADDR=
PEERDNS=yes
GATEWAY=
IPV6INIT=no
ONBOOT=no
CHANNEL=1
[root@kohji ~]#


Perhaps this info is too verbose, but I hope it helps someone.

Cheers,
Angel

2 comments:

Dominik said...

Hi, I'm tracking your battle with w89c35 kernel module and I wonder if you have a source code for it? Seems like your tips will help me get it working on my brand new slackware 12 which lacks only support for this usb2wlan card. Peace.

Cannan Charity said...

Great stuff. I really appreciate with getting lot of good and reliable information with your post.......
Samsung laptops