pastebin - collaborative debugging tool
eckelmann.kpaste.net RSS


barebox: Publish USB *Class* device values as barebox hush shell variables
Posted by Anonymous on Mon 25th Nov 2019 14:11
raw | new post

  1. diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
  2. index d29cd13..abf28ed 100644
  3. --- a/drivers/usb/core/usb.c
  4. +++ b/drivers/usb/core/usb.c
  5. @@ -464,6 +464,24 @@ int usb_new_device(struct usb_device *dev)
  6.                         dev->descriptor->idVendor, "%04x");
  7.         dev_add_param_uint32_fixed(&dev->dev, "idProduct",
  8.                         dev->descriptor->idProduct, "%04x");
  9. +       /*
  10. +        * These are used so barebox scripts can idenfify specific
  11. +        * devices by their class
  12. +        */
  13. +       dev_add_param_uint32_fixed(&dev->dev, "bDeviceClass",
  14. +                       (uint32_t)dev->descriptor->bDeviceClass, "%x");
  15. +       dev_add_param_uint32_fixed(&dev->dev, "bDeviceSubClass",
  16. +                       (uint32_t)dev->descriptor->bDeviceSubClass, "%x");
  17. +       dev_add_param_uint32_fixed(&dev->dev, "bDeviceProtocol",
  18. +                       (uint32_t)dev->descriptor->bDeviceProtocol, "%x");
  19. +       //dev_add_param_uint32_fixed(&dev->dev, "bInterfaceClass",
  20. +       //              dev->descriptor->bInterfaceClass, "%02x");
  21. +       //dev_add_param_uint32_fixed(&dev->dev, "bInterfaceSubClass",
  22. +       //              dev->descriptor->bInterfaceSubClass, "%02x");
  23. +       //dev_add_param_uint32_fixed(&dev->dev, "bInterfaceProtocol",
  24. +       //              dev->descriptor->bInterfaceSubClass, "%02x");
  25. +
  26. +
  27.         list_add_tail(&dev->list, &usb_device_list);
  28.         dev_count++;

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at