Changeset c0e4b5b2 in mainline
- Timestamp:
- 2017-10-13T09:38:32Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5995383c
- Parents:
- 741bcdeb
- Location:
- uspace/drv/bus/usb/vhc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/vhc/main.c
r741bcdeb rc0e4b5b2 89 89 90 90 /* Initialize generic structures */ 91 ret = hcd_ddf_setup_hc(dev, USB_SPEED_FULL, 92 BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11); 91 ret = hcd_ddf_setup_hc(dev); 93 92 if (ret != EOK) { 94 93 usb_log_error("Failed to init HCD structures: %s.\n", … … 98 97 } 99 98 100 hcd_set_implementation(dev_to_hcd(dev), data, &vhc_hc_ops );99 hcd_set_implementation(dev_to_hcd(dev), data, &vhc_hc_ops, &data->bus.base); 101 100 102 101 /* Add virtual hub device */ -
uspace/drv/bus/usb/vhc/transfer.c
r741bcdeb rc0e4b5b2 31 31 #include <usb/debug.h> 32 32 #include <usbvirt/device.h> 33 #include <usb/host/bandwidth.h> 33 34 #include <usbvirt/ipc.h> 34 35 #include "vhcd.h" … … 37 38 static bool is_set_address_transfer(vhc_transfer_t *transfer) 38 39 { 39 if (transfer->batch->ep-> endpoint != 0) {40 if (transfer->batch->ep->target.endpoint != 0) { 40 41 return false; 41 42 } … … 80 81 if (dir == USB_DIRECTION_IN) { 81 82 rc = usbvirt_data_in(dev, batch->ep->transfer_type, 82 batch->ep-> endpoint,83 batch->ep->target.endpoint, 83 84 batch->buffer, batch->buffer_size, 84 85 actual_data_size); … … 86 87 assert(dir == USB_DIRECTION_OUT); 87 88 rc = usbvirt_data_out(dev, batch->ep->transfer_type, 88 batch->ep-> endpoint,89 batch->ep->target.endpoint, 89 90 batch->buffer, batch->buffer_size); 90 91 } … … 115 116 } else { 116 117 if (dir == USB_DIRECTION_IN) { 117 rc = usbvirt_ipc_send_data_in(sess, batch->ep-> endpoint,118 rc = usbvirt_ipc_send_data_in(sess, batch->ep->target.endpoint, 118 119 batch->ep->transfer_type, 119 120 batch->buffer, batch->buffer_size, … … 121 122 } else { 122 123 assert(dir == USB_DIRECTION_OUT); 123 rc = usbvirt_ipc_send_data_out(sess, batch->ep-> endpoint,124 rc = usbvirt_ipc_send_data_out(sess, batch->ep->target.endpoint, 124 125 batch->ep->transfer_type, 125 126 batch->buffer, batch->buffer_size); … … 159 160 list_initialize(&instance->devices); 160 161 fibril_mutex_initialize(&instance->guard); 162 usb2_bus_init(&instance->bus, BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11); 161 163 instance->magic = 0xDEADBEEF; 162 164 return virthub_init(&instance->hub, "root hub"); … … 182 184 list_foreach(vhc->devices, link, vhc_virtdev_t, dev) { 183 185 fibril_mutex_lock(&dev->guard); 184 if (dev->address == transfer->batch->ep-> address) {186 if (dev->address == transfer->batch->ep->target.address) { 185 187 if (!targets) { 186 188 list_append(&transfer->link, &dev->transfer_queue); -
uspace/drv/bus/usb/vhc/vhcd.h
r741bcdeb rc0e4b5b2 42 42 43 43 #include <usb/host/hcd.h> 44 #include <usb/host/usb2_bus.h> 44 45 45 46 #define NAME "vhc" … … 60 61 fibril_mutex_t guard; 61 62 usbvirt_device_t hub; 63 usb2_bus_t bus; 62 64 } vhc_data_t; 63 65
Note:
See TracChangeset
for help on using the changeset viewer.