Changeset 27ed734c in mainline for uspace/lib
- Timestamp:
- 2011-10-31T13:06:57Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5e07cbc0
- Parents:
- d25e0a4
- Location:
- uspace/lib
- Files:
-
- 8 edited
-
drv/generic/remote_usb.c (modified) (3 diffs)
-
drv/include/usb_iface.h (modified) (2 diffs)
-
usb/include/usb/ddfiface.h (modified) (1 diff)
-
usb/include/usb/hc.h (modified) (1 diff)
-
usb/src/ddfiface.c (modified) (4 diffs)
-
usb/src/hc.c (modified) (2 diffs)
-
usb/src/resolve.c (modified) (1 diff)
-
usbdev/src/pipes.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usb.c
rd25e0a4 r27ed734c 40 40 41 41 42 static void remote_usb_get_ address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);42 static void remote_usb_get_my_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 43 43 static void remote_usb_get_interface(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 44 44 static void remote_usb_get_hc_handle(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 47 47 /** Remote USB interface operations. */ 48 48 static remote_iface_func_ptr_t remote_usb_iface_ops [] = { 49 remote_usb_get_address,50 remote_usb_get_interface,51 remote_usb_get_hc_handle49 [IPC_M_USB_GET_MY_ADDRESS] = remote_usb_get_my_address, 50 [IPC_M_USB_GET_INTERFACE] = remote_usb_get_interface, 51 [IPC_M_USB_GET_HOST_CONTROLLER_HANDLE] = remote_usb_get_hc_handle, 52 52 }; 53 53 … … 61 61 62 62 63 void remote_usb_get_ address(ddf_fun_t *fun, void *iface,63 void remote_usb_get_my_address(ddf_fun_t *fun, void *iface, 64 64 ipc_callid_t callid, ipc_call_t *call) 65 65 { 66 66 usb_iface_t *usb_iface = (usb_iface_t *) iface; 67 67 68 if (usb_iface->get_ address == NULL) {68 if (usb_iface->get_my_address == NULL) { 69 69 async_answer_0(callid, ENOTSUP); 70 70 return; 71 71 } 72 72 73 devman_handle_t handle = DEV_IPC_GET_ARG1(*call);74 75 73 usb_address_t address; 76 int rc = usb_iface->get_ address(fun, handle, &address);74 int rc = usb_iface->get_my_address(fun, &address); 77 75 if (rc != EOK) { 78 76 async_answer_0(callid, rc); -
uspace/lib/drv/include/usb_iface.h
rd25e0a4 r27ed734c 65 65 * handle must be resolved by its parent. 66 66 */ 67 IPC_M_USB_GET_ ADDRESS,67 IPC_M_USB_GET_MY_ADDRESS, 68 68 69 69 /** Tell interface number given device can use. … … 90 90 /** USB device communication interface. */ 91 91 typedef struct { 92 int (*get_ address)(ddf_fun_t *, devman_handle_t, usb_address_t *);92 int (*get_my_address)(ddf_fun_t *, usb_address_t *); 93 93 int (*get_interface)(ddf_fun_t *, devman_handle_t, int *); 94 94 int (*get_hc_handle)(ddf_fun_t *, devman_handle_t *); -
uspace/lib/usb/include/usb/ddfiface.h
rd25e0a4 r27ed734c 40 40 41 41 int usb_iface_get_hc_handle_device_impl(ddf_fun_t *, devman_handle_t *); 42 int usb_iface_get_address_forward_impl(ddf_fun_t *, devman_handle_t, 43 usb_address_t *); 42 int usb_iface_get_my_address_forward_impl(ddf_fun_t *, usb_address_t *); 44 43 extern usb_iface_t usb_iface_hub_impl; 45 44 46 int usb_iface_get_address_from_device_data(ddf_fun_t *, devman_handle_t, 47 usb_address_t *); 45 int usb_iface_get_my_address_from_device_data(ddf_fun_t *, usb_address_t *); 48 46 extern usb_iface_t usb_iface_hub_child_impl; 49 47 50 48 int usb_iface_get_hc_handle_hc_impl(ddf_fun_t *, devman_handle_t *); 51 52 49 53 50 #endif -
uspace/lib/usb/include/usb/hc.h
rd25e0a4 r27ed734c 62 62 devman_handle_t *); 63 63 64 usb_address_t usb_ hc_get_address_by_handle(devman_handle_t);64 usb_address_t usb_get_address_by_handle(devman_handle_t); 65 65 66 66 int usb_hc_find(devman_handle_t, devman_handle_t *); -
uspace/lib/usb/src/ddfiface.c
rd25e0a4 r27ed734c 44 44 45 45 /** DDF interface for USB device, implementation for typical hub. */ 46 usb_iface_t usb_iface_hub_impl = {46 usb_iface_t usb_iface_hub_impl = { 47 47 .get_hc_handle = usb_iface_get_hc_handle_device_impl, 48 .get_ address = usb_iface_get_address_forward_impl,48 .get_my_address = usb_iface_get_my_address_forward_impl, 49 49 }; 50 50 51 51 /** DDF interface for USB device, implementation for child of a typical hub. */ 52 usb_iface_t usb_iface_hub_child_impl = {52 usb_iface_t usb_iface_hub_child_impl = { 53 53 .get_hc_handle = usb_iface_get_hc_handle_device_impl, 54 .get_ address = usb_iface_get_address_from_device_data,54 .get_my_address = usb_iface_get_my_address_from_device_data, 55 55 }; 56 56 … … 92 92 * @return Error code. 93 93 */ 94 int usb_iface_get_ address_forward_impl(ddf_fun_t *fun, devman_handle_t handle,94 int usb_iface_get_my_address_forward_impl(ddf_fun_t *fun, 95 95 usb_address_t *address) 96 96 { 97 97 assert(fun); 98 assert(handle == 0);99 98 100 99 async_sess_t *parent_sess = … … 107 106 108 107 sysarg_t addr; 109 int rc = async_req_ 2_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),110 IPC_M_USB_GET_ ADDRESS, handle, &addr);108 int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 109 IPC_M_USB_GET_MY_ADDRESS, &addr); 111 110 112 111 async_exchange_end(exch); … … 133 132 * @return Error code. 134 133 */ 135 int usb_iface_get_ address_from_device_data(ddf_fun_t *fun,136 devman_handle_t handle,usb_address_t *address)134 int usb_iface_get_my_address_from_device_data(ddf_fun_t *fun, 135 usb_address_t *address) 137 136 { 138 137 assert(fun); 139 assert(handle == 0);140 138 assert(fun->driver_data); 141 139 usb_hub_attached_device_t *device = fun->driver_data; -
uspace/lib/usb/src/hc.c
rd25e0a4 r27ed734c 174 174 * @return USB address or negative error code. 175 175 */ 176 usb_address_t usb_ hc_get_address_by_handle(devman_handle_t dev_handle)176 usb_address_t usb_get_address_by_handle(devman_handle_t dev_handle) 177 177 { 178 178 async_sess_t *parent_sess = … … 185 185 186 186 sysarg_t address; 187 int rc = async_req_2_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 188 IPC_M_USB_GET_ADDRESS, 189 dev_handle, &address); 187 int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 188 IPC_M_USB_GET_MY_ADDRESS, &address); 190 189 191 190 async_exchange_end(exch); -
uspace/lib/usb/src/resolve.c
rd25e0a4 r27ed734c 200 200 /* Try to get its address. */ 201 201 if (!found_addr) { 202 dev_addr = usb_ hc_get_address_by_handle(tmp_handle);202 dev_addr = usb_get_address_by_handle(tmp_handle); 203 203 if (dev_addr >= 0) { 204 204 found_addr = true; -
uspace/lib/usbdev/src/pipes.c
rd25e0a4 r27ed734c 56 56 async_exch_t *exch = async_exchange_begin(sess); 57 57 58 /*59 * We are sending special value as a handle - zero - to get60 * handle of the parent function (that handle was used61 * when registering our device @p dev.62 */63 58 sysarg_t address; 64 int rc = async_req_ 2_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),65 IPC_M_USB_GET_ ADDRESS, 0, &address);59 int rc = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE), 60 IPC_M_USB_GET_MY_ADDRESS, &address); 66 61 67 62 async_exchange_end(exch);
Note:
See TracChangeset
for help on using the changeset viewer.
