diff --git a/configs/boardctl.c b/configs/boardctl.c index 3d33b7e7c55..43150630127 100644 --- a/configs/boardctl.c +++ b/configs/boardctl.c @@ -182,6 +182,7 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl) case BOARDIOC_USBDEV_CONNECT: /* Connect the Composite device */ { #warning THIS DOES NOT BELONG HERE!!!!!!!!!!!!!!!!!!!!!!!!!! +#warning THIS BELONGS IN BOARD-SPECIFIC LOGIC!!!!!!!!!!!!!!!!!!!!!!!!!! /* Here we are composing the configuration of the usb composite device. * * The standard is to use one CDC/ACM and one USB mass storage device. @@ -204,8 +205,8 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl) /* Overwrite and correct some values... */ /* The callback functions for the CDC/ACM class */ - dev[0].board_classobject = board_cdcclassobject; - dev[0].board_uninitialize = board_cdcuninitialize; + dev[0].classobject = board_cdcclassobject; + dev[0].uninitialize = board_cdcuninitialize; /* Interfaces */ @@ -237,8 +238,8 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl) /* Overwrite and correct some values... */ /* The callback functions for the USBMSC class */ - dev[1].board_classobject = board_mscclassobject; - dev[1].board_uninitialize = board_mscuninitialize; + dev[1].classobject = board_mscclassobject; + dev[1].uninitialize = board_mscuninitialize; /* Interfaces */ diff --git a/include/nuttx/usb/usbdev.h b/include/nuttx/usb/usbdev.h index ed7fe433ee5..b1b8b38d193 100644 --- a/include/nuttx/usb/usbdev.h +++ b/include/nuttx/usb/usbdev.h @@ -196,6 +196,49 @@ /* USB Controller Structures ********************************************************/ +/* usbdev_description_s - describes the low level bindings of an usb device */ + +struct usbdev_description_s +{ + int ninterfaces; /* Number of interfaces in the configuration */ + int ifnobase; /* Offset to Interface-IDs */ + + int nstrings; /* Number of Strings */ + int strbase; /* Offset to String Numbers */ + + int nendpoints; /* Number of Endpoints referenced in the following allay */ + int epno[5]; /* Array holding the endpoint configuration for this device */ +}; + +#ifdef CONFIG_USBDEV_COMPOSITE + +struct composite_devdesc_s +{ +#ifdef CONFIG_USBDEV_DUALSPEED + CODE int16_t (*mkconfdesc)(FAR uint8_t *buf, + FAR struct usbdev_description_s *devdesc, + uint8_t speed, uint8_t type); +#else + CODE int16_t (*mkconfdesc)(FAR uint8_t *buf, + FAR struct usbdev_description_s *devdesc); +#endif + + CODE int (*mkstrdesc)(uint8_t id, FAR struct usb_strdesc_s *strdesc); + CODE int (*classobject)(int minor, + FAR struct usbdev_description_s *devdesc, + FAR struct usbdevclass_driver_s **classdev); + CODE void (*uninitialize)(FAR struct usbdevclass_driver_s *classdev); + + int nconfigs; /* Number of configurations supported */ + int configid; /* The only supported configuration ID */ + + int cfgdescsize; /* The size of the config descriptor */ + int minor; + + struct usbdev_description_s devdesc; +}; +#endif + /* struct usbdev_req_s - describes one i/o request */ struct usbdev_ep_s;