Page 1 of 3 123 LastLast
Results 1 to 10 of 24
  1. #1

    Exclamation Linux drivers for USB WiFi device

    First I'd like to say I think I'm almost there, but need help with getting Make to work. Now here's the context:

    I've bought a USB WiFi dongle thing so that I can use my PC on my wireless network. It's a ZyDAS ZD1211, and it works ok in Windows XP for sharing files and internet, and netstumbler works - good for looking at the signal strength.
    However, other programs like aircrack and airodump - which I wanted to try to test my network security - don't seem to be compatible with the zd1211, under windows.
    Looking at this site, , which documents airodump, it seems that it could still work under Linux.

    I've got Ubuntu Linux (Breezy Badger) on an old-ish PC, so figured I'd have a go setting up the WiFi dongle on it. This is where it just gets more and more complicated.

    I'm in serious need of a step-by-step guide or something here.

    I've downloaded an open-source Linux driver for the zd1211 from here: and have extracted it. Now I'm a little baffled by the whole "make" process. In the beginning the terminal told me there was no such command. After some fiddling I found that Ubuntu doesn't include make by default, so I installed the package for it. Now I can type "sudo make" while in the directory of the driver, which makes a lot of text appear, but it ends up with the error "No rule to make target 'modules'. Stop." Now this seems like a nice sort of error with the driver's makefile rather something of my doing. But I really don't know. Maybe I'm trying to install the wrong driver altogether.

    So, any insight from the world? How do I make the driver for the USB WiFi dongle work under Linux?


  2. #2
    Join Date
    Dec 2004

    Default Re: Linux drivers for USB WiFi device

    I'm using the same USB dongles. For XP.

    The drivers you want for Linux, if you have the ZD1211 are here

    The guide for the above say:

    The User Guide of ZD1211 USB Linux Driver

    Amendment History
    Release Date Release Version Release Person Release Description
    2005.11.25 1.6 MingZhou Cai Add Customize PID/VID Section
    2005.09.15 1.5 MingZhou Cai Add Dual band operation
    2005.08.31 1.4 MingZhou Cai Revise Continuous Tx Operation
    2005.08.08 1.3 MingZhou Cai Modification of compile process
    2005.08.01 1.2 MingZhou Cai Continuous Tx Operation
    2005.06.15 1.1 MingZhou Cai Add setRegion operation
    2005.06.06 1.0 MingZhou Cai This document is based on ZD1212 User Guide. Descriptions of unsupported operation is removed.

    1. Introduction:

    Because more and more people install the Linux operating system in the desktop and notebook, we provide the Linux solution of our ZD1211 802.11a+b+g Wireless LAN Card. ZD1211 provides 802.11 a+b+g wireless solution for USB interface. In our ZD1211 solution, we can run in the Infrastructure (Managed), Ad-hoc or AP (Master) modes. One can easily change these modes. This document is intended to describe how to setup and how to use ZD1211 under the Linux operating system.

    2.1 Requirements:

    1. Kernel 2.4+ . The driver had success built in Redhat9, Fedora Core2,3 ,and Debian 3.1. You can easily build it without any problem

    2. To build zd1211 you will need: Configured kernel source code for the kernel you are running. Ideally, Configured means that you have at least run 'make config', 'make enuconfig', or 'make xconfig'. If your platform is not SMP system, please don't config SMP supported, because when module loaded, this will make unresolved symbol.

    3. Make sure your kernel usb 2.0 support is running
    - Use lsmod to check "ehci-hcd" module is loaded.
    - If host is not support usb 2.0, zd1211 will run under pure-b mode.

    2. Building the device driver:
    In this section, we will describe how to build our ZD1211 Linux driver under the Linux operating system.

    2.1 Uncompress the package:
    tar zxvf ZD1211LnxDrv_xxxx.tar.gz (where xxxx is the version number, such as 2_0_0_0)

    The first thing one should do is uncompress this package by tar. After untar this package, you can see the source files. One should change directory into this directory for proceeding the next step.

    2.2 Build and install the package:

    The package contains drivers for ZD1211 and ZD1211B. If you doesn’t have specified request, both of them will be installed.
    Under the extracted directory, there is a Makefile in it. Because our driver can support for kernel 2.4 and kernel 2.6, there are two sets of rule in the Makefile. One has to modify the Makefile according to the path of “kernel source tree” and the version of the kernel in your system. In the Makefile, you may see the following statements,
    # if the kernel is 2.6.x, turn on this
    # if the kernel is 2.4.x, turn on this
    If you want to build the kernel under the kernel of 2.4.x, one has to let the variable KERN_24=y and comment the KERN_26=y like that as the example above and modify the variable KERNEL_SOURCE to the path which you install the kernel source. After doing these things, one just need to type the “make”, and the driver module will be generated and installed.

    2.3 Install individual driver:
    If you only need driver of ZD1211 or ZD1211B, you can issue :

    make clean
    make ZD1211REV_B=0 (0 for ZD1211, 1 for ZD1211B)
    make ZD1211REV_B=0 install (0 for ZD1211, 1 for ZD1211B)

    to install the driver.

    2.4 Build the debugging tool:
    There are two debugging tools in this package, “apdbg” and “menudbg”. Run “make debug” to compile them both. If you don’t have the ncurse library, you may get some error messages while compiling menudbg. You can ignore it and get apdbg only

    3. Getting Start:
    3.1 Load the driver:
    One can use the modprobe –v zd1211(or zd1211b) to load our driver. In order to check whether our driver is loaded successfully, one can use the “lsmod” for this check. If our driver is loaded successfully, the following messages should be seen
    zd1211 183576 0 (unused)
    Please note that the 183576 may not be the same as that in your system.

    3.2 Open the network interface:
    In our driver, we will stop all the commands until the network interface assigned to us is opened. One can open the network interface by the following command
    ]$ ifconfig ethX up
    ]$ ifconfig ethX <IP address>

    3.3 Configure the Wireless settings
    In our driver, we support the wireless extension commands to control our driver.

    essid :
    Set the ESSID (or Network Name - in some products it may also called Domain ID). The ESSID is used to identify cells which are part of the same virtual network.

    iwconfig ethX essid <ESSID>
    Set the operation mode of our device.

    iwconfig ethX <mode>
    Managed (Infrastructure Station mode)
    Ah-hoc (Ad hoc mode)
    Master (Access Point mode)

    Set the channel in the device.

    iwconfig ethX channel <channel>
    The channel can vary from 1 to 14. One should note that, the set channel command will not work under the Managed (infrastructure mode). Because in the in this mode, the channel should change to channel of the AP we want to associate.

    Set the RTS Threshold.

    iwconfig ethX rts 250
    Set the Fragmentation Threshold.

    iwconfig ethX frag 512

    Used to manipulate encryption or scrambling keys and encryption mode. To set the current encryption key, just enter the key in hex digits as XXXX-XXXX-XXXX-XXXX or XXXXXXXX. To set a key other than the current key, append [index] to the key itself. You can also enter the key as an ASCII string by using the s: prefix. To change which key is the current active key, just enter [index] (without entering any key value). off and on disable and reenable encryption, open set the system in open mode (accept non-encrypted packets) and restricted discard non-encrypted packets.

    Examples :
    iwconfig ethX key 0123-4567-89 [1]
    iwconfig ethX key [1] open
    iwconfig wlan0 key off
    Used to manipulate the power management scheme mode.

    iwconfig ethX power on (Turn on power saving mode)
    iwconfig ethX power off (Turn off power saving mode)

    3.4 Private commands:
    Except for commands support for wireless extension, we also define some commands for us to set parameters to our driver. One can use the “iwpriv” for this purpose.

    3.4.1 Set authentication type:
    One can set the authentication to our driver by the following command:
    ]$ iwpriv ethX set_auth <Auth Type>
    0: Open System
    1: Shared Key
    Be aware that shared key authentication requires a WEP key.

    3.4.2 Set preamble type:
    One can set the preamble type to our driver by the following command:
    ]$ iwpriv ethX set_preamble <Preamble Type>
    0: Long preamble
    1: Short preamble

    3.4.3 Get preamble type:
    One can get the preamble type of our driver by the following command:
    ]$ iwpriv ethX get_preamble

    3.4.4 Set MAC mode:
    Because the ZD1211 is a+b+g solution, we support the PURE_A, PURE B, PURE G and Mixed mode in our driver. One can use the following command to change the MAC mode in our driver.

    ]$ iwpriv ethX set_mac_mode <MAC mode>
    1: Mixed Mode
    2: Pure G Mode
    3: Pure B Mode
    4: Pure A Mode

    3.4.5 Get MAC mode:
    One can get the MAC mode of our driver by the following command
    ]$ iwpriv ethX get_mac_mode

    3.4.6 Connect to the given Access Point:
    One can associate with the given Access Point with a given Cell Number by the following
    ]$ iwpriv ethX connect <Cell Number>
    The Cell Number is got from the site survey operation by the doing “iwlist” command.
    We recommend that user uses the following scenario under the Managed
    (Infrastructure) or Adhoc mode. One can first do the site survey command by the following command:

    ]$ iwlist ethX scanning
    Then, associate with the AP with the Cell number got from the iwlist command.
    ]$ iwlist ethX connect <Cell Number>

    3.4.7 Dynamical Region Setting(For 802.11b/g only)
    From ver 1.5, you can dynamically change the region settings. With different regions, the allowed channels are different. The private commands to get/set region information includes :
    1. get_Region : To get the current region setting
    iwpriv ethX get_Region  You will get a region string.
    2. set_Region : To set the region
    iwpriv ethX set_Region <RegionID> (refer tofollowing table)

    RegionID Region String Channel Countries
    1 USA 1-11 USA,Canada,Argentina,Brazil,Ukraine,China,HongKong
    2 Taiwan/Europe 1-13 Taiwan, Europe, Spain, AustriaBelgium, Switzerland, Australia
    3 France 10-13 France, Singapore
    4 Japan 1-14 Japan
    5 Israel 3-9 Israel
    6 Mexico 10-11 Mexico
    The table of region id and region string

    3.4.8 Activate MIC Fail Counter Measure Feature:
    The feature will disable the network connection for one minutes when you get two MIC fail frame in one minute. The feature is initially disabled. You can activate the feature by using the apdbg tool.
    $ apdbg ethX s_mic_cnt 0 1

    Or inactivate it.
    $ apdbg ethX s_mic_cnt 0 0

    Or get its current state
    $ apdbg ethX g_mic_cnt 0 0

    3.5 Set up IP address:
    If you use the RedHat distribution Linux, you can edit the /etc/sysconfig/network-scripts/ifcfg-ethX or edit the /etc/network/interfaces under the Debian to set up the IP address on booting process. Or one can use the netconfig command for ip address setting.
    We provide two types setting in the following examples. One is to assign a fix IP address, netmask, and default gateway. Another is to get IP configuration from a DHCP server.

    3.5.1 Fixed Setting:
    # This is an example of fixed IP setting

    3.5.2 Get IP setting from DHCP:
    # This is an example of getting ip from DHCP server.

    3.5.3 Setting Access Point: The typical setting procedure:
    - ]$iwconfig ethx mode master // Set to AP mode
    - ]$iwconfig ethx essid ssid // Set ssid
    - ]$iwpriv ethx set_mac_mode mac_mode //Ref section 3.4.4 Set MAC mode
    - ]$iwconfig ethx channel channel# // Available channel # is1,2,3,4..etc

    3.6 Continuous TX Operation
    When you make the driver, you also get the apdbg configuration tool. One of its most important feature is to enable/set continuous tx operation.

    3.6.1 Turn On/Off Continuous TX Operation
    Usage :
    iwconfig ethX mode monitor ( only issue for 1 time)
    apdbg ethX cont_tx 0 RateID

    This command will start the continuous tx with your specified rate. When the rate is greater than 0xB, it turn off the operation. Please remember that if you want to change different rate or channel, you must turn off continuous tx operation first.

    The RateID Table
    RateID TX Rate
    0 1M
    1 2M
    2 5.5M
    3 11M
    4 6M
    5 9M
    6 12M
    7 18M
    8 24M
    9 36M
    A 48M
    B 54M
    C Turn Off

    3.7 Working with Linux WPA supplicant.

    Note: I do the following procedure in Fedora Core2, for other distribution package, you may need install additional libraries required to build the wpa supplicant..

    3.7.1 Setup the Linux wpa supplicant
    - Copy wpa_supplicant.tar.gz file into a subdirectory on Linux system.
    - Unzip it by using command:
    tar zxvf wpa_supplicant.tar.gz
    Then, a subdirectory of wpa_supplicant/ will be created under the current
    - Enter subdirectory wpa_supplicant/
    - Delete the original .config file by:
    ]$ rm –f .config

    - Edit Makefile, make sure the following statements in mkconfig: section:
    echo CONFIG_IEEE8021X_EAPOL=y >> .config
    echo CONFIG_EAP_MD5=y >> .config
    echo CONFIG_MSCHAPV2=y >> .config
    echo CONFIG_EAP_PEAP=y >> .config
    echo CONFIG_EAP_TLS=y >> .config
    echo CONFIG_DRIVER_WEXT=y >> .config
    echo CONFIG_WIRELESS_EXTENSION=y >> .config
    echo CONFIG_DRIVER_ZYDAS=y >> .config
    - Create the new .config file by:
    ]$ make mkconfig
    - Now, we can build the Linux wpa supplicant by entering following command:
    ]$ make
    After make process completed, A executable file wpa_supplicant created.
    - To create a WPA PSK connection, please modify the configuration file (For detailed description , you can refer to the original sample configuration file: wpa_supplicant.conf) wpa_supplicant_psk.conf to meet wpa-psk test condition.

    Sample settings for wpa-psk:
    pairwise=CCMP TKIP
    group=CCMP TKIP WEP104 WEP40
    Similarily, for wpa eap-tls and wpa peap, its sample setting block:
    pairwise=CCMP TKIP
    group=CCMP TKIP WEP104 WEP40
    The fluffy.pem is created by:
     openssl pkcs7 -in fluffy.p7c -inform DER -print_certs -outform PEM -out fluffy.pem
     openssl pkcs12 -in fluffy.pfx -passin passassword -out fluffy.pem -cacerts -nokeys
    The id_key.pem is created by
    > openssl pkcs12 -in fluffy.pfx -passin passassword -passout passassword -out id_key.pem -nocerts
    The id.pem is created by
    > openssl pkcs12 -in fluffy.pfx -passin passassword -out id.pem –nokeys
    You can run openssl utility (Included in in Microsoft Windows OS.
    The detailed description, please refer to CertConvReadme.txt. (Located in lnx_wpa_supplicant.tar.gz)

    For WPA PEAP

    - After modifying, use the following command to setup WPA connection.
    If the zd1211 is not open yet, please open it firstly by command:
    ]$ ifconfig eth1 up <IP address of the network interface>
    After network interface is opened, enter the command to build wpa psk connection:
    ]$ ./wpa_supplicant -ieth1 -c wpa_supplicant_psk.conf -d -D zydas
    To build wpa eap-tls
    ]$ ./wpa_supplicant -ieth1 -c wpa_supplicant_tls.conf -d -D zydas
    To build wpa peap:
    ]$ ./wpa_supplicant -ieth1 -c wpa_supplicant_peap.conf -d -D zydas

    @-i: interface name: eth1
    @-c: Configuration file: wpa_supplicant_psk.conf
    @-D: The name of network interface.
    You will see the following message if wpa-psk connection is built successfully.
    WPA: Sending EAPOL-Key 2/2 ---> The Group handshake is about to finish.
    EAPOL: SUPP_PAE entering state SUCCESS
    EAP: EAP entering state SUCCESS
    EAPOL: SUPP_BE entering state IDLE

    Note of wpa supplicant operation issue:
    The WPA supplicant should be keep running during connection. If you press
    Ctrl-C to stop the wpa supplicant, it will also close the network interface card
    by "zd1205_close" call back routine. So you have to issue ifconfig ethx up again
    before using the network interface card.

    3.8 Customization of VID/PID Table
    Someone may want to drive any NIC with ZD1211 chipset. But, if its VID/PID isn’t listed in the driver, the linux kernel won’t load the zd1211 driver to serve the device. You can add the device’s VID/PID to the driver source. Then, the kernel will load driver next time you plug the USB dongle.

    In the source file, src/zdusb.c, A static structure, zd1211_ids, stores the VID/PID list of supported products. You can add your dongle’s VID/PID here. Then, remake and install the driver and plug the dongle. You will see it works now.

    4. Conclusion
    This document doesn’t explain how to setup the wireless LAN environment in detail. One may get some problems when setting up the wireless LAN environment. If you have any question about how to set up the environment, you can send an e-mail to us or find the solution on the network.

    - How to create certificate file and private key file.
    1. First, please install a personal certficate via a web browser(IE 6.0 or later) to a Radius server (Windows 2003 Server or Windows 2000 Server edition).
    2. Open MS IE6.0 or later, Select 工具->網際網路選項->內容->憑證


    選 “是, 匯出…..”

    加選 “如果可能的話……..”

    Input Password. This password will be the same password in –passin parameter input.

    Input filename , then press Next to finish the certificate exporting.
    The exported certficate file will be suffixed with extension name: “.pfx”. and you can use this file to generate 1. Root Certficate 2. Personal Certificate 2. Personal Private key. Which are required in WPA EAP-TLS mode.
    Last edited by Speedy Gonzales; 14-05-2006 at 07:49 PM.

  3. #3

    Exclamation Re: Linux drivers for USB WiFi device

    Thanks for that Speedy, but I'm afraid that doesn't quite fix it.

    Using the manufacturer's driver is a good idea, don't know how I missed it, but I think the other driver is ok too. The problem seems to be with Make. I get the same error trying to Make the ZyDAS official driver as from the other one:

    "Entering directory '/lib/modules/2.6.12-10-386/build'
    *** No rule to make target 'modules'. Stop."

    What causes this? What does it want?

  4. #4
    Join Date
    Dec 2004

    Default Re: Linux drivers for USB WiFi device

    Quote Originally Posted by Atreides
    Thanks for that Speedy, but I'm afraid that doesn't quite fix it.

    Using the manufacturer's driver is a good idea, don't know how I missed it, but I think the other driver is ok too. The problem seems to be with Make. I get the same error trying to Make the ZyDAS official driver as from the other one:

    "Entering directory '/lib/modules/2.6.12-10-386/build'
    *** No rule to make target 'modules'. Stop."

    What causes this? What does it want?
    Thats a good question. I have no idea. I've never used Linux.

    Might have to wait, until one of the Linux guys reply.

  5. #5
    Moderator Jen's Avatar
    Join Date
    Dec 2004

    Default Re: Linux drivers for USB WiFi device

    If you are going to be compiling modules under Ubuntu, then you have to have the kernel headers (or source) installed otherwise you are not going to get far. Pretty sure this isn't by default with Ubuntu.

    I found some discussions and a sort of semi-complete how-to guide for that driver under Ubuntu which may help:

    ZD1211 driver - forum discussion.

    Request: WPA supplicant 0.3.9 with ZYDAS support - forum discussion.

    WifiDocs/Driver/zydas zd1211 - Wiki: semi-complete, but has some information further down the page which may help.

  6. #6

    Arrow Re: Linux drivers for USB WiFi device

    Linux makes my head fall off!

    Where do I get kernel headers for Ubuntu? What are kernel headers?
    Is this related to it? The 'linux-tree' bit?
    "sudo apt-get install linux-tree
    sudo apt-get update
    sudo apt-get install build-essential
    sudo apt-get install kernel-package
    sudo apt-get install gcc
    sudo apt-get install libncurses5
    sudo apt-get install libncurses5-dev
    sudo apt-get install libqt3-mt-dev
    sudo apt-get install wireless-tools"

    That comes from this forum how-to which was linked to from the wiki you mentioned, Jen. I think progress might be made from here, but I'll acknowlege your reply now. Thanks! I'll post again when I have progress or another wall...


  7. #7

    Exclamation Re: Linux drivers for USB WiFi device

    Well. This How-To seemed pretty good, certainly detailed, seemed to be setting everything up pretty well.

    In /usr/src I've now got Ubuntu source and linux headers and OpenSSL source and WPA Supplicant source and the zd1211 driver source and symbolic links and things, and I've got various other bits and pieces of the sytem updated too.

    But at the line in the how-to which finally tells me to type "sudo make"... I get the same error as before.
    "No rule to make target 'modules'. Stop."

    Stupid brick walls. I want my Windozer. It may not work with network analysing tools, but at least the network works! You stick the CD in, you plug in the USB thing, up pops a screen and you say, 'Yeah, install the driver please,' and it does. Why can't Linux? Why?

    Persistence is called for. Tomorrow this will resume... But I need help again.

  8. #8
    I said WHAT... dolby digital's Avatar
    Join Date
    Dec 2004
    Near Harvey Normans; no deposit, nothing to pay for 50 years, and then they take your house.

    Default Re: Linux drivers for USB WiFi device

    Good luck getting it going. I have a DSE PCI wireless card which is supposed to be Linux compatible. I tried Knoppix and SUSE 10.0 and it would recognise it but I could never get it to go. Its on my list of things to do.
    No cloud is perfect...

  9. #9

    Arrow Re: Linux drivers for USB WiFi device

    I suppose that part of the problem is that I don't really know what it is that "installing a driver involves. What are the parts that have to happen? A whole lot of recompiling bits and pieces of source of kernels and the driver... What exactly are 'linux headers'? And what is a 'module'? Since that is what seems to get the error... No rule to 'make' it.

  10. #10
    Pedant and proud of it
    Join Date
    Dec 2004

    Default Re: Linux drivers for USB WiFi device

    make is a clever piece of software which makes it possible for mere humans to do things like this. It drives the compilation process for all the bits and pieces needed to make an object module. A module is pretty much the same as what is called "driver" in Windows. A device drive in *nix can be a module (which can be loaded only when needed) or it can be built into the kernel so it is always there. (The driver for the boot disk is almost always built in. )

    When you type make , it looks for a file called "Makefile" in the current directory. Often, that is enough. But many Makefiles contain information for a number of devices, models, or different options. If so, the make command needs to be given arguments. That long screed above shows some arguments to be given, depending on what model of the thing you have.
    Very often, after the make process has completed successfully you need to run make again: make instal, which causes it to put the module in the right place, and often, run some scripts to modify system configuration files so it will work properly. It's all rather complicated. And it usually works.

    When make drops out with that "no target" message it means that it doesn't know what target (final result) you want.

    To compile muopdules, you need the development package. Tht's the compiler and its associated tools, and at least the header files of the source for your version. The header files are definitions which define all sorts of things in the kernel. A module which doesn't know lots of things about the kernel it won't work.

Similar Threads

  1. Device drivers
    By Richard in forum PressF1
    Replies: 9
    Last Post: 04-07-2008, 09:14 AM
  2. Device Drivers
    By WILLWILLWILLWILL in forum PressF1
    Replies: 6
    Last Post: 01-07-2004, 11:26 AM
  3. Device Drivers
    By tkelly in forum PressF1
    Replies: 2
    Last Post: 07-05-2004, 10:45 PM
  4. Device Drivers
    By z832z5762 in forum PressF1
    Replies: 1
    Last Post: 05-01-2004, 04:55 PM
  5. Dos Device Drivers
    By in forum PressF1
    Replies: 1
    Last Post: 04-02-2002, 01:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts