Changeset a1732929 in mainline for uspace/drv/bus/usb/usbhub/usbhub.c
- Timestamp:
- 2018-01-15T17:04:34Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ff99e8
- Parents:
- c1a966e
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:32)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/usbhub.c
rc1a966e ra1732929 117 117 usb_device_data_alloc(usb_dev, sizeof(usb_hub_dev_t)); 118 118 if (hub_dev == NULL) { 119 usb_log_error("Failed to create hub driver structure. \n");119 usb_log_error("Failed to create hub driver structure."); 120 120 return ENOMEM; 121 121 } … … 129 129 int opResult = usb_set_first_configuration(usb_dev); 130 130 if (opResult != EOK) { 131 usb_log_error("Could not set hub configuration: %s \n",131 usb_log_error("Could not set hub configuration: %s", 132 132 str_error(opResult)); 133 133 return opResult; … … 137 137 opResult = usb_hub_process_hub_specific_info(hub_dev); 138 138 if (opResult != EOK) { 139 usb_log_error("Could process hub specific info, %s \n",139 usb_log_error("Could process hub specific info, %s", 140 140 str_error(opResult)); 141 141 return opResult; … … 143 143 144 144 /* Create hub control function. */ 145 usb_log_debug("Creating DDF function '" HUB_FNC_NAME "'. \n");145 usb_log_debug("Creating DDF function '" HUB_FNC_NAME "'."); 146 146 hub_dev->hub_fun = usb_device_ddf_fun_create(hub_dev->usb_device, 147 147 fun_exposed, HUB_FNC_NAME); 148 148 if (hub_dev->hub_fun == NULL) { 149 usb_log_error("Failed to create hub function. \n");149 usb_log_error("Failed to create hub function."); 150 150 return ENOMEM; 151 151 } … … 154 154 opResult = ddf_fun_bind(hub_dev->hub_fun); 155 155 if (opResult != EOK) { 156 usb_log_error("Failed to bind hub function: %s. \n",156 usb_log_error("Failed to bind hub function: %s.", 157 157 str_error(opResult)); 158 158 ddf_fun_destroy(hub_dev->hub_fun); … … 167 167 ddf_fun_unbind(hub_dev->hub_fun); 168 168 ddf_fun_destroy(hub_dev->hub_fun); 169 usb_log_error("Failed to initialize polling fibril: %s. \n",169 usb_log_error("Failed to initialize polling fibril: %s.", 170 170 str_error(opResult)); 171 171 return opResult; … … 189 189 ddf_fun_unbind(hub_dev->hub_fun); 190 190 ddf_fun_destroy(hub_dev->hub_fun); 191 usb_log_error("Failed to create polling fibril: %s. \n",191 usb_log_error("Failed to create polling fibril: %s.", 192 192 str_error(opResult)); 193 193 return opResult; … … 195 195 196 196 hub_dev->running = true; 197 usb_log_info("Controlling hub '%s' (%p: %zu ports). \n",197 usb_log_info("Controlling hub '%s' (%p: %zu ports).", 198 198 usb_device_get_name(hub_dev->usb_device), hub_dev, 199 199 hub_dev->port_count); … … 335 335 sizeof(usb_hub_descriptor_header_t), &received_size); 336 336 if (opResult != EOK) { 337 usb_log_error("(%p): Failed to receive hub descriptor: %s. \n",337 usb_log_error("(%p): Failed to receive hub descriptor: %s.", 338 338 hub_dev, str_error(opResult)); 339 339 return opResult; 340 340 } 341 341 342 usb_log_debug("(%p): Setting port count to %d. \n", hub_dev,342 usb_log_debug("(%p): Setting port count to %d.", hub_dev, 343 343 descriptor.port_count); 344 344 hub_dev->port_count = descriptor.port_count; … … 365 365 } 366 366 367 usb_log_info("(%p): Hub port power switching enabled (%s). \n", hub_dev,367 usb_log_info("(%p): Hub port power switching enabled (%s).", hub_dev, 368 368 hub_dev->per_port_power ? "per port" : "ganged"); 369 369 … … 374 374 375 375 if (ret != EOK) { 376 usb_log_error("(%p-%u): Cannot power on port: %s. \n",376 usb_log_error("(%p-%u): Cannot power on port: %s.", 377 377 hub_dev, hub_dev->ports[port].port_number, 378 378 str_error(ret)); … … 402 402 const size_t configuration_count = 403 403 usb_device_descriptors(usb_device)->device.configuration_count; 404 usb_log_debug("Hub has %zu configurations. \n", configuration_count);404 usb_log_debug("Hub has %zu configurations.", configuration_count); 405 405 406 406 if (configuration_count < 1) { 407 usb_log_error("There are no configurations available \n");407 usb_log_error("There are no configurations available"); 408 408 return EINVAL; 409 409 } … … 426 426 config_descriptor->configuration_number); 427 427 if (opResult != EOK) { 428 usb_log_error("Failed to set hub configuration: %s. \n",428 usb_log_error("Failed to set hub configuration: %s.", 429 429 str_error(opResult)); 430 430 } else { 431 usb_log_debug("\tUsed configuration %d \n",431 usb_log_debug("\tUsed configuration %d", 432 432 config_descriptor->configuration_number); 433 433 }
Note:
See TracChangeset
for help on using the changeset viewer.