Ignore:
Timestamp:
2011-03-05T00:12:21Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eae83aa
Parents:
0e06a14
Message:

Refactoring

Rename transfer_descriptor_t to td_t
Minor fixes

File:
1 edited

Legend:

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

    r0e06a14 rc5b93dc  
    3838#include "utils/malloc32.h"
    3939
    40 void transfer_descriptor_init(transfer_descriptor_t *instance,
    41     int error_count, size_t size, bool toggle, bool isochronous, bool low_speed,
    42     usb_target_t target, int pid, void *buffer, transfer_descriptor_t *next)
     40void td_init(td_t *instance, int err_count, size_t size, bool toggle, bool iso,
     41    bool low_speed, usb_target_t target, int pid, void *buffer, td_t *next)
    4342{
    4443        assert(instance);
     44        assert(size < 1024);
    4545
    4646        instance->next = 0
     
    4949
    5050        instance->status = 0
    51           | ((error_count & TD_STATUS_ERROR_COUNT_MASK) << TD_STATUS_ERROR_COUNT_POS)
    52                 | (low_speed ? TD_STATUS_LOW_SPEED_FLAG : 0)
    53           | TD_STATUS_ERROR_ACTIVE;
     51            | ((err_count & TD_STATUS_ERROR_COUNT_MASK) << TD_STATUS_ERROR_COUNT_POS)
     52            | (low_speed ? TD_STATUS_LOW_SPEED_FLAG : 0)
     53            | (iso ? TD_STATUS_ISOCHRONOUS_FLAG : 0)
     54            | TD_STATUS_ERROR_ACTIVE;
    5455
    55         assert(size < 1024);
    5656        instance->device = 0
    57                 | (((size - 1) & TD_DEVICE_MAXLEN_MASK) << TD_DEVICE_MAXLEN_POS)
    58                 | (toggle ? TD_DEVICE_DATA_TOGGLE_ONE_FLAG : 0)
    59                 | ((target.address & TD_DEVICE_ADDRESS_MASK) << TD_DEVICE_ADDRESS_POS)
    60                 | ((target.endpoint & TD_DEVICE_ENDPOINT_MASK) << TD_DEVICE_ENDPOINT_POS)
    61                 | ((pid & TD_DEVICE_PID_MASK) << TD_DEVICE_PID_POS);
     57            | (((size - 1) & TD_DEVICE_MAXLEN_MASK) << TD_DEVICE_MAXLEN_POS)
     58            | (toggle ? TD_DEVICE_DATA_TOGGLE_ONE_FLAG : 0)
     59            | ((target.address & TD_DEVICE_ADDRESS_MASK) << TD_DEVICE_ADDRESS_POS)
     60            | ((target.endpoint & TD_DEVICE_ENDPOINT_MASK) << TD_DEVICE_ENDPOINT_POS)
     61            | ((pid & TD_DEVICE_PID_MASK) << TD_DEVICE_PID_POS);
    6262
    6363        instance->buffer_ptr = 0;
     
    6868
    6969        usb_log_debug2("Created TD: %X:%X:%X:%X(%p).\n",
    70                 instance->next, instance->status, instance->device,
    71           instance->buffer_ptr, buffer);
     70            instance->next, instance->status, instance->device,
     71            instance->buffer_ptr, buffer);
    7272}
    7373/*----------------------------------------------------------------------------*/
    74 int transfer_descriptor_status(transfer_descriptor_t *instance)
     74int td_status(td_t *instance)
    7575{
    7676        assert(instance);
Note: See TracChangeset for help on using the changeset viewer.