Changes in uspace/drv/vhc/hub/hub.c [70e5ad5:bd8c753d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/hub/hub.c
r70e5ad5 rbd8c753d 27 27 */ 28 28 29 /** @addtogroup usb29 /** @addtogroup drvusbvhc 30 30 * @{ 31 31 */ … … 155 155 } 156 156 157 /** Disconnects a device from a hub. 158 * 159 * @param hub Hub the device was connected to. 160 * @param device Device to be disconnected. 161 * @return Error code. 162 */ 163 int hub_disconnect_device(hub_t *hub, void *device) 164 { 165 size_t index = hub_find_device(hub, device); 166 if (index == (size_t) -1) { 167 return ENOENT; 168 } 169 170 hub_port_t *port = &hub->ports[index]; 171 172 port->connected_device = NULL; 173 port->state = HUB_PORT_STATE_DISCONNECTED; 174 set_port_status_change(port, HUB_STATUS_C_PORT_CONNECTION); 175 176 return EOK; 177 } 178 157 179 /** Find port device is connected to. 158 180 * … … 173 195 } 174 196 175 return 0;197 return -1; 176 198 } 177 199
Note:
See TracChangeset
for help on using the changeset viewer.