Changeset a1732929 in mainline for uspace/lib/usbhost/src
- Timestamp:
- 2018-01-15T17:04:34Z (8 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)
- Location:
- uspace/lib/usbhost/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/bus.c
rc1a966e ra1732929 387 387 } 388 388 389 usb_log_debug("Register endpoint %d:%d %s-%s %zuB. \n",389 usb_log_debug("Register endpoint %d:%d %s-%s %zuB.", 390 390 device->address, ep->endpoint, 391 391 usb_str_transfer_type(ep->transfer_type), … … 467 467 return ENOTSUP; 468 468 469 usb_log_debug("Unregister endpoint %d:%d %s-%s %zuB. \n",469 usb_log_debug("Unregister endpoint %d:%d %s-%s %zuB.", 470 470 device->address, ep->endpoint, 471 471 usb_str_transfer_type(ep->transfer_type), … … 543 543 endpoint_t *ep = bus_find_endpoint(device, target.endpoint, direction); 544 544 if (ep == NULL) { 545 usb_log_error("Endpoint(%d:%d) not registered for %s. \n",545 usb_log_error("Endpoint(%d:%d) not registered for %s.", 546 546 device->address, target.endpoint, name); 547 547 return ENOENT; -
uspace/lib/usbhost/src/ddf_helpers.c
rc1a966e ra1732929 133 133 assert(dev); 134 134 135 usb_log_debug("Device %d requested default address at %s speed \n",135 usb_log_debug("Device %d requested default address at %s speed", 136 136 dev->address, usb_str_speed(speed)); 137 137 return bus_reserve_default_address(hcd->bus, speed); … … 152 152 assert(dev); 153 153 154 usb_log_debug("Device %d released default address \n", dev->address);154 usb_log_debug("Device %d released default address", dev->address); 155 155 bus_release_default_address(hcd->bus); 156 156 … … 173 173 assert(hub); 174 174 175 usb_log_debug("Hub %d reported a new USB device on port: %u \n",175 usb_log_debug("Hub %d reported a new USB device on port: %u", 176 176 hub->address, port); 177 177 return hcd_ddf_new_device(hcd, hc, hub, port); … … 185 185 assert(ddf_dev); 186 186 assert(dev); 187 usb_log_debug("Hub `%s' reported removal of device on port %u \n",187 usb_log_debug("Hub `%s' reported removal of device on port %u", 188 188 ddf_fun_get_name(fun), port); 189 189 return hcd_ddf_remove_device(ddf_dev, dev, port); … … 535 535 hc_device_t *instance = ddf_dev_data_alloc(device, size); 536 536 if (instance == NULL) { 537 usb_log_error("Failed to allocate HCD ddf structure. \n");537 usb_log_error("Failed to allocate HCD ddf structure."); 538 538 return ENOMEM; 539 539 } … … 543 543 instance->ctl_fun = ddf_fun_create(device, fun_exposed, "ctl"); 544 544 if (!instance->ctl_fun) { 545 usb_log_error("Failed to create HCD ddf fun. \n");545 usb_log_error("Failed to create HCD ddf fun."); 546 546 goto err_destroy_fun; 547 547 } … … 549 549 ret = ddf_fun_bind(instance->ctl_fun); 550 550 if (ret != EOK) { 551 usb_log_error("Failed to bind ctl_fun: %s. \n", str_error(ret));551 usb_log_error("Failed to bind ctl_fun: %s.", str_error(ret)); 552 552 goto err_destroy_fun; 553 553 } … … 555 555 ret = ddf_fun_add_to_category(instance->ctl_fun, USB_HC_CATEGORY); 556 556 if (ret != EOK) { 557 usb_log_error("Failed to add fun to category: %s. \n",557 usb_log_error("Failed to add fun to category: %s.", 558 558 str_error(ret)); 559 559 ddf_fun_unbind(instance->ctl_fun); -
uspace/lib/usbhost/src/endpoint.c
rc1a966e ra1732929 239 239 usbhc_iface_transfer_callback_t on_complete, void *arg, const char *name) 240 240 { 241 usb_log_debug2("%s %d:%d %zu(%zu). \n",241 usb_log_debug2("%s %d:%d %zu(%zu).", 242 242 name, target.address, target.endpoint, size, ep->max_packet_size); 243 243 … … 250 250 const bus_ops_t *ops = BUS_OPS_LOOKUP(device->bus->ops, batch_schedule); 251 251 if (!ops) { 252 usb_log_error("HCD does not implement scheduler. \n");252 usb_log_error("HCD does not implement scheduler."); 253 253 return ENOTSUP; 254 254 } … … 270 270 usb_transfer_batch_t *batch = usb_transfer_batch_create(ep); 271 271 if (!batch) { 272 usb_log_error("Failed to create transfer batch. \n");272 usb_log_error("Failed to create transfer batch."); 273 273 return ENOMEM; 274 274 } -
uspace/lib/usbhost/src/hcd.c
rc1a966e ra1732929 169 169 const int irq = hc_driver->irq_code_gen(&irq_code, hcd, hw_res); 170 170 if (irq < 0) { 171 usb_log_error("Failed to generate IRQ code: %s. \n",171 usb_log_error("Failed to generate IRQ code: %s.", 172 172 str_error(irq)); 173 173 return irq; … … 178 178 irq_code_clean(&irq_code); 179 179 if (irq_cap < 0) { 180 usb_log_error("Failed to register interrupt handler: %s. \n",180 usb_log_error("Failed to register interrupt handler: %s.", 181 181 str_error(irq_cap)); 182 182 return irq_cap; … … 186 186 int ret = hcd_ddf_enable_interrupt(hcd, irq); 187 187 if (ret != EOK) { 188 usb_log_error("Failed to enable interrupts: %s. \n",188 usb_log_error("Failed to enable interrupts: %s.", 189 189 str_error(ret)); 190 190 unregister_interrupt_handler(hcd->ddf_dev, irq_cap); … … 219 219 ret = hcd_ddf_setup_hc(device, hc_driver->hc_device_size); 220 220 if (ret != EOK) { 221 usb_log_error("Failed to setup HC device. \n");221 usb_log_error("Failed to setup HC device."); 222 222 return ret; 223 223 } … … 229 229 if (ret != EOK) { 230 230 usb_log_error("Failed to get register memory addresses " 231 "for `%s': %s. \n", ddf_dev_get_name(device),231 "for `%s': %s.", ddf_dev_get_name(device), 232 232 str_error(ret)); 233 233 goto err_hcd; … … 236 236 ret = hc_driver->hc_add(hcd, &hw_res); 237 237 if (ret != EOK) { 238 usb_log_error("Failed to init HCD. \n");238 usb_log_error("Failed to init HCD."); 239 239 goto err_hw_res; 240 240 } … … 245 245 hcd->irq_cap = hcd_ddf_setup_interrupts(hcd, &hw_res); 246 246 if (hcd->irq_cap >= 0) { 247 usb_log_debug("Hw interrupts enabled. \n");247 usb_log_debug("Hw interrupts enabled."); 248 248 } 249 249 … … 261 261 ret = hc_driver->start(hcd); 262 262 if (ret != EOK) { 263 usb_log_error("Failed to start HCD: %s. \n", str_error(ret));263 usb_log_error("Failed to start HCD: %s.", str_error(ret)); 264 264 goto err_irq; 265 265 } … … 271 271 hcd->polling_fibril = fibril_create(interrupt_polling, hcd->bus); 272 272 if (!hcd->polling_fibril) { 273 usb_log_error("Failed to create polling fibril \n");273 usb_log_error("Failed to create polling fibril"); 274 274 ret = ENOMEM; 275 275 goto err_started; … … 277 277 fibril_add_ready(hcd->polling_fibril); 278 278 usb_log_warning("Failed to enable interrupts: %s." 279 " Falling back to polling. \n", str_error(hcd->irq_cap));279 " Falling back to polling.", str_error(hcd->irq_cap)); 280 280 } 281 281 … … 287 287 ret = hc_driver->setup_root_hub(hcd); 288 288 if (ret != EOK) { 289 usb_log_error("Failed to setup HC root hub: %s. \n",289 usb_log_error("Failed to setup HC root hub: %s.", 290 290 str_error(ret)); 291 291 goto err_polling; 292 292 } 293 293 294 usb_log_info("Controlling new `%s' device `%s'. \n",294 usb_log_info("Controlling new `%s' device `%s'.", 295 295 hc_driver->name, ddf_dev_get_name(device)); 296 296 return EOK; -
uspace/lib/usbhost/src/usb_transfer_batch.c
rc1a966e ra1732929 93 93 94 94 if (ops) { 95 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " destroying. \n",95 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " destroying.", 96 96 batch, USB_TRANSFER_BATCH_ARGS(*batch)); 97 97 ops->batch_destroy(batch); 98 98 } 99 99 else { 100 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " disposing. \n",100 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " disposing.", 101 101 batch, USB_TRANSFER_BATCH_ARGS(*batch)); 102 102 free(batch); … … 114 114 assert(batch->ep); 115 115 116 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " finishing. \n",116 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " finishing.", 117 117 batch, USB_TRANSFER_BATCH_ARGS(*batch)); 118 118
Note:
See TracChangeset
for help on using the changeset viewer.