Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset c0e4b5b2 in mainline for uspace/drv/bus/usb/vhc/transfer.c


Ignore:
Timestamp:
2017-10-13T09:38:32Z (4 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master
Children:
5995383c
Parents:
741bcdeb
Message:

usbhost refactoring: vhc

Now, please, review.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/vhc/transfer.c

    r741bcdeb rc0e4b5b2  
    3131#include <usb/debug.h>
    3232#include <usbvirt/device.h>
     33#include <usb/host/bandwidth.h>
    3334#include <usbvirt/ipc.h>
    3435#include "vhcd.h"
     
    3738static bool is_set_address_transfer(vhc_transfer_t *transfer)
    3839{
    39         if (transfer->batch->ep->endpoint != 0) {
     40        if (transfer->batch->ep->target.endpoint != 0) {
    4041                return false;
    4142        }
     
    8081                if (dir == USB_DIRECTION_IN) {
    8182                        rc = usbvirt_data_in(dev, batch->ep->transfer_type,
    82                             batch->ep->endpoint,
     83                            batch->ep->target.endpoint,
    8384                            batch->buffer, batch->buffer_size,
    8485                            actual_data_size);
     
    8687                        assert(dir == USB_DIRECTION_OUT);
    8788                        rc = usbvirt_data_out(dev, batch->ep->transfer_type,
    88                             batch->ep->endpoint,
     89                            batch->ep->target.endpoint,
    8990                            batch->buffer, batch->buffer_size);
    9091                }
     
    115116        } else {
    116117                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,
    118119                            batch->ep->transfer_type,
    119120                            batch->buffer, batch->buffer_size,
     
    121122                } else {
    122123                        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,
    124125                            batch->ep->transfer_type,
    125126                            batch->buffer, batch->buffer_size);
     
    159160        list_initialize(&instance->devices);
    160161        fibril_mutex_initialize(&instance->guard);
     162        usb2_bus_init(&instance->bus, BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11);
    161163        instance->magic = 0xDEADBEEF;
    162164        return virthub_init(&instance->hub, "root hub");
     
    182184        list_foreach(vhc->devices, link, vhc_virtdev_t, dev) {
    183185                fibril_mutex_lock(&dev->guard);
    184                 if (dev->address == transfer->batch->ep->address) {
     186                if (dev->address == transfer->batch->ep->target.address) {
    185187                        if (!targets) {
    186188                                list_append(&transfer->link, &dev->transfer_queue);
Note: See TracChangeset for help on using the changeset viewer.