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