Google
 

« Why Bad is Good in Spam         A Depressed Web Server »

DLink DWL-122 USB on Fedora Core 2

Posted February 10, 2005 – 2:16 pm by Yakov Shafranovich in Linux

After struggling for a few days to get this adapter to work, I was finally sucessful and am going to do a small writeup here to help others. I am running Fedora Core 2 with kernel v2.6.10-1.9_FC2 on Athlon 1Ghz with Wlan-NG v0.2.1-pre26.

The DLink DWL-122 USB 802.11b Adapter is based on the Intersil Prism 2.5 chipset. There are two options that I found to work: NdisWrapper which lets the native DLink Windows driver run in Linux, and Wlan-NG’s prism2_usb native driver for Prism 2.5 (there is also the Orinoco’s prism_usb driver but their USB support is not finished yet).

I originally ran the NdisWrapper driver but somewhere along the way, an upgrade Fedora Core 2 kernel broke NdisWrapper. So instead, I decided to try out the Wlan-NG driver. Funny enough I managed to get it to work exactly ONE time before it stopped working. This driver maintains a list of configuration files in the /etc/wlan directory with a separate wlan-networkname file for each SSID. The file I created for my network was not being read by the driver, thus not setting the correct WEP settings. However, the actual module and the driver worked. I managed to figure out how to get around the problem by plugging in my regular PCMCIA card which started using the prism2_cs driver and left some tell-tell signs in the log - it seems that a script called “wlan-ng” is needed to execute when the USB dongle in pluged in. However, it fails because the driver needs to be started first via a special command. Once I started the driver, I ran the script and everything worked. Here are step by step instructions:

1. Download the Wlan-NG distribution from Linux-Wlan.org and unpack into a directory of your choice. You DO NOT need the Kernel source.
2. Go into the directory and run “make config”.
3. Choose “yes” for the _cs AND_usb driver and “no” for others (unless you need others). Leave the rest of the questions blank.
4. After this command is finished, run “make all” to compile the source.
5. After compilation is finished, run “make install” to install the modules (you need to be root to do that, use “su” or “sudo” if you are not).
6. Go to the “/etc/wlan” directory and copy the “wlan-DEFAULT” file to whatever SSID your network is using (wlan-SSID). Open the file in a text editor and add your network settings.
7. Insert the card into the USB slot. You should see something like this in the /var/log/messages file:

kernel: Writing 4096 bytes to ram @0×7e2ffe
kernel: Writing 4096 bytes to ram @0×7e3ffe

kernel: hfa384x_docmd: ctlx failure=REQ_FAILED
wlan.agent[7786]: Failed to enable the device, resultcode= implementation_failure .
wlan.agent[7786]: WLAN Could not bring up wlan0
kernel: hfa384x_drvr_start: cmd_initialize() failed, result=-5
kernel: prism2sta_ifstate: hfa384x_drvr_start() failed,result=-5

The error messages are normal, they are shown because the device needs to be turned on first. If you don’t see these messages at all, try removing and reinserting the adaptor. If that doesn’t help, run “/sbin/rmmod prism2_usb” and “/sbin/modprobe prism2_usb” to remove and reinsert the module.
8. Run “/sbin/wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable” as root. This command will turn on the radio in the adaptor. For some reason, it fails to do it automatically. You should received the following message:

message=lnxreq_ifstate
ifstate=enable
resultcode=success

9. Run command “cd /etc/pcmcia/” to switch to the PCMCIA directory.
10. Run command “./wlan-ng start wlan0 2>&1″ to start the adaptor. You should see the following message in your logs :

kernel: linkstatus=CONNECTED

11. Set the IP address of your adaptor via “/sbin/ifconfig wlan0 192.168.0.55″ command.
12. If you are using this network for sharing an Internet connection, than you need to add a default route via “/sbin/route add default gw x.x.x.x” where “x.x.x.x” is the IP address of your gateway.

UPDATE #1: After upgrading to Fedora Core 3 with the latest kernel, this adapter suddenly stopped working even with my procedure described above. Stayed tuned for more information.

Tags: , , ,

Permalink | Trackback URL | This post has

  1. 22 Responses to “DLink DWL-122 USB on Fedora Core 2”

  2. I’m trying to do this in Fedora and the make config process complains that it needs the kernel source. Just a heads up cuz apparently it needs the kernel source after all (I got this same msg using Mandrake 10)

    By Apu on Feb 22, 2005

  3. On my configuration (FC2) the headers are included in the regular kernel RPM.

    By netwizard on Feb 22, 2005

  4. Hi, I went over you howto with my USB D-link DWL 122 WiFi NIC on my Fedora Core 3 (2.6.10-1.766_FC3) and it works! Whoooo! Thanks for help!

    By Noovi on Mar 3, 2005

  5. doesn’t work for me. it never detects the insertion of the adaptor and when i run /sbin/rmmod prism2_usb, i am told the module does not exist in /proc/modules.

    the the best of my knowledge i did everything else correctly?

    By ken on Mar 9, 2005

  6. After some troubleshooting over IM, ken’s problem has been solved

    By netwizard on Mar 9, 2005

  7. I’ve successfully brought my DWL-122 alive under fedora core 3, thanks for your detailed instruction. By the way, is there any way to make the wireless adapter assigned IP address automatically by DHCP instead of “ifconfig” and “route” it?

    By SiMing Weng on Mar 13, 2005

  8. You can try running ‘/sbin/dhclient wlan0′ as root INSTEAD of the ifconfig command.

    By netwizard on Mar 13, 2005

  9. Thank you very much! My Syntax USB-400 has the exact same problem as yours (when running kernel > 2.6.9 and wlan-ng v0.2.1-pre26), and it’s currently up and running now. Appreciate that ~

    By Wilson on Mar 21, 2005

  10. I’d like to appreciate your sharing experience with us. I got another problem. My wireless connection has been established and there was no problem browsing the web, but the connection becomes dead every time I try to ssh to the linux box. There’s no error messages in /var/log/messages at all. Can I say that such a wireless connection is not valid for remote login? Have you ever tried to ssh to your linux box through the wireless? Cheers

    By SiMing Weng on Mar 22, 2005

  11. I never tried SSHing into my box, but SSH out of my box works just fine. I would recommend retesting with a wireline Ethernet network before blaming it on the wireless. It could be an issue with the firewall or the network configuration which blocks SSH connections.

    By netwizard on Mar 23, 2005

  12. In step 1 I installed linux-wlan-ng-0.2.1-pre26.tar.gz from the referenced site, but there is no wlan-ng command as described in step 10. I ran an ‘updatedb && locate wlan-ng’ and there is no file named wlan-ng outside of the directory I extracted the tarball into:
    [root@shuttle pcmcia]# uname -a
    Linux shuttle 2.6.10-1.770_14.rhfc3.at #1 Fri Mar 4 11:34:31 EST 2005 i686 athlon i386 GNU/Linux
    [root@shuttle pcmcia]# /sbin/wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable
    message=lnxreq_ifstate
    ifstate=enable
    resultcode=success
    [root@shuttle pcmcia]# pwd
    /etc/pcmcia
    [root@shuttle pcmcia]# ./wlan-ng start wlan0
    -bash: ./wlan-ng: No such file or directory

    So close! What did I do wrong?

    By stu on Mar 28, 2005

  13. Make sure to include the PCMCIA _cs driver as well.

    By netwizard on Mar 30, 2005

  14. With FC3 and latest kernel, I seem to be pretty much working (NetworkManager has started and detected networks). It turned out that I needed to actually run this:

    /sbin/wlanctl-ng wlan0 lnxreq_ifstate ifstate=disable

    (note that’s *disable)
    then:

    cd /etc/pcmcia
    ./wlan-ng start wlan0 2>&1

    *then*

    /sbin/wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable

    (enable this time). I was getting complaints in /var/log/messages that the firmware couldn’t be written while it was enabled.

    hth

    By tolan on Mar 30, 2005

  15. Thanks but it doesn’t work for me

    By netwizard on Mar 30, 2005

  16. I’m hoping that your instructions will work on FC3 as well, but ‘make config’ will not let me get past specifying a location for the Linux source directory. How did you “leave this blank” (default is /usr/src/linux)?

    By spindel on Apr 18, 2005

  17. It worked for me with blank but you can try to specify the source directory manually (its either /lib/modules/X.XX.XX/something or /usr/src/redhat).

    By netwizard on Apr 19, 2005

  18. I had a similiar problem with an usb-wlan interface(netgear ma-111).
    Reading your Blog helped me solving:

    wlanctl-ng wlan0 lnxreq_ifstate ifstate=enable
    wlanctl-ng wlan0 lnxreq_autojoin ssid=MYESSID authtype=opensystem

    Thank you
    paoga

    By paoga on May 13, 2005

  19. according to d-link support:

    The DWL-122 uses a Prism 3 chipset. You may be able to obtain drivers for the DWL-122 in Linux from the Chipset manufacturer. Please visit D-Links FAQ section for more help: http://support.dlink.com/faq/view.asp?prod_id=357

    i tried all the things above and couldn’t get my usb adapter to connect. i am running fc3. i tried both pre25 and pre26, for kernels 2.6.11-1.27 and 2.6.9-1.667

    does fc4 solve any of these issues?

    By draku on Jun 22, 2005

  20. Sorry I am quite new with linux. What does it mean the instruction 6?

    >6. Go to the “/etc/wlan” directory and copy the >”wlan-DEFAULT” file to whatever SSID your network >is using (wlan-SSID).

    How do I know where to copy wlan-DEFAULT?

    Thanks.

    By peter on Sep 18, 2005

  21. For example, if the SSID is ’somenetwork’, you would run the following command:

    cp wlan-DEFAULT wlan-somenetwork

    By netwizard on Sep 19, 2005

  22. I am using core 4, and I can not get it to work.
    firmware failes to load, any clue?
    My network is using wep, but I have disabled it,
    no sucess.

    By hans petter on May 1, 2006

  23. I am using core 4, and I can not get it to work.
    firmware failes to load, any clue?
    My network is using wep, but I have disabled it,
    no sucess.

    By hans petter on May 1, 2006

Post a Comment