Changeset feb10c88 in mainline


Ignore:
Timestamp:
2011-04-07T14:35:08Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2e6bbcf
Parents:
8f30c2e
Message:

Remove redundant batch_get parameters

Location:
uspace/drv/uhci-hcd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/batch.c

    r8f30c2e rfeb10c88  
    8080 * transaction and callback.
    8181 */
    82 usb_transfer_batch_t * batch_get(ddf_fun_t *fun, usb_target_t target,
    83     usb_transfer_type_t transfer_type, size_t max_packet_size,
    84     usb_speed_t speed, char *buffer, size_t buffer_size,
    85     char* setup_buffer, size_t setup_size,
     82usb_transfer_batch_t * batch_get(ddf_fun_t *fun, endpoint_t *ep,
     83    char *buffer, size_t buffer_size, char* setup_buffer, size_t setup_size,
    8684    usbhc_iface_transfer_in_callback_t func_in,
    87     usbhc_iface_transfer_out_callback_t func_out, void *arg, endpoint_t *ep
    88     )
     85    usbhc_iface_transfer_out_callback_t func_out, void *arg)
    8986{
    9087        assert(ep);
     
    104101        CHECK_NULL_DISPOSE_RETURN(instance,
    105102            "Failed to allocate batch instance.\n");
     103        usb_target_t target =
     104            { .address = ep->address, .endpoint = ep->endpoint };
    106105        usb_transfer_batch_init(instance, target,
    107             transfer_type, speed, max_packet_size,
     106            ep->transfer_type, ep->speed, ep->max_packet_size,
    108107            buffer, NULL, buffer_size, NULL, setup_size, func_in,
    109108            func_out, arg, fun, ep, NULL);
     
    116115        instance->private_data = data;
    117116
    118         data->transfers = (buffer_size + max_packet_size - 1) / max_packet_size;
    119         if (transfer_type == USB_TRANSFER_CONTROL) {
     117        data->transfers =
     118            (buffer_size + ep->max_packet_size - 1) / ep->max_packet_size;
     119        if (ep->transfer_type == USB_TRANSFER_CONTROL) {
    120120                data->transfers += 2;
    121121        }
     
    179179                            instance, i, data->tds[i].status);
    180180                        td_print_status(&data->tds[i]);
    181                         if (instance->ep != NULL)
    182                                 endpoint_toggle_set(instance->ep,
    183                                     td_toggle(&data->tds[i]));
     181                        assert(instance->ep != NULL);
     182
     183                        endpoint_toggle_set(instance->ep,
     184                            td_toggle(&data->tds[i]));
    184185                        if (i > 0)
    185186                                goto substract_ret;
  • uspace/drv/uhci-hcd/batch.h

    r8f30c2e rfeb10c88  
    4444
    4545usb_transfer_batch_t * batch_get(
    46     ddf_fun_t *fun,
    47                 usb_target_t target,
    48     usb_transfer_type_t transfer_type,
    49                 size_t max_packet_size,
    50     usb_speed_t speed,
    51                 char *buffer,
    52                 size_t size,
    53                 char *setup_buffer,
    54                 size_t setup_size,
     46    ddf_fun_t *fun, endpoint_t *ep, char *buffer, size_t size,
     47    char *setup_buffer, size_t setup_size,
    5548    usbhc_iface_transfer_in_callback_t func_in,
    5649    usbhc_iface_transfer_out_callback_t func_out,
    57                 void *arg,
    58                 endpoint_t *ep
    59                 );
     50    void *arg);
    6051
    6152void batch_dispose(usb_transfer_batch_t *instance);
  • uspace/drv/uhci-hcd/iface.c

    r8f30c2e rfeb10c88  
    244244
    245245        usb_transfer_batch_t *batch =
    246             batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
    247                 ep->speed, data, size, NULL, 0, NULL, callback, arg, ep);
     246            batch_get(fun, ep, data, size, NULL, 0, NULL, callback, arg);
    248247        if (!batch)
    249248                return ENOMEM;
     
    301300
    302301        usb_transfer_batch_t *batch =
    303             batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
    304                 ep->speed, data, size, NULL, 0, callback, NULL, arg, ep);
     302            batch_get(fun, ep, data, size, NULL, 0, callback, NULL, arg);
    305303        if (!batch)
    306304                return ENOMEM;
     
    348346
    349347        usb_transfer_batch_t *batch =
    350             batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
    351                 ep->speed, data, size, NULL, 0, NULL, callback, arg, ep);
     348            batch_get(fun, ep, data, size, NULL, 0, NULL, callback, arg);
    352349        if (!batch)
    353350                return ENOMEM;
     
    394391
    395392        usb_transfer_batch_t *batch =
    396             batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
    397                 ep->speed, data, size, NULL, 0, callback, NULL, arg, ep);
     393            batch_get(fun, ep, data, size, NULL, 0, callback, NULL, arg);
    398394        if (!batch)
    399395                return ENOMEM;
     
    447443
    448444        usb_transfer_batch_t *batch =
    449             batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
    450                 ep->speed, data, size, setup_data, setup_size, NULL, callback,
    451                 arg, ep);
     445            batch_get(fun, ep, data, size, setup_data, setup_size,
     446                NULL, callback, arg);
    452447        if (!batch)
    453448                return ENOMEM;
     
    499494
    500495        usb_transfer_batch_t *batch =
    501             batch_get(fun, target, ep->transfer_type, ep->max_packet_size,
    502                 ep->speed, data, size, setup_data, setup_size,
    503                 callback, NULL, arg, ep);
     496            batch_get(fun, ep, data, size, setup_data, setup_size,
     497                callback, NULL, arg);
    504498        if (!batch)
    505499                return ENOMEM;
Note: See TracChangeset for help on using the changeset viewer.