Georg Acher wrote:
>
> On Tue, Mar 28, 2000 at 06:24:56PM +0000, Johan Verrept wrote:
> <...>
> > But that doesn't matter beacuse i have found out what the problem is.
> > I hooked up a CATC and behold!
> > The alternate interface set by me, specifies an out packet size of 32
> > bytes, and an in packet size of 64. (the alternative interfaces only
> > differ in the packets sizes...).
> > The linux machine however is sending larger packets (64 bytes).
> > So there is a bug there somewhere...
>
> Look at the maxsze-variable in uhci_submit_bulk_urb, this is the pipesize used
> for assembling packets. If it is wrong there, it's not HCD's fault.
It wrong there.
The usb_set_maxpacket() runs down all the alternative settings to
determine what is the maximum pacekt size. I don't think this is
correct.
It should run down all the interfaces and all the endpoints, but only on
the active alternate setting. At least, if you want to use this to
determine which packet size you are allowed to use in transmitting
packets!
It's actually a bug in usb.c then :-)
patch attached. ($Id: usb.c,v 1.58 2000/03/13 16:44:45 acher Exp $)
> > Did i say that ?
> > I can't remember trying anything else than usb-uhci, certainly not with
> > 2.3.99-pre2
>
> Hm, I thought I saw something in your mail. If it wasn't so, I withdraw
> everything ;-)
If i did, well, i'll withdraw those words ;-)
J.
--- usb.c.orig Tue Mar 28 20:37:43 2000
+++ usb.c Tue Mar 28 20:49:36 2000
@@ -1371,32 +1371,28 @@
static void usb_set_maxpacket(struct usb_device *dev)
{
- int i, j, b;
- struct usb_interface *ifp;
+ int i, b;
for (i=0; i<dev->actconfig->bNumInterfaces; i++) {
- ifp = dev->actconfig->interface + i;
+ struct usb_interface *ifp = dev->actconfig->interface + i;
+ struct usb_interface_descriptor *as = ifp->altsetting +
+ifp->act_altsetting;
+ struct usb_endpoint_descriptor *ep = as->endpoint;
+ int e;
- for (j = 0; j < ifp->num_altsetting; j++) {
- struct usb_interface_descriptor *as = ifp->altsetting + j;
- struct usb_endpoint_descriptor *ep = as->endpoint;
- int e;
-
- for (e=0; e<as->bNumEndpoints; e++) {
- b = ep[e].bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
- if ((ep[e].bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
==
- USB_ENDPOINT_XFER_CONTROL) { /* Control =>
bidirectional */
+ for (e=0; e<as->bNumEndpoints; e++) {
+ b = ep[e].bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
+ if ((ep[e].bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
+ USB_ENDPOINT_XFER_CONTROL) { /* Control =>
+bidirectional */
+ dev->epmaxpacketout[b] = ep[e].wMaxPacketSize;
+ dev->epmaxpacketin [b] = ep[e].wMaxPacketSize;
+ }
+ else if (usb_endpoint_out(ep[e].bEndpointAddress)) {
+ if (ep[e].wMaxPacketSize > dev->epmaxpacketout[b])
dev->epmaxpacketout[b] = ep[e].wMaxPacketSize;
+ }
+ else {
+ if (ep[e].wMaxPacketSize > dev->epmaxpacketin [b])
dev->epmaxpacketin [b] = ep[e].wMaxPacketSize;
- }
- else if (usb_endpoint_out(ep[e].bEndpointAddress)) {
- if (ep[e].wMaxPacketSize >
dev->epmaxpacketout[b])
- dev->epmaxpacketout[b] =
ep[e].wMaxPacketSize;
- }
- else {
- if (ep[e].wMaxPacketSize > dev->epmaxpacketin
[b])
- dev->epmaxpacketin [b] =
ep[e].wMaxPacketSize;
- }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]