X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=usb%2Fcore%2Fcore.c;h=89d3f69c1a5e11a04e75c17319234aa40dfba62c;hb=4bdf4447cdcbb235dc4d22a9c7ec2b481df1156b;hp=e3dffb24e4102e8f45259f139c58c5aa66d89af8;hpb=251726c276ab844095583d4c8d7607a30c0a802c;p=ppcskel.git diff --git a/usb/core/core.c b/usb/core/core.c index e3dffb2..89d3f69 100644 --- a/usb/core/core.c +++ b/usb/core/core.c @@ -100,14 +100,34 @@ usb_device *usb_add_device() dev->epTogl[2] = 0; char buf[64]; - u8 devdescr_size; - u8 address = usb_next_address(); /* ask first 8 bytes of device descriptor with this special * GET Descriptor Request, when device address = 0 */ - usb_control_msg(dev, 0x80, GET_DESCRIPTOR, 1, 0, 64, buf, 8, 0); + /* + * see page 253 in usb_20.pdf + * + * bmRequestType = 0x80 = 10000000B + * bRequest = GET_DESCRIPTOR + * wValue = DEVICE (Descriptor Type) + * wIndex = 0 + * wLength = 8 (in Bytes!?) + */ + usb_control_msg(dev, 0x80, GET_DESCRIPTOR, DEVICE, 0, 8, buf, 8, 0); + + /* + * length (here =64) should be "number of byte to transfer", not + * (as here) "number of bits to transfer. + * ? + */ + //usb_control_msg(dev, 0x80, GET_DESCRIPTOR, 1, 0, 64, buf, 8, 0); + printf("===========\nafter usb control msg:\n"); + hexdump(buf, sizeof(buf)); + +#if 0 + u8 devdescr_size; + u8 address = usb_next_address(); dev->bMaxPacketSize0 = (u8) buf[7] ? (u8) buf[7] : 1; //dirty? /* setup real ep0 fifo size */ devdescr_size = (u8) buf[0]; /* save real length of device descriptor */ @@ -155,6 +175,7 @@ usb_device *usb_add_device() list_add_tail(core.devices, tmp); usb_probe_driver(); +#endif return dev; } @@ -424,6 +445,7 @@ usb_transfer_descriptor *usb_create_transfer_descriptor(usb_irp * irp) td->endpoint = irp->endpoint; td->iso = 0; td->state = USB_TRANSFER_DESCR_NONE; + td->maxp = irp->epsize; return td; }