Changeset ae3a941 in mainline for uspace/lib/drv/generic
- Timestamp:
- 2018-02-26T16:51:40Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e773f58
- Parents:
- 3692678
- Location:
- uspace/lib/drv/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usb.c
r3692678 rae3a941 52 52 usb_dev_session_t *usb_dev_connect_to_self(ddf_dev_t *dev) 53 53 { 54 return devman_parent_device_connect(ddf_dev_get_handle(dev), IPC_FLAG_BLOCKING); 54 return devman_parent_device_connect(ddf_dev_get_handle(dev), 55 IPC_FLAG_BLOCKING); 55 56 } 56 57 … … 90 91 } 91 92 92 static void remote_usb_get_my_description(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 93 static void remote_usb_get_my_description(ddf_fun_t *, void *, 94 ipc_callid_t, ipc_call_t *); 93 95 94 96 /** Remote USB interface operations. */ -
uspace/lib/drv/generic/remote_usbdiag.c
r3692678 rae3a941 58 58 } 59 59 60 errno_t usbdiag_test_in(async_exch_t *exch, const usbdiag_test_params_t *params, usbdiag_test_results_t *results) 60 errno_t usbdiag_test_in(async_exch_t *exch, 61 const usbdiag_test_params_t *params, usbdiag_test_results_t *results) 61 62 { 62 63 if (!exch) … … 64 65 65 66 ipc_call_t answer; 66 aid_t req = async_send_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_TEST_IN, &answer); 67 68 errno_t rc = async_data_write_start(exch, params, sizeof(usbdiag_test_params_t)); 69 if (rc != EOK) { 70 async_exchange_end(exch); 71 async_forget(req); 72 return rc; 73 } 74 75 rc = async_data_read_start(exch, results, sizeof(usbdiag_test_results_t)); 67 aid_t req = async_send_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), 68 IPC_M_USBDIAG_TEST_IN, &answer); 69 70 errno_t rc = async_data_write_start(exch, params, 71 sizeof(usbdiag_test_params_t)); 72 if (rc != EOK) { 73 async_exchange_end(exch); 74 async_forget(req); 75 return rc; 76 } 77 78 rc = async_data_read_start(exch, results, 79 sizeof(usbdiag_test_results_t)); 76 80 if (rc != EOK) { 77 81 async_exchange_end(exch); … … 88 92 } 89 93 90 errno_t usbdiag_test_out(async_exch_t *exch, const usbdiag_test_params_t *params, usbdiag_test_results_t *results) 94 errno_t usbdiag_test_out(async_exch_t *exch, 95 const usbdiag_test_params_t *params, usbdiag_test_results_t *results) 91 96 { 92 97 if (!exch) … … 94 99 95 100 ipc_call_t answer; 96 aid_t req = async_send_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_TEST_OUT, &answer); 97 98 errno_t rc = async_data_write_start(exch, params, sizeof(usbdiag_test_params_t)); 99 if (rc != EOK) { 100 async_exchange_end(exch); 101 async_forget(req); 102 return rc; 103 } 104 105 rc = async_data_read_start(exch, results, sizeof(usbdiag_test_results_t)); 101 aid_t req = async_send_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), 102 IPC_M_USBDIAG_TEST_OUT, &answer); 103 104 errno_t rc = async_data_write_start(exch, params, 105 sizeof(usbdiag_test_params_t)); 106 if (rc != EOK) { 107 async_exchange_end(exch); 108 async_forget(req); 109 return rc; 110 } 111 112 rc = async_data_read_start(exch, results, 113 sizeof(usbdiag_test_results_t)); 106 114 if (rc != EOK) { 107 115 async_exchange_end(exch); … … 118 126 } 119 127 120 static void remote_usbdiag_test_in(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 121 static void remote_usbdiag_test_out(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); 128 static void remote_usbdiag_test_in(ddf_fun_t *, void *, 129 ipc_callid_t, ipc_call_t *); 130 static void remote_usbdiag_test_out(ddf_fun_t *, void *, 131 ipc_callid_t, ipc_call_t *); 122 132 123 133 /** Remote USB diagnostic interface operations. */ … … 133 143 }; 134 144 135 void remote_usbdiag_test_in(ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call) 145 void remote_usbdiag_test_in(ddf_fun_t *fun, void *iface, 146 ipc_callid_t callid, ipc_call_t *call) 136 147 { 137 148 const usbdiag_iface_t *diag_iface = (usbdiag_iface_t *) iface; … … 158 169 159 170 usbdiag_test_results_t results; 160 const errno_t ret = !diag_iface->test_in ? ENOTSUP : diag_iface->test_in(fun, ¶ms, &results); 171 const errno_t ret = !diag_iface->test_in ? ENOTSUP 172 : diag_iface->test_in(fun, ¶ms, &results); 161 173 162 174 if (ret != EOK) { … … 185 197 } 186 198 187 void remote_usbdiag_test_out(ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call) 199 void remote_usbdiag_test_out(ddf_fun_t *fun, void *iface, 200 ipc_callid_t callid, ipc_call_t *call) 188 201 { 189 202 const usbdiag_iface_t *diag_iface = (usbdiag_iface_t *) iface; … … 210 223 211 224 usbdiag_test_results_t results; 212 const errno_t ret = !diag_iface->test_out ? ENOTSUP : diag_iface->test_out(fun, ¶ms, &results); 225 const errno_t ret = !diag_iface->test_out ? ENOTSUP 226 : diag_iface->test_out(fun, ¶ms, &results); 213 227 214 228 if (ret != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.