Hallo!

I own a X-MICRO WLAN 11b USB Adapter. But it does not work with the kernel version 2.6.1 correctly. If I plug the adapter in, I get the following messages:

hub 3-0:1.0: new USB device on port 1, assigned address 2
usb 3-1: device not accepting address 2, error -110
hub 3-0:1.0: Cannot enable port 1.  Maybe the USB cable is bad?

After a litle searching, I found in the Linux USB FAQ, that I should look at /proc/interrupts to see if the interrupt count for the host controller driver goes up. This happens on my system.

After looking to the www.x-micro.com, I found a linux driver for the adapter. But the main problem is, that it is for the 2.4.xx kernel family. In the driver package there is a desription, how to patch the kernel, but all the described things are 2.4.xx related. I didn't had success by porting the changes from 2.4.xx to 2.6.1, because of the big changes in 2.6.1 in the core/usb.c/usb_new_device.

You can find bellow the original 2.4.xx code and the X-MICRO changes in 2.4.xx. Could you please help me to port this changes also in the 2.6.1?

Best regards,
nihil


---original-code-2.4.xx------------------------------------------------

int usb_new_device(struct usb_device *dev)
{
        int err;

        /* USB v1.1 5.5.3 */
        /* We read the first 8 bytes from the device descriptor to get to */
        /*  the bMaxPacketSize0 field. Then we set the maximum packet size */
        /*  for the control pipe, and retrieve the rest */

        dev->epmaxpacketin [0] = 8;
        dev->epmaxpacketout[0] = 8;

        err = usb_set_address(dev);
        if (err < 0) {
                err("USB device not accepting new address=%d (error=%d)",
                        dev->devnum, err);
                clear_bit(dev->devnum, &dev->bus->devmap.devicemap);
                dev->devnum = -1;
                return 1;
        }

        wait_ms(10);    /* Let the SET_ADDRESS settle */

        err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, &dev->descriptor, 8);
        if (err < 8) {
                if (err < 0)
                        err("USB device not responding, giving up (error=%d)", err);
                else
                        err("USB device descriptor short read (expected %i, got %i)", 8, err);
                clear_bit(dev->devnum, &dev->bus->devmap.devicemap);
                dev->devnum = -1;
                return 1;
        }

        dev->epmaxpacketin [0] = dev->descriptor.bMaxPacketSize0;
        dev->epmaxpacketout[0] = dev->descriptor.bMaxPacketSize0;

      ....
       
---x-micro-code-2.4.xx------------------------------------------------
int usb_new_device(struct usb_device *dev)
{
      int err;
      int addr;

      /* USB v1.1 5.5.3 */
      /* We read the first 8 bytes from the device descriptor to get to */
      /* the bMaxPacketSize0 field. Then we set the maximum packet size */
      /* for the control pipe, and retrieve the rest */

      dev->epmaxpacketin [0] = 8;
      dev->epmaxpacketout[0] = 8;

      printk("Address: %d\n", dev->devnum);
      addr = dev->devnum;
      dev->devnum = 0;

      err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, &dev->descriptor, 8);
      if (err < 8) {
             if (err < 0)
                    err("USB device not responding, giving up (error=%d)", err);
             else
                    err("USB device descriptor short read (expected %i, got %i)", 8, err);
             clear_bit(dev->devnum, &dev->bus->devmap.devicemap);
             dev->devnum = -1;
             return 1;
      }

     dev->epmaxpacketin [0] = 8;
     dev->epmaxpacketout[0] = 8;
     dev->devnum = addr;

     err = usb_set_address(dev);
     if (err < 0) {
          err("USB device not accepting new address=%d (error=%d)",
                 dev->devnum, err);
          clear_bit(dev->devnum, &dev->bus->devmap.devicemap);
          dev->devnum = -1;
          return 1;
     }

     wait_ms(10);       /* Let the SET_ADDRESS settle */

     dev->epmaxpacketin [0] = dev->descriptor.bMaxPacketSize0;
     dev->epmaxpacketout[0] = dev->descriptor.bMaxPacketSize0;

    ....


Reply via email to