Mastermode Implementation of zd1211 on Ubuntu10.04LTS

Source: Internet
Author: User
There is a tiscali USB card on the hand, that is, the famous "God Card", this card can be used as a general B/g wireless network card, but also can be set to a soft AP. Zd1211rw: Ubuntu10.04LTS contains the zd1211 driver, called zd1211rw. This driver is not provided by the manufacturer, but a rewrite driver. Rw drivers are built in after linux2.1.18-rc1. General users can use them without having to find their own drivers.

There is a tiscali USB card on the hand, that is, the famous "God Card", this card can be used as a general B/g wireless network card, but also can be set to a soft AP.


Zd1211rw:

Ubuntu 10.04 LTS contains the zd1211 driver, known as zd1211rw. This driver is not provided by the manufacturer, but a rewrite driver.

The rw driver is built in linux 2.1.18-rc1. Generally, you do not need to find the driver on your own, so you can use a wireless network card with zd1211 or zd1211b. However, the rw driver does not support the AP function. When the sudo iwconfig wlan0 mode master command is used, an error is returned:


Error for wireless request "Set Mode" (8B06 ):
SET failed on device wlan0; Invalid argument.


See ubuntu documentation (https://help.ubuntu.com/community/WifiDocs/MasterMode), which mentions how to implement zd1211 master mode recommendations: Use VendorBasedDriver.


VendorBasedDriver:

To use VendorBasedDriver, you need to find a suitable version of the driver source code and recompile and load it. As shown in the following figure, first find

Http://zd1211.wiki.sourceforge.net/VendorBasedDriver.

In fact, this version does not solve the problem, and even the compilation cannot be completed. If you are interested, try it.

Because this version cannot be compiled successfully, I can only search for it online and find an updated source code of zd1211.

The http://code.google.com/p/open1211/ provides a very new zd1211 source code that is said to be able to complete compilation on 2.6.33. However, as the Code does not provide a complete description, new people like me still cannot compile the source code obtained from open1211, and once again fail.

The reason for the compilation failure is estimated to be due to the improvement of the Linux kernel version, which makes the Declaration and reference of the Source Code no longer apply to the kernel. To solve this problem, I changed the search method on google and tried to find a solution on the Linux forum.


Http://www.mail-archive.com/zd1211-devs@lists.sourceforge.net/msg01760.html


There areZd1211InLinux 2.6.31Compilation failure. Here we find the basic solution to the problem. By the way, this address is broken down and can only be seen after it is rolled over.

Because the discussion is still quite long, I won't copy it up. Let's talk about the key points.

Hin-Tak Leung (The name seems to be a Hong Kong man.)PairZd1211The source codePatch. To implementZd1211In a later versionLinuxTo compile the kernel, You need to compile the source code of the old version.Patch.Hin-Tak LeungA total2VersionsPatch: ar2524-3.0.0.56AndZd1211-2.22.0.Ar2524YesZd1211Is also usedZyDAS zd1211Chip, so the driver can communicate with each other.

We canHttp://htl10.users.sourceforge.net/patchsets/Download the corresponding versionPatchset. InHttp://www.kernel.org/pub/linux/kernel/people/mcgrof/zd1211/DownloadableAr2524-3.0.0.56Driver source code. Unfortunately, I cannot find it.ZD1211LnxDrv_2_22_0_0.


Compile:

First, determine your ownLinuxVersion:Uname-r, And then

Apt-cache search linux-source:


jx@jx-laptop:~$ apt-cache search linux-source
linux-source - Linux kernel source with Ubuntu patches
linux-source-2.6.32 - Linux kernel source for version 2.6.32 with Ubuntu patches

Download and install the kernel source code

Sudo apt-get install linux-source-2.6.32
With apt-get this can not download, and later on the official website to download the linux-source-2.6.32_2.6.32-22.36_all.deb

Sudo ipkg-I linux-source-2.6.32_2.6.32-22.36_all.deb

Cd/usr/src
Sudo tar jxvf linux-source-2.6.32.tar.bz2
Build a folder linux-source-2.6.32

DownloadAr2524-3.0.0.56And correspondingPatchDecompress and usePacthCommand source codePatch,For examplePatch <0001-xxxxIn this way. RememberSrcFolder.PatchOperation. Otherwise, an error occurs.PatchCommon11From0001To0012,Where0004Is bad. It is said that0004It was too big to be split. If you are interested, you can search by yourself.PatchAfter that, the preparation is basically complete. to confirm whether the NIC is inAr2524In the support scope, I want to check. Insert the NIC, and thenLsusbTo check the network cardID:Bus 001 Device 008: ID 0ace: 1211 ZyDAS 802.11bg
NoteIdThe following information:0ace 1211 (Each person's Nic may be different.). Then enterSrvFolder,Vi zdusb. c,Find/* Table of devices that work with this driver */
Static struct usb_device_id zd1211_ids [] = {
# Ifdef ZD1211B
{USB_DEVICE (VENDOR_ZYDAS, 0x1215 )},
{USB_DEVICE (VENDOR_ZYDAS, 0xA215 )},
# If ZDCONF_FULL_IDS = 1
{USB_DEVICE (0x0053, 0x5301 )},
{USB_DEVICE (0x0053, 0x5302 )},
{USB_DEVICE (0x2019, 0x5303)}, // Add, 2006.04.17
{USB_DEVICE (0x0471, 0x1236 )},
{USB_DEVICE (0x050D, 0x4050 )},
{USB_DEVICE (0x050D, 0x705C )},
{USB_DEVICE (0x0586, 0x340F )},
/* Table of devices that work with this driver */

Static struct usb_device_id zd1211_ids [] = {

# Ifdef ZD1211B

{USB_DEVICE (VENDOR_ZYDAS, 0x1215 )},

{USB_DEVICE (VENDOR_ZYDAS, 0xA215 )},

# If ZDCONF_FULL_IDS = 1

{USB_DEVICE (0x0053, 0x5301 )},

{USB_DEVICE (0x0053, 0x5302 )},

{USB_DEVICE (0x2019, 0x5303)}, // Add, 2006.04.17

{USB_DEVICE (0x0471, 0x1236 )},

{USB_DEVICE (0x050D, 0x4050 )},

{USB_DEVICE (0x050D, 0x705C )},

{USB_DEVICE (0x0586, 0x340F )},

{USB_DEVICE (0x079B, 0x0062 )},

{USB_DEVICE (0x083A, 0x4505 )},

{USB_DEVICE (0x083A, 0xE501 )},

{USB_DEVICE (0x0BAF, 0x0121 )},

{USB_DEVICE (0x0CDE, 0x001A )},

{USB_DEVICE (0x0DF6, 0x9075 )},

{USB_DEVICE (0x0F88, 0x3014 )},

{USB_DEVICE (0x079B, 0x0062 )},
{USB_DEVICE (0x083A, 0x4505 )},
{USB_DEVICE (0x083A, 0xE501 )},
{USB_DEVICE (0x0BAF, 0x0121 )},
{USB_DEVICE (0x0CDE, 0x001A )},
{USB_DEVICE (0x0DF6, 0x9075 )},
{USB_DEVICE (0x0F88, 0x3014 )},
{USB_DEVICE (0x1233, 0x0471)},/* vid <-> pid reversed typo for earlier Philip USB stick? */
{USB_DEVICE (0x1582, 0x6003 )},
{USB_DEVICE (0x04bb, 0x0938 )},
# Endif
# Elif defined (ZD1211)
{USB_DEVICE (VENDOR_ZYDAS, PRODUCT_1211 )},
{USB_DEVICE (VENDOR_ZYDAS, PRODUCT_A211 )},
# If ZDCONF_FULL_IDS = 1
{USB_DEVICE (VENDOR_ZYXEL, PRODUCT_G220 )},
{USB_DEVICE (VENDOR_3COM, PRODUCT_A727 )},
{USB_DEVICE (0x2019, 0xc008 )},
{USB_DEVICE (0x2019, 0xc009 )},
{USB_DEVICE (0x079b, 0x004a )},
{USB_DEVICE (0x07b8, 0x6001 )},
{USB_DEVICE (0x0b3b, 0x1630 )},
{USB_DEVICE (0x0b3b, 0x5630 )},
{USB_DEVICE (0x0b3b, 0x6630 )},
{USB_DEVICE (0x0cde, 0x0011 )},
{USB_DEVICE (0x0df6, 0x9071 )},
{USB_DEVICE (0x126f, 0xa006 )},
{USB_DEVICE (0x129b, 0x1666 )},
{USB_DEVICE (0x1435, 0x0711 )},
{USB_DEVICE (0x0DF6, 0x9071 )},
{USB_DEVICE (0x0105, 0x145F )},
{USB_DEVICE (0x0ace, 0x1211 )},
# Endif

# Endif
Look at your NicIDIf not, add it. When you add them, you need to differentiate them:Zd1211bAndZd1211It is different. After modification, save and exit. There is another job to do before compilation.(In fact, it can also be done after compilation), The originalZd1211rwToBlacklistNow:Sudo vi/etc/modprobe. d/blacklist. conf, Add at the endBlacklist zd1211rw. NextSudo rm/lib/firmware/zd1211/zd *Zd1211rwOfFirmwareAlso delete. Of course, you 'd better back up the data first to avoid regret.BlacklistAfter,Reboot.OK, Which can be compiled:Ar2524drvRun in the folder:Sudo makeThere are a large numberWarning, Ignore it directly... The eyes are not clear. Remember to useSudo makeDon'tMakeOtherwise, you must manually installZd1211.koAnd so on. Finished? Finished. Plug-in card.Dmesg:

[2, 183.789784] usb 1-1: new high speed USB device using ehci_hcd and address 2
[2, 183.967465] usb 1-1: configuration #1 chosen from 1 choice
[183.998424]
[183.998442] _____ ____ _ ____
[183.998453] |__/_ | _ \/___ |
[183.998495] // | /_\\___\
[183.998506] // | _ |/___ \ ___) |
[183.998517]/____ \__, | ____/_/\_\____/
[1, 183.998526] | ___/
[1, 183.998538] zd1211-version 3.0.0.56
[2, 184.000173] vendor_id = 0ace
[184.000195] product_id = 1211
[184.000219] USB 2.0 Host
[184.001956] Release Ver = 4330
[184.002434] EEPORM Ver = 4330
[2, 184.015447] Finsih download Firmware. Ready to reboot
[1, 184.301238] PA type: 0
[2, 184.305927] RFMD RF
[184.781297] Overwrite CR47 = 0x1E
[184.861737] zd1205_config: EEP (HWFeature) = 0x110
[1, 184.868787] AllowedChannel = 0000000ff
[1, 184.868852] Region: 16

[2, 185.980995] usbcore: registered new interface driver zd1211Because each person's network adapter is different, some information may be different. Now, the network card compilation and loading are complete. However, there are many compilation processes.WarningI don't know if the driver can be used. UseIwconfigLet's see:Jx @ jx-laptop :~ $ Iwconfig
Lo no wireless extensions.
Eth0 no wireless extensions.
Ppp0 no wireless extensions.
Ath0 802.11b/g nic essid :""
Mode: Managed Frequency = 2.462 GHz Access Point: Not-Associated
Bit Rate: 0 kb/s
Retry: on RTS thr = 9999 B Fragment thr: off
Power Management: off
Link Quality: 0 Signal level: 0 Noise level: 0
Rx invalid nwid: 0 Rx invalid crypt: 0 Rx invalid frag: 0
Tx excessive retries: 0 Invalid misc: 3 Missed beacon: 0
Very good. It seems that the load is normal. The key is to try it.Master modeIf not, you will be busy:Jx @ jx-laptop :~ $ Sudo ifconfig ath0 192.168.1.1 up
Jx @ jx-laptop :~ $ Sudo iwconfig ath0 mode master
Jx @ jx-laptop :~ $
Use a wireless network adapter to search for an access point with a strange name. Hey, it's done! Also, it's not over! Not verified yet.APConfigure. However, at leastMaster modeYes.
BTW: I still want to find a solution that can solve all the problems of warning...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.