Ignore:
Timestamp:
2011-04-08T22:25:32Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e42dd32
Parents:
7786cea
Message:

Implement TD initialization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/hw_struct/transfer_descriptor.h

    r7786cea rb854e56  
    3939#include "completion_codes.h"
    4040
     41/* OHCI TDs can handle up to 8KB buffers */
     42#define OHCI_TD_MAX_TRANSFER (8 * 1024)
     43
    4144typedef struct td {
    4245        volatile uint32_t status;
     
    5255#define TD_STATUS_T_MASK (0x3)  /* data toggle 1x = use ED toggle carry */
    5356#define TD_STATUS_T_SHIFT (24)
     57#define TD_STATUS_T_0 (0x0)
     58#define TD_STATUS_T_1 (0x1)
     59#define TD_STATUS_T_USE_EP (0x1)
    5460#define TD_STATUS_EC_MASK (0x3) /* error count */
    5561#define TD_STATUS_EC_SHIFT (26)
     
    6470        volatile uint32_t be; /* buffer end, address of the last byte */
    6571} __attribute__((packed)) td_t;
     72
     73void td_init(
     74    td_t *instance, usb_direction_t dir, void *buffer, size_t size, int toggle);
     75
     76inline static void td_set_next(td_t *instance, uint32_t next)
     77{
     78        assert(instance);
     79        instance->next = next & TD_NEXT_PTR_MASK;
     80}
    6681#endif
    6782/**
Note: See TracChangeset for help on using the changeset viewer.