Changeset 5a6cc679 in mainline for uspace/drv/bus/usb/usbhub/usbhub.c
- Timestamp:
- 2018-01-31T02:21:24Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a0a9cc2
- Parents:
- 132ab5d1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/usbhub.c
r132ab5d1 r5a6cc679 99 99 }; 100 100 101 static int usb_set_first_configuration(usb_device_t *);102 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *);101 static errno_t usb_set_first_configuration(usb_device_t *); 102 static errno_t usb_hub_process_hub_specific_info(usb_hub_dev_t *); 103 103 static void usb_hub_over_current(const usb_hub_dev_t *, usb_hub_status_t); 104 static int usb_hub_polling_init(usb_hub_dev_t *, usb_endpoint_mapping_t *);104 static errno_t usb_hub_polling_init(usb_hub_dev_t *, usb_endpoint_mapping_t *); 105 105 static void usb_hub_global_interrupt(const usb_hub_dev_t *); 106 106 107 107 static bool usb_hub_polling_error_callback(usb_device_t *dev, 108 int err_code, void *arg)108 errno_t err_code, void *arg) 109 109 { 110 110 assert(dev); … … 125 125 * @return error code 126 126 */ 127 int usb_hub_device_add(usb_device_t *usb_dev)127 errno_t usb_hub_device_add(usb_device_t *usb_dev) 128 128 { 129 129 int err; … … 198 198 } 199 199 200 static int usb_hub_cleanup(usb_hub_dev_t *hub)200 static errno_t usb_hub_cleanup(usb_hub_dev_t *hub) 201 201 { 202 202 free(hub->polling.buffer); … … 228 228 * @return error code 229 229 */ 230 int usb_hub_device_remove(usb_device_t *usb_dev)230 errno_t usb_hub_device_remove(usb_device_t *usb_dev) 231 231 { 232 232 assert(usb_dev); … … 249 249 * @return error code 250 250 */ 251 int usb_hub_device_gone(usb_device_t *usb_dev)251 errno_t usb_hub_device_gone(usb_device_t *usb_dev) 252 252 { 253 253 assert(usb_dev); … … 270 270 * @param mapping The mapping of Status Change Endpoint 271 271 */ 272 static int usb_hub_polling_init(usb_hub_dev_t *hub_dev,272 static errno_t usb_hub_polling_init(usb_hub_dev_t *hub_dev, 273 273 usb_endpoint_mapping_t *mapping) 274 274 { 275 int err;275 errno_t err; 276 276 usb_polling_t *polling = &hub_dev->polling; 277 277 … … 369 369 * @return error code 370 370 */ 371 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev)371 static errno_t usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev) 372 372 { 373 373 assert(hub_dev); … … 382 382 usb_hub_descriptor_header_t descriptor; 383 383 size_t received_size; 384 int opResult = usb_request_get_descriptor(control_pipe,384 errno_t opResult = usb_request_get_descriptor(control_pipe, 385 385 USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_DEVICE, 386 386 desc_type, 0, 0, &descriptor, … … 436 436 * @return error code 437 437 */ 438 static int usb_set_first_configuration(usb_device_t *usb_device)438 static errno_t usb_set_first_configuration(usb_device_t *usb_device) 439 439 { 440 440 assert(usb_device); … … 462 462 /* Set configuration. Use the configuration that was in 463 463 * usb_device->descriptors.configuration i.e. The first one. */ 464 int opResult = usb_request_set_configuration(464 errno_t opResult = usb_request_set_configuration( 465 465 usb_device_get_default_pipe(usb_device), 466 466 config_descriptor->configuration_number); … … 500 500 /* Over-current condition is gone, it is safe to turn the ports on. */ 501 501 for (size_t port = 0; port < hub_dev->port_count; ++port) { 502 const int ret = usb_hub_set_port_feature(hub_dev, port,502 const errno_t ret = usb_hub_set_port_feature(hub_dev, port, 503 503 USB_HUB_FEATURE_PORT_POWER); 504 504 if (ret != EOK) { … … 637 637 /* NOTE: We can't use standard USB GET_STATUS request, because 638 638 * hubs reply is 4byte instead of 2 */ 639 const int opResult = usb_pipe_control_read(control_pipe,639 const errno_t opResult = usb_pipe_control_read(control_pipe, 640 640 &get_hub_status_request, sizeof(get_hub_status_request), 641 641 &status, sizeof(usb_hub_status_t), &rcvd_size); … … 655 655 usb_hub_over_current(hub_dev, status); 656 656 /* Ack change in hub OC flag */ 657 const int ret = usb_request_clear_feature(657 const errno_t ret = usb_request_clear_feature( 658 658 control_pipe, USB_REQUEST_TYPE_CLASS, 659 659 USB_REQUEST_RECIPIENT_DEVICE, … … 679 679 * Just ACK the change. 680 680 */ 681 const int ret = usb_request_clear_feature(681 const errno_t ret = usb_request_clear_feature( 682 682 control_pipe, USB_REQUEST_TYPE_CLASS, 683 683 USB_REQUEST_RECIPIENT_DEVICE,
Note:
See TracChangeset
for help on using the changeset viewer.