Changeset 1e64b250 in mainline for uspace/lib/drv/generic/remote_usbhc.c
- Timestamp:
- 2011-02-11T14:20:57Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4e38d69
- Parents:
- 0a6fa9f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usbhc.c
r0a6fa9f r1e64b250 42 42 43 43 static void remote_usbhc_get_address(device_t *, void *, ipc_callid_t, ipc_call_t *); 44 static void remote_usbhc_get_buffer(device_t *, void *, ipc_callid_t, ipc_call_t *);45 44 static void remote_usbhc_interrupt_out(device_t *, void *, ipc_callid_t, ipc_call_t *); 46 45 static void remote_usbhc_interrupt_in(device_t *, void *, ipc_callid_t, ipc_call_t *); … … 64 63 remote_usbhc_get_address, 65 64 66 remote_usbhc_get_buffer,67 68 65 remote_usbhc_reserve_default_address, 69 66 remote_usbhc_release_default_address, … … 157 154 } 158 155 159 void remote_usbhc_get_buffer(device_t *device, void *iface,160 ipc_callid_t callid, ipc_call_t *call)161 {162 sysarg_t buffer_hash = DEV_IPC_GET_ARG1(*call);163 async_transaction_t * trans = (async_transaction_t *)buffer_hash;164 if (trans == NULL) {165 async_answer_0(callid, ENOENT);166 return;167 }168 if (trans->buffer == NULL) {169 async_answer_0(callid, EINVAL);170 async_transaction_destroy(trans);171 return;172 }173 174 ipc_callid_t cid;175 size_t accepted_size;176 if (!async_data_read_receive(&cid, &accepted_size)) {177 async_answer_0(callid, EINVAL);178 async_transaction_destroy(trans);179 return;180 }181 182 if (accepted_size > trans->size) {183 accepted_size = trans->size;184 }185 async_data_read_finalize(cid, trans->buffer, accepted_size);186 187 async_answer_1(callid, EOK, accepted_size);188 189 async_transaction_destroy(trans);190 }191 192 156 void remote_usbhc_reserve_default_address(device_t *device, void *iface, 193 157 ipc_callid_t callid, ipc_call_t *call) … … 304 268 305 269 async_answer_0(trans->caller, USB_OUTCOME_OK); 270 271 async_transaction_destroy(trans); 306 272 } 307 273
Note:
See TracChangeset
for help on using the changeset viewer.