Changes in uspace/drv/vhc/hub/hub.c [70e5ad5:0f21c0c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/hub/hub.c
r70e5ad5 r0f21c0c 27 27 */ 28 28 29 /** @addtogroup usb29 /** @addtogroup drvusbvhc 30 30 * @{ 31 31 */ … … 40 40 #include <stdlib.h> 41 41 #include <driver.h> 42 #include <usb/usbdrv.h>43 42 44 43 #include "hub.h" … … 155 154 } 156 155 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 157 178 /** Find port device is connected to. 158 179 * … … 173 194 } 174 195 175 return 0;196 return -1; 176 197 } 177 198
Note:
See TracChangeset
for help on using the changeset viewer.