Changeset b791e3e in mainline
- Timestamp:
- 2010-10-22T14:10:20Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a498728
- Parents:
- 34586183
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbvirt/main.c
r34586183 rb791e3e 52 52 usb_address_t address = IPC_GET_ARG1(icall); 53 53 usb_endpoint_t endpoint = IPC_GET_ARG2(icall); 54 size_t expected_len = IPC_GET_ARG5(icall); 54 55 55 56 if (address != device->address) { … … 58 59 } 59 60 60 size_t len; 61 void * buffer; 62 int rc = async_data_write_accept(&buffer, false, 63 1, USB_MAX_PAYLOAD_SIZE, 64 0, &len); 65 66 if (rc != EOK) { 67 ipc_answer_0(iid, rc); 68 return; 61 size_t len = 0; 62 void * buffer = NULL; 63 if (expected_len > 0) { 64 int rc = async_data_write_accept(&buffer, false, 65 1, USB_MAX_PAYLOAD_SIZE, 66 0, &len); 67 68 if (rc != EOK) { 69 ipc_answer_0(iid, rc); 70 return; 71 } 69 72 } 70 73 71 74 device->receive_data(device, endpoint, buffer, len); 72 75 73 free(buffer); 76 if (buffer != NULL) { 77 free(buffer); 78 } 74 79 75 80 ipc_answer_0(iid, EOK); … … 209 214 device_init(dev); 210 215 216 device = dev; 217 211 218 return EOK; 212 219 }
Note:
See TracChangeset
for help on using the changeset viewer.