Changeset b10a434 in mainline for uspace/lib/drv/generic/remote_usbdiag.c
- Timestamp:
- 2017-12-22T13:22:54Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 00d23a2
- Parents:
- 96c416a
- git-author:
- Petr Mánek <petr.manek@…> (2017-12-22 13:22:51)
- git-committer:
- Petr Mánek <petr.manek@…> (2017-12-22 13:22:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbdiag.c
r96c416a rb10a434 62 62 } 63 63 64 int usbdiag_burst_intr_in(async_exch_t *exch, int cycles, size_t size) 65 { 66 if (!exch) 67 return EBADMEM; 68 69 return async_req_3_0(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_INTR_IN, cycles, size); 70 } 71 72 int usbdiag_burst_intr_out(async_exch_t *exch, int cycles, size_t size) 73 { 74 if (!exch) 75 return EBADMEM; 76 77 return async_req_3_0(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_INTR_OUT, cycles, size); 78 } 79 80 int usbdiag_burst_bulk_in(async_exch_t *exch, int cycles, size_t size) 81 { 82 if (!exch) 83 return EBADMEM; 84 85 return async_req_3_0(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_BULK_IN, cycles, size); 86 } 87 88 int usbdiag_burst_bulk_out(async_exch_t *exch, int cycles, size_t size) 89 { 90 if (!exch) 91 return EBADMEM; 92 93 return async_req_3_0(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_BULK_OUT, cycles, size); 94 } 95 96 int usbdiag_burst_isoch_in(async_exch_t *exch, int cycles, size_t size) 97 { 98 if (!exch) 99 return EBADMEM; 100 101 return async_req_3_0(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_ISOCH_IN, cycles, size); 102 } 103 104 int usbdiag_burst_isoch_out(async_exch_t *exch, int cycles, size_t size) 105 { 106 if (!exch) 107 return EBADMEM; 108 109 return async_req_3_0(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_ISOCH_OUT, cycles, size); 64 int usbdiag_burst_intr_in(async_exch_t *exch, int cycles, size_t size, usbdiag_dur_t *duration) 65 { 66 if (!exch) 67 return EBADMEM; 68 69 sysarg_t duration_; 70 const int rc = async_req_3_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_INTR_IN, cycles, size, &duration_); 71 72 if (rc == EOK && duration) 73 *duration = duration_; 74 75 return rc; 76 } 77 78 int usbdiag_burst_intr_out(async_exch_t *exch, int cycles, size_t size, usbdiag_dur_t *duration) 79 { 80 if (!exch) 81 return EBADMEM; 82 83 sysarg_t duration_; 84 const int rc = async_req_3_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_INTR_OUT, cycles, size, &duration_); 85 86 if (rc == EOK && duration) 87 *duration = duration_; 88 89 return rc; 90 } 91 92 int usbdiag_burst_bulk_in(async_exch_t *exch, int cycles, size_t size, usbdiag_dur_t *duration) 93 { 94 if (!exch) 95 return EBADMEM; 96 97 sysarg_t duration_; 98 const int rc = async_req_3_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_BULK_IN, cycles, size, &duration_); 99 100 if (rc == EOK && duration) 101 *duration = duration_; 102 103 return rc; 104 } 105 106 int usbdiag_burst_bulk_out(async_exch_t *exch, int cycles, size_t size, usbdiag_dur_t *duration) 107 { 108 if (!exch) 109 return EBADMEM; 110 111 sysarg_t duration_; 112 const int rc = async_req_3_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_BULK_OUT, cycles, size, &duration_); 113 114 if (rc == EOK && duration) 115 *duration = duration_; 116 117 return rc; 118 } 119 120 int usbdiag_burst_isoch_in(async_exch_t *exch, int cycles, size_t size, usbdiag_dur_t *duration) 121 { 122 if (!exch) 123 return EBADMEM; 124 125 sysarg_t duration_; 126 const int rc = async_req_3_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_ISOCH_IN, cycles, size, &duration_); 127 128 if (rc == EOK && duration) 129 *duration = duration_; 130 131 return rc; 132 } 133 134 int usbdiag_burst_isoch_out(async_exch_t *exch, int cycles, size_t size, usbdiag_dur_t *duration) 135 { 136 if (!exch) 137 return EBADMEM; 138 139 sysarg_t duration_; 140 const int rc = async_req_3_1(exch, DEV_IFACE_ID(USBDIAG_DEV_IFACE), IPC_M_USBDIAG_BURST_ISOCH_OUT, cycles, size, &duration_); 141 142 if (rc == EOK && duration) 143 *duration = duration_; 144 145 return rc; 110 146 } 111 147 … … 144 180 int cycles = DEV_IPC_GET_ARG1(*call); 145 181 size_t size = DEV_IPC_GET_ARG2(*call); 146 const int ret = diag_iface->burst_intr_in(fun, cycles, size); 147 async_answer_0(callid, ret); 182 usbdiag_dur_t duration; 183 const int ret = diag_iface->burst_intr_in(fun, cycles, size, &duration); 184 185 if (ret != EOK) { 186 async_answer_0(callid, ret); 187 } else { 188 async_answer_1(callid, EOK, duration); 189 } 148 190 } 149 191 … … 159 201 int cycles = DEV_IPC_GET_ARG1(*call); 160 202 size_t size = DEV_IPC_GET_ARG2(*call); 161 const int ret = diag_iface->burst_intr_out(fun, cycles, size); 162 async_answer_0(callid, ret); 203 usbdiag_dur_t duration; 204 const int ret = diag_iface->burst_intr_out(fun, cycles, size, &duration); 205 206 if (ret != EOK) { 207 async_answer_0(callid, ret); 208 } else { 209 async_answer_1(callid, EOK, duration); 210 } 163 211 } 164 212 … … 174 222 int cycles = DEV_IPC_GET_ARG1(*call); 175 223 size_t size = DEV_IPC_GET_ARG2(*call); 176 const int ret = diag_iface->burst_bulk_in(fun, cycles, size); 177 async_answer_0(callid, ret); 224 usbdiag_dur_t duration; 225 const int ret = diag_iface->burst_bulk_in(fun, cycles, size, &duration); 226 227 if (ret != EOK) { 228 async_answer_0(callid, ret); 229 } else { 230 async_answer_1(callid, EOK, duration); 231 } 178 232 } 179 233 … … 189 243 int cycles = DEV_IPC_GET_ARG1(*call); 190 244 size_t size = DEV_IPC_GET_ARG2(*call); 191 const int ret = diag_iface->burst_bulk_out(fun, cycles, size); 192 async_answer_0(callid, ret); 245 usbdiag_dur_t duration; 246 const int ret = diag_iface->burst_bulk_out(fun, cycles, size, &duration); 247 248 if (ret != EOK) { 249 async_answer_0(callid, ret); 250 } else { 251 async_answer_1(callid, EOK, duration); 252 } 193 253 } 194 254 … … 204 264 int cycles = DEV_IPC_GET_ARG1(*call); 205 265 size_t size = DEV_IPC_GET_ARG2(*call); 206 const int ret = diag_iface->burst_isoch_in(fun, cycles, size); 207 async_answer_0(callid, ret); 266 usbdiag_dur_t duration; 267 const int ret = diag_iface->burst_isoch_in(fun, cycles, size, &duration); 268 269 if (ret != EOK) { 270 async_answer_0(callid, ret); 271 } else { 272 async_answer_1(callid, EOK, duration); 273 } 208 274 } 209 275 … … 219 285 int cycles = DEV_IPC_GET_ARG1(*call); 220 286 size_t size = DEV_IPC_GET_ARG2(*call); 221 const int ret = diag_iface->burst_isoch_out(fun, cycles, size); 222 async_answer_0(callid, ret); 287 usbdiag_dur_t duration; 288 const int ret = diag_iface->burst_isoch_out(fun, cycles, size, &duration); 289 290 if (ret != EOK) { 291 async_answer_0(callid, ret); 292 } else { 293 async_answer_1(callid, EOK, duration); 294 } 223 295 } 224 296
Note:
See TracChangeset
for help on using the changeset viewer.