Re: strange(?) USB device with wMaxPacketSize = 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 12 Oct 2009, Tim Jones wrote:

> Hi. I've been trying to examine the operation of a USB device by
> snooping on it while it's running with its proprietary driver in a
> VirtualBox (closed source, PUEL edition, so no trickery on my part to
> get USB working) running Windows XP.

You're probably better off running a native XP kernel and using a 
program like SnoopyPro.  Virtual environments don't always get their 
USB emulation correct.

>  When the device is connected and
> on, the kernel starts spamming:
> usb 1-1: bogus endpoint ep1in in usb_submit_urb (bad maxpacket 0)
> usb 1-1: usbfs: usb_submit_urb returned -90
> continuously, without end. Examining the function usb_submit_urb in
> drivers/usb/core/urb.c of the kernel source tree (2.6.30) indicates
> that the issue is with a wMaxPacketSize descriptor equal to zero.
> Examining the descriptor tree of my device confirms that for the given
> interface, bAlternateSetting = 0, there is an endpoint 0x81 (otherwise
> reported in the error message as ep1in) for which wMaxPacketSize is
> zero.

(In fact the condition for logging that error message isn't quite
right.  It should be okay for maxpacket to be 0 provided the URB's
transfer_length is also 0.  But that's probably not true in your case 
anyway...)

>  (Find the complete descriptor tree `lsusb -d 05a9:a538 -v` at
> http://pastebin.ca/1616649 ). For the same interface, there is also an
> alternate bAlternateSetting = 1 for which there is an endpoint 0x81
> with wMaxPacketSize = 0x13fc (3x 1020 bytes). Now, at this juncture I
> am not familiar enough with standard USB operation to know what to
> expect from Alternate Settings on a given Interface. So as I read up
> on the standards, I appeal before the gods of linux-usb: is such a
> device with wMaxPacketSize = 0x00 simply insane?

It isn't, although it would be more natural for the device simply to
omit that endpoint entirely from altsetting 0.  The USB spec says that
devices are not supposed to use Isochronous endpoints in altsetting 0.  
That's why you see this weird remnant.

>  Is there some easy,
> or otherwise, way I could force the device to use bAlternateSetting =
> 0, just for the hell of it?

Presumably you mean altsetting 1.  No, only the device's driver can 
change the altsetting.

>  The device does appear to "just work"
> under a system booted into Windows (no virtualization), and in the
> meantime I'll try to snoop around there, if possible. I suppose I
> haven't given much information to work with here, but again, any
> insight on sanity of the device would be appreciated.

The descriptors look okay to me.  I'd suspect the virtualization before 
anything else.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux