Alan Stern wrote:

On Tue, 22 Jun 2004, Tommy Faasen wrote:



Hi,

I have a sweex usb-wifi stick see also http://sourceforge.net/projects/linux-lc100020/ and it's forums.
And I have 2 machines
Machine 1: Via kt133a chipset -> uhci_hcd
Machine 2: Sis 748 Chipset -> ohci_hcd


The device works without a problem on machine 2 with at least kernels 2.6.6 and 2.6.7.
The usb wifi stick fails to accept an address on machine 1. There is a good faq about it with things you can try. (turn off acpi, irq for usb, no irq sharing, removing all pci cards,etc) I tried everything but with no luck.



Your kernel log showed that interrupts were getting delivered okay, so that's not the problem.




I tried kernels 2.4.26 till and including 2.6.7 without luck, however on the same machine is also connected an usb joystick that works without a problem, so my usb does work.

The usb wifi stick is known to need to get a descriptor before settings it's address but even with this patch I can't get it to work ( I didn't need the patch for machine 2).



Can you give a URL for the patch you're talking about?


I have attached the patch for your convenience.

I don't understand -- if the stick is known to need to transfer a
descriptor before setting its address, how come it works on machine 2 when
you set the address first?



Several people indicated that they needed that patch before getting the stick to work, I guess that intel/via hardware is the most common. A person on the forum uses an intel board with the patch to get it to work. So I guess it is indeed needed, I can't explain why, nor am I aware of differences between uhci and ohci except for the fact that I read that ohci does more in hardware.

I read some usb specs/docs kernel usb stuff, but since I'm no expert I cannot see where the problem is, therefore posted below is some information that hopefully is helpfull to you.

Please let me know what else I can do to help,



Other people have reported similar problems, and I'd like to know the answer. The fact that the stick fails with both 2.4 and 2.6 kernels indicates it's not some recent change to the driver that messed something up.



I forgot to mention that I got it to work once with the patch on machine 1 with kernel 2.4.23 but I was unable to reproduce that. Unfortunatly I can't seem to find logs about that.

Have you tried plugging the wifi stick into the other USB port, the port currently used by the joystick? Maybe that will make a difference...



Yes I tried both ports on both hubs, the joystick works on all ports.

Alan Stern

.




diff -ru linux-2.6.7/drivers/usb/core/hub.c linux-2.6.7.rxq/drivers/usb/core/hub.c
--- linux-2.6.7/drivers/usb/core/hub.c  2004-06-16 07:19:22.000000000 +0200
+++ linux-2.6.7.rxq/drivers/usb/core/hub.c      2004-06-22 12:02:17.000000000 +0200
@@ -1045,6 +1045,20 @@
        return retval;
 }
 
+/* Try to get the descriptor from a device without address set. 
+ * e.g. ZyDAS ZD1201 won't accept an address until this is done
+ */
+int usb_get_descriptor_broken(struct usb_device *dev)
+{
+       char buffer[8];
+       int retval;
+
+       retval = usb_control_msg(dev, usb_rcvdefctrl(dev), 
+               USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, USB_DT_DEVICE<<8, 0, buffer,
+               8, HZ * USB_CTRL_GET_TIMEOUT);
+       return retval;
+}
+
 /* reset device, (re)assign address, get device descriptor.
  * device connection is stable, no more debouncing needed.
  * returns device in USB_STATE_ADDRESS, except on error.
@@ -1154,6 +1168,8 @@
         * set in certain configurations".  Yes, really.
         */
        for (i = 0; i < GET_DESCRIPTOR_TRIES; ++i) {
+               usb_get_descriptor_broken(udev);
+               msleep(200);
                for (j = 0; j < SET_ADDRESS_TRIES; ++j) {
                        retval = hub_set_address(udev);
                        if (retval >= 0)

Reply via email to