Changeset beee81a in mainline for uspace/lib/usbvirt/src/device.c
- Timestamp:
- 2011-05-07T09:35:15Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bc02b83, d38d830
- Parents:
- 42e2172
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbvirt/src/device.c
r42e2172 rbeee81a 44 44 #include <usb/debug.h> 45 45 46 /** Current device. */ 46 47 static usbvirt_device_t *DEV = NULL; 47 48 49 /** Main IPC call handling from virtual host controller. 50 * 51 * @param iid Caller identification. 52 * @param icall Initial incoming call. 53 */ 48 54 static void callback_connection(ipc_callid_t iid, ipc_call_t *icall) 49 55 { … … 82 88 devman_handle_t handle; 83 89 90 if (DEV != NULL) { 91 return ELIMIT; 92 } 93 84 94 rc = devman_device_get_handle(vhc_path, &handle, 0); 85 95 if (rc != EOK) { … … 94 104 95 105 DEV = dev; 106 dev->vhc_phone = hcd_phone; 96 107 97 108 rc = async_connect_to_me(hcd_phone, 0, 0, 0, callback_connection); 98 109 if (rc != EOK) { 99 110 DEV = NULL; 100 return rc;101 111 } 102 112 103 104 105 return EOK; 113 return rc; 106 114 } 107 115 116 /** Disconnect the device from virtual host controller. 117 * 118 * @param dev Device to be disconnected. 119 */ 120 void usbvirt_device_unplug(usbvirt_device_t *dev) 121 { 122 async_hangup(dev->vhc_phone); 123 } 108 124 109 125 /**
Note:
See TracChangeset
for help on using the changeset viewer.