Changeset 05770666 in mainline
- Timestamp:
- 2018-01-18T14:40:20Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e7f21884
- Parents:
- 2c0564c
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-18 14:30:02)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-18 14:40:20)
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hc.c
r2c0564c r05770666 504 504 XHCI_REG_SET(hc->op_regs, XHCI_OP_RS, 1); 505 505 506 /* The reset changed status of all ports, and SW originated reason does 507 * not cause an interrupt. 508 */ 509 for (uint8_t port = 1; port <= hc->rh.max_ports; ++port) 510 xhci_rh_handle_port_change(&hc->rh, port); 506 xhci_rh_startup(&hc->rh); 511 507 512 508 return EOK; -
uspace/drv/bus/usb/xhci/rh.c
r2c0564c r05770666 224 224 status &= ~XHCI_REG_MASK(XHCI_PORT_CSC); 225 225 226 bool connected = !!(status & XHCI_REG_MASK(XHCI_PORT_CCS));226 const bool connected = !!(status & XHCI_REG_MASK(XHCI_PORT_CCS)); 227 227 if (connected) { 228 228 usb_port_connected(&port->base, &rh_enumerate_device); … … 234 234 if (status & XHCI_REG_MASK(XHCI_PORT_PRC)) { 235 235 status &= ~XHCI_REG_MASK(XHCI_PORT_PRC); 236 bool enabled = !!(status & XHCI_REG_MASK(XHCI_PORT_PED)); 237 236 237 const bool enabled = !!(status & XHCI_REG_MASK(XHCI_PORT_PED)); 238 238 if (enabled) { 239 239 usb_port_enabled(&port->base); … … 258 258 } 259 259 260 void xhci_rh_startup(xhci_rh_t *rh) 261 { 262 /* The reset changed status of all ports, and SW originated reason does 263 * not cause an interrupt. 264 */ 265 for (uint8_t i = 1; i < rh->max_ports; ++i) { 266 xhci_rh_handle_port_change(rh, i + 1); 267 268 rh_port_t * const port = &rh->ports[i]; 269 270 /* 271 * When xHCI starts, for some reasons USB 3 ports do not have 272 * the CSC bit, even though they are connected. Try to find 273 * such ports. 274 */ 275 if (XHCI_REG_RD(port->regs, XHCI_PORT_CCS) && port->base.state == PORT_DISABLED) 276 usb_port_connected(&port->base, &rh_enumerate_device); 277 } 278 } 279 260 280 /** 261 281 * @} -
uspace/drv/bus/usb/xhci/rh.h
r2c0564c r05770666 80 80 void xhci_rh_handle_port_change(xhci_rh_t *, uint8_t); 81 81 void xhci_rh_set_ports_protocol(xhci_rh_t *, unsigned, unsigned, unsigned); 82 void xhci_rh_startup(xhci_rh_t *); 82 83 83 84 #endif
Note:
See TracChangeset
for help on using the changeset viewer.