Changeset a46e56b in mainline for uspace/lib/drv/generic/remote_usbdiag.c
- Timestamp:
- 2018-03-22T06:49:35Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77f0a1d
- Parents:
- 3e242d2
- git-author:
- Jakub Jermar <jakub@…> (2018-03-21 23:29:06)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-22 06:49:35)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbdiag.c
r3e242d2 ra46e56b 144 144 145 145 void remote_usbdiag_test_in(ddf_fun_t *fun, void *iface, 146 cap_call_handle_t c allid, ipc_call_t *call)146 cap_call_handle_t chandle, ipc_call_t *call) 147 147 { 148 148 const usbdiag_iface_t *diag_iface = (usbdiag_iface_t *) iface; 149 149 150 150 size_t size; 151 cap_call_handle_t data_c allid;152 if (!async_data_write_receive(&data_c allid, &size)) {153 async_answer_0(data_c allid, EINVAL);154 async_answer_0(c allid, EINVAL);151 cap_call_handle_t data_chandle; 152 if (!async_data_write_receive(&data_chandle, &size)) { 153 async_answer_0(data_chandle, EINVAL); 154 async_answer_0(chandle, EINVAL); 155 155 return; 156 156 } 157 157 158 158 if (size != sizeof(usbdiag_test_params_t)) { 159 async_answer_0(data_c allid, EINVAL);160 async_answer_0(c allid, EINVAL);159 async_answer_0(data_chandle, EINVAL); 160 async_answer_0(chandle, EINVAL); 161 161 return; 162 162 } 163 163 164 164 usbdiag_test_params_t params; 165 if (async_data_write_finalize(data_c allid, ¶ms, size) != EOK) {166 async_answer_0(c allid, EINVAL);165 if (async_data_write_finalize(data_chandle, ¶ms, size) != EOK) { 166 async_answer_0(chandle, EINVAL); 167 167 return; 168 168 } … … 173 173 174 174 if (ret != EOK) { 175 async_answer_0(c allid, ret);176 return; 177 } 178 179 if (!async_data_read_receive(&data_c allid, &size)) {180 async_answer_0(data_c allid, EINVAL);181 async_answer_0(c allid, EINVAL);175 async_answer_0(chandle, ret); 176 return; 177 } 178 179 if (!async_data_read_receive(&data_chandle, &size)) { 180 async_answer_0(data_chandle, EINVAL); 181 async_answer_0(chandle, EINVAL); 182 182 return; 183 183 } 184 184 185 185 if (size != sizeof(usbdiag_test_results_t)) { 186 async_answer_0(data_c allid, EINVAL);187 async_answer_0(c allid, EINVAL);188 return; 189 } 190 191 if (async_data_read_finalize(data_c allid, &results, size) != EOK) {192 async_answer_0(c allid, EINVAL);193 return; 194 } 195 196 async_answer_0(c allid, ret);186 async_answer_0(data_chandle, EINVAL); 187 async_answer_0(chandle, EINVAL); 188 return; 189 } 190 191 if (async_data_read_finalize(data_chandle, &results, size) != EOK) { 192 async_answer_0(chandle, EINVAL); 193 return; 194 } 195 196 async_answer_0(chandle, ret); 197 197 } 198 198 199 199 void remote_usbdiag_test_out(ddf_fun_t *fun, void *iface, 200 cap_call_handle_t c allid, ipc_call_t *call)200 cap_call_handle_t chandle, ipc_call_t *call) 201 201 { 202 202 const usbdiag_iface_t *diag_iface = (usbdiag_iface_t *) iface; 203 203 204 204 size_t size; 205 cap_call_handle_t data_c allid;206 if (!async_data_write_receive(&data_c allid, &size)) {207 async_answer_0(data_c allid, EINVAL);208 async_answer_0(c allid, EINVAL);205 cap_call_handle_t data_chandle; 206 if (!async_data_write_receive(&data_chandle, &size)) { 207 async_answer_0(data_chandle, EINVAL); 208 async_answer_0(chandle, EINVAL); 209 209 return; 210 210 } 211 211 212 212 if (size != sizeof(usbdiag_test_params_t)) { 213 async_answer_0(data_c allid, EINVAL);214 async_answer_0(c allid, EINVAL);213 async_answer_0(data_chandle, EINVAL); 214 async_answer_0(chandle, EINVAL); 215 215 return; 216 216 } 217 217 218 218 usbdiag_test_params_t params; 219 if (async_data_write_finalize(data_c allid, ¶ms, size) != EOK) {220 async_answer_0(c allid, EINVAL);219 if (async_data_write_finalize(data_chandle, ¶ms, size) != EOK) { 220 async_answer_0(chandle, EINVAL); 221 221 return; 222 222 } … … 227 227 228 228 if (ret != EOK) { 229 async_answer_0(c allid, ret);230 return; 231 } 232 233 if (!async_data_read_receive(&data_c allid, &size)) {234 async_answer_0(data_c allid, EINVAL);235 async_answer_0(c allid, EINVAL);229 async_answer_0(chandle, ret); 230 return; 231 } 232 233 if (!async_data_read_receive(&data_chandle, &size)) { 234 async_answer_0(data_chandle, EINVAL); 235 async_answer_0(chandle, EINVAL); 236 236 return; 237 237 } 238 238 239 239 if (size != sizeof(usbdiag_test_results_t)) { 240 async_answer_0(data_c allid, EINVAL);241 async_answer_0(c allid, EINVAL);242 return; 243 } 244 245 if (async_data_read_finalize(data_c allid, &results, size) != EOK) {246 async_answer_0(c allid, EINVAL);247 return; 248 } 249 250 async_answer_0(c allid, ret);240 async_answer_0(data_chandle, EINVAL); 241 async_answer_0(chandle, EINVAL); 242 return; 243 } 244 245 if (async_data_read_finalize(data_chandle, &results, size) != EOK) { 246 async_answer_0(chandle, EINVAL); 247 return; 248 } 249 250 async_answer_0(chandle, ret); 251 251 } 252 252
Note:
See TracChangeset
for help on using the changeset viewer.