On Thu, 11 Oct 2001, Jean Tourrilhes wrote:
> Sorry to bother you, but I wanted to give more details about
> the crash. It took me a bit of trying to get my box to not instantly
> freeze.
[...]
> After the first packet sent to the dongle, things go very
> funky. I've got this weird error message and all my URB timeout. Then,
> when the uhci module is remove, I've got a nice oops.
Hi Jean and Johannes,
let me step in here with something I've just realized with irda-usb which
might be related to this problem:
I was always concerned because, according to the logs, the call to
usb_get_class_descriptor() failed (-32, EPIPE) for me (ACT-IR2000U) when
the irda-usb tried to read the irda-usb class descriptor. However, the
driver did work without problem, due to the fallback to scan for
interleaved extra descriptors.
Apparently, your problem might be triggered at this very situation:
> usb.c: registered new driver irda-usb
> Vendor: 9c4, Product: 11
> IRDA-USB found at address 2
> uhci.c - uhci_alloc_urb_priv() - Insert at 9029
> uhci.c - uhci_alloc_urb_priv() - Insert at 9029
> usb-irda: set interface 0 result -32
> uhci.c - uhci_alloc_urb_priv() - Insert at 9029
> uhci.c - uhci_alloc_urb_priv() - Insert at 9030
> irda_usb_probe(), Clearing stall on control interface
> irda_usb_parse_endpoints(), And our endpoints are : in=02, out=01 (64),
> int=03
> uhci.c - uhci_alloc_urb_priv() - Insert at 9030
> irda_usb_find_class_desc(), ret=-32
> usb-irda: usb_get_class_descriptor failed (0xffffffe0)
> irda_usb_find_class_desc(), parsing extra descriptors ...
I've just realized, this failure is expected to happen:
usb_get_class_descriptor() uses the standard USB_REQ_GET_DESCRIPTOR
request to read the class descriptor. The USB-IrDA class spec 1.0 in
section 6.1.3 however, requires the device to STALL any attempt to read
the class descriptor when the _standard_ request is used!
It is this STALL condition on EP0 which makes usb_get_class_descriptor
returning EPIPE - and, I might be wrong, but it might be the combination
with VIA and uhci that triggers the problem for you - probably JE could
comment on this. I've only used usb-ohci so far which works for me.
Currently the irda-usb falls back trying to find the class specific
descriptor interleaved with standard descriptors. At least according to
USB 1.1 spec. this _may_ work, but is _not_ required - So we are just
lucky with the IR2000U and probably with other current dongles too.
The clean solution obviously is to use the class specific
(interface) request, as given in 6.2.5 of USB-IrDA spec.
Below a first (tested!) try that solves the issue for me. Of course, the
define has to be moved into irda-usb.h for some final application.
Martin
------------------------------
static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_device *dev,
unsigned int ifnum)
{
struct irda_class_desc *desc;
int ret;
desc = kmalloc(sizeof (*desc), GFP_KERNEL);
if (desc == NULL)
return NULL;
memset(desc, 0, sizeof(*desc));
/* USB-IrDA class spec 1.0:
* 6.1.3: Standard "Get Descriptor" Device Request is not
* appropriate to retrieve class-specific descriptor
* 6.2.5: Class Specific "Get Class Descriptor" Interface Request
* is mandatory and returns the USB-IrDA class descriptor
*/
#define IU_REQ_GET_CLASS_DESC 0x06 /* 6.2.5, USB-IrDA class spec 1.0 */
ret = usb_control_msg(dev, usb_rcvctrlpipe(dev,0),
IU_REQ_GET_CLASS_DESC,
USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
0, ifnum, desc, sizeof(*desc), MSECS_TO_JIFFIES(500));
IRDA_DEBUG(0, __FUNCTION__ "(), ret=%d\n", ret);
if (ret < sizeof(*desc)) {
WARNING("usb-irda: class_descriptor read %s (%d)\n",
(ret<0) ? "failed" : "too short", ret);
}
else if (desc->bDescriptorType != USB_DT_IRDA) {
WARNING("usb-irda: bad class_descriptor type\n");
}
else {
#ifdef IU_DUMP_CLASS_DESC
irda_usb_dump_class_desc(desc);
#endif /* IU_DUMP_CLASS_DESC */
return desc;
}
kfree(desc);
return NULL;
}
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel