Changeset d017cea in mainline for uspace/lib/usb/src/host/batch.c


Ignore:
Timestamp:
2011-04-12T10:09:56Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
508a0ca
Parents:
f13381b
Message:

Remove EP information stored in usb_transfer_batch_t

rename usb_transfer_batch_t.transport_buffer ⇒ data_buffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/host/batch.c

    rf13381b rd017cea  
    4141void usb_transfer_batch_init(
    4242    usb_transfer_batch_t *instance,
    43     usb_target_t target,
    44     usb_transfer_type_t transfer_type,
    45     usb_speed_t speed,
    46     size_t max_packet_size,
     43                endpoint_t *ep,
    4744    char *buffer,
    48     char *transport_buffer,
     45    char *data_buffer,
    4946    size_t buffer_size,
    5047    char *setup_buffer,
     
    5451    void *arg,
    5552    ddf_fun_t *fun,
    56                 endpoint_t *ep,
    5753    void *private_data
    5854    )
     
    6056        assert(instance);
    6157        link_initialize(&instance->link);
    62         instance->target = target;
    63         instance->transfer_type = transfer_type;
    64         instance->speed = speed;
    65         instance->direction = ep->direction;
     58        instance->ep = ep;
    6659        instance->callback_in = func_in;
    6760        instance->callback_out = func_out;
    6861        instance->arg = arg;
    6962        instance->buffer = buffer;
    70         instance->transport_buffer = transport_buffer;
     63        instance->data_buffer = data_buffer;
    7164        instance->buffer_size = buffer_size;
    7265        instance->setup_buffer = setup_buffer;
    7366        instance->setup_size = setup_size;
    74         instance->max_packet_size = max_packet_size;
    7567        instance->fun = fun;
    7668        instance->private_data = private_data;
     
    7870        instance->next_step = NULL;
    7971        instance->error = EOK;
    80         instance->ep = ep;
    8172        endpoint_use(instance->ep);
    8273}
     
    10596        assert(instance);
    10697        assert(instance->callback_in);
     98        assert(instance->ep);
    10799
    108100        /* We are data in, we need data */
    109         memcpy(instance->buffer, instance->transport_buffer,
    110             instance->buffer_size);
     101        memcpy(instance->buffer, instance->data_buffer, instance->buffer_size);
    111102
    112103        usb_log_debug("Batch %p done (T%d.%d, %s %s in, %zuB): %s (%d).\n",
    113             instance,
    114             instance->target.address, instance->target.endpoint,
    115             usb_str_speed(instance->speed),
    116             usb_str_transfer_type_short(instance->transfer_type),
    117             instance->transfered_size,
    118             str_error(instance->error), instance->error);
     104            instance, instance->ep->address, instance->ep->endpoint,
     105            usb_str_speed(instance->ep->speed),
     106            usb_str_transfer_type_short(instance->ep->transfer_type),
     107            instance->transfered_size, str_error(instance->error), instance->error);
    119108
    120109        instance->callback_in(instance->fun, instance->error,
     
    132121
    133122        usb_log_debug("Batch %p done (T%d.%d, %s %s out): %s (%d).\n",
    134             instance,
    135             instance->target.address, instance->target.endpoint,
    136             usb_str_speed(instance->speed),
    137             usb_str_transfer_type_short(instance->transfer_type),
     123            instance, instance->ep->address, instance->ep->endpoint,
     124            usb_str_speed(instance->ep->speed),
     125            usb_str_transfer_type_short(instance->ep->transfer_type),
    138126            str_error(instance->error), instance->error);
    139127
Note: See TracChangeset for help on using the changeset viewer.