Changeset ae3a941 in mainline for uspace/lib/usb/include
- Timestamp:
- 2018-02-26T16:51:40Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e773f58
- Parents:
- 3692678
- Location:
- uspace/lib/usb/include/usb
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/classes/hub.h
r3692678 rae3a941 178 178 */ 179 179 uint8_t max_current; 180 } __attribute__ 180 } __attribute__((packed)) usb_hub_descriptor_header_t; 181 181 182 182 /** One bit for the device and one bit for every port */ … … 187 187 */ 188 188 typedef enum { 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 189 /** This request resets a value reported in the hub status. */ 190 USB_HUB_REQ_TYPE_CLEAR_HUB_FEATURE = 0x20, 191 /** This request resets a value reported in the port status. */ 192 USB_HUB_REQ_TYPE_CLEAR_PORT_FEATURE = 0x23, 193 /** 194 * This is an optional per-port diagnostic request that returns the bus 195 * state value, as sampled at the last EOF2 point. 196 */ 197 USB_HUB_REQ_TYPE_GET_STATE = 0xA3, 198 /** This request returns the hub descriptor. */ 199 USB_HUB_REQ_TYPE_GET_DESCRIPTOR = 0xA0, 200 /** 201 * This request returns the current hub status and the states that have 202 * changed since the previous acknowledgment. 203 */ 204 USB_HUB_REQ_TYPE_GET_HUB_STATUS = 0xA0, 205 /** 206 * This request returns the current port status and the current value of the 207 * port status change bits. 208 */ 209 USB_HUB_REQ_TYPE_GET_PORT_STATUS = 0xA3, 210 /** This request overwrites the hub descriptor. */ 211 USB_HUB_REQ_TYPE_SET_DESCRIPTOR = 0x20, 212 /** This request sets a value reported in the hub status. */ 213 USB_HUB_REQ_TYPE_SET_HUB_FEATURE = 0x20, 214 /** 215 * This request sets the value that the hub uses to determine the index 216 * into the Route String Index for the hub. 217 */ 218 USB_HUB_REQ_TYPE_SET_HUB_DEPTH = 0x20, 219 /** This request sets a value reported in the port status. */ 220 USB_HUB_REQ_TYPE_SET_PORT_FEATURE = 0x23, 221 221 } usb_hub_bm_request_type_t; 222 222 223 /** @brief hub class request codes*/ 224 /// \TODO these are duplicit to standart descriptors 223 /** 224 * @brief hub class request codes 225 */ 225 226 typedef enum { 226 /** */ 227 USB_HUB_REQUEST_GET_STATUS = 0, 228 /** */ 229 USB_HUB_REQUEST_CLEAR_FEATURE = 1, 230 /** USB 1.0 only */ 231 USB_HUB_REQUEST_GET_STATE = 2, 232 /** */ 233 USB_HUB_REQUEST_SET_FEATURE = 3, 234 /** */ 235 USB_HUB_REQUEST_GET_DESCRIPTOR = 6, 236 /** */ 237 USB_HUB_REQUEST_SET_DESCRIPTOR = 7, 238 /** */ 239 USB_HUB_REQUEST_CLEAR_TT_BUFFER = 8, 240 /** */ 241 USB_HUB_REQUEST_RESET_TT = 9, 242 /** */ 243 USB_HUB_GET_TT_STATE = 10, 244 /** */ 245 USB_HUB_STOP_TT = 11, 246 /** USB 3+ only */ 247 USB_HUB_REQUEST_SET_HUB_DEPTH = 12, 227 USB_HUB_REQUEST_GET_STATUS = 0, 228 USB_HUB_REQUEST_CLEAR_FEATURE = 1, 229 /** USB 1.0 only */ 230 USB_HUB_REQUEST_GET_STATE = 2, 231 USB_HUB_REQUEST_SET_FEATURE = 3, 232 USB_HUB_REQUEST_GET_DESCRIPTOR = 6, 233 USB_HUB_REQUEST_SET_DESCRIPTOR = 7, 234 USB_HUB_REQUEST_CLEAR_TT_BUFFER = 8, 235 USB_HUB_REQUEST_RESET_TT = 9, 236 USB_HUB_GET_TT_STATE = 10, 237 USB_HUB_STOP_TT = 11, 238 /** USB 3+ only */ 239 USB_HUB_REQUEST_SET_HUB_DEPTH = 12, 248 240 } usb_hub_request_t; 249 241 -
uspace/lib/usb/include/usb/descriptor.h
r3692678 rae3a941 101 101 /** Number of possible configurations. */ 102 102 uint8_t configuration_count; 103 } __attribute__ 103 } __attribute__((packed)) usb_standard_device_descriptor_t; 104 104 105 105 /** USB device qualifier decriptor is basically a cut down version of the device … … 129 129 uint8_t configuration_count; 130 130 uint8_t reserved; 131 } __attribute__ 131 } __attribute__((packed)) usb_standard_device_qualifier_descriptor_t; 132 132 133 133 /** Standard USB configuration descriptor. … … 156 156 */ 157 157 uint8_t max_power; 158 } __attribute__ 158 } __attribute__((packed)) usb_standard_configuration_descriptor_t; 159 159 160 160 /** USB Other Speed Configuration descriptor shows values that would change … … 191 191 /** String descriptor describing this interface. */ 192 192 uint8_t str_interface; 193 } __attribute__ 193 } __attribute__((packed)) usb_standard_interface_descriptor_t; 194 194 195 195 /** Standard USB endpoint descriptor. … … 223 223 */ 224 224 uint8_t poll_interval; 225 } __attribute__ 225 } __attribute__((packed)) usb_standard_endpoint_descriptor_t; 226 226 227 227 /** Superspeed USB endpoint companion descriptor. … … 254 254 */ 255 255 uint16_t bytes_per_interval; 256 } __attribute__ 256 } __attribute__((packed)) usb_superspeed_endpoint_companion_descriptor_t; 257 257 258 258 /** Part of standard USB HID descriptor specifying one class descriptor. … … 265 265 /** Length of class-specific descriptor in bytes. */ 266 266 uint16_t length; 267 } __attribute__ 267 } __attribute__((packed)) usb_standard_hid_class_descriptor_info_t; 268 268 269 269 /** Standard USB HID descriptor. … … 296 296 /** First mandatory class descriptor (Report) info. */ 297 297 usb_standard_hid_class_descriptor_info_t report_desc_info; 298 } __attribute__ 298 } __attribute__((packed)) usb_standard_hid_descriptor_t; 299 299 300 300 #endif -
uspace/lib/usb/include/usb/port.h
r3692678 rae3a941 90 90 91 91 /* And these are to be called from the connected handler. */ 92 int usb_port_condvar_wait_timeout(usb_port_t *port, fibril_condvar_t *, suseconds_t); 92 int usb_port_condvar_wait_timeout(usb_port_t *port, 93 fibril_condvar_t *, suseconds_t); 93 94 94 95 /** -
uspace/lib/usb/include/usb/usb.h
r3692678 rae3a941 54 54 #define uint32_usb2host(n) uint32_t_le2host((n)) 55 55 56 const char * usb_str_transfer_type(usb_transfer_type_tt);57 const char * usb_str_transfer_type_short(usb_transfer_type_tt);56 const char *usb_str_transfer_type(usb_transfer_type_t); 57 const char *usb_str_transfer_type_short(usb_transfer_type_t); 58 58 59 59 const char *usb_str_direction(usb_direction_t); … … 149 149 static inline bool usb_target_same(usb_target_t a, usb_target_t b) 150 150 { 151 return (a.address == b.address) 152 && (a.endpoint == b.endpoint); 151 return (a.address == b.address) && (a.endpoint == b.endpoint); 153 152 } 154 153 … … 167 166 USB_PID_SETUP = _MAKE_PID(3, 1), 168 167 169 USB_PID_DATA0 = _MAKE_PID(0 ,3),170 USB_PID_DATA1 = _MAKE_PID(2 ,3),168 USB_PID_DATA0 = _MAKE_PID(0, 3), 169 USB_PID_DATA1 = _MAKE_PID(2, 3), 171 170 172 USB_PID_ACK = _MAKE_PID(0 ,2),173 USB_PID_NAK = _MAKE_PID(2 ,2),174 USB_PID_STALL = _MAKE_PID(3 ,2),171 USB_PID_ACK = _MAKE_PID(0, 2), 172 USB_PID_NAK = _MAKE_PID(2, 2), 173 USB_PID_STALL = _MAKE_PID(3, 2), 175 174 176 USB_PID_PRE = _MAKE_PID(3 ,0),175 USB_PID_PRE = _MAKE_PID(3, 0), 177 176 /* USB_PID_ = _MAKE_PID( ,), */ 178 177 #undef _MAKE_PID
Note:
See TracChangeset
for help on using the changeset viewer.