Changeset a1732929 in mainline for uspace/drv/bus/usb
- 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/drv/bus/usb
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci_batch.c
rc1a966e ra1732929 143 143 batch_setup[ehci_batch->base.ep->transfer_type](ehci_batch); 144 144 145 usb_log_debug("Batch %p %s " USB_TRANSFER_BATCH_FMT " initialized. \n",145 usb_log_debug("Batch %p %s " USB_TRANSFER_BATCH_FMT " initialized.", 146 146 ehci_batch, usb_str_direction(ehci_batch->base.dir), 147 147 USB_TRANSFER_BATCH_ARGS(ehci_batch->base)); … … 163 163 assert(ehci_batch); 164 164 165 usb_log_debug("Batch %p: checking %zu td(s) for completion. \n",165 usb_log_debug("Batch %p: checking %zu td(s) for completion.", 166 166 ehci_batch, ehci_batch->td_count); 167 167 168 usb_log_debug2("Batch %p: QH: %08x:%08x:%08x:%08x:%08x:%08x. \n",168 usb_log_debug2("Batch %p: QH: %08x:%08x:%08x:%08x:%08x:%08x.", 169 169 ehci_batch, 170 170 ehci_batch->qh->ep_char, ehci_batch->qh->ep_cap, -
uspace/drv/bus/usb/ehci/ehci_rh.c
rc1a966e ra1732929 107 107 (EHCI_RD(caps->hcsparams) >> EHCI_CAPS_HCS_N_PORTS_SHIFT) & 108 108 EHCI_CAPS_HCS_N_PORTS_MASK; 109 usb_log_debug2("RH(%p): hcsparams: %x. \n", instance,109 usb_log_debug2("RH(%p): hcsparams: %x.", instance, 110 110 EHCI_RD(caps->hcsparams)); 111 usb_log_info("RH(%p): Found %u ports. \n", instance,111 usb_log_info("RH(%p): Found %u ports.", instance, 112 112 instance->port_count); 113 113 -
uspace/drv/bus/usb/ehci/endpoint_list.c
rc1a966e ra1732929 97 97 assert(ep); 98 98 assert(ep->qh); 99 usb_log_debug2("EPL(%p-%s): Append endpoint(%p). \n",99 usb_log_debug2("EPL(%p-%s): Append endpoint(%p).", 100 100 instance, instance->name, ep); 101 101 … … 128 128 ehci_endpoint_t *first = ehci_endpoint_list_instance( 129 129 list_first(&instance->endpoint_list)); 130 usb_log_debug("EPL(%p-%s): EP(%p) added to list, first is %p(%p). \n",130 usb_log_debug("EPL(%p-%s): EP(%p) added to list, first is %p(%p).", 131 131 instance, instance->name, ep, first, first->qh); 132 132 if (last_qh == instance->list_head) { 133 usb_log_debug2("EPL(%p-%s): head EP(%p-%"PRIxn"): %x:%x. \n",133 usb_log_debug2("EPL(%p-%s): head EP(%p-%"PRIxn"): %x:%x.", 134 134 instance, instance->name, last_qh, 135 135 addr_to_phys(instance->list_head), … … 153 153 fibril_mutex_lock(&instance->guard); 154 154 155 usb_log_debug2("EPL(%p-%s): removing EP(%p). \n",155 usb_log_debug2("EPL(%p-%s): removing EP(%p).", 156 156 instance, instance->name, ep); 157 157 … … 172 172 write_barrier(); 173 173 174 usb_log_debug("EPL(%p-%s): EP(%p) removed (%s), horizontal %x. \n",174 usb_log_debug("EPL(%p-%s): EP(%p) removed (%s), horizontal %x.", 175 175 instance, instance->name, ep, qpos, ep->qh->horizontal); 176 176 -
uspace/drv/bus/usb/ehci/hc.c
rc1a966e ra1732929 134 134 EHCI_WR(code->cmds[1].value, EHCI_USED_INTERRUPTS); 135 135 136 usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d. \n",136 usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d.", 137 137 RNGABSPTR(regs), RNGSZ(regs), hw_res->irqs.irqs[0]); 138 138 … … 160 160 if (ret != EOK) { 161 161 usb_log_error("HC(%p): Failed to gain access to device " 162 "registers: %s. \n", instance, str_error(ret));162 "registers: %s.", instance, str_error(ret)); 163 163 return ret; 164 164 } … … 211 211 assert(ep); 212 212 ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep); 213 usb_log_debug("HC(%p) enqueue EP(%d:%d:%s:%s) \n", instance,213 usb_log_debug("HC(%p) enqueue EP(%d:%d:%s:%s)", instance, 214 214 ep->device->address, ep->endpoint, 215 215 usb_str_transfer_type_short(ep->transfer_type), … … 235 235 assert(ep); 236 236 ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep); 237 usb_log_debug("HC(%p) dequeue EP(?:%d:%s:%s) \n", instance,237 usb_log_debug("HC(%p) dequeue EP(?:%d:%s:%s)", instance, 238 238 ep->endpoint, 239 239 usb_str_transfer_type_short(ep->transfer_type), … … 423 423 usb_log_debug("HC(%p): HW started.", instance); 424 424 425 usb_log_debug2("HC(%p): Registers: \n"426 "\tUSBCMD(%p): %x(0x00080000 = at least 1ms between interrupts) \n"427 "\tUSBSTS(%p): %x(0x00001000 = HC halted) \n"428 "\tUSBINT(%p): %x(0x0 = no interrupts). \n"429 "\tCONFIG(%p): %x(0x0 = ports controlled by companion hc). \n",425 usb_log_debug2("HC(%p): Registers: " 426 "\tUSBCMD(%p): %x(0x00080000 = at least 1ms between interrupts)" 427 "\tUSBSTS(%p): %x(0x00001000 = HC halted)" 428 "\tUSBINT(%p): %x(0x0 = no interrupts)." 429 "\tCONFIG(%p): %x(0x0 = ports controlled by companion hc).", 430 430 instance, 431 431 &instance->registers->usbcmd, EHCI_RD(instance->registers->usbcmd), -
uspace/drv/bus/usb/ehci/res.c
rc1a966e ra1732929 74 74 eecp + USBLEGSUP_OFFSET, &usblegsup); 75 75 if (ret != EOK) { 76 usb_log_error("Failed to read USBLEGSUP: %s. \n", str_error(ret));77 return ret; 78 } 79 usb_log_debug2("USBLEGSUP: %" PRIx32 ". \n", usblegsup);76 usb_log_error("Failed to read USBLEGSUP: %s.", str_error(ret)); 77 return ret; 78 } 79 usb_log_debug2("USBLEGSUP: %" PRIx32 ".", usblegsup); 80 80 81 81 /* Request control from firmware/BIOS by writing 1 to highest 82 82 * byte. (OS Control semaphore)*/ 83 usb_log_debug("Requesting OS control. \n");83 usb_log_debug("Requesting OS control."); 84 84 ret = pci_config_space_write_8(parent_sess, 85 85 eecp + USBLEGSUP_OFFSET + 3, 1); 86 86 if (ret != EOK) { 87 usb_log_error("Failed to request OS EHCI control: %s. \n",87 usb_log_error("Failed to request OS EHCI control: %s.", 88 88 str_error(ret)); 89 89 return ret; … … 103 103 104 104 if ((usblegsup & USBLEGSUP_BIOS_CONTROL) == 0) { 105 usb_log_info("BIOS released control after %zu usec. \n", wait);105 usb_log_info("BIOS released control after %zu usec.", wait); 106 106 return EOK; 107 107 } … … 109 109 /* BIOS failed to hand over control, this should not happen. */ 110 110 usb_log_warning( "BIOS failed to release control after " 111 "%zu usecs, force it. \n", wait);111 "%zu usecs, force it.", wait); 112 112 ret = pci_config_space_write_32(parent_sess, 113 113 eecp + USBLEGSUP_OFFSET, USBLEGSUP_OS_CONTROL); 114 114 if (ret != EOK) { 115 usb_log_error("Failed to force OS control: %s. \n",115 usb_log_error("Failed to force OS control: %s.", 116 116 str_error(ret)); 117 117 return ret; … … 130 130 eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts); 131 131 if (ret != EOK) { 132 usb_log_error("Failed to get USBLEGCTLSTS: %s. \n",132 usb_log_error("Failed to get USBLEGCTLSTS: %s.", 133 133 str_error(ret)); 134 134 return ret; 135 135 } 136 usb_log_debug2("USBLEGCTLSTS: %" PRIx32 ". \n", usblegctlsts);136 usb_log_debug2("USBLEGCTLSTS: %" PRIx32 ".", usblegctlsts); 137 137 /* 138 138 * Zero SMI enables in legacy control register. … … 143 143 eecp + USBLEGCTLSTS_OFFSET, 0xe0000000); 144 144 if (ret != EOK) { 145 usb_log_error("Failed to zero USBLEGCTLSTS: %s \n",145 usb_log_error("Failed to zero USBLEGCTLSTS: %s", 146 146 str_error(ret)); 147 147 return ret; … … 153 153 eecp + USBLEGCTLSTS_OFFSET, &usblegctlsts); 154 154 if (ret != EOK) { 155 usb_log_error("Failed to get USBLEGCTLSTS 2: %s. \n",155 usb_log_error("Failed to get USBLEGCTLSTS 2: %s.", 156 156 str_error(ret)); 157 157 return ret; 158 158 } 159 usb_log_debug2("Zeroed USBLEGCTLSTS: %" PRIx32 ". \n",159 usb_log_debug2("Zeroed USBLEGCTLSTS: %" PRIx32 ".", 160 160 usblegctlsts); 161 161 } … … 165 165 eecp + USBLEGSUP_OFFSET, &usblegsup); 166 166 if (ret != EOK) { 167 usb_log_error("Failed to read USBLEGSUP: %s. \n",168 str_error(ret)); 169 return ret; 170 } 171 usb_log_debug2("USBLEGSUP: %" PRIx32 ". \n", usblegsup);167 usb_log_error("Failed to read USBLEGSUP: %s.", 168 str_error(ret)); 169 return ret; 170 } 171 usb_log_debug2("USBLEGSUP: %" PRIx32 ".", usblegsup); 172 172 return ret; 173 173 } … … 181 181 return ENOMEM; 182 182 183 usb_log_debug("Disabling EHCI legacy support. \n");183 usb_log_debug("Disabling EHCI legacy support."); 184 184 185 185 186 186 const uint32_t hcc_params = EHCI_RD(hc->caps->hccparams); 187 usb_log_debug2("Value of hcc params register: %x. \n", hcc_params);187 usb_log_debug2("Value of hcc params register: %x.", hcc_params); 188 188 189 189 /* Read value of EHCI Extended Capabilities Pointer … … 191 191 const uint32_t eecp = 192 192 (hcc_params >> EHCI_CAPS_HCC_EECP_SHIFT) & EHCI_CAPS_HCC_EECP_MASK; 193 usb_log_debug2("Value of EECP: %x. \n", eecp);193 usb_log_debug2("Value of EECP: %x.", eecp); 194 194 195 195 int ret = disable_extended_caps(parent_sess, eecp); 196 196 if (ret != EOK) { 197 usb_log_error("Failed to disable extended capabilities: %s. \n",197 usb_log_error("Failed to disable extended capabilities: %s.", 198 198 str_error(ret)); 199 199 goto clean; -
uspace/drv/bus/usb/ohci/endpoint_list.c
rc1a966e ra1732929 57 57 instance->list_head = malloc32(sizeof(ed_t)); 58 58 if (!instance->list_head) { 59 usb_log_error("Failed to allocate list head. \n");59 usb_log_error("Failed to allocate list head."); 60 60 return ENOMEM; 61 61 } 62 62 instance->list_head_pa = addr_to_phys(instance->list_head); 63 usb_log_debug2("Transfer list %s setup with ED: %p(0x%0" PRIx32 ")). \n",63 usb_log_debug2("Transfer list %s setup with ED: %p(0x%0" PRIx32 ")).", 64 64 name, instance->list_head, instance->list_head_pa); 65 65 … … 96 96 assert(instance); 97 97 assert(ep); 98 usb_log_debug2("Queue %s: Adding endpoint(%p). \n", instance->name, ep);98 usb_log_debug2("Queue %s: Adding endpoint(%p).", instance->name, ep); 99 99 100 100 fibril_mutex_lock(&instance->guard); … … 126 126 ohci_endpoint_t *first = list_get_instance( 127 127 list_first(&instance->endpoint_list), ohci_endpoint_t, link); 128 usb_log_debug("HCD EP(%p) added to list %s, first is %p(%p). \n",128 usb_log_debug("HCD EP(%p) added to list %s, first is %p(%p).", 129 129 ep, instance->name, first, first->ed); 130 130 if (last_ed == instance->list_head) { 131 usb_log_debug2("%s head ED(%p-0x%0" PRIx32 "): %x:%x:%x:%x. \n",131 usb_log_debug2("%s head ED(%p-0x%0" PRIx32 "): %x:%x:%x:%x.", 132 132 instance->name, last_ed, instance->list_head_pa, 133 133 last_ed->status, last_ed->td_tail, last_ed->td_head, … … 151 151 fibril_mutex_lock(&instance->guard); 152 152 153 usb_log_debug2("Queue %s: removing endpoint(%p). \n", instance->name, ep);153 usb_log_debug2("Queue %s: removing endpoint(%p).", instance->name, ep); 154 154 155 155 const char *qpos = NULL; … … 171 171 write_barrier(); 172 172 173 usb_log_debug("HCD EP(%p) removed (%s) from %s, next %x. \n",173 usb_log_debug("HCD EP(%p) removed (%s) from %s, next %x.", 174 174 ep, qpos, instance->name, ep->ed->next); 175 175 -
uspace/drv/bus/usb/ohci/hc.c
rc1a966e ra1732929 136 136 OHCI_WR(code->cmds[1].value, OHCI_USED_INTERRUPTS); 137 137 138 usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d. \n",138 usb_log_debug("Memory mapped regs at %p (size %zu), IRQ %d.", 139 139 RNGABSPTR(regs), RNGSZ(regs), hw_res->irqs.irqs[0]); 140 140 … … 160 160 (void **) &instance->registers); 161 161 if (ret != EOK) { 162 usb_log_error("Failed to gain access to registers: %s. \n",162 usb_log_error("Failed to gain access to registers: %s.", 163 163 str_error(ret)); 164 164 return ret; 165 165 } 166 usb_log_debug("Device registers at %" PRIx64 " (%zuB) accessible. \n",166 usb_log_debug("Device registers at %" PRIx64 " (%zuB) accessible.", 167 167 hw_res->mem_ranges.ranges[0].address.absolute, 168 168 hw_res->mem_ranges.ranges[0].size); … … 173 173 ret = hc_init_memory(instance); 174 174 if (ret != EOK) { 175 usb_log_error("Failed to create OHCI memory structures: %s. \n",175 usb_log_error("Failed to create OHCI memory structures: %s.", 176 176 str_error(ret)); 177 177 // TODO: We should disable pio access here … … 293 293 /* Check for root hub communication */ 294 294 if (batch->target.address == ohci_rh_get_address(&hc->rh)) { 295 usb_log_debug("OHCI root hub request. \n");295 usb_log_debug("OHCI root hub request."); 296 296 return ohci_rh_schedule(&hc->rh, batch); 297 297 } … … 341 341 if ((status & ~I_SF) == 0) /* ignore sof status */ 342 342 return; 343 usb_log_debug2("OHCI(%p) interrupt: %x. \n", hc, status);343 usb_log_debug2("OHCI(%p) interrupt: %x.", hc, status); 344 344 if (status & I_RHSC) 345 345 ohci_rh_interrupt(&hc->rh); … … 347 347 if (status & I_WDH) { 348 348 fibril_mutex_lock(&hc->guard); 349 usb_log_debug2("HCCA: %p-%#" PRIx32 " (%p). \n", hc->hcca,349 usb_log_debug2("HCCA: %p-%#" PRIx32 " (%p).", hc->hcca, 350 350 OHCI_RD(hc->registers->hcca), 351 351 (void *) addr_to_phys(hc->hcca)); 352 usb_log_debug2("Periodic current: %#" PRIx32 ". \n",352 usb_log_debug2("Periodic current: %#" PRIx32 ".", 353 353 OHCI_RD(hc->registers->periodic_current)); 354 354 … … 370 370 371 371 if (status & I_UE) { 372 usb_log_fatal("Error like no other! \n");372 usb_log_fatal("Error like no other!"); 373 373 hc_start(&hc->base); 374 374 } … … 387 387 hc_t *instance = hcd_to_hc(hcd); 388 388 389 usb_log_debug("Requesting OHCI control. \n");389 usb_log_debug("Requesting OHCI control."); 390 390 if (OHCI_RD(instance->registers->revision) & R_LEGACY_FLAG) { 391 391 /* Turn off legacy emulation, it should be enough to zero … … 396 396 volatile uint32_t *ohci_emulation_reg = 397 397 (uint32_t*)((char*)instance->registers + LEGACY_REGS_OFFSET); 398 usb_log_debug("OHCI legacy register %p: %x. \n",398 usb_log_debug("OHCI legacy register %p: %x.", 399 399 ohci_emulation_reg, OHCI_RD(*ohci_emulation_reg)); 400 400 /* Zero everything but A20State */ … … 402 402 OHCI_CLR(*ohci_emulation_reg, ~0x100); 403 403 usb_log_debug( 404 "OHCI legacy register (should be 0 or 0x100) %p: %x. \n",404 "OHCI legacy register (should be 0 or 0x100) %p: %x.", 405 405 ohci_emulation_reg, OHCI_RD(*ohci_emulation_reg)); 406 406 } … … 408 408 /* Interrupt routing enabled => smm driver is active */ 409 409 if (OHCI_RD(instance->registers->control) & C_IR) { 410 usb_log_debug("SMM driver: request ownership change. \n");410 usb_log_debug("SMM driver: request ownership change."); 411 411 // TODO: should we ack interrupts before doing this? 412 412 OHCI_SET(instance->registers->command_status, CS_OCR); … … 415 415 async_usleep(1000); 416 416 } 417 usb_log_info("SMM driver: Ownership taken. \n");417 usb_log_info("SMM driver: Ownership taken."); 418 418 C_HCFS_SET(instance->registers->control, C_HCFS_RESET); 419 419 async_usleep(50000); … … 424 424 /* Interrupt routing disabled && status != USB_RESET => BIOS active */ 425 425 if (hc_status != C_HCFS_RESET) { 426 usb_log_debug("BIOS driver found. \n");426 usb_log_debug("BIOS driver found."); 427 427 if (hc_status == C_HCFS_OPERATIONAL) { 428 usb_log_info("BIOS driver: HC operational. \n");428 usb_log_info("BIOS driver: HC operational."); 429 429 return EOK; 430 430 } … … 432 432 C_HCFS_SET(instance->registers->control, C_HCFS_RESUME); 433 433 async_usleep(20000); 434 usb_log_info("BIOS driver: HC resumed. \n");434 usb_log_info("BIOS driver: HC resumed."); 435 435 return EOK; 436 436 } … … 438 438 /* HC is in reset (hw startup) => no other driver 439 439 * maintain reset for at least the time specified in USB spec (50 ms)*/ 440 usb_log_debug("Host controller found in reset state. \n");440 usb_log_debug("Host controller found in reset state."); 441 441 async_usleep(50000); 442 442 return EOK; … … 454 454 /* OHCI guide page 42 */ 455 455 assert(instance); 456 usb_log_debug2("Started hc initialization routine. \n");456 usb_log_debug2("Started hc initialization routine."); 457 457 458 458 /* Save contents of fm_interval register */ 459 459 const uint32_t fm_interval = OHCI_RD(instance->registers->fm_interval); 460 usb_log_debug2("Old value of HcFmInterval: %x. \n", fm_interval);460 usb_log_debug2("Old value of HcFmInterval: %x.", fm_interval); 461 461 462 462 /* Reset hc */ 463 usb_log_debug2("HC reset. \n");463 usb_log_debug2("HC reset."); 464 464 size_t time = 0; 465 465 OHCI_WR(instance->registers->command_status, CS_HCR); … … 468 468 time += 10; 469 469 } 470 usb_log_debug2("HC reset complete in %zu us. \n", time);470 usb_log_debug2("HC reset complete in %zu us.", time); 471 471 472 472 /* Restore fm_interval */ … … 475 475 476 476 /* hc is now in suspend state */ 477 usb_log_debug2("HC should be in suspend state(%x). \n",477 usb_log_debug2("HC should be in suspend state(%x).", 478 478 OHCI_RD(instance->registers->control)); 479 479 … … 484 484 OHCI_WR(instance->registers->bulk_head, 485 485 instance->lists[USB_TRANSFER_BULK].list_head_pa); 486 usb_log_debug2("Bulk HEAD set to: %p (%#" PRIx32 "). \n",486 usb_log_debug2("Bulk HEAD set to: %p (%#" PRIx32 ").", 487 487 instance->lists[USB_TRANSFER_BULK].list_head, 488 488 instance->lists[USB_TRANSFER_BULK].list_head_pa); … … 490 490 OHCI_WR(instance->registers->control_head, 491 491 instance->lists[USB_TRANSFER_CONTROL].list_head_pa); 492 usb_log_debug2("Control HEAD set to: %p (%#" PRIx32 "). \n",492 usb_log_debug2("Control HEAD set to: %p (%#" PRIx32 ").", 493 493 instance->lists[USB_TRANSFER_CONTROL].list_head, 494 494 instance->lists[USB_TRANSFER_CONTROL].list_head_pa); … … 496 496 /* Enable queues */ 497 497 OHCI_SET(instance->registers->control, (C_PLE | C_IE | C_CLE | C_BLE)); 498 usb_log_debug("Queues enabled(%x). \n",498 usb_log_debug("Queues enabled(%x).", 499 499 OHCI_RD(instance->registers->control)); 500 500 … … 503 503 OHCI_WR(instance->registers->interrupt_enable, 504 504 OHCI_USED_INTERRUPTS); 505 usb_log_debug("Enabled interrupts: %x. \n",505 usb_log_debug("Enabled interrupts: %x.", 506 506 OHCI_RD(instance->registers->interrupt_enable)); 507 507 OHCI_WR(instance->registers->interrupt_enable, I_MI); … … 513 513 OHCI_WR(instance->registers->periodic_start, 514 514 ((frame_length / 10) * 9) & PS_MASK << PS_SHIFT); 515 usb_log_debug2("All periodic start set to: %x(%u - 90%% of %d). \n",515 usb_log_debug2("All periodic start set to: %x(%u - 90%% of %d).", 516 516 OHCI_RD(instance->registers->periodic_start), 517 517 OHCI_RD(instance->registers->periodic_start), frame_length); 518 518 C_HCFS_SET(instance->registers->control, C_HCFS_OPERATIONAL); 519 usb_log_debug("OHCI HC up and running (ctl_reg=0x%x). \n",519 usb_log_debug("OHCI HC up and running (ctl_reg=0x%x).", 520 520 OHCI_RD(instance->registers->control)); 521 521 … … 536 536 const int ret = endpoint_list_init(&instance->lists[type], name); \ 537 537 if (ret != EOK) { \ 538 usb_log_error("Failed to setup %s endpoint list: %s. \n", \538 usb_log_error("Failed to setup %s endpoint list: %s.", \ 539 539 name, str_error(ret)); \ 540 540 endpoint_list_fini(&instance->lists[USB_TRANSFER_ISOCHRONOUS]);\ … … 577 577 if (instance->hcca == NULL) 578 578 return ENOMEM; 579 usb_log_debug2("OHCI HCCA initialized at %p. \n", instance->hcca);579 usb_log_debug2("OHCI HCCA initialized at %p.", instance->hcca); 580 580 581 581 for (unsigned i = 0; i < HCCA_INT_EP_COUNT; ++i) { … … 583 583 instance->lists[USB_TRANSFER_INTERRUPT].list_head_pa); 584 584 } 585 usb_log_debug2("Interrupt HEADs set to: %p (%#" PRIx32 "). \n",585 usb_log_debug2("Interrupt HEADs set to: %p (%#" PRIx32 ").", 586 586 instance->lists[USB_TRANSFER_INTERRUPT].list_head, 587 587 instance->lists[USB_TRANSFER_INTERRUPT].list_head_pa); -
uspace/drv/bus/usb/ohci/ohci_batch.c
rc1a966e ra1732929 175 175 assert(ohci_batch); 176 176 177 usb_log_debug("Batch %p checking %zu td(s) for completion. \n",177 usb_log_debug("Batch %p checking %zu td(s) for completion.", 178 178 &ohci_batch->base, ohci_batch->td_count); 179 usb_log_debug2("ED: %08x:%08x:%08x:%08x. \n",179 usb_log_debug2("ED: %08x:%08x:%08x:%08x.", 180 180 ohci_batch->ed->status, ohci_batch->ed->td_head, 181 181 ohci_batch->ed->td_tail, ohci_batch->ed->next); … … 196 196 for (size_t i = 0; i < ohci_batch->td_count; ++i) { 197 197 assert(ohci_batch->tds[i] != NULL); 198 usb_log_debug("TD %zu: %08x:%08x:%08x:%08x. \n", i,198 usb_log_debug("TD %zu: %08x:%08x:%08x:%08x.", i, 199 199 ohci_batch->tds[i]->status, ohci_batch->tds[i]->cbp, 200 200 ohci_batch->tds[i]->next, ohci_batch->tds[i]->be); … … 217 217 -= td_remain_size(ohci_batch->tds[i]); 218 218 } else { 219 usb_log_debug("Batch %p found error TD(%zu):%08x. \n",219 usb_log_debug("Batch %p found error TD(%zu):%08x.", 220 220 &ohci_batch->base, i, 221 221 ohci_batch->tds[i]->status); … … 295 295 assert(dir == USB_DIRECTION_IN || dir == USB_DIRECTION_OUT); 296 296 297 usb_log_debug("Using ED(%p): %08x:%08x:%08x:%08x. \n", ohci_batch->ed,297 usb_log_debug("Using ED(%p): %08x:%08x:%08x:%08x.", ohci_batch->ed, 298 298 ohci_batch->ed->status, ohci_batch->ed->td_tail, 299 299 ohci_batch->ed->td_head, ohci_batch->ed->next); … … 312 312 ohci_batch->tds[0], ohci_batch->tds[1], USB_DIRECTION_BOTH, 313 313 buffer, USB_SETUP_PACKET_SIZE, toggle); 314 usb_log_debug("Created CONTROL SETUP TD: %08x:%08x:%08x:%08x. \n",314 usb_log_debug("Created CONTROL SETUP TD: %08x:%08x:%08x:%08x.", 315 315 ohci_batch->tds[0]->status, ohci_batch->tds[0]->cbp, 316 316 ohci_batch->tds[0]->next, ohci_batch->tds[0]->be); … … 328 328 ohci_batch->tds[td_current + 1], 329 329 data_dir, buffer, transfer_size, toggle); 330 usb_log_debug("Created CONTROL DATA TD: %08x:%08x:%08x:%08x. \n",330 usb_log_debug("Created CONTROL DATA TD: %08x:%08x:%08x:%08x.", 331 331 ohci_batch->tds[td_current]->status, 332 332 ohci_batch->tds[td_current]->cbp, … … 344 344 td_init(ohci_batch->tds[td_current], ohci_batch->tds[td_current + 1], 345 345 status_dir, NULL, 0, 1); 346 usb_log_debug("Created CONTROL STATUS TD: %08x:%08x:%08x:%08x. \n",346 usb_log_debug("Created CONTROL STATUS TD: %08x:%08x:%08x:%08x.", 347 347 ohci_batch->tds[td_current]->status, 348 348 ohci_batch->tds[td_current]->cbp, … … 350 350 ohci_batch->tds[td_current]->be); 351 351 usb_log_debug2( 352 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized. \n", \352 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.", \ 353 353 &ohci_batch->base, 354 354 usb_str_transfer_type(ohci_batch->base.ep->transfer_type), … … 371 371 usb_direction_t dir = ohci_batch->base.dir; 372 372 assert(dir == USB_DIRECTION_IN || dir == USB_DIRECTION_OUT); 373 usb_log_debug("Using ED(%p): %08x:%08x:%08x:%08x. \n", ohci_batch->ed,373 usb_log_debug("Using ED(%p): %08x:%08x:%08x:%08x.", ohci_batch->ed, 374 374 ohci_batch->ed->status, ohci_batch->ed->td_tail, 375 375 ohci_batch->ed->td_head, ohci_batch->ed->next); … … 386 386 dir, buffer, transfer_size, -1); 387 387 388 usb_log_debug("Created DATA TD: %08x:%08x:%08x:%08x. \n",388 usb_log_debug("Created DATA TD: %08x:%08x:%08x:%08x.", 389 389 ohci_batch->tds[td_current]->status, 390 390 ohci_batch->tds[td_current]->cbp, … … 398 398 } 399 399 usb_log_debug2( 400 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized. \n", \400 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.", \ 401 401 &ohci_batch->base, 402 402 usb_str_transfer_type(ohci_batch->base.ep->transfer_type), -
uspace/drv/bus/usb/ohci/ohci_rh.c
rc1a966e ra1732929 114 114 instance->registers = regs; 115 115 instance->port_count = OHCI_RD(regs->rh_desc_a) & RHDA_NDS_MASK; 116 usb_log_debug2("rh_desc_a: %x. \n", OHCI_RD(regs->rh_desc_a));116 usb_log_debug2("rh_desc_a: %x.", OHCI_RD(regs->rh_desc_a)); 117 117 if (instance->port_count > OHCI_MAX_PORTS) { 118 118 usb_log_warning("OHCI specification does not allow %d ports. " 119 "Max %d ports will be used. \n", instance->port_count,119 "Max %d ports will be used.", instance->port_count, 120 120 OHCI_MAX_PORTS); 121 121 instance->port_count = OHCI_MAX_PORTS; 122 122 } 123 usb_log_info("%s: Found %u ports. \n", name, instance->port_count);123 usb_log_info("%s: Found %u ports.", name, instance->port_count); 124 124 125 125 #if defined OHCI_POWER_SWITCH_no 126 usb_log_info("%s: Set power mode to no power switching. \n", name);126 usb_log_info("%s: Set power mode to no power switching.", name); 127 127 /* Set port power mode to no power-switching. (always on) */ 128 128 OHCI_SET(regs->rh_desc_a, RHDA_NPS_FLAG); … … 132 132 133 133 #elif defined OHCI_POWER_SWITCH_ganged 134 usb_log_info("%s: Set power mode to ganged power switching. \n", name);134 usb_log_info("%s: Set power mode to ganged power switching.", name); 135 135 /* Set port power mode to ganged power-switching. */ 136 136 OHCI_CLR(regs->rh_desc_a, RHDA_NPS_FLAG); … … 144 144 OHCI_CLR(regs->rh_desc_a, RHDA_OCPM_FLAG); 145 145 #else 146 usb_log_info("%s: Set power mode to per-port power switching. \n", name);146 usb_log_info("%s: Set power mode to per-port power switching.", name); 147 147 /* Set port power mode to per port power-switching. */ 148 148 OHCI_CLR(regs->rh_desc_a, RHDA_NPS_FLAG); … … 356 356 case USB_HUB_FEATURE_C_PORT_RESET: /*20*/ 357 357 usb_log_debug2("Clearing port C_CONNECTION, C_ENABLE, " 358 "C_SUSPEND, C_OC or C_RESET on port %u. \n", port);358 "C_SUSPEND, C_OC or C_RESET on port %u.", port); 359 359 /* Bit offsets correspond to the feature number */ 360 360 OHCI_WR(hub->registers->rh_port_status[port], … … 405 405 case USB_HUB_FEATURE_PORT_RESET: /*4*/ 406 406 usb_log_debug2("Setting port POWER, ENABLE, SUSPEND or RESET " 407 "on port %u. \n", port);407 "on port %u.", port); 408 408 /* Bit offsets correspond to the feature number */ 409 409 OHCI_WR(hub->registers->rh_port_status[port], 1 << feature); … … 451 451 } 452 452 453 usb_log_debug2("OHCI root hub interrupt mask: %hx. \n", mask);453 usb_log_debug2("OHCI root hub interrupt mask: %hx.", mask); 454 454 455 455 if (mask == 0) -
uspace/drv/bus/usb/uhci/hc.c
rc1a966e ra1732929 141 141 code->cmds[3].addr = (void*)®isters->usbsts; 142 142 143 usb_log_debug("I/O regs at %p (size %zu), IRQ %d. \n",143 usb_log_debug("I/O regs at %p (size %zu), IRQ %d.", 144 144 RNGABSPTR(regs), RNGSZ(regs), hw_res->irqs.irqs[0]); 145 145 … … 182 182 /* Resume interrupts are not supported */ 183 183 if (status & UHCI_STATUS_RESUME) { 184 usb_log_error("Resume interrupt! \n");184 usb_log_error("Resume interrupt!"); 185 185 } 186 186 187 187 /* Bits 4 and 5 indicate hc error */ 188 188 if (status & (UHCI_STATUS_PROCESS_ERROR | UHCI_STATUS_SYSTEM_ERROR)) { 189 usb_log_error("UHCI hardware failure!. \n");189 usb_log_error("UHCI hardware failure!."); 190 190 ++instance->hw_failures; 191 191 transfer_list_abort_all(&instance->transfers_interrupt); … … 198 198 hc_init_hw(instance); 199 199 } else { 200 usb_log_fatal("Too many UHCI hardware failures!. \n");200 usb_log_fatal("Too many UHCI hardware failures!."); 201 201 hc_gone(&instance->base); 202 202 } … … 229 229 (void **) &instance->registers); 230 230 if (ret != EOK) { 231 usb_log_error("Failed to gain access to registers: %s. \n",231 usb_log_error("Failed to gain access to registers: %s.", 232 232 str_error(ret)); 233 233 return ret; 234 234 } 235 235 236 usb_log_debug("Device registers at %" PRIx64 " (%zuB) accessible. \n",236 usb_log_debug("Device registers at %" PRIx64 " (%zuB) accessible.", 237 237 hw_res->io_ranges.ranges[0].address.absolute, 238 238 hw_res->io_ranges.ranges[0].size); … … 240 240 ret = hc_init_mem_structures(instance, hcd); 241 241 if (ret != EOK) { 242 usb_log_error("Failed to init UHCI memory structures: %s. \n",242 usb_log_error("Failed to init UHCI memory structures: %s.", 243 243 str_error(ret)); 244 244 // TODO: we should disable pio here … … 304 304 const uint16_t cmd = pio_read_16(®isters->usbcmd); 305 305 if (cmd != 0) 306 usb_log_warning("Previous command value: %x. \n", cmd);306 usb_log_warning("Previous command value: %x.", cmd); 307 307 308 308 /* Start the hc with large(64B) packet FSBR */ … … 399 399 return ENOMEM; 400 400 } 401 usb_log_debug("Initialized frame list at %p. \n", instance->frame_list);401 usb_log_debug("Initialized frame list at %p.", instance->frame_list); 402 402 403 403 /* Init transfer lists */ 404 404 int ret = hc_init_transfer_lists(instance); 405 405 if (ret != EOK) { 406 usb_log_error("Failed to initialize transfer lists. \n");406 usb_log_error("Failed to initialize transfer lists."); 407 407 return_page(instance->frame_list); 408 408 return ENOMEM; 409 409 } 410 usb_log_debug("Initialized transfer lists. \n");410 usb_log_debug("Initialized transfer lists."); 411 411 412 412 … … 438 438 int ret = transfer_list_init(&instance->transfers_##type, name); \ 439 439 if (ret != EOK) { \ 440 usb_log_error("Failed to setup %s transfer list: %s. \n", \440 usb_log_error("Failed to setup %s transfer list: %s.", \ 441 441 name, str_error(ret)); \ 442 442 transfer_list_fini(&instance->transfers_bulk_full); \ … … 552 552 553 553 if (((cmd & UHCI_CMD_RUN_STOP) != 1) || (sts != 0)) { 554 usb_log_debug2("Command: %X Status: %X Intr: %x \n",554 usb_log_debug2("Command: %X Status: %X Intr: %x", 555 555 cmd, sts, intr); 556 556 } … … 559 559 pio_read_32(&instance->registers->flbaseadd) & ~0xfff; 560 560 if (frame_list != addr_to_phys(instance->frame_list)) { 561 usb_log_debug("Framelist address: %p vs. %p. \n",561 usb_log_debug("Framelist address: %p vs. %p.", 562 562 (void *) frame_list, 563 563 (void *) addr_to_phys(instance->frame_list)); … … 570 570 uintptr_t real_pa = addr_to_phys(QH(interrupt)); 571 571 if (expected_pa != real_pa) { 572 usb_log_debug("Interrupt QH: %p (frame %d) vs. %p. \n",572 usb_log_debug("Interrupt QH: %p (frame %d) vs. %p.", 573 573 (void *) expected_pa, frnum, (void *) real_pa); 574 574 } … … 577 577 real_pa = addr_to_phys(QH(control_slow)); 578 578 if (expected_pa != real_pa) { 579 usb_log_debug("Control Slow QH: %p vs. %p. \n",579 usb_log_debug("Control Slow QH: %p vs. %p.", 580 580 (void *) expected_pa, (void *) real_pa); 581 581 } … … 584 584 real_pa = addr_to_phys(QH(control_full)); 585 585 if (expected_pa != real_pa) { 586 usb_log_debug("Control Full QH: %p vs. %p. \n",586 usb_log_debug("Control Full QH: %p vs. %p.", 587 587 (void *) expected_pa, (void *) real_pa); 588 588 } … … 591 591 real_pa = addr_to_phys(QH(bulk_full)); 592 592 if (expected_pa != real_pa ) { 593 usb_log_debug("Bulk QH: %p vs. %p. \n",593 usb_log_debug("Bulk QH: %p vs. %p.", 594 594 (void *) expected_pa, (void *) real_pa); 595 595 } -
uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.c
rc1a966e ra1732929 104 104 instance->buffer_ptr = addr_to_phys(buffer); 105 105 106 usb_log_debug2("Created TD(%p): %X:%X:%X:%X(%p). \n",106 usb_log_debug2("Created TD(%p): %X:%X:%X:%X(%p).", 107 107 instance, instance->next, instance->status, instance->device, 108 108 instance->buffer_ptr, buffer); 109 109 td_print_status(instance); 110 110 if (pid == USB_PID_SETUP) { 111 usb_log_debug2("SETUP BUFFER: %s \n",111 usb_log_debug2("SETUP BUFFER: %s", 112 112 usb_debug_str_buffer(buffer, 8, 8)); 113 113 } … … 160 160 assert(instance); 161 161 const uint32_t s = instance->status; 162 usb_log_debug2("TD(%p) status(%#" PRIx32 "):%s %d,%s%s%s%s%s%s%s%s%s%s%s %zu. \n",162 usb_log_debug2("TD(%p) status(%#" PRIx32 "):%s %d,%s%s%s%s%s%s%s%s%s%s%s %zu.", 163 163 instance, instance->status, 164 164 (s & TD_STATUS_SPD_FLAG) ? " SPD," : "", -
uspace/drv/bus/usb/uhci/transfer_list.c
rc1a966e ra1732929 59 59 instance->queue_head = malloc32(sizeof(qh_t)); 60 60 if (!instance->queue_head) { 61 usb_log_error("Failed to allocate queue head. \n");61 usb_log_error("Failed to allocate queue head."); 62 62 return ENOMEM; 63 63 } 64 64 const uint32_t queue_head_pa = addr_to_phys(instance->queue_head); 65 usb_log_debug2("Transfer list %s setup with QH: %p (%#" PRIx32" ). \n",65 usb_log_debug2("Transfer list %s setup with QH: %p (%#" PRIx32" ).", 66 66 name, instance->queue_head, queue_head_pa); 67 67 … … 120 120 fibril_mutex_unlock(&ep->guard); 121 121 122 usb_log_debug2("Batch %p adding to queue %s. \n",122 usb_log_debug2("Batch %p adding to queue %s.", 123 123 uhci_batch, instance->name); 124 124 … … 150 150 151 151 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT 152 " scheduled in queue %s. \n", uhci_batch,152 " scheduled in queue %s.", uhci_batch, 153 153 USB_TRANSFER_BATCH_ARGS(uhci_batch->base), instance->name); 154 154 fibril_mutex_unlock(&instance->guard); … … 213 213 assert(fibril_mutex_is_locked(&instance->guard)); 214 214 215 usb_log_debug2("Batch %p removing from queue %s. \n",215 usb_log_debug2("Batch %p removing from queue %s.", 216 216 uhci_batch, instance->name); 217 217 … … 236 236 list_remove(&uhci_batch->link); 237 237 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " removed (%s) " 238 "from %s, next: %x. \n", uhci_batch,238 "from %s, next: %x.", uhci_batch, 239 239 USB_TRANSFER_BATCH_ARGS(uhci_batch->base), 240 240 qpos, instance->name, uhci_batch->qh->next); -
uspace/drv/bus/usb/uhci/uhci_batch.c
rc1a966e ra1732929 75 75 calloc(1, sizeof(uhci_transfer_batch_t)); 76 76 if (!uhci_batch) { 77 usb_log_error("Failed to allocate UHCI batch. \n");77 usb_log_error("Failed to allocate UHCI batch."); 78 78 return NULL; 79 79 } … … 112 112 uhci_batch->device_buffer = malloc32(total_size); 113 113 if (!uhci_batch->device_buffer) { 114 usb_log_error("Failed to allocate UHCI buffer. \n");114 usb_log_error("Failed to allocate UHCI buffer."); 115 115 return ENOMEM; 116 116 } … … 135 135 } 136 136 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT 137 " memory structures ready. \n", usb_batch,137 " memory structures ready.", usb_batch, 138 138 USB_TRANSFER_BATCH_ARGS(*usb_batch)); 139 139 … … 159 159 160 160 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT 161 " checking %zu transfer(s) for completion. \n",161 " checking %zu transfer(s) for completion.", 162 162 uhci_batch, USB_TRANSFER_BATCH_ARGS(*batch), 163 163 uhci_batch->td_count); … … 174 174 175 175 usb_log_debug("Batch %p found error TD(%zu->%p):%" 176 PRIx32 ". \n", uhci_batch, i,176 PRIx32 ".", uhci_batch, i, 177 177 &uhci_batch->tds[i], uhci_batch->tds[i].status); 178 178 td_print_status(&uhci_batch->tds[i]); … … 260 260 uhci_batch->base.ep->toggle = toggle; 261 261 usb_log_debug2( 262 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized. \n", \262 "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.", \ 263 263 uhci_batch, 264 264 usb_str_transfer_type(uhci_batch->base.ep->transfer_type), … … 333 333 td_set_ioc(&uhci_batch->tds[td]); 334 334 335 usb_log_debug2("Control last TD status: %x. \n",335 usb_log_debug2("Control last TD status: %x.", 336 336 uhci_batch->tds[td].status); 337 337 } -
uspace/drv/bus/usb/uhci/uhci_rh.c
rc1a966e ra1732929 202 202 data[0] = ((value & STATUS_LINE_D_MINUS) ? 1 : 0) 203 203 | ((value & STATUS_LINE_D_PLUS) ? 2 : 0); 204 RH_DEBUG(hub, port, "Bus state %" PRIx8 "(source %" PRIx16") \n",204 RH_DEBUG(hub, port, "Bus state %" PRIx8 "(source %" PRIx16")", 205 205 data[0], value); 206 206 *act_size = 1; … … 248 248 ); 249 249 RH_DEBUG(hub, port, "Port status %" PRIx32 " (source %" PRIx16 250 "%s) \n", uint32_usb2host(status), val,250 "%s)", uint32_usb2host(status), val, 251 251 hub->reset_changed[port] ? "-reset" : ""); 252 252 memcpy(data, &status, sizeof(status)); … … 276 276 case USB_HUB_FEATURE_PORT_ENABLE: 277 277 RH_DEBUG(hub, port, "Clear port enable (status %" 278 PRIx16 ") \n", status);278 PRIx16 ")", status); 279 279 pio_write_16(hub->ports[port], val & ~STATUS_ENABLED); 280 280 break; 281 281 case USB_HUB_FEATURE_PORT_SUSPEND: 282 282 RH_DEBUG(hub, port, "Clear port suspend (status %" 283 PRIx16 ") \n", status);283 PRIx16 ")", status); 284 284 pio_write_16(hub->ports[port], val & ~STATUS_SUSPEND); 285 285 // TODO we should do resume magic 286 usb_log_warning("Resume is not implemented on port %u \n", port);286 usb_log_warning("Resume is not implemented on port %u", port); 287 287 break; 288 288 case USB_HUB_FEATURE_PORT_POWER: 289 RH_DEBUG(hub, port, "Clear port power (status %" PRIx16 ") \n",289 RH_DEBUG(hub, port, "Clear port power (status %" PRIx16 ")", 290 290 status); 291 291 /* We are always powered */ 292 usb_log_warning("Tried to power off port %u \n", port);292 usb_log_warning("Tried to power off port %u", port); 293 293 break; 294 294 case USB_HUB_FEATURE_C_PORT_CONNECTION: 295 295 RH_DEBUG(hub, port, "Clear port conn change (status %" 296 PRIx16 ") \n", status);296 PRIx16 ")", status); 297 297 pio_write_16(hub->ports[port], val | STATUS_CONNECTED_CHANGED); 298 298 break; 299 299 case USB_HUB_FEATURE_C_PORT_RESET: 300 300 RH_DEBUG(hub, port, "Clear port reset change (status %" 301 PRIx16 ") \n", status);301 PRIx16 ")", status); 302 302 hub->reset_changed[port] = false; 303 303 break; 304 304 case USB_HUB_FEATURE_C_PORT_ENABLE: 305 305 RH_DEBUG(hub, port, "Clear port enable change (status %" 306 PRIx16 ") \n", status);306 PRIx16 ")", status); 307 307 pio_write_16(hub->ports[port], status | STATUS_ENABLED_CHANGED); 308 308 break; 309 309 case USB_HUB_FEATURE_C_PORT_SUSPEND: 310 310 RH_DEBUG(hub, port, "Clear port suspend change (status %" 311 PRIx16 ") \n", status);311 PRIx16 ")", status); 312 312 //TODO 313 313 return ENOTSUP; 314 314 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: 315 315 RH_DEBUG(hub, port, "Clear port OC change (status %" 316 PRIx16 ") \n", status);316 PRIx16 ")", status); 317 317 /* UHCI Does not report over current */ 318 318 //TODO: newer chips do, but some have broken wiring … … 320 320 default: 321 321 RH_DEBUG(hub, port, "Clear unknown feature %d (status %" 322 PRIx16 ") \n", feature, status);323 usb_log_warning("Clearing feature %d is unsupported \n",322 PRIx16 ")", feature, status); 323 usb_log_warning("Clearing feature %d is unsupported", 324 324 feature); 325 325 return ESTALL; … … 348 348 case USB_HUB_FEATURE_PORT_RESET: 349 349 RH_DEBUG(hub, port, "Set port reset before (status %" PRIx16 350 ") \n", status);350 ")", status); 351 351 uhci_port_reset_enable(hub->ports[port]); 352 352 hub->reset_changed[port] = true; 353 353 RH_DEBUG(hub, port, "Set port reset after (status %" PRIx16 354 ") \n", pio_read_16(hub->ports[port]));354 ")", pio_read_16(hub->ports[port])); 355 355 break; 356 356 case USB_HUB_FEATURE_PORT_SUSPEND: 357 357 RH_DEBUG(hub, port, "Set port suspend (status %" PRIx16 358 ") \n", status);358 ")", status); 359 359 pio_write_16(hub->ports[port], 360 360 (status & ~STATUS_WC_BITS) | STATUS_SUSPEND); 361 usb_log_warning("Suspend is not implemented on port %u \n", port);361 usb_log_warning("Suspend is not implemented on port %u", port); 362 362 break; 363 363 case USB_HUB_FEATURE_PORT_POWER: 364 364 RH_DEBUG(hub, port, "Set port power (status %" PRIx16 365 ") \n", status);365 ")", status); 366 366 /* We are always powered */ 367 usb_log_warning("Tried to power port %u \n", port);367 usb_log_warning("Tried to power port %u", port); 368 368 break; 369 369 case USB_HUB_FEATURE_C_PORT_CONNECTION: … … 372 372 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: 373 373 RH_DEBUG(hub, port, "Set port change flag (status %" PRIx16 374 ") \n", status);374 ")", status); 375 375 /* These are voluntary and don't have to be set 376 376 * there is no way we could do it on UHCI anyway */ … … 378 378 default: 379 379 RH_DEBUG(hub, port, "Set unknown feature %d (status %" PRIx16 380 ") \n", feature, status);381 usb_log_warning("Setting feature %d is unsupported \n",380 ")", feature, status); 381 usb_log_warning("Setting feature %d is unsupported", 382 382 feature); 383 383 return ESTALL; … … 418 418 RH_DEBUG(hub, -1, "Event mask %" PRIx8 419 419 " (status_a %" PRIx16 "%s)," 420 " (status_b %" PRIx16 "%s) \n", status,420 " (status_b %" PRIx16 "%s)", status, 421 421 status_a, hub->reset_changed[0] ? "-reset" : "", 422 422 status_b, hub->reset_changed[1] ? "-reset" : "" ); -
uspace/drv/bus/usb/usbdiag/device.c
rc1a966e ra1732929 79 79 usb_endpoint_mapping_t *epm = usb_device_get_mapped_ep(dev->usb_dev, USBDIAG_EP_##ep_no);\ 80 80 if (!epm || !epm->present) {\ 81 usb_log_error("Failed to map endpoint: " #ep_no ". \n");\81 usb_log_error("Failed to map endpoint: " #ep_no ".");\ 82 82 rc = ENOENT;\ 83 83 goto err_fun;\ -
uspace/drv/bus/usb/usbdiag/main.c
rc1a966e ra1732929 52 52 usbdiag_dev_t *diag_dev; 53 53 if ((rc = usbdiag_dev_create(dev, &diag_dev))) { 54 usb_log_error("Failed create device: %s. \n", str_error(rc));54 usb_log_error("Failed create device: %s.", str_error(rc)); 55 55 goto err; 56 56 } 57 57 58 58 if ((rc = ddf_fun_bind(diag_dev->fun))) { 59 usb_log_error("Failed to bind DDF function: %s. \n", str_error(rc));59 usb_log_error("Failed to bind DDF function: %s.", str_error(rc)); 60 60 goto err_create; 61 61 } … … 96 96 97 97 if ((rc = ddf_fun_unbind(diag_dev->fun))) { 98 usb_log_error("Failed to unbind DDF function: %s \n", str_error(rc));98 usb_log_error("Failed to unbind DDF function: %s", str_error(rc)); 99 99 goto err; 100 100 } … … 117 117 118 118 if ((rc = ddf_fun_unbind(diag_dev->fun))) { 119 usb_log_error("Failed to unbind DDF function: %s \n", str_error(rc));119 usb_log_error("Failed to unbind DDF function: %s", str_error(rc)); 120 120 goto err; 121 121 } -
uspace/drv/bus/usb/usbdiag/tests.c
rc1a966e ra1732929 68 68 while (remaining > 0) { 69 69 if ((rc = usb_pipe_read(pipe, buffer + size - remaining, remaining, &transferred))) { 70 usb_log_error("Read of %s IN endpoint failed with error: %s \n", usb_str_transfer_type(pipe->desc.transfer_type), str_error(rc));70 usb_log_error("Read of %s IN endpoint failed with error: %s", usb_str_transfer_type(pipe->desc.transfer_type), str_error(rc)); 71 71 break; 72 72 } 73 73 74 74 if (transferred > remaining) { 75 usb_log_error("Read of %s IN endpoint returned more data than expected. \n", usb_str_transfer_type(pipe->desc.transfer_type));75 usb_log_error("Read of %s IN endpoint returned more data than expected.", usb_str_transfer_type(pipe->desc.transfer_type)); 76 76 rc = EINVAL; 77 77 break; … … 121 121 // Write buffer to device. 122 122 if ((rc = usb_pipe_write(pipe, buffer, size))) { 123 usb_log_error("Write to %s OUT endpoint failed with error: %s \n", usb_str_transfer_type(pipe->desc.transfer_type), str_error(rc));123 usb_log_error("Write to %s OUT endpoint failed with error: %s", usb_str_transfer_type(pipe->desc.transfer_type), str_error(rc)); 124 124 break; 125 125 } … … 169 169 while (remaining > 0) { 170 170 if ((rc = usb_pipe_read(pipe, buffer + size - remaining, remaining, &transferred))) { 171 usb_log_error("Read of %s IN endpoint failed with error: %s \n", usb_str_transfer_type(pipe->desc.transfer_type), str_error(rc));171 usb_log_error("Read of %s IN endpoint failed with error: %s", usb_str_transfer_type(pipe->desc.transfer_type), str_error(rc)); 172 172 break; 173 173 } 174 174 175 175 if (transferred > remaining) { 176 usb_log_error("Read of %s IN endpoint returned more data than expected. \n", usb_str_transfer_type(pipe->desc.transfer_type));176 usb_log_error("Read of %s IN endpoint returned more data than expected.", usb_str_transfer_type(pipe->desc.transfer_type)); 177 177 rc = EINVAL; 178 178 break; … … 187 187 for (size_t i = 0; i < size; i += sizeof(test_data)) { 188 188 if (*(uint32_t *)(buffer + i) != test_data) { 189 usb_log_error("Read of %s IN endpoint returned invald data at address %lu. \n", usb_str_transfer_type(pipe->desc.transfer_type), i);189 usb_log_error("Read of %s IN endpoint returned invald data at address %lu.", usb_str_transfer_type(pipe->desc.transfer_type), i); 190 190 rc = EINVAL; 191 191 break; … … 238 238 // Write buffer to device. 239 239 if ((rc = usb_pipe_write(pipe, buffer, size))) { 240 usb_log_error("Write to %s OUT endpoint failed with error: %s \n", usb_str_transfer_type(pipe->desc.transfer_type), str_error(rc));240 usb_log_error("Write to %s OUT endpoint failed with error: %s", usb_str_transfer_type(pipe->desc.transfer_type), str_error(rc)); 241 241 break; 242 242 } -
uspace/drv/bus/usb/usbflbk/main.c
rc1a966e ra1732929 48 48 static int usbfallback_device_add(usb_device_t *dev) 49 49 { 50 usb_log_info("Pretending to control %s `%s'. \n",50 usb_log_info("Pretending to control %s `%s'.", 51 51 usb_device_get_iface_number(dev) < 0 ? "device" : "interface", 52 52 usb_device_get_name(dev)); -
uspace/drv/bus/usb/usbhub/port.c
rc1a966e ra1732929 141 141 assert(port); 142 142 assert(hub); 143 usb_log_debug2("(%p-%u): Interrupt. \n", hub, port->port_number);143 usb_log_debug2("(%p-%u): Interrupt.", hub, port->port_number); 144 144 145 145 usb_port_status_t status = 0; 146 146 const int opResult = get_port_status(port, &status); 147 147 if (opResult != EOK) { 148 usb_log_error("(%p-%u): Failed to get port status: %s. \n", hub,148 usb_log_error("(%p-%u): Failed to get port status: %s.", hub, 149 149 port->port_number, str_error(opResult)); 150 150 return; … … 155 155 const bool connected = 156 156 (status & USB_HUB_PORT_STATUS_CONNECTION) != 0; 157 usb_log_debug("(%p-%u): Connection change: device %s. \n", hub,157 usb_log_debug("(%p-%u): Connection change: device %s.", hub, 158 158 port->port_number, connected ? "attached" : "removed"); 159 159 … … 189 189 if (status & USB_HUB_PORT_C_STATUS_ENABLED) { 190 190 // TODO: maybe HS reset failed? 191 usb_log_info("(%p-%u): Port disabled because of errors. \n", hub,191 usb_log_info("(%p-%u): Port disabled because of errors.", hub, 192 192 port->port_number); 193 193 usb_hub_port_device_gone(port, hub); … … 294 294 if (enabled) { 295 295 port->reset_status = RESET_OK; 296 usb_log_debug("(%p-%u): Port reset complete. \n", hub,296 usb_log_debug("(%p-%u): Port reset complete.", hub, 297 297 port->port_number); 298 298 } else { -
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 } -
uspace/drv/bus/usb/usbmid/dump.c
rc1a966e ra1732929 56 56 usb_standard_interface_descriptor_t *descriptor 57 57 = (usb_standard_interface_descriptor_t *) data; 58 usb_log_info("Found interface: %s (0x%02x/0x%02x/0x%02x). \n",58 usb_log_info("Found interface: %s (0x%02x/0x%02x/0x%02x).", 59 59 usb_str_class(descriptor->interface_class), 60 60 (int) descriptor->interface_class, -
uspace/drv/bus/usb/usbmid/explore.c
rc1a966e ra1732929 106 106 107 107 108 usb_log_info("Creating child for interface %d (%s). \n",108 usb_log_info("Creating child for interface %d (%s).", 109 109 interface->interface_number, 110 110 usb_str_class(interface->interface_class)); … … 144 144 dev_class, usb_str_class(dev_class), 145 145 USB_CLASS_USE_INTERFACE); 146 usb_log_error("Not a multi-interface device, refusing. \n");146 usb_log_error("Not a multi-interface device, refusing."); 147 147 return ENOTSUP; 148 148 } … … 160 160 config_descriptor->configuration_number); 161 161 if (rc != EOK) { 162 usb_log_error("Failed to set device configuration: %s. \n",162 usb_log_error("Failed to set device configuration: %s.", 163 163 str_error(rc)); 164 164 return rc; … … 168 168 usb_mid_t *usb_mid = usb_device_data_alloc(dev, sizeof(usb_mid_t)); 169 169 if (!usb_mid) { 170 usb_log_error("Failed to create USB MID structure. \n");170 usb_log_error("Failed to create USB MID structure."); 171 171 return ENOMEM; 172 172 } … … 175 175 usb_mid->ctl_fun = usb_device_ddf_fun_create(dev, fun_exposed, "ctl"); 176 176 if (usb_mid->ctl_fun == NULL) { 177 usb_log_error("Failed to create control function. \n");177 usb_log_error("Failed to create control function."); 178 178 return ENOMEM; 179 179 } … … 182 182 rc = ddf_fun_bind(usb_mid->ctl_fun); 183 183 if (rc != EOK) { 184 usb_log_error("Failed to bind control function: %s. \n",184 usb_log_error("Failed to bind control function: %s.", 185 185 str_error(rc)); 186 186 ddf_fun_destroy(usb_mid->ctl_fun); -
uspace/drv/bus/usb/usbmid/main.c
rc1a966e ra1732929 51 51 static int usbmid_device_add(usb_device_t *dev) 52 52 { 53 usb_log_info("Taking care of new MID `%s'. \n", usb_device_get_name(dev));53 usb_log_info("Taking care of new MID `%s'.", usb_device_get_name(dev)); 54 54 55 55 return usbmid_explore_device(dev); … … 68 68 const int pret = usbmid_interface_destroy(iface); 69 69 if (pret != EOK) { 70 usb_log_error("Failed to remove child `%s': %s \n",70 usb_log_error("Failed to remove child `%s': %s", 71 71 ddf_fun_get_name(iface->fun), str_error(pret)); 72 72 ret = pret; … … 91 91 int ret = ddf_fun_unbind(usb_mid->ctl_fun); 92 92 if (ret != EOK) { 93 usb_log_error("Failed to unbind USB MID ctl function: %s. \n",93 usb_log_error("Failed to unbind USB MID ctl function: %s.", 94 94 str_error(ret)); 95 95 return ret; … … 99 99 /* Remove all children */ 100 100 list_foreach(usb_mid->interface_list, link, usbmid_interface_t, iface) { 101 usb_log_info("Removing child `%s'. \n",101 usb_log_info("Removing child `%s'.", 102 102 ddf_fun_get_name(iface->fun)); 103 103 … … 105 105 int pret = ddf_fun_offline(iface->fun); 106 106 if (pret != EOK) { 107 usb_log_warning("Failed to turn off child `%s': %s \n",107 usb_log_warning("Failed to turn off child `%s': %s", 108 108 ddf_fun_get_name(iface->fun), str_error(pret)); 109 109 ret = pret; … … 125 125 assert(usb_mid); 126 126 127 usb_log_info("USB MID gone: `%s'. \n", usb_device_get_name(dev));127 usb_log_info("USB MID gone: `%s'.", usb_device_get_name(dev)); 128 128 129 129 /* Remove ctl function */ 130 130 int ret = ddf_fun_unbind(usb_mid->ctl_fun); 131 131 if (ret != EOK) { 132 usb_log_error("Failed to unbind USB MID ctl function: %s. \n",132 usb_log_error("Failed to unbind USB MID ctl function: %s.", 133 133 str_error(ret)); 134 134 return ret; -
uspace/drv/bus/usb/vhc/conndev.c
rc1a966e ra1732929 113 113 receive_device_name(callback); 114 114 115 usb_log_info("New virtual device `%s' (id: %" PRIxn "). \n",115 usb_log_info("New virtual device `%s' (id: %" PRIxn ").", 116 116 plugged_device_name, plugged_device_handle); 117 117 } else … … 130 130 131 131 if (plugged_device_handle != 0) { 132 usb_log_info("Virtual device `%s' disconnected (id: %" PRIxn "). \n",132 usb_log_info("Virtual device `%s' disconnected (id: %" PRIxn ").", 133 133 plugged_device_name, plugged_device_handle); 134 134 vhc_virtdev_unplug(vhc, plugged_device_handle); -
uspace/drv/bus/usb/vhc/hub/hub.c
rc1a966e ra1732929 231 231 } 232 232 233 usb_log_debug("Setting port %zu to state %d. \n", port_index, state);233 usb_log_debug("Setting port %zu to state %d.", port_index, state); 234 234 235 235 switch (state) { … … 423 423 uint16_t old_value = port->status_change; 424 424 port->status_change |= change; 425 usb_log_debug("Changing status change on %zu: %04x => %04x \n",425 usb_log_debug("Changing status change on %zu: %04x => %04x", 426 426 port->index, 427 427 (unsigned int) old_value, (unsigned int) port->status_change); … … 510 510 fid_t fibril = fibril_create(set_port_state_delayed_fibril, change); 511 511 if (fibril == 0) { 512 printf("Failed to create fibril\n");512 usb_log_error("Failed to create fibril."); 513 513 free(change); 514 514 return; -
uspace/drv/bus/usb/vhc/main.c
rc1a966e ra1732929 77 77 int ret = hcd_ddf_setup_hc(dev, sizeof(vhc_data_t)); 78 78 if (ret != EOK) { 79 usb_log_error("Failed to init HCD structures: %s. \n",79 usb_log_error("Failed to init HCD structures: %s.", 80 80 str_error(ret)); 81 81 return ret; … … 90 90 ret = vhc_control_node(dev, &ctl_fun); 91 91 if (ret != EOK) { 92 usb_log_error("Failed to setup control node. \n");92 usb_log_error("Failed to setup control node."); 93 93 return ret; 94 94 } … … 97 97 ret = vhc_virtdev_plug_hub(vhc, &vhc->hub, NULL, 0); 98 98 if (ret != EOK) { 99 usb_log_error("Failed to plug root hub: %s. \n", str_error(ret));99 usb_log_error("Failed to plug root hub: %s.", str_error(ret)); 100 100 ddf_fun_destroy(ctl_fun); 101 101 return ret; … … 108 108 ret = hcd_setup_virtual_root_hub(&vhc->base); 109 109 if (ret != EOK) { 110 usb_log_error("Failed to init VHC root hub: %s \n",110 usb_log_error("Failed to init VHC root hub: %s", 111 111 str_error(ret)); 112 112 // TODO do something here... -
uspace/drv/bus/usb/vhc/transfer.c
rc1a966e ra1732929 207 207 208 208 if (targets > 1) 209 usb_log_warning("Transfer would be accepted by more devices! \n");209 usb_log_warning("Transfer would be accepted by more devices!"); 210 210 211 211 return targets ? EOK : ENOENT; … … 236 236 dev->dev_local, &data_transfer_size); 237 237 } else { 238 usb_log_warning("Device has no remote phone nor local node. \n");238 usb_log_warning("Device has no remote phone nor local node."); 239 239 rc = ESTALL; 240 240 } 241 241 242 usb_log_debug2("Transfer %p processed: %s. \n",242 usb_log_debug2("Transfer %p processed: %s.", 243 243 transfer, str_error(rc)); 244 244 … … 249 249 (void*) transfer->batch.setup.buffer; 250 250 dev->address = setup->value; 251 usb_log_debug2("Address changed to %d \n",251 usb_log_debug2("Address changed to %d", 252 252 dev->address); 253 253 } -
uspace/drv/bus/usb/xhci/bus.c
rc1a966e ra1732929 73 73 if ((err = hc_enable_slot(bus->hc, &dev->slot_id)) != EOK) 74 74 return err; 75 usb_log_debug2("Obtained slot ID: %u. \n", dev->slot_id);75 usb_log_debug2("Obtained slot ID: %u.", dev->slot_id); 76 76 77 77 /* Create and configure control endpoint. */ -
uspace/drv/bus/usb/xhci/hc.c
rc1a966e ra1732929 190 190 hc->mmio_range = hw_res->mem_ranges.ranges[0]; 191 191 192 usb_log_debug("MMIO area at %p (size %zu), IRQ %d. \n",192 usb_log_debug("MMIO area at %p (size %zu), IRQ %d.", 193 193 RNGABSPTR(hc->mmio_range), RNGSZ(hc->mmio_range), hw_res->irqs.irqs[0]); 194 194 … … 406 406 async_usleep(XHCI_LEGSUP_POLLING_DELAY_1MS); 407 407 } 408 usb_log_error("BIOS did not release XHCI legacy hold! \n");408 usb_log_error("BIOS did not release XHCI legacy hold!"); 409 409 410 410 return ENOTSUP; … … 776 776 xhci_device_ctx_t *dev_ctx = dev->dev_ctx.virt; 777 777 dev->base.address = XHCI_SLOT_DEVICE_ADDRESS(dev_ctx->slot_ctx); 778 usb_log_debug2("Obtained USB address: %d. \n", dev->base.address);778 usb_log_debug2("Obtained USB address: %d.", dev->base.address); 779 779 780 780 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.