X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=ppcskel.git;a=blobdiff_plain;f=usb%2Fcore%2Fcore.c;h=89d3f69c1a5e11a04e75c17319234aa40dfba62c;hp=47e236c1d59a295433e183d69e8b36381528f8be;hb=4bdf4447cdcbb235dc4d22a9c7ec2b481df1156b;hpb=f9935091a024bfad92e99a37e0f5b887e66b8b2c diff --git a/usb/core/core.c b/usb/core/core.c index 47e236c..89d3f69 100644 --- a/usb/core/core.c +++ b/usb/core/core.c @@ -104,7 +104,24 @@ usb_device *usb_add_device() /* 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));