Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/hw_struct/transfer_descriptor.h

    r9d2d444 rc61338a  
    4040#include "link_pointer.h"
    4141
    42 /** Transfer Descriptor, defined in UHCI design guide p. 26 */
     42/** UHCI Transfer Descriptor */
    4343typedef struct transfer_descriptor {
    44         /** Pointer to the next entity (TD or QH) */
    4544        link_pointer_t next;
    4645
    47         /** Status doubleword */
    4846        volatile uint32_t status;
    4947#define TD_STATUS_RESERVED_MASK 0xc000f800
    50 #define TD_STATUS_SPD_FLAG         (1 << 29)
    51 #define TD_STATUS_ERROR_COUNT_POS 27
    52 #define TD_STATUS_ERROR_COUNT_MASK 0x3
    53 #define TD_STATUS_LOW_SPEED_FLAG   (1 << 26)
    54 #define TD_STATUS_ISOCHRONOUS_FLAG (1 << 25)
    55 #define TD_STATUS_IOC_FLAG         (1 << 24)
     48#define TD_STATUS_SPD_FLAG ( 1 << 29 )
     49#define TD_STATUS_ERROR_COUNT_POS ( 27 )
     50#define TD_STATUS_ERROR_COUNT_MASK ( 0x3 )
     51#define TD_STATUS_LOW_SPEED_FLAG ( 1 << 26 )
     52#define TD_STATUS_ISOCHRONOUS_FLAG ( 1 << 25 )
     53#define TD_STATUS_IOC_FLAG ( 1 << 24 )
    5654
    57 #define TD_STATUS_ERROR_ACTIVE    (1 << 23)
    58 #define TD_STATUS_ERROR_STALLED   (1 << 22)
    59 #define TD_STATUS_ERROR_BUFFER    (1 << 21)
    60 #define TD_STATUS_ERROR_BABBLE    (1 << 20)
    61 #define TD_STATUS_ERROR_NAK       (1 << 19)
    62 #define TD_STATUS_ERROR_CRC       (1 << 18)
    63 #define TD_STATUS_ERROR_BIT_STUFF (1 << 17)
    64 #define TD_STATUS_ERROR_RESERVED  (1 << 16)
     55#define TD_STATUS_ERROR_ACTIVE ( 1 << 23 )
     56#define TD_STATUS_ERROR_STALLED ( 1 << 22 )
     57#define TD_STATUS_ERROR_BUFFER ( 1 << 21 )
     58#define TD_STATUS_ERROR_BABBLE ( 1 << 20 )
     59#define TD_STATUS_ERROR_NAK ( 1 << 19 )
     60#define TD_STATUS_ERROR_CRC ( 1 << 18 )
     61#define TD_STATUS_ERROR_BIT_STUFF ( 1 << 17 )
     62#define TD_STATUS_ERROR_RESERVED ( 1 << 16 )
    6563#define TD_STATUS_ERROR_POS 16
    66 #define TD_STATUS_ERROR_MASK 0xff
     64#define TD_STATUS_ERROR_MASK ( 0xff )
    6765
    6866#define TD_STATUS_ACTLEN_POS 0
    6967#define TD_STATUS_ACTLEN_MASK 0x7ff
    7068
    71         /* double word with USB device specific info */
    7269        volatile uint32_t device;
    7370#define TD_DEVICE_MAXLEN_POS 21
    74 #define TD_DEVICE_MAXLEN_MASK 0x7ff
    75 #define TD_DEVICE_RESERVED_FLAG        (1 << 20)
    76 #define TD_DEVICE_DATA_TOGGLE_ONE_FLAG (1 << 19)
     71#define TD_DEVICE_MAXLEN_MASK ( 0x7ff )
     72#define TD_DEVICE_RESERVED_FLAG ( 1 << 20 )
     73#define TD_DEVICE_DATA_TOGGLE_ONE_FLAG ( 1 << 19 )
    7774#define TD_DEVICE_ENDPOINT_POS 15
    78 #define TD_DEVICE_ENDPOINT_MASK 0xf
     75#define TD_DEVICE_ENDPOINT_MASK ( 0xf )
    7976#define TD_DEVICE_ADDRESS_POS 8
    80 #define TD_DEVICE_ADDRESS_MASK 0x7f
     77#define TD_DEVICE_ADDRESS_MASK ( 0x7f )
    8178#define TD_DEVICE_PID_POS 0
    82 #define TD_DEVICE_PID_MASK 0xff
     79#define TD_DEVICE_PID_MASK ( 0xff )
    8380
    84         /** Pointer(physical) to the beginning of the transaction's buffer */
    8581        volatile uint32_t buffer_ptr;
    8682
    87         /* According to UHCI design guide, there is 16 bytes of
    88          * data available here.
    89          * According to linux kernel the hardware does not care,
    90          * it just needs to be aligned. We don't use it anyway.
     83        /* there is 16 bytes of data available here, according to UHCI
     84         * Design guide, according to linux kernel the hardware does not care,
     85         * it just needs to be aligned, we don't use it anyway
    9186         */
    9287} __attribute__((packed)) td_t;
Note: See TracChangeset for help on using the changeset viewer.