Changeset 472235a in mainline for uspace/drv/bus/usb/xhci/rh.c
- Timestamp:
- 2017-10-03T16:53:47Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 65e079b
- Parents:
- efe9463
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/rh.c
refe9463 r472235a 135 135 xhci_cmd_fini(&cmd); 136 136 137 137 // TODO: Issue configure endpoint commands (sec 4.3.5). 138 138 139 139 return EOK; … … 165 165 usb_log_debug("Detected new device on port %u, port speed id %u.", port_id, port_speed); 166 166 167 alloc_dev(hc, port_id, 0);167 return alloc_dev(hc, port_id, 0); 168 168 } 169 169 else if (link_state == 5) { 170 170 /* USB 3 failed to enable. */ 171 171 usb_log_error("USB 3 port couldn't be enabled."); 172 return EAGAIN; 172 173 } 173 174 else { 174 175 usb_log_error("USB 3 port is in invalid state %u.", link_state); 176 return EINVAL; 175 177 } 176 178 } … … 183 185 going around? 184 186 */ 185 } 186 187 return EOK; 187 return EOK; 188 } 188 189 } 189 190 190 191 int xhci_handle_port_status_change_event(xhci_hc_t *hc, xhci_trb_t *trb) 191 192 { 193 int err; 194 192 195 uint8_t port_id = xhci_get_hub_port(trb); 193 196 usb_log_debug("Port status change event detected for port %u.", port_id); … … 202 205 usb_log_debug2("Detected port reset on port %u, port speed id %u.", port_id, port_speed); 203 206 /** FIXME: only if that port is not yet initialized */ 204 alloc_dev(hc, port_id, 0); 207 if ((err = alloc_dev(hc, port_id, 0)) != EOK) 208 return err; 205 209 } 206 210 … … 210 214 211 215 if (XHCI_REG_RD(regs, XHCI_PORT_CCS) == 1) { 212 handle_connected_device(hc, regs, port_id); 216 if ((err = handle_connected_device(hc, regs, port_id)) != EOK) 217 return err; 213 218 } else { 214 219 // TODO: Device disconnected 220 return ENOTSUP; 215 221 } 216 222 }
Note:
See TracChangeset
for help on using the changeset viewer.