Changeset 58f4c0f in mainline
- Timestamp:
- 2018-01-20T21:38:48Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d648e83
- Parents:
- cb63854
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/rh.c
rcb63854 r58f4c0f 62 62 XHCI_REG_MASK(XHCI_PORT_CEC); 63 63 64 static const uint32_t port_reset_mask = 65 XHCI_REG_MASK(XHCI_PORT_WRC) | 66 XHCI_REG_MASK(XHCI_PORT_PRC); 67 64 68 typedef struct rh_port { 65 69 usb_port_t base; … … 133 137 if ((err = usb_port_wait_for_enabled(&port->base))) 134 138 return err; 139 } else { 140 /* Do the Warm reset to ensure the state is clear. */ 141 XHCI_REG_SET(port->regs, XHCI_PORT_WPR, 1); 142 if ((err = usb_port_wait_for_enabled(&port->base))) 143 return err; 135 144 } 136 145 … … 220 229 XHCI_REG_WR_FIELD(&port->regs->portsc, status & ~XHCI_REG_MASK(XHCI_PORT_PED), 32); 221 230 231 const bool connected = !!(status & XHCI_REG_MASK(XHCI_PORT_CCS)); 232 const bool enabled = !!(status & XHCI_REG_MASK(XHCI_PORT_PED)); 233 222 234 if (status & XHCI_REG_MASK(XHCI_PORT_CSC)) { 223 235 usb_log_info("Connected state changed on port %u.", port_id); 224 236 status &= ~XHCI_REG_MASK(XHCI_PORT_CSC); 225 237 226 const bool connected = !!(status & XHCI_REG_MASK(XHCI_PORT_CCS));227 238 if (connected) { 228 239 usb_port_connected(&port->base, &rh_enumerate_device); … … 232 243 } 233 244 234 if (status & XHCI_REG_MASK(XHCI_PORT_PRC)) { 235 status &= ~XHCI_REG_MASK(XHCI_PORT_PRC); 236 237 const bool enabled = !!(status & XHCI_REG_MASK(XHCI_PORT_PED)); 245 if (status & port_reset_mask) { 246 status &= ~port_reset_mask; 247 238 248 if (enabled) { 239 249 usb_port_enabled(&port->base);
Note:
See TracChangeset
for help on using the changeset viewer.