OpenWrt Forum Archive

Topic: WRT54G3G and Huawei E870 running Kamikaze 8.09_RC2

The content of this topic has been archived on 25 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi to everybody.

I've just loaded my WRT54G3G-EU with the latest OpenWRT 8.09_RC2. I've found that there is a problem with the HSDPA card, and that it's impossible to access the USB-serial device. The card is a Huawei E870 ExpressCard (with an adaptor to be used in a PCMCIA slot).

This card identifies as "vendor=0x12d1 product=0x1003", just like the Huawei E220 USB HSDPA modem. I suppose tha both are the same device internally, having the E870 an extra expresscard interface.

Until a year ago, I was using one of these E220 modems in my laptop, that was running Slackware. The E220 had a problem caused by the fact that it was really two devices: a modem and a storage device. Every time I plugged the E220, the usbserial module was initialized incorrectly, due to the fact that both devices (modem and storage) were initialized almost at the same time.

I found that if the laptop was rebooted with the E220 plugged, the problem dissapeared. It seemed like the modem needed some time to power up and get ready to be initialized.

The E870 has a similar problem, but a bit more complicated to solve. The Expresscard only gets power when cardbus adapter is initialized, and that isn't time enough until E870's modules are loaded.

That's what we get at boot in a WRT54G3G-EU with the OpenWRT and all the needed modules (pcmcia, usb2, ohci, etc...), without any other modification:

Linux Kernel Card Services 3.1.22
  options:  [pci] [cardbus]
PCI: Enabling device 01:01.0 (0000 -> 0002)
Yenta ISA IRQ mask 0x06f8, PCI irq 2
Socket status: 30000820
cs: cb_alloc(bus 2): vendor 0x1033, device 0x0035
PCI: Enabling device 02:00.0 (0000 -> 0002)
PCI: Enabling device 02:00.1 (0000 -> 0002)
ip_conntrack version 2.1 (5953 buckets, 5953 max) - 360 bytes per conntrack
PCI: Setting latency timer of device 00:04.0 to 64
usb-ohci.c: USB OHCI at membase 0xb8004000, IRQ 2
usb-ohci.c: usb-00:04.0, PCI device 14e4:4716
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
PCI: Setting latency timer of device 02:00.0 to 64
usb-ohci.c: USB OHCI at membase 0xc0202000, IRQ 2
usb-ohci.c: usb-02:00.0, PCI device 1033:0035
usb.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found
hub.c: 3 ports detected
ehci_hcd 02:00.1: PCI device 1033:00e0
ehci_hcd 02:00.1: irq 2, pci mem c020b000
usb.c: new USB bus registered, assigned bus number 3
ehci_hcd 02:00.1: USB 2.0 enabled, EHCI 1.00, driver 2003-Dec-29/2.4
hub.c: USB hub found
hub.c: 3 ports detected
usb.c: registered new driver serial
usbserial.c: USB Serial support registered for Generic
usbserial.c: USB Serial Driver core v1.4
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
device wl0 entered promiscuous mode
br-lan: port 2(wl0) entering learning state
br-lan: port 2(wl0) entering forwarding state
br-lan: topology change detected, propagating
hub.c: new USB device 02:00.0-1, assigned address 2
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB0 (or usb/tts/0 for devfs)


As we can see, the usbserial module is loaded before usb-storage module, and only detects one serial port. This serial port is incorrectly initialized, and therefore it's impossible to use.

The order the modules are loaded in is determined by the file order in the /etc/modules.d:

root@OpenWrt:/etc/modules.d# ls /etc/modules.d/*
/etc/modules.d/20-scsi-core      /etc/modules.d/30-ppp            /etc/modules.d/41-ipt-conntrack  /etc/modules.d/50-usb2
/etc/modules.d/20-switch         /etc/modules.d/40-ipt-core       /etc/modules.d/42-ipt-nat        /etc/modules.d/50-wlcompat
/etc/modules.d/20-usb-core       /etc/modules.d/40-pcmcia-core    /etc/modules.d/45-ipt-nathelper  /etc/modules.d/60-usb-serial
/etc/modules.d/30-brcm-wl        /etc/modules.d/40-scsi-core      /etc/modules.d/50-usb-ohci       /etc/modules.d/60-usb-storage


What I've done to get an extra time before the usbserial module is loaded, is to delay the loading changing the order:

root@OpenWrt:~# ls /etc/modules.d/*
/etc/modules.d/20-scsi-core      /etc/modules.d/30-ppp            /etc/modules.d/41-ipt-conntrack  /etc/modules.d/50-usb2
/etc/modules.d/20-switch         /etc/modules.d/40-ipt-core       /etc/modules.d/42-ipt-nat        /etc/modules.d/50-wlcompat
/etc/modules.d/20-usb-core       /etc/modules.d/40-pcmcia-core    /etc/modules.d/45-ipt-nathelper  /etc/modules.d/60-usb-storage
/etc/modules.d/30-brcm-wl        /etc/modules.d/40-scsi-core      /etc/modules.d/50-usb-ohci       /etc/modules.d/65-usb-serial


With this little change, the E870 has time enough to power up two serial ports, and they are correctly detected and initialized by the usbserial module:

Linux Kernel Card Services 3.1.22
  options:  [pci] [cardbus]
PCI: Enabling device 01:01.0 (0000 -> 0002)
Yenta ISA IRQ mask 0x06f8, PCI irq 2
Socket status: 30000820
cs: cb_alloc(bus 2): vendor 0x1033, device 0x0035
PCI: Enabling device 02:00.0 (0000 -> 0002)
PCI: Enabling device 02:00.1 (0000 -> 0002)
ip_conntrack version 2.1 (5953 buckets, 5953 max) - 360 bytes per conntrack
PCI: Setting latency timer of device 00:04.0 to 64
usb-ohci.c: USB OHCI at membase 0xb8004000, IRQ 2
usb-ohci.c: usb-00:04.0, PCI device 14e4:4716
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
PCI: Setting latency timer of device 02:00.0 to 64
usb-ohci.c: USB OHCI at membase 0xc0202000, IRQ 2
usb-ohci.c: usb-02:00.0, PCI device 1033:0035
usb.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found
hub.c: 3 ports detected
ehci_hcd 02:00.1: PCI device 1033:00e0
ehci_hcd 02:00.1: irq 2, pci mem c020b000
usb.c: new USB bus registered, assigned bus number 3
ehci_hcd 02:00.1: USB 2.0 enabled, EHCI 1.00, driver 2003-Dec-29/2.4
hub.c: USB hub found
hub.c: 3 ports detected
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
usb.c: registered new driver serial
usbserial.c: USB Serial support registered for Generic
usbserial.c: USB Serial Driver core v1.4
hub.c: new USB device 02:00.0-1, assigned address 2
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: HUAWEI    Model: Mass Storage      Rev: 2.31
  Type:   CD-ROM                             ANSI SCSI revision: 02
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
device wl0 entered promiscuous mode
br-lan: port 2(wl0) entering learning state
br-lan: port 2(wl0) entering forwarding state
br-lan: topology change detected, propagating
usb.c: USB disconnect on device 02:00.0-1 address 2
hub.c: new USB device 02:00.0-1, assigned address 3
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB0 (or usb/tts/0 for devfs)
usbserial.c: Generic converter detected
usbserial.c: Generic converter now attached to ttyUSB1 (or usb/tts/1 for devfs)
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3


However, when it's plugged into my laptop, the E870 card shows three serial ports, not two as it shows when plugged into the WRT54G3G. I've done some test removing the initial loading of the usbserial module, and loading it manually some minutes later, and the E870 shows always only two serial ports.

Anyway, the fact is I have a working E870 on my WRT54G3G now.

The only problem I haven't solved is that the throughput is very low, about 500Kbps. With the original firmware from Linksys, I got nearly 3Mbps. I've read that there was a problem with the usbserial buffer size in early releases of Kamikaze. Is this bug solved in 8.09_RC2?

(Last edited by int21h on 1 Feb 2009, 14:05)

Forget the throughput problem. I thought that it was no necessary to set the maxSize at the loading of the module usbserial, but I've re-read the explanation and I've found my mistake.

Now I have a very good throughput !!!

hi int21h,
i already wrote email, but maybe you cant read it.
my question:
do you use kernel 2.6 or kernel 2.4?
i want to update to kernel 2.6 but i am not sure if its running. in the forum they didnt spoke about rc2 already, when i am right they only spoke that rc1 is not running.
greetings
peter

Also I suspect you are suffering from the ZeroCD issue which comes with the newer model HSDPA cards et al.  Card gets inserted and kernel detects it as a CD, then it takes a few mins and swaps over to being a USBModem.

There is talk about it on the umtsmon sourceforge site: http://umtsmon.sourceforge.net/cards/

Plus I have seen this code: http://www.pharscape.org/ozerocdoff.html

I also have a wrt54g3g, and hope to revive the openwrt-3g project, perhaps rehost it on sf or somewhere similar to support all sorts of different cards in the wrt54g3g.

All that the wiki guys need to do is FIX THIS LINK: http://wiki.openwrt.org/OpenWrtDocs/Har … s/WRT54G3G

neubau wrote:

hi int21h,
i already wrote email, but maybe you cant read it.
my question:
do you use kernel 2.6 or kernel 2.4?
i want to update to kernel 2.6 but i am not sure if its running. in the forum they didnt spoke about rc2 already, when i am right they only spoke that rc1 is not running.
greetings
peter

With WRT54G3G you have to use the 2.4 kernel, if you want to use the pcmcia slot.
You can also use the 2.6 kernel, but the pcmcia slot will not work.

hi int21h, I also used huawei E870 and wrt54g3g, can you tell how to change the file position in the /etc/modules.d in order that the usbserial module is loaded before usb-storage module, is it to use cat command? Thanks for you help?


oh, I know, you change file name~! haha !!!

(Last edited by happybit on 28 Nov 2009, 15:02)

The discussion might have continued from here.