Changeset 81c0854f in mainline for uspace/drv/vhc/hub
- Timestamp:
- 2011-01-28T12:41:33Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba5ab09
- Parents:
- c2020f7 (diff), ea6a824 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/drv/vhc/hub
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/hub/hub.c
rc2020f7 r81c0854f 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 -
uspace/drv/vhc/hub/hub.h
rc2020f7 r81c0854f 27 27 */ 28 28 29 /** @addtogroup usb29 /** @addtogroup drvusbvhc 30 30 * @{ 31 31 */ … … 38 38 #include <fibril_synch.h> 39 39 40 #ifndef HUB_PORT_COUNT 40 41 #define HUB_PORT_COUNT 2 42 #endif 41 43 #define BITS2BYTES(bits) (bits ? ((((bits)-1)>>3)+1) : 0) 42 44 … … 94 96 void hub_init(hub_t *); 95 97 size_t hub_connect_device(hub_t *, void *); 98 int hub_disconnect_device(hub_t *, void *); 96 99 size_t hub_find_device(hub_t *, void *); 97 100 void hub_acquire(hub_t *); -
uspace/drv/vhc/hub/virthub.c
rc2020f7 r81c0854f 27 27 */ 28 28 29 /** @addtogroup usb29 /** @addtogroup drvusbvhc 30 30 * @{ 31 31 */ … … 164 164 dev->device_data = hub; 165 165 166 usbvirt_connect_local(dev); 167 168 return EOK; 166 int rc; 167 #ifdef STANDALONE_HUB 168 dev->name = "hub"; 169 rc = usbvirt_connect(dev); 170 #else 171 rc = usbvirt_connect_local(dev); 172 #endif 173 174 return rc; 169 175 } 170 176 … … 203 209 204 210 hub_acquire(hub); 205 /* TODO: implement. */211 hub_disconnect_device(hub, conn); 206 212 hub_release(hub); 207 213 -
uspace/drv/vhc/hub/virthub.h
rc2020f7 r81c0854f 27 27 */ 28 28 29 /** @addtogroup usb29 /** @addtogroup drvusbvhc 30 30 * @{ 31 31 */ … … 37 37 38 38 #include <usbvirt/device.h> 39 #include "hub.h" 40 41 #ifdef STANDALONE_HUB 42 #define virtdev_connection_t int 43 #else 39 44 #include "../devices.h" 40 # include "hub.h"45 #endif 41 46 42 47 /** Endpoint number for status change pipe. */ -
uspace/drv/vhc/hub/virthubops.c
rc2020f7 r81c0854f 27 27 */ 28 28 29 /** @addtogroup usb29 /** @addtogroup drvusbvhc 30 30 * @{ 31 31 */
Note:
See TracChangeset
for help on using the changeset viewer.
