Changeset eb2f7dd in mainline
- Timestamp:
- 2011-05-08T13:37:51Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- df25ab6
- Parents:
- 84de606d
- Location:
- uspace/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
r84de606d reb2f7dd 52 52 static void remote_usbhc_request_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 53 53 static void remote_usbhc_bind_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 54 static void remote_usbhc_find_by_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 54 55 static void remote_usbhc_release_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 55 56 static void remote_usbhc_register_endpoint(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 61 62 remote_usbhc_request_address, 62 63 remote_usbhc_bind_address, 64 remote_usbhc_find_by_address, 63 65 remote_usbhc_release_address, 64 66 … … 161 163 162 164 async_answer_0(callid, rc); 165 } 166 167 void remote_usbhc_find_by_address(ddf_fun_t *fun, void *iface, 168 ipc_callid_t callid, ipc_call_t *call) 169 { 170 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 171 172 if (!usb_iface->find_by_address) { 173 async_answer_0(callid, ENOTSUP); 174 return; 175 } 176 177 usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call); 178 devman_handle_t handle; 179 int rc = usb_iface->find_by_address(fun, address, &handle); 180 181 if (rc == EOK) { 182 async_answer_1(callid, EOK, handle); 183 } else { 184 async_answer_0(callid, rc); 185 } 163 186 } 164 187 -
uspace/lib/drv/include/usbhc_iface.h
r84de606d reb2f7dd 105 105 IPC_M_USBHC_BIND_ADDRESS, 106 106 107 /** Get handle binded with given USB address. 108 * Parameters 109 * - USB address 110 * Answer: 111 * - EOK - address binded, first parameter is the devman handle 112 * - ENOENT - address is not in use at the moment 113 */ 114 IPC_M_USBHC_GET_HANDLE_BY_ADDRESS, 115 107 116 /** Release address in use. 108 117 * Arguments: … … 207 216 int (*request_address)(ddf_fun_t *, usb_speed_t, usb_address_t *); 208 217 int (*bind_address)(ddf_fun_t *, usb_address_t, devman_handle_t); 218 int (*find_by_address)(ddf_fun_t *, usb_address_t, devman_handle_t *); 209 219 int (*release_address)(ddf_fun_t *, usb_address_t); 210 220 -
uspace/lib/usb/include/usb/hub.h
r84de606d reb2f7dd 63 63 const usb_hc_attached_device_t *); 64 64 int usb_hc_unregister_device(usb_hc_connection_t *, usb_address_t); 65 int usb_hc_get_handle_by_address(usb_hc_connection_t *, usb_address_t, 66 devman_handle_t *); 65 67 66 68 #endif -
uspace/lib/usb/src/hub.c
r84de606d reb2f7dd 117 117 DEV_IFACE_ID(USBHC_DEV_IFACE), 118 118 IPC_M_USBHC_RELEASE_ADDRESS, address); 119 } 120 121 /** Get handle of USB device with given address. 122 * 123 * @param[in] connection Opened connection to host controller. 124 * @param[in] address Address of device in question. 125 * @param[out] handle Where to write the device handle. 126 * @return Error code. 127 */ 128 int usb_hc_get_handle_by_address(usb_hc_connection_t *connection, 129 usb_address_t address, devman_handle_t *handle) 130 { 131 CHECK_CONNECTION(connection); 132 133 sysarg_t tmp; 134 int rc = async_req_2_1(connection->hc_phone, 135 DEV_IFACE_ID(USBHC_DEV_IFACE), 136 IPC_M_USBHC_GET_HANDLE_BY_ADDRESS, 137 address, &tmp); 138 if ((rc == EOK) && (handle != NULL)) { 139 *handle = tmp; 140 } 141 142 return rc; 119 143 } 120 144
Note:
See TracChangeset
for help on using the changeset viewer.