Changeset 9efad54 in mainline for uspace/lib/usb/include/usb/descriptor.h
- Timestamp:
- 2018-01-06T21:15:48Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 56257ba
- Parents:
- c901632
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/descriptor.h
rc901632 r9efad54 200 200 /** Endpoint address together with data flow direction. */ 201 201 uint8_t endpoint_address; 202 #define USB_ED_GET_EP(ed) ((ed).endpoint_address & 0xf) 203 #define USB_ED_GET_DIR(ed) (!(((ed).endpoint_address >> 7) & 0x1)) 204 202 205 /** Endpoint attributes. 203 206 * Includes transfer type (usb_transfer_type_t). 204 207 */ 205 208 uint8_t attributes; 209 #define USB_ED_GET_TRANSFER_TYPE(ed) ((ed).attributes & 0x3) 206 210 /** Maximum packet size. 207 211 * Lower 10 bits represent the actuall size … … 209 213 * HS INT and ISO transfers. */ 210 214 uint16_t max_packet_size; 211 212 #define ED_MPS_PACKET_SIZE_MASK 0x3ff 213 #define ED_MPS_PACKET_SIZE_GET(value) \ 214 ((value) & ED_MPS_PACKET_SIZE_MASK) 215 #define ED_MPS_TRANS_OPPORTUNITIES_GET(value) \ 216 ((((value) >> 10) & 0x3) + 1) 217 215 #define USB_ED_GET_MPS(ed) \ 216 (uint16_usb2host((ed).max_packet_size) & 0x7ff) 217 #define USB_ED_GET_ADD_OPPS(ed) \ 218 ((uint16_usb2host((ed).max_packet_size) >> 11) & 0x3) 218 219 /** Polling interval in milliseconds. 219 220 * Ignored for bulk and control endpoints. … … 246 247 */ 247 248 uint8_t attributes; 248 #define SS_COMPANION_MAX_STREAMS(attributes) \ 249 (attributes & 0x1f) 250 #define SS_COMPANION_MULT(attributes) \ 251 (attributes & 0x3) 249 #define USB_SSC_MAX_STREAMS(sscd) ((sscd).attributes & 0x1f) 250 #define USB_SSC_MULT(sscd) ((sscd).attributes & 0x3) 252 251 /** The total number of bytes this endpoint will transfer 253 252 * every service interval (SI).
Note:
See TracChangeset
for help on using the changeset viewer.