Changeset 7a7bfeb3 in mainline for uspace/srv/hw/bus/usb/hcd/virtual/conndev.c
- Timestamp:
- 2010-10-24T16:43:40Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 355f7c2
- Parents:
- b8a3cda
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/bus/usb/hcd/virtual/conndev.c
rb8a3cda r7a7bfeb3 42 42 #include "hub.h" 43 43 44 /** Handle data from device to host.45 */46 static void handle_data_from_device(ipc_callid_t iid, ipc_call_t icall,47 virtdev_connection_t *dev)48 {49 usb_target_t target = {50 .address = IPC_GET_ARG1(icall),51 .endpoint = IPC_GET_ARG2(icall)52 };53 size_t len = IPC_GET_ARG3(icall);54 55 if (!hub_can_device_signal(dev)) {56 ipc_answer_0(iid, EREFUSED);57 return;58 }59 60 dprintf("data from device %d [%d.%d]", dev->id,61 target.address, target.endpoint);62 63 int rc;64 65 void * buffer = NULL;66 if (len > 0) {67 rc = async_data_write_accept(&buffer, false,68 1, USB_MAX_PAYLOAD_SIZE,69 0, &len);70 71 if (rc != EOK) {72 ipc_answer_0(iid, rc);73 return;74 }75 }76 77 rc = hc_fillin_transaction_from_device(target, buffer, len);78 79 ipc_answer_0(iid, rc);80 }81 82 44 /** Connection handler for communcation with virtual device. 83 45 * … … 110 72 break; 111 73 112 case IPC_M_USBVIRT_DATA_FROM_DEVICE:113 handle_data_from_device(callid, call, dev);114 break;115 116 74 default: 117 75 ipc_answer_0(callid, EINVAL);
Note:
See TracChangeset
for help on using the changeset viewer.