Changeset 27ed734c in mainline
- Timestamp:
- 2011-10-31T13:06:57Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update
- Children:
- 5e07cbc0
- Parents:
- d25e0a4
- Location:
- uspace
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci.c
rd25e0a4 r27ed734c 76 76 } 77 77 /*----------------------------------------------------------------------------*/ 78 /** Get address of the device identified by handle. 79 * 80 * @param[in] dev DDF instance of the device to use. 81 * @param[in] iid (Unused). 82 * @param[in] call Pointer to the call that represents interrupt. 83 */ 84 static int usb_iface_get_address( 85 ddf_fun_t *fun, devman_handle_t handle, usb_address_t *address) 78 /** Get USB address assigned to root hub. 79 * 80 * @param[in] fun Root hub function. 81 * @param[out] address Store the address here. 82 * @return Error code. 83 */ 84 static int rh_get_my_address(ddf_fun_t *fun, usb_address_t *address) 86 85 { 87 86 assert(fun); 88 assert(handle == 0);89 87 90 88 if (address != NULL) { … … 101 99 * @return Error code. 102 100 */ 103 static int usb_iface_get_hc_handle(101 static int rh_get_hc_handle( 104 102 ddf_fun_t *fun, devman_handle_t *handle) 105 103 { … … 115 113 /** Root hub USB interface */ 116 114 static usb_iface_t usb_iface = { 117 .get_hc_handle = usb_iface_get_hc_handle,118 .get_ address = usb_iface_get_address115 .get_hc_handle = rh_get_hc_handle, 116 .get_my_address = rh_get_my_address, 119 117 }; 120 118 /*----------------------------------------------------------------------------*/ -
uspace/drv/bus/usb/usbmid/usbmid.c
rd25e0a4 r27ed734c 63 63 static usb_iface_t child_usb_iface = { 64 64 .get_hc_handle = usb_iface_get_hc_handle_device_impl, 65 .get_ address = usb_iface_get_address_forward_impl,66 .get_interface = usb_iface_get_interface_impl 65 .get_my_address = usb_iface_get_my_address_forward_impl, 66 .get_interface = usb_iface_get_interface_impl, 67 67 }; 68 68 -
uspace/drv/bus/usb/vhc/connhost.c
rd25e0a4 r27ed734c 479 479 } 480 480 481 static int tell_address(ddf_fun_t *fun, devman_handle_t handle, 482 usb_address_t *address) 481 static int tell_address(ddf_fun_t *fun, usb_address_t *address) 483 482 { 484 483 UNSUPPORTED("tell_address"); … … 497 496 } 498 497 499 static int tell_address_rh(ddf_fun_t *root_hub_fun, devman_handle_t handle, 500 usb_address_t *address) 498 static int tell_address_rh(ddf_fun_t *root_hub_fun, usb_address_t *address) 501 499 { 502 500 VHC_DATA(vhc, root_hub_fun); 503 501 504 if (handle == 0) { 505 handle = root_hub_fun->handle; 506 } 502 devman_handle_t handle = root_hub_fun->handle; 507 503 508 504 usb_log_debug("tell_address_rh(handle=%" PRIun ")\n", handle); … … 532 528 usb_iface_t vhc_usb_iface = { 533 529 .get_hc_handle = usb_iface_get_hc_handle_hc_impl, 534 .get_ address = tell_address530 .get_my_address = tell_address 535 531 }; 536 532 537 533 usb_iface_t rh_usb_iface = { 538 534 .get_hc_handle = usb_iface_get_hc_handle_rh_impl, 539 .get_ address = tell_address_rh535 .get_my_address = tell_address_rh 540 536 }; 541 537 -
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 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 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.