On 15:12 Fri 04 Sep , Tom Rix wrote: > When developing usb device features, it is useful to print out > common usb structures. > > Signed-off-by: Tom Rix <tom....@windriver.com> > --- > include/usbdescriptors.h | 31 +++++++++++++ > include/usbdevice.h | 105 > ++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 136 insertions(+), 0 deletions(-) > > diff --git a/include/usbdescriptors.h b/include/usbdescriptors.h > index ea05672..f4e33b6 100644 > --- a/include/usbdescriptors.h > +++ b/include/usbdescriptors.h > @@ -510,4 +510,35 @@ struct usb_class_descriptor { > > } __attribute__ ((packed)); > > +#ifdef DEBUG > +#define PRINT_DEVICE_DESCRIPTOR(d) \ inline will be better > +do { \ > + serial_printf("usb device descriptor \n"); \ > + serial_printf("\tbLength %2.2x\n", (d)->bLength); \ > + serial_printf("\tbDescriptorType %2.2x\n", \ > + (d)->bDescriptorType); \ > + serial_printf("\tbcdUSB %4.4x\n", (d)->bcdUSB); \ > + serial_printf("\tbDeviceClass %2.2x\n", (d)->bDeviceClass); \ > + serial_printf("\tbDeviceSubClass %2.2x\n", \ > + (d)->bDeviceSubClass); \ > + serial_printf("\tbDeviceProtocol %2.2x\n", \ > + (d)->bDeviceProtocol); \ > + serial_printf("\tbMaxPacketSize0 %2.2x\n", \ > + (d)->bMaxPacketSize0); \ > + serial_printf("\tidVendor %4.4x\n", (d)->idVendor); \ > + serial_printf("\tidProduct %4.4x\n", (d)->idProduct); \ > + serial_printf("\tbcdDevice %4.4x\n", (d)->bcdDevice); \ > + serial_printf("\tiManufacturer %2.2x\n", (d)->iManufacturer); \ > + serial_printf("\tiProduct %2.2x\n", (d)->iProduct); \ > + serial_printf("\tiSerialNumber %2.2x\n", (d)->iSerialNumber); \ > + serial_printf("\tbNumConfigurations %2.2x\n", \ > + (d)->bNumConfigurations); \ > +} while (0) Best Regards, J. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/8] USB add macros for debugging usb device setup.
Jean-Christophe PLAGNIOL-VILLARD Fri, 04 Sep 2009 17:42:18 -0700
- Re: [U-Boot] [PATCH... Jean-Christophe PLAGNIOL-VILLARD
- Re: [U-Boot] [PATCH... Tom
- Re: [U-Boot] [PATCH 6/8]... Jean-Christophe PLAGNIOL-VILLARD
- Re: [U-Boot] [PATCH 5/8] OMA... Jean-Christophe PLAGNIOL-VILLARD
- Re: [U-Boot] [PATCH 4/8] OMAP3 A... Jean-Christophe PLAGNIOL-VILLARD
- Re: [U-Boot] [PATCH 4/8] OMA... Tom
- Re: [U-Boot] [PATCH 4/8]... Jean-Christophe PLAGNIOL-VILLARD
- Re: [U-Boot] [PATCH 3/8] TWL4030 Add... Jean-Christophe PLAGNIOL-VILLARD
- Re: [U-Boot] [PATCH 3/8] TWL4030... Tom
- Re: [U-Boot] [PATCH 3/8] TWL... Jean-Christophe PLAGNIOL-VILLARD
- Re: [U-Boot] [PATCH 2/8] USB add macros f... Jean-Christophe PLAGNIOL-VILLARD