Changeset 605db7f in mainline
- Timestamp:
- 2015-07-03T21:39:22Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 05b51e37
- Parents:
- 34c9cfc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci_rh.c
r34c9cfc r605db7f 106 106 (EHCI_RD(caps->hcsparams) >> EHCI_CAPS_HCS_N_PORTS_SHIFT) & 107 107 EHCI_CAPS_HCS_N_PORTS_MASK; 108 usb_log_debug2("hcsparams: %x.\n", EHCI_RD(caps->hcsparams)); 109 usb_log_info("%s: Found %u ports.\n", name, instance->port_count); 108 usb_log_debug2("RH(%p): hcsparams: %x.\n", instance, 109 EHCI_RD(caps->hcsparams)); 110 usb_log_info("RH(%p): Found %u ports.\n", instance, 111 instance->port_count); 110 112 111 113 if (EHCI_RD(caps->hcsparams) & EHCI_CAPS_HCS_PPC_FLAG) { 112 usb_log_info(" %s: Per-port power switching.\n", name);114 usb_log_info("RH(%p): Per-port power switching.", instance); 113 115 } else { 114 usb_log_info(" %s: No power switching.\n", name);116 usb_log_info("RH(%p): No power switching.", instance); 115 117 } 116 118 … … 146 148 batch->buffer, batch->buffer_size, &batch->transfered_size); 147 149 if (batch->error == ENAK) { 148 usb_log_debug(" EHCI RH(%p): BATCH(%p) adding as unfinished\n",150 usb_log_debug("RH(%p): BATCH(%p) adding as unfinished", 149 151 instance, batch); 150 152 /* This is safe because only status change interrupt transfers … … 156 158 usb_transfer_batch_finish(batch, NULL); 157 159 usb_transfer_batch_destroy(batch); 158 usb_log_debug(" EHCI RH(%p): BATCH(%p) virtual request: %s\n",160 usb_log_debug("RH(%p): BATCH(%p) virtual request complete: %s", 159 161 instance, batch, str_error(batch->error)); 160 162 } … … 174 176 usb_transfer_batch_t *batch = instance->unfinished_interrupt_transfer; 175 177 instance->unfinished_interrupt_transfer = NULL; 178 usb_log_debug2("RH(%p): Interrupt. Processing batch: %p", 179 instance, batch); 176 180 if (batch) { 177 181 const usb_target_t target = {{ … … 290 294 ); 291 295 /* Note feature numbers for test and indicator feature do not 292 * corespond to the port status bit locations */ 296 * correspond to the port status bit locations */ 297 usb_log_debug2("RH(%p-%u) port status: %"PRIx32, hub, port, status); 293 298 memcpy(data, &status, sizeof(status)); 294 299 *act_size = sizeof(status); … … 305 310 ehci_rh_job_t *job = arg; 306 311 async_usleep(50000); 307 usb_log_debug(" EHCI_RH(%p-%u): Clearing reset", job->hub, job->port);312 usb_log_debug("RH(%p-%u): Clearing reset", job->hub, job->port); 308 313 EHCI_CLR(job->hub->registers->portsc[job->port], 309 314 USB_PORTSC_PORT_RESET_FLAG); … … 313 318 async_usleep(1); 314 319 }; 315 usb_log_debug(" EHCI_RH(%p-%u): Reset complete", job->hub, job->port);320 usb_log_debug("RH(%p-%u): Reset complete", job->hub, job->port); 316 321 /* Handle port ownership, if the port is not enabled 317 322 * after reset it's a full speed device */ 318 323 if (!(EHCI_RD(job->hub->registers->portsc[job->port]) & 319 324 USB_PORTSC_ENABLED_FLAG)) { 320 usb_log_debug(" EHCI_RH(%p-%u): Port not enabled after reset, "325 usb_log_debug("RH(%p-%u): Port not enabled after reset, " 321 326 "giving up ownership", job->hub, job->port); 322 327 EHCI_SET(job->hub->registers->portsc[job->port], … … 334 339 ehci_rh_job_t *job = arg; 335 340 async_usleep(20000); 341 usb_log_debug("RH(%p-%u): Stopping resume", job->hub, job->port); 336 342 EHCI_CLR(job->hub->registers->portsc[job->port], 337 343 USB_PORTSC_RESUME_FLAG); … … 355 361 } 356 362 fibril_add_ready(fib); 363 usb_log_debug2("RH(%p-%u): Scheduled delayed stop job.", rh, port); 357 364 return EOK; 358 365 } … … 379 386 { 380 387 case USB_HUB_FEATURE_PORT_POWER: /*8*/ 388 usb_log_debug2("RH(%p-%u): Clear port power.", hub, port); 381 389 EHCI_CLR(hub->registers->portsc[port], 382 390 USB_PORTSC_PORT_POWER_FLAG); … … 384 392 385 393 case USB_HUB_FEATURE_PORT_ENABLE: /*1*/ 394 usb_log_debug2("RH(%p-%u): Clear port enable.", hub, port); 386 395 EHCI_CLR(hub->registers->portsc[port], 387 396 USB_PORTSC_ENABLED_FLAG); … … 389 398 390 399 case USB_HUB_FEATURE_PORT_SUSPEND: /*2*/ 400 usb_log_debug2("RH(%p-%u): Clear port suspend.", hub, port); 391 401 /* If not in suspend it's noop */ 392 402 if ((EHCI_RD(hub->registers->portsc[port]) & … … 396 406 EHCI_SET(hub->registers->portsc[port], 397 407 USB_PORTSC_RESUME_FLAG); 398 delayed_job(stop_resume, hub, port);399 return EOK;408 //TODO: What if creating the delayed job fails? 409 return delayed_job(stop_resume, hub, port); 400 410 401 411 case USB_HUB_FEATURE_C_PORT_CONNECTION: /*16*/ 412 usb_log_debug2("RH(%p-%u): Clear port connection change.", 413 hub, port); 402 414 EHCI_SET(hub->registers->portsc[port], 403 415 USB_PORTSC_CONNECT_CH_FLAG); 404 416 return EOK; 405 417 case USB_HUB_FEATURE_C_PORT_ENABLE: /*17*/ 418 usb_log_debug2("RH(%p-%u): Clear port enable change.", 419 hub, port); 406 420 EHCI_SET(hub->registers->portsc[port], 407 421 USB_PORTSC_CONNECT_CH_FLAG); 408 422 return EOK; 409 423 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: /*19*/ 424 usb_log_debug2("RH(%p-%u): Clear port OC change.", 425 hub, port); 410 426 EHCI_SET(hub->registers->portsc[port], 411 427 USB_PORTSC_OC_CHANGE_FLAG); 412 428 return EOK; 413 429 case USB_HUB_FEATURE_C_PORT_SUSPEND: /*18*/ 430 usb_log_debug2("RH(%p-%u): Clear port suspend change.", 431 hub, port); 414 432 hub->resume_flag[port] = false; 415 433 return EOK; 416 434 case USB_HUB_FEATURE_C_PORT_RESET: /*20*/ 435 usb_log_debug2("RH(%p-%u): Clear port reset change.", 436 hub, port); 417 437 hub->reset_flag[port] = false; 418 438 return EOK; 419 439 420 440 default: 441 usb_log_warning("RH(%p-%u): Clear unknown feature: %u", 442 hub, port, feature); 421 443 return ENOTSUP; 422 444 } … … 441 463 switch (feature) { 442 464 case USB_HUB_FEATURE_PORT_ENABLE: /*1*/ 465 usb_log_debug2("RH(%p-%u): Set port enable.", hub, port); 443 466 EHCI_SET(hub->registers->portsc[port], 444 467 USB_PORTSC_ENABLED_FLAG); 445 468 return EOK; 446 469 case USB_HUB_FEATURE_PORT_SUSPEND: /*2*/ 470 usb_log_debug2("RH(%p-%u): Set port suspend.", hub, port); 447 471 EHCI_SET(hub->registers->portsc[port], 448 472 USB_PORTSC_SUSPEND_FLAG); 449 473 return EOK; 450 474 case USB_HUB_FEATURE_PORT_RESET: /*4*/ 475 usb_log_debug2("RH(%p-%u): Set port reset.", hub, port); 451 476 EHCI_SET(hub->registers->portsc[port], 452 477 USB_PORTSC_PORT_RESET_FLAG); 453 delayed_job(stop_reset, hub, port);454 return EOK;478 //TODO: What if creating the delayed job fails? 479 return delayed_job(stop_reset, hub, port); 455 480 case USB_HUB_FEATURE_PORT_POWER: /*8*/ 481 usb_log_debug2("RH(%p-%u): Set port power.", hub, port); 456 482 EHCI_SET(hub->registers->portsc[port], 457 483 USB_PORTSC_PORT_POWER_FLAG); 458 484 return EOK; 459 485 default: 486 usb_log_warning("RH(%p-%u): Set unknown feature: %u", 487 hub, port, feature); 460 488 return ENOTSUP; 461 489 } … … 501 529 } 502 530 503 usb_log_debug2(" EHCI root hub interrupt mask: %hx.\n", mask);531 usb_log_debug2("RH(%p): root hub interrupt mask: %"PRIx16, hub, mask); 504 532 505 533 if (mask == 0)
Note:
See TracChangeset
for help on using the changeset viewer.