Changeset 971fbfde in mainline
- Timestamp:
- 2012-12-22T21:52:10Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6326155b
- Parents:
- f8d43aa
- Location:
- uspace/lib
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/include/usb/dev/request.h
rf8d43aa r971fbfde 41 41 #include <usb/dev/pipes.h> 42 42 #include <usb/descriptor.h> 43 #include <usb/request.h> 43 44 44 45 /** USB device status - device is self powered (opposed to bus powered). */ … … 57 58 #define USB_FEATURE_SELECTOR_REMOTE_WAKEUP (1) 58 59 59 /** Standard device request. */60 typedef enum {61 USB_DEVREQ_GET_STATUS = 0,62 USB_DEVREQ_CLEAR_FEATURE = 1,63 USB_DEVREQ_SET_FEATURE = 3,64 USB_DEVREQ_SET_ADDRESS = 5,65 USB_DEVREQ_GET_DESCRIPTOR = 6,66 USB_DEVREQ_SET_DESCRIPTOR = 7,67 USB_DEVREQ_GET_CONFIGURATION = 8,68 USB_DEVREQ_SET_CONFIGURATION = 9,69 USB_DEVREQ_GET_INTERFACE = 10,70 USB_DEVREQ_SET_INTERFACE = 11,71 USB_DEVREQ_SYNCH_FRAME = 12,72 USB_DEVREQ_LAST_STD73 } usb_stddevreq_t;74 75 /** Device request setup packet.76 * The setup packet describes the request.77 */78 typedef struct {79 /** Request type.80 * The type combines transfer direction, request type and81 * intended recipient.82 */83 uint8_t request_type;84 #define SETUP_REQUEST_TYPE_DEVICE_TO_HOST (1 << 7)85 #define SETUP_REQUEST_TYPE_GET_TYPE(rt) ((rt >> 5) & 0x3)86 #define SETUP_REQUEST_TYPE_GET_RECIPIENT(rec) (rec & 0x1f)87 #define SETUP_REQUEST_TO_HOST(type, recipient) \88 (uint8_t)((1 << 7) | ((type & 0x3) << 5) | (recipient & 0x1f))89 #define SETUP_REQUEST_TO_DEVICE(type, recipient) \90 (uint8_t)(((type & 0x3) << 5) | (recipient & 0x1f))91 92 /** Request identification. */93 uint8_t request;94 /** Main parameter to the request. */95 union __attribute__ ((packed)) {96 uint16_t value;97 /* FIXME: add #ifdefs according to host endianness */98 struct __attribute__ ((packed)) {99 uint8_t value_low;100 uint8_t value_high;101 };102 };103 /** Auxiliary parameter to the request.104 * Typically, it is offset to something.105 */106 uint16_t index;107 /** Length of extra data. */108 uint16_t length;109 } __attribute__ ((packed)) usb_device_request_setup_packet_t;110 111 int assert[(sizeof(usb_device_request_setup_packet_t) == 8) ? 1: -1];112 60 113 61 int usb_control_request_set(usb_pipe_t *,
Note:
See TracChangeset
for help on using the changeset viewer.