2007-09-26 06:22:15     zd1211rw on isp1760

Document created by Aaronwu Employee on Aug 8, 2013
Version 1Show Document
  • View in full screen mode

2007-09-26 06:22:15     zd1211rw on isp1760

Manolo van Ee (NETHERLANDS)

Message: 44563   

 

Hi,

 

I'm trying to connect a USB WLAN device with zd1211 chipset to the blackfin with the isp1760 USB controller. Uploading the firmware seems to work fine, but then things start going wrong. The problem is that I know absolutely nothing about USB and don't know where to start. Below is the log output. Does anybody have any ideas?

 

Regards,

Manolo

 

Jan  1 00:21:33 blackfin user.info kernel: usb 1-1.1: new high speed USB device using isp1761 and address 6

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1: default language 0x0409

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1: new device strings: Mfr=16, Product=32, SerialNumber=0

Jan  1 00:21:33 blackfin user.info kernel: usb 1-1.1: Product: USB2.0 WLAN

Jan  1 00:21:33 blackfin user.info kernel: usb 1-1.1: Manufacturer: ZyDAS

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1: uevent

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1: usb_probe_device

Jan  1 00:21:33 blackfin user.info kernel: usb 1-1.1: configuration #1 chosen from 1 choice

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1: adding 1-1.1:1.0 (config #1, interface 0)

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1:1.0: uevent

Jan  1 00:21:33 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: usb_probe_interface

Jan  1 00:21:33 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: usb_probe_interface - got id

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1: print_id() 0ace:1215 v4810 high

Jan  1 00:21:33 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: zd_netdev_alloc() netdev->flags 0x1002

Jan  1 00:21:33 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: zd_netdev_alloc() netdev->features 0x00000000

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1: request_fw_file() fw name zd1211/zd1211b_ub

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1: upload_firmware() firmware device id 0x4810 is equal to the actual de

vice id

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1: request_fw_file() fw name zd1211/zd1211b_uphr

Jan  1 00:21:33 blackfin user.debug kernel: usb 1-1.1: upload_code() transfer size 4096

Jan  1 00:21:34 blackfin user.debug kernel: usb 1-1.1: upload_code() transfer size 1024

Jan  1 00:21:34 blackfin user.debug kernel: usb 1-1.1: upload_code() firmware confirm return value 0x01

Jan  1 00:21:34 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: zd_usb_enable_int()

Jan  1 00:21:34 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: zd_usb_enable_int() submit urb 002dc380

Jan  1 00:21:34 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: zd_chip_init_hw()

Jan  1 00:21:34 blackfin user.warn kernel: intr period 1 uframes,

Jan  1 00:21:34 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: dump_cr() CR_AFTER_PNP 0x00000000

Jan  1 00:21:35 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: zd_usb_ioread16v() read timed out

Jan  1 00:21:35 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: zd_ioread32v_locked() error: zd_ioread16v_locked. Error numb

er -110

Jan  1 00:21:35 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: dump_cr() error reading CR_GPI_EN. Error number -110

Jan  1 00:21:35 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: zd_usb_disable_int() urb 002dc380 killed

Jan  1 00:21:35 blackfin user.debug kernel: zd1211rw 1-1.1:1.0: probe() couldn't initialize mac. Error number -110

Jan  1 00:21:35 blackfin user.info kernel: usb 1-1.1: reset high speed USB device using isp1761 and address 6

Jan  1 00:21:35 blackfin user.debug kernel:  usbdev1.6_ep01: ep_device_release called for usbdev1.6_ep01

Jan  1 00:21:35 blackfin user.debug kernel:  usbdev1.6_ep82: ep_device_release called for usbdev1.6_ep82

Jan  1 00:21:35 blackfin user.debug kernel:  usbdev1.6_ep83: ep_device_release called for usbdev1.6_ep83

Jan  1 00:21:35 blackfin user.debug kernel:  usbdev1.6_ep04: ep_device_release called for usbdev1.6_ep04

Jan  1 00:21:35 blackfin user.warn kernel: zd1211rw: probe of 1-1.1:1.0 failed with error -110

Jan  1 00:21:35 blackfin user.debug kernel: usb 1-1.1:1.0: uevent

Jan  1 00:21:35 blackfin user.err kernel: usb 1-1.1: device_add(1-1.1:1.0) --> -110

Jan  1 00:21:35 blackfin user.debug kernel: hub 1-1:1.0: state 7 ports 3 chg 0000 evt 0002

QuoteReplyEditDelete

 

 

2007-09-27 04:04:32     Re: zd1211rw on isp1760

Frederik Schmid (SWEDEN)

Message: 44608    Hi, I recently got a zd1211 based USB-stick somewhat working on blackfin. I mainly had issues with unaligned data loads/stores in the driver that I had to work around.

 

I wrote a HOWTO while doing this that might, or might not help.

 

Regards,

Frederik Schmid

Rubico AB

 

=== Patching the kernel ===

 

The kernel tested had a number of alignment errors on our blackfin architecture.

The following patches should at least get the driver working:

 

file zd1211w.patch:

 

--- uClinux-dist/linux-2.6.x/drivers/net/wireless/zd1211rw/zd_mac.c     2007-01-12 11:09:28.000000000 +0100

+++ uClinux-dist-patches/linux-2.6.x/drivers/net/wireless/zd1211rw/zd_mac.c     2007-09-26 09:53:07.000000000 +0200

@@ -947,12 +947,14 @@

{

        struct sk_buff *skb;

 

-       skb = dev_alloc_skb(sizeof(struct zd_rt_hdr) + length);

+       skb = dev_alloc_skb(sizeof(struct zd_rt_hdr) + length + 1);

        if (!skb) {

                dev_warn(zd_mac_dev(mac), "Could not allocate skb.\n");

                return -ENOMEM;

        }

-       skb_reserve(skb, sizeof(struct zd_rt_hdr));

+       skb_reserve(skb, sizeof(struct zd_rt_hdr) + 1);

+       /* Avoid unalignment caused by rx_status by pulling a single byte */

+       skb_pull(skb, 1);

        memcpy(__skb_put(skb, length), buffer, length);

        skb_queue_tail(&mac->rx_queue, skb);

        tasklet_schedule(&mac->rx_tasklet);

Only in uClinux-dist-patches/linux-2.6.x/drivers: .svn

diff -aru uClinux-dist/linux-2.6.x/net/ieee80211/ieee80211_tx.c uClinux-dist-patches/linux-2.6.x/net/ieee80211/ieee80211_tx.c

--- uClinux-dist/linux-2.6.x/net/ieee80211/ieee80211_tx.c       2007-01-10 09:32:17.000000000 +0100

+++ uClinux-dist-patches/linux-2.6.x/net/ieee80211/ieee80211_tx.c       2007-09-26 09:51:08.000000000 +0200

@@ -40,6 +40,7 @@

#include <linux/wireless.h>

#include <linux/etherdevice.h>

#include <asm/uaccess.h>

+#include <asm/unaligned.h>

 

#include <net/ieee80211.h>

 

@@ -126,6 +127,7 @@

static u8 P802_1H_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0xf8 };

static u8 RFC1042_OUI[P80211_OUI_LEN] = { 0x00, 0x00, 0x00 };

 

+

static int ieee80211_copy_snap(u8 * data, u16 h_proto)

{

        struct ieee80211_snap_hdr *snap;

@@ -144,8 +146,8 @@

        snap->oui[1] = oui[1];

        snap->oui[2] = oui[2];

 

-       *(u16 *) (data + SNAP_SIZE) = htons(h_proto);

-

+       put_unaligned(htons(h_proto), (u16 *) (data + SNAP_SIZE));

+

        return SNAP_SIZE + sizeof(u16);

}

 

 

Patches apply to uClinux-dist-2007R1-RC3

 

 

=== Kernel configuration ===

 

Type make linux_menuconfig in the uClinux root folder, select:

 

-> Networking

  -> Networking support (NET [=y])

    -> Generic IEEE 802.11 Networking Stack (IEEE80211 [=y])

    -> Software MAC add-on to the IEEE 802.11 networking stack

 

-> Device Drivers

  -> Network device support

    -> Network device support (NETDEVICES [=y])

      -> Wireless LAN (non-hamradio)

        -> Wireless LAN drivers (non-hamradio) & Wireless Extensions (NET_RADIO [=y])

          -> ZyDAS ZD1211/ZD1211B USB-wireless support

 

 

=== uClinux configuration ===

 

Type make config_menuconfig in the uClinux root folder, select:

 

Network Applications  --->

--- Wireless-tools

[*] dhcpcd-new

[*] wireless_tools support

[*] iwconfig (NEW)

[*] iwgetid (NEW)

[*] iwlist (NEW)

[*] iwpriv (NEW)

[*] iwspy (NEW)

 

 

=== Firmware ===

 

Get the firmware needed at:

 

http://sourceforge.net/projects/zd1211/

 

Extract the tarball to /lib/firmware/zd1211 of the system.

 

The kernel signals userspace with a hotplug event when firmware is ready to be loaded.

The following lines should be added to /sbin/hotplug

 

#!/bin/sh

 

# Useful for hotplug event debugging

#env >> /var/log/hotplug.log

 

 

if [ "${FIRMWARE}x" != "x" ]; then

    echo 1 > /sys/$DEVPATH/loading

    cat /lib/firmware/$FIRMWARE > /sys/$DEVPATH/data

    echo 0 > /sys/$DEVPATH/loading

fi

 

 

=== WLAN configuration ===

 

ifconfig <device> up

iwconfig <device> essid "My Network" | iwconfig <device> essid any

dhcpcd <device> &

 

Example:

 

ifconfig eth1 up

iwconfig eth1 essid "Aurorum Science Park"

dhcpcd eth1 &

 

It may take a while obtain an ip address

 

 

=== Bugs ===

 

* It doesn't seem to work to detach and the re-attach the USB-stick without rebooting.

QuoteReplyEditDelete

 

 

2007-09-27 04:15:45     Re: zd1211rw on isp1760

Frederik Schmid (SWEDEN)

Message: 44609    Btw, this forum is buggy!

 

In konqueror I got no newlines in my post and with firefox my attached file didn't seem to show up anywhere.

QuoteReplyEditDelete

 

 

2007-09-27 05:59:59     Re: zd1211rw on isp1760

Manolo van Ee (NETHERLANDS)

Message: 44623   

 

Hi Frederik,

 

Thanks for your reply. I managed to do this in a similar way, but only with the SL811HS USB controller. Now I'm using the ISP1760 hi-speed controller, but it seems to get stuck in the communication somewhere.

 

Did you (or anyone else) use the ISP1760?

 

I have to say that I connected the ISP1760 in a completely different way from what is done on the ADDS-USB20-EZEXT. So I wonder whether someone got it working on that board, what will indicate that the problem lays in my interface to the chip, or that it is a generic problem with this driver.

QuoteReplyEditDelete

 

 

2007-09-27 06:35:57     Re: zd1211rw on isp1760

Frederik Schmid (SWEDEN)

Message: 44625    Hi Manolo, I haven't used the ISP1760. For the USB WLAN stick I used ISP1362.

 

Regards,

Frederik

QuoteReplyEditDelete

 

 

2007-09-28 01:08:57     Re: zd1211rw on isp1760

Sonic Zhang (CHINA)

Message: 44673   

 

Please submit this patch to our patch tracker and sent to LKML for review.

 

 

QuoteReplyEditDelete

 

 

2008-10-16 14:57:44     Re: zd1211rw on isp1760

Alex Pereira (BRAZIL)

Message: 63807   

 

Hi,

 

I'm trying to setup a Wifi interface using BF537 stamp. I'm using the same usb device, host and kernel version as Frederik Schmid did. Right now, when I insert the driver module the following kernel messages are logged:

 

bus usb: add driver zd1211rw

usbcore: registered new interface driver zd1211rw

zd1211rw initialized

 

 

When I insert the USB device the kernel logs the following messages:

 

hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0004

hub 1-0:1.0: port 2, status 0101, change 0001, 12 Mb/s

hub 1-0:1.0: debounce: port 2: total 100ms stable 100ms status 0x101

usb 1-2: new full speed USB device using isp1362-hcd and address 2

usb 1-2: default language 0x0409

usb 1-2: new device strings: Mfr=16, Product=32, SerialNumber=32

usb 1-2: Product: USB2.0 WLAN

usb 1-2: Manufacturer: ZyDAS

usb 1-2: SerialNumber: USB2.0 WLAN

DEV: registering device: ID = '1-2'

bus usb: add device 1-2

usb 1-2: uevent

usb: Matched Device 1-2 with Driver usb

usb: Probing driver usb with device 1-2

usb 1-2: usb_probe_device

DEV: registering device: ID = 'usbdev1.2_ep00'

usb 1-2: configuration #1 chosen from 1 choice

usb 1-2: adding 1-2:1.0 (config #1, interface 0)

DEV: registering device: ID = '1-2:1.0'

bus usb: add device 1-2:1.0

usb 1-2:1.0: uevent

DEV: registering device: ID = 'usbdev1.2_ep01'

DEV: registering device: ID = 'usbdev1.2_ep82'

DEV: registering device: ID = 'usbdev1.2_ep83'

DEV: registering device: ID = 'usbdev1.2_ep04'

CLASS: registering class device: ID = 'usbdev1.2'

class_uevent - name = usbdev1.2

class_device_create_uevent called for usbdev1.2

drivers/usb/core/inode.c: creating file '002'

bound device '1-2' to driver 'usb'

usb: Bound Device 1-2 to Driver usb

hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0004

 

 

It seems that something is missing because the probe function of the driver were no executed. Does someone knows how to proceed? I don't really need a hotplug feature, I'm using this procedure because I don't know other. Is there other method then hotpluging to setup a wifi card?

 

Thanks,

 

Alex

 

 

QuoteReplyEditDelete

 

 

2008-10-17 00:39:58     Re: zd1211rw on isp1760

Bryan Wu (CHINA)

Message: 63830   

 

I noticed you were using isp1362 instead of isp1760.

 

usb 1-2: new full speed USB device using isp1362-hcd and address 2

 

Maybe Fred can provide some info about this USB WIFI card. We don't have such device and can not provide more information abou this.

 

-Bryan

Attachments

    Outcomes