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.h

    r0e06a14 rc5b93dc  
    8888         * we don't use it anyway
    8989         */
    90 } __attribute__((packed)) transfer_descriptor_t;
     90} __attribute__((packed)) td_t;
    9191
    9292
    93 void transfer_descriptor_init(transfer_descriptor_t *instance,
    94     int error_count, size_t size, bool toggle, bool isochronous, bool low_speed,
    95     usb_target_t target, int pid, void *buffer, transfer_descriptor_t * next);
     93void td_init(td_t *instance, int error_count, size_t size, bool toggle, bool iso,
     94    bool low_speed, usb_target_t target, int pid, void *buffer, td_t * next);
    9695
    97 int transfer_descriptor_status(transfer_descriptor_t *instance);
     96int td_status(td_t *instance);
    9897
    99 static inline size_t transfer_descriptor_actual_size(
    100     transfer_descriptor_t *instance)
     98static inline size_t td_act_size(td_t *instance)
    10199{
    102100        assert(instance);
    103101        return
    104             ((instance->status >> TD_STATUS_ACTLEN_POS) + 1) & TD_STATUS_ACTLEN_MASK;
     102            ((instance->status >> TD_STATUS_ACTLEN_POS) + 1)
     103            & TD_STATUS_ACTLEN_MASK;
    105104}
    106105
    107 static inline bool transfer_descriptor_is_active(
    108     transfer_descriptor_t *instance)
     106static inline bool td_is_short(td_t *instance)
     107{
     108        const size_t act_size = td_act_size(instance);
     109        const size_t max_size =
     110            ((instance->device >> TD_DEVICE_MAXLEN_POS) + 1)
     111            & TD_DEVICE_MAXLEN_MASK;
     112        return
     113            (instance->status | TD_STATUS_SPD_FLAG) && act_size < max_size;
     114}
     115
     116static inline bool td_is_active(td_t *instance)
    109117{
    110118        assert(instance);
Note: See TracChangeset for help on using the changeset viewer.