Changeset 19a1800 in mainline for uspace/lib/usbvirt/src/callback.c
- Timestamp:
- 2011-03-01T22:20:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e24e7b1
- Parents:
- 976f546 (diff), ac8285d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbvirt/src/callback.c
r976f546 r19a1800 27 27 */ 28 28 29 /** @addtogroup libusbvirt usb29 /** @addtogroup libusbvirt 30 30 * @{ 31 31 */ … … 54 54 55 55 if (address != device->address) { 56 ipc_answer_0(iid, EADDRNOTAVAIL);56 async_answer_0(iid, EADDRNOTAVAIL); 57 57 return; 58 58 } 59 59 60 60 if ((endpoint < 0) || (endpoint >= USB11_ENDPOINT_MAX)) { 61 ipc_answer_0(iid, EINVAL);61 async_answer_0(iid, EINVAL); 62 62 return; 63 63 } 64 64 65 65 if (expected_len == 0) { 66 ipc_answer_0(iid, EINVAL);66 async_answer_0(iid, EINVAL); 67 67 return; 68 68 } … … 74 74 75 75 if (rc != EOK) { 76 ipc_answer_0(iid, rc);76 async_answer_0(iid, rc); 77 77 return; 78 78 } … … 80 80 rc = device->transaction_setup(device, endpoint, buffer, len); 81 81 82 ipc_answer_0(iid, rc);82 async_answer_0(iid, rc); 83 83 } 84 84 … … 92 92 93 93 if (address != device->address) { 94 ipc_answer_0(iid, EADDRNOTAVAIL);94 async_answer_0(iid, EADDRNOTAVAIL); 95 95 return; 96 96 } 97 97 98 98 if ((endpoint < 0) || (endpoint >= USB11_ENDPOINT_MAX)) { 99 ipc_answer_0(iid, EINVAL);99 async_answer_0(iid, EINVAL); 100 100 return; 101 101 } … … 111 111 112 112 if (rc != EOK) { 113 ipc_answer_0(iid, rc);113 async_answer_0(iid, rc); 114 114 return; 115 115 } … … 122 122 } 123 123 124 ipc_answer_0(iid, rc);124 async_answer_0(iid, rc); 125 125 } 126 126 … … 135 135 136 136 if (address != device->address) { 137 ipc_answer_0(iid, EADDRNOTAVAIL);137 async_answer_0(iid, EADDRNOTAVAIL); 138 138 return; 139 139 } 140 140 141 141 if ((endpoint < 0) || (endpoint >= USB11_ENDPOINT_MAX)) { 142 ipc_answer_0(iid, EINVAL);142 async_answer_0(iid, EINVAL); 143 143 return; 144 144 } … … 157 157 ipc_callid_t callid; 158 158 if (!async_data_read_receive(&callid, &receive_len)) { 159 ipc_answer_0(iid, EINVAL);159 async_answer_0(iid, EINVAL); 160 160 return; 161 161 } 162 async_data_read_finalize(callid, buffer, receive_len); 163 } 164 165 ipc_answer_0(iid, rc); 162 if (len > receive_len) { 163 len = receive_len; 164 } 165 async_data_read_finalize(callid, buffer, len); 166 } 167 168 async_answer_1(iid, rc, len); 166 169 } 167 170 … … 171 174 { 172 175 if (device->name == NULL) { 173 ipc_answer_0(iid, ENOENT);176 async_answer_0(iid, ENOENT); 174 177 } 175 178 … … 179 182 size_t accepted_size; 180 183 if (!async_data_read_receive(&callid, &accepted_size)) { 181 ipc_answer_0(iid, EINVAL);184 async_answer_0(iid, EINVAL); 182 185 return; 183 186 } … … 188 191 async_data_read_finalize(callid, device->name, accepted_size); 189 192 190 ipc_answer_1(iid, EOK, accepted_size);193 async_answer_1(iid, EOK, accepted_size); 191 194 } 192 195 … … 194 197 void device_callback_connection(usbvirt_device_t *device, ipc_callid_t iid, ipc_call_t *icall) 195 198 { 196 ipc_answer_0(iid, EOK);199 async_answer_0(iid, EOK); 197 200 198 201 while (true) { … … 203 206 switch (IPC_GET_IMETHOD(call)) { 204 207 case IPC_M_PHONE_HUNGUP: 205 ipc_answer_0(callid, EOK);208 async_answer_0(callid, EOK); 206 209 return; 207 210 … … 223 226 224 227 default: 225 ipc_answer_0(callid, EINVAL);228 async_answer_0(callid, EINVAL); 226 229 break; 227 230 }
Note:
See TracChangeset
for help on using the changeset viewer.