Running a D-Link DWL-122 on a 64bit kernel      2005.08.10 @ 3:54:41 PM
I've got very nice and rich email from Robert Barber about his experience getting a DWL-122 to work on a 64-bit 2.6 kernel. His article follows:

I recently installed a 64 bit system with a stock Debian 2.6.8-11-amd64-k8 kernel, and I wanted to get my DWL-122 card up on it. I built the computer primarily to record sound, and since the soundcard (Delta 410) and everything else on the computer was working perfectly, and since I had already compiled and installed some 3rd-party modules against the kernel headers for the stock kernel, I was reluctant to recompile the kernel and have to do everything over again. Someone suggested that I try to compile the linux-wlan-ng modules against the kernel headers and see if it worked. Well, in brief, it did, but there were a few kinks that needed to be worked out.

My card (from the label on the back) =

MODEL NO: D WL-122
H/W Ver:A1


I downloaded the linux-wlan-ng source, compiled it against the kernel headers, and got "Invalid module format" errors. So I checked my gcc and kernel versions.

r/src# gcc --version
gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)


sonido:/usr/src# cat /proc/version
Linux version 2.6.8-11-amd64-k8 (buildd@athlon.lowpingbastards.de) (gcc
version3.4.4 20050314 (prerelease) (Debian 3.4.3-13)) #1 Wed Jun 1 01:03:08
CEST 2005


The source of the errors seemed to be that the kernel was compiled with gcc 3.4 while the modules were compiled with gcc 3.3. So I apt-got gcc 3.4, removed the bad modules, removed the source code, untarred the source code again, and recompiled the modules this way:

./configure # (your answers from your web page)
make all CC=gcc-3.4 # this was the key
make install


Now everything works as you say it should, except that there is one more twist. This card has always worked perfectly for me with 2.4 kernels, but has given me trouble in 2.6 kernels. Why? I don't really know. But after getting it working in this amd64 system and 2.6 version kernel, it immediately began to give me problems again! Looking at the messages it seemed to me that hotplug was having a hard time bringing up the card on its own. So I copied the modules into the /etc/modules file:

#these two modules added anywhere in the file, one module per line
prism2_usb
p80211


Then I edited my /etc/network/interfaces file to make wlan0 the default network interface:

# The primary network interface
auto wlan0
iface wlan0 inet static
address 192.168.x.y
netmask 255.255.255.0
network 192.168.x.0
broadcast 192.168.x.255
gateway 192.168.x.1
# dns-* options are implemented by the resolvconf package, if
installed
dns-nameservers 192.168.x.1
dns-search MYDOMAIN


Now the modules are loaded at boot time before hotplug gets into the act (I think), and the card works fine. I have a message in dmesg that the kernel is tainted:

prism2_usb: no version for "p80211netdev_rx" found: kernel tainted.
prism2usb_init: prism2_usb.o: 0.2.1-pre26 Loaded
prism2usb_init: dev_info is: prism2_usb
usbcore: registered new driver prism2_usb


Hopefully, this won't cause a problem for me somewhere down the road.



All knowledge and software published in this website is released under the GNU General Public License (GPL)