Changeset d1582b50 in mainline for uspace/drv/bus/usb/ehci/ehci_rh.c
- Timestamp:
- 2020-12-14T20:41:53Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 02fe42e
- Parents:
- 1382446
- git-author:
- Jiri Svoboda <jiri@…> (2020-12-14 20:33:54)
- git-committer:
- Jiri Svoboda <jiri@…> (2020-12-14 20:41:53)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci_rh.c
r1382446 rd1582b50 86 86 instance->hub_descriptor.header.max_current = 0; 87 87 88 /* Device removable and some legacy 1.0 stuff */88 /* Device removable and some legacy 1.0 stuff */ 89 89 instance->hub_descriptor.rempow[0] = 0xff; 90 90 instance->hub_descriptor.rempow[1] = 0xff; … … 410 410 /* Enabled features to clear: see page 269 of USB specs */ 411 411 switch (feature) { 412 case USB_HUB_FEATURE_PORT_POWER: /* 8*/412 case USB_HUB_FEATURE_PORT_POWER: /* 8 */ 413 413 usb_log_debug2("RH(%p-%u): Clear port power.", hub, port); 414 414 EHCI_CLR(hub->registers->portsc[port], … … 416 416 return EOK; 417 417 418 case USB2_HUB_FEATURE_PORT_ENABLE: /* 1*/418 case USB2_HUB_FEATURE_PORT_ENABLE: /* 1 */ 419 419 usb_log_debug2("RH(%p-%u): Clear port enable.", hub, port); 420 420 EHCI_CLR(hub->registers->portsc[port], … … 422 422 return EOK; 423 423 424 case USB2_HUB_FEATURE_PORT_SUSPEND: /* 2*/424 case USB2_HUB_FEATURE_PORT_SUSPEND: /* 2 */ 425 425 usb_log_debug2("RH(%p-%u): Clear port suspend.", hub, port); 426 426 /* If not in suspend it's noop */ … … 434 434 return delayed_job(stop_resume, hub, port); 435 435 436 case USB_HUB_FEATURE_C_PORT_CONNECTION: /* 16*/436 case USB_HUB_FEATURE_C_PORT_CONNECTION: /* 16 */ 437 437 usb_log_debug2("RH(%p-%u): Clear port connection change.", 438 438 hub, port); … … 440 440 USB_PORTSC_CONNECT_CH_FLAG); 441 441 return EOK; 442 case USB2_HUB_FEATURE_C_PORT_ENABLE: /* 17*/442 case USB2_HUB_FEATURE_C_PORT_ENABLE: /* 17 */ 443 443 usb_log_debug2("RH(%p-%u): Clear port enable change.", 444 444 hub, port); … … 446 446 USB_PORTSC_CONNECT_CH_FLAG); 447 447 return EOK; 448 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: /* 19*/448 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: /* 19 */ 449 449 usb_log_debug2("RH(%p-%u): Clear port OC change.", 450 450 hub, port); … … 452 452 USB_PORTSC_OC_CHANGE_FLAG); 453 453 return EOK; 454 case USB2_HUB_FEATURE_C_PORT_SUSPEND: /* 18*/454 case USB2_HUB_FEATURE_C_PORT_SUSPEND: /* 18 */ 455 455 usb_log_debug2("RH(%p-%u): Clear port suspend change.", 456 456 hub, port); 457 457 hub->resume_flag[port] = false; 458 458 return EOK; 459 case USB_HUB_FEATURE_C_PORT_RESET: /* 20*/459 case USB_HUB_FEATURE_C_PORT_RESET: /* 20 */ 460 460 usb_log_debug2("RH(%p-%u): Clear port reset change.", 461 461 hub, port); … … 487 487 const unsigned feature = uint16_usb2host(setup_packet->value); 488 488 switch (feature) { 489 case USB2_HUB_FEATURE_PORT_ENABLE: /* 1*/489 case USB2_HUB_FEATURE_PORT_ENABLE: /* 1 */ 490 490 usb_log_debug2("RH(%p-%u): Set port enable.", hub, port); 491 491 EHCI_SET(hub->registers->portsc[port], 492 492 USB_PORTSC_ENABLED_FLAG); 493 493 return EOK; 494 case USB2_HUB_FEATURE_PORT_SUSPEND: /* 2*/494 case USB2_HUB_FEATURE_PORT_SUSPEND: /* 2 */ 495 495 usb_log_debug2("RH(%p-%u): Set port suspend.", hub, port); 496 496 EHCI_SET(hub->registers->portsc[port], 497 497 USB_PORTSC_SUSPEND_FLAG); 498 498 return EOK; 499 case USB_HUB_FEATURE_PORT_RESET: /* 4*/499 case USB_HUB_FEATURE_PORT_RESET: /* 4 */ 500 500 usb_log_debug2("RH(%p-%u): Set port reset.", hub, port); 501 501 EHCI_SET(hub->registers->portsc[port], … … 503 503 //TODO: What if creating the delayed job fails? 504 504 return delayed_job(stop_reset, hub, port); 505 case USB_HUB_FEATURE_PORT_POWER: /* 8*/505 case USB_HUB_FEATURE_PORT_POWER: /* 8 */ 506 506 usb_log_debug2("RH(%p-%u): Set port power.", hub, port); 507 507 EHCI_SET(hub->registers->portsc[port],
Note:
See TracChangeset
for help on using the changeset viewer.