Changeset ae3a941 in mainline for uspace/lib/usbdev
- 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/usbdev
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/include/usb/dev/device.h
r3692678 rae3a941 59 59 60 60 /* DDF parts */ 61 errno_t usb_device_create_ddf(ddf_dev_t *, const usb_endpoint_description_t **, const char **); 61 errno_t usb_device_create_ddf(ddf_dev_t *, 62 const usb_endpoint_description_t **, const char **); 62 63 void usb_device_destroy_ddf(ddf_dev_t *); 63 64 … … 68 69 } 69 70 70 usb_device_t * 71 usb_device_t *usb_device_create(devman_handle_t); 71 72 void usb_device_destroy(usb_device_t *); 72 73 73 const char * 74 const char *usb_device_get_name(usb_device_t *); 74 75 ddf_fun_t *usb_device_ddf_fun_create(usb_device_t *, fun_type_t, const char *); 75 76 76 async_exch_t * 77 async_exch_t *usb_device_bus_exchange_begin(usb_device_t *); 77 78 void usb_device_bus_exchange_end(async_exch_t *); 78 79 … … 95 96 devman_handle_t usb_device_get_devman_handle(const usb_device_t *); 96 97 97 const usb_device_descriptors_t * 98 const usb_device_descriptors_t *usb_device_descriptors(usb_device_t *); 98 99 99 const usb_alternate_interfaces_t * 100 const usb_alternate_interfaces_t *usb_device_get_alternative_ifaces( 100 101 usb_device_t *); 101 102 102 void * 103 void * 103 void *usb_device_data_alloc(usb_device_t *, size_t); 104 void *usb_device_data_get(usb_device_t *); 104 105 105 106 #endif -
uspace/lib/usbdev/include/usb/dev/pipes.h
r3692678 rae3a941 92 92 const usb_standard_endpoint_descriptor_t *descriptor; 93 93 /** Relevant superspeed companion descriptor. */ 94 const usb_superspeed_endpoint_companion_descriptor_t *companion_descriptor; 94 const usb_superspeed_endpoint_companion_descriptor_t 95 *companion_descriptor; 95 96 /** Interface descriptor the endpoint belongs to. */ 96 97 const usb_standard_interface_descriptor_t *interface; … … 105 106 size_t, const uint8_t *, size_t, usb_dev_session_t *); 106 107 107 errno_t usb_pipe_register(usb_pipe_t *, const usb_standard_endpoint_descriptor_t *, const usb_superspeed_endpoint_companion_descriptor_t *); 108 errno_t usb_pipe_register(usb_pipe_t *, 109 const usb_standard_endpoint_descriptor_t *, 110 const usb_superspeed_endpoint_companion_descriptor_t *); 108 111 errno_t usb_pipe_unregister(usb_pipe_t *); 109 112 -
uspace/lib/usbdev/include/usb/dev/poll.h
r3692678 rae3a941 60 60 size_t request_size; 61 61 62 /** Data buffer of at least `request_size`. User is responsible for its allocation. */ 62 /** 63 * Data buffer of at least `request_size`. User is responsible for its 64 * allocation. 65 */ 63 66 uint8_t *buffer; 64 67 … … 75 78 76 79 77 /** Optional parameters - user can customize them, but they are defaulted to 78 * some reasonable values. 80 /** 81 * Optional parameters - user can customize them, but they are 82 * defaulted to some reasonable values. 79 83 */ 80 84 … … 86 90 int debug; 87 91 88 /** Maximum number of consecutive errors before polling termination (default 3). */ 92 /** 93 * Maximum number of consecutive errors before polling termination 94 * (default 3). 95 */ 89 96 size_t max_failures; 90 97 … … 121 128 122 129 123 /** Internal parameters - user is not expected to set them. Messing with them 124 * can result in unexpected behavior if you do not know what you are doing. 130 /** 131 * Internal parameters - user is not expected to set them. Messing with 132 * them can result in unexpected behavior if you do not know what you 133 * are doing. 125 134 */ 126 135 -
uspace/lib/usbdev/src/dp.c
r3692678 rae3a941 127 127 * @retval -1 Invalid input. 128 128 */ 129 static int get_descriptor_type(const usb_dp_parser_data_t *data, const uint8_t *start) 129 static int get_descriptor_type(const usb_dp_parser_data_t *data, 130 const uint8_t *start) 130 131 { 131 132 if (start == NULL) { … … 258 259 int parent_type = get_descriptor_type(data, parent); 259 260 int possible_sibling_type = get_descriptor_type(data, possible_sibling); 260 if (is_nested_descriptor_type(parser, possible_sibling_type, parent_type)) { 261 if (is_nested_descriptor_type(parser, 262 possible_sibling_type, parent_type)) { 261 263 return possible_sibling; 262 264 } else { -
uspace/lib/usbdev/src/pipes.c
r3692678 rae3a941 338 338 * @return Error code. 339 339 */ 340 errno_t usb_pipe_write_dma(usb_pipe_t *pipe, void *base, void * ptr,size_t size)340 errno_t usb_pipe_write_dma(usb_pipe_t *pipe, void *base, void *ptr, size_t size) 341 341 { 342 342 assert(pipe); … … 377 377 /** Initialize USB default control pipe. 378 378 * 379 * This one is special because it must not be registered, it is registered automatically. 379 * This one is special because it must not be registered, it is registered 380 * automatically. 380 381 * 381 382 * @param pipe Endpoint pipe to be initialized. … … 383 384 * @return Error code. 384 385 */ 385 errno_t usb_pipe_initialize_default_control(usb_pipe_t *pipe, usb_dev_session_t *bus_session) 386 errno_t usb_pipe_initialize_default_control(usb_pipe_t *pipe, 387 usb_dev_session_t *bus_session) 386 388 { 387 389 const errno_t ret = usb_pipe_initialize(pipe, bus_session); … … 402 404 * @return Error code. 403 405 */ 404 errno_t usb_pipe_register(usb_pipe_t *pipe, const usb_standard_endpoint_descriptor_t *ep_desc, const usb_superspeed_endpoint_companion_descriptor_t *comp_desc) 406 errno_t usb_pipe_register(usb_pipe_t *pipe, 407 const usb_standard_endpoint_descriptor_t *ep_desc, 408 const usb_superspeed_endpoint_companion_descriptor_t *comp_desc) 405 409 { 406 410 assert(pipe); … … 429 433 #undef COPY 430 434 431 const errno_t ret = usbhc_register_endpoint(exch, &pipe->desc, &descriptors); 435 const errno_t ret = usbhc_register_endpoint(exch, 436 &pipe->desc, &descriptors); 432 437 async_exchange_end(exch); 433 438 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.