Changes in uspace/drv/bus/usb/usbhub/usbhub.c [58563585:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/usbhub.c
r58563585 rb7fd2a0 81 81 }; 82 82 83 static int usb_set_first_configuration(usb_device_t *usb_device);84 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev);83 static errno_t usb_set_first_configuration(usb_device_t *usb_device); 84 static errno_t usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev); 85 85 static void usb_hub_over_current(const usb_hub_dev_t *hub_dev, 86 86 usb_hub_status_t status); … … 97 97 * @return error code 98 98 */ 99 int usb_hub_device_add(usb_device_t *usb_dev)99 errno_t usb_hub_device_add(usb_device_t *usb_dev) 100 100 { 101 101 assert(usb_dev); … … 114 114 115 115 /* Set hub's first configuration. (There should be only one) */ 116 int opResult = usb_set_first_configuration(usb_dev);116 errno_t opResult = usb_set_first_configuration(usb_dev); 117 117 if (opResult != EOK) { 118 118 usb_log_error("Could not set hub configuration: %s\n", … … 174 174 * @return error code 175 175 */ 176 int usb_hub_device_remove(usb_device_t *usb_dev)176 errno_t usb_hub_device_remove(usb_device_t *usb_dev) 177 177 { 178 178 return ENOTSUP; … … 184 184 * @return error code 185 185 */ 186 int usb_hub_device_gone(usb_device_t *usb_dev)186 errno_t usb_hub_device_gone(usb_device_t *usb_dev) 187 187 { 188 188 assert(usb_dev); … … 202 202 203 203 for (size_t port = 0; port < hub->port_count; ++port) { 204 const int ret = usb_hub_port_fini(&hub->ports[port], hub);204 const errno_t ret = usb_hub_port_fini(&hub->ports[port], hub); 205 205 if (ret != EOK) 206 206 return ret; … … 208 208 free(hub->ports); 209 209 210 const int ret = ddf_fun_unbind(hub->hub_fun);210 const errno_t ret = ddf_fun_unbind(hub->hub_fun); 211 211 if (ret != EOK) { 212 212 usb_log_error("(%p) Failed to unbind '%s' function: %s.", … … 266 266 * @return error code 267 267 */ 268 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev)268 static errno_t usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev) 269 269 { 270 270 assert(hub_dev); … … 277 277 usb_hub_descriptor_header_t descriptor; 278 278 size_t received_size; 279 int opResult = usb_request_get_descriptor(control_pipe,279 errno_t opResult = usb_request_get_descriptor(control_pipe, 280 280 USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_DEVICE, 281 281 USB_DESCTYPE_HUB, 0, 0, &descriptor, … … 317 317 for (unsigned int port = 0; port < hub_dev->port_count; ++port) { 318 318 usb_log_debug("(%p): Powering port %u.", hub_dev, port); 319 const int ret = usb_hub_port_set_feature(319 const errno_t ret = usb_hub_port_set_feature( 320 320 &hub_dev->ports[port], USB_HUB_FEATURE_PORT_POWER); 321 321 … … 343 343 * @return error code 344 344 */ 345 static int usb_set_first_configuration(usb_device_t *usb_device)345 static errno_t usb_set_first_configuration(usb_device_t *usb_device) 346 346 { 347 347 assert(usb_device); … … 369 369 /* Set configuration. Use the configuration that was in 370 370 * usb_device->descriptors.configuration i.e. The first one. */ 371 const int opResult = usb_request_set_configuration(371 const errno_t opResult = usb_request_set_configuration( 372 372 usb_device_get_default_pipe(usb_device), 373 373 config_descriptor->configuration_number); … … 406 406 /* Over-current condition is gone, it is safe to turn the ports on. */ 407 407 for (size_t port = 0; port < hub_dev->port_count; ++port) { 408 const int ret = usb_hub_port_set_feature(408 const errno_t ret = usb_hub_port_set_feature( 409 409 &hub_dev->ports[port], USB_HUB_FEATURE_PORT_POWER); 410 410 if (ret != EOK) { … … 438 438 /* NOTE: We can't use standard USB GET_STATUS request, because 439 439 * hubs reply is 4byte instead of 2 */ 440 const int opResult = usb_pipe_control_read(control_pipe,440 const errno_t opResult = usb_pipe_control_read(control_pipe, 441 441 &get_hub_status_request, sizeof(get_hub_status_request), 442 442 &status, sizeof(usb_hub_status_t), &rcvd_size); … … 456 456 usb_hub_over_current(hub_dev, status); 457 457 /* Ack change in hub OC flag */ 458 const int ret = usb_request_clear_feature(458 const errno_t ret = usb_request_clear_feature( 459 459 control_pipe, USB_REQUEST_TYPE_CLASS, 460 460 USB_REQUEST_RECIPIENT_DEVICE, … … 480 480 * Just ACK the change. 481 481 */ 482 const int ret = usb_request_clear_feature(482 const errno_t ret = usb_request_clear_feature( 483 483 control_pipe, USB_REQUEST_TYPE_CLASS, 484 484 USB_REQUEST_RECIPIENT_DEVICE,
Note:
See TracChangeset
for help on using the changeset viewer.