Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/usb_device.h
| Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | |||||
| struct usb_device_statistics { | struct usb_device_statistics { | ||||
| uint32_t uds_requests[4]; | uint32_t uds_requests[4]; | ||||
| }; | }; | ||||
| /* | /* | ||||
| * The following structure defines an USB device. There exists one of | * The following structure defines an USB device. There exists one of | ||||
| * these structures for every USB device. | * these structures for every USB device. | ||||
| */ | */ | ||||
| struct usb_device { | struct _usb_device { | ||||
| /* statistics */ | /* statistics */ | ||||
| struct usb_device_statistics stats_err; | struct usb_device_statistics stats_err; | ||||
| struct usb_device_statistics stats_ok; | struct usb_device_statistics stats_ok; | ||||
| struct usb_device_statistics stats_cancelled; | struct usb_device_statistics stats_cancelled; | ||||
| /* generic clear stall message */ | /* generic clear stall message */ | ||||
| struct usb_udev_msg cs_msg[2]; | struct usb_udev_msg cs_msg[2]; | ||||
| struct sx enum_sx; | struct sx enum_sx; | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | #define USB_RE_ENUM_SET_CONFIG 3 | ||||
| struct usb_endpoint_descriptor ctrl_ep_desc; /* for endpoint 0 */ | struct usb_endpoint_descriptor ctrl_ep_desc; /* for endpoint 0 */ | ||||
| struct usb_endpoint_ss_comp_descriptor ctrl_ep_comp_desc; /* for endpoint 0 */ | struct usb_endpoint_ss_comp_descriptor ctrl_ep_comp_desc; /* for endpoint 0 */ | ||||
| struct usb_device_descriptor ddesc; /* device descriptor */ | struct usb_device_descriptor ddesc; /* device descriptor */ | ||||
| char *serial; /* serial number, can be NULL */ | char *serial; /* serial number, can be NULL */ | ||||
| char *manufacturer; /* manufacturer string, can be NULL */ | char *manufacturer; /* manufacturer string, can be NULL */ | ||||
| char *product; /* product string, can be NULL */ | char *product; /* product string, can be NULL */ | ||||
| #if USB_HAVE_COMPAT_LINUX | |||||
| /* Linux compat */ | |||||
| struct usb_device_descriptor descriptor; | |||||
| struct usb_host_endpoint ep0; | |||||
| struct usb_interface *linux_iface_start; | |||||
| struct usb_interface *linux_iface_end; | |||||
| struct usb_host_endpoint *linux_endpoint_start; | |||||
| struct usb_host_endpoint *linux_endpoint_end; | |||||
| uint16_t devnum; | |||||
| #endif | |||||
| uint32_t clear_stall_errors; /* number of clear-stall failures */ | uint32_t clear_stall_errors; /* number of clear-stall failures */ | ||||
| union usb_device_scratch scratch; | union usb_device_scratch scratch; | ||||
| #if (USB_HAVE_FIXED_CONFIG != 0) | #if (USB_HAVE_FIXED_CONFIG != 0) | ||||
| uint32_t config_data[(USB_CONFIG_MAX + 3) / 4]; | uint32_t config_data[(USB_CONFIG_MAX + 3) / 4]; | ||||
| #endif | #endif | ||||
| }; | }; | ||||
| #if USB_HAVE_COMPAT_LINUX | |||||
| /* Actual size on 64bit + some spare. */ | |||||
| #define LINUXKPI_USB_DEVICE_SIZE (376 + 4 * 8) | |||||
| #endif | |||||
| /* Guard for the LinuxKPI USB, which has its own copy of struct usb_device. */ | |||||
| #ifndef LINUXKPI_USB | |||||
| struct usb_device { | |||||
| struct _usb_device; | |||||
| #if USB_HAVE_COMPAT_LINUX | |||||
| uint8_t ___linuxkpi_scratch[0] __aligned(CACHE_LINE_SIZE); | |||||
| uint8_t ___linuxkpi[LINUXKPI_USB_DEVICE_SIZE]; | |||||
| #endif | |||||
| }; | |||||
| #endif | |||||
| /* globals */ | /* globals */ | ||||
| extern int usb_template; | extern int usb_template; | ||||
| /* function prototypes */ | /* function prototypes */ | ||||
| const char *usb_statestr(enum usb_dev_state state); | const char *usb_statestr(enum usb_dev_state state); | ||||
| ▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines | |||||