#include <mem.h>
#include <usb/usb.h>
#include "link_pointer.h"
Go to the source code of this file.
Data Structures | |
struct | transfer_descriptor |
Transfer Descriptor, defined in UHCI design guide p. More... | |
Defines | |
#define | TD_DEVICE_ADDRESS_MASK 0x7f |
#define | TD_DEVICE_ADDRESS_POS 8 |
#define | TD_DEVICE_DATA_TOGGLE_ONE_FLAG (1 << 19) |
#define | TD_DEVICE_ENDPOINT_MASK 0xf |
#define | TD_DEVICE_ENDPOINT_POS 15 |
#define | TD_DEVICE_MAXLEN_MASK 0x7ff |
#define | TD_DEVICE_MAXLEN_POS 21 |
#define | TD_DEVICE_PID_MASK 0xff |
#define | TD_DEVICE_PID_POS 0 |
#define | TD_DEVICE_RESERVED_FLAG (1 << 20) |
#define | TD_STATUS_ACTLEN_MASK 0x7ff |
#define | TD_STATUS_ACTLEN_POS 0 |
#define | TD_STATUS_ERROR_ACTIVE (1 << 23) |
#define | TD_STATUS_ERROR_BABBLE (1 << 20) |
#define | TD_STATUS_ERROR_BIT_STUFF (1 << 17) |
#define | TD_STATUS_ERROR_BUFFER (1 << 21) |
#define | TD_STATUS_ERROR_COUNT_MASK 0x3 |
#define | TD_STATUS_ERROR_COUNT_POS 27 |
#define | TD_STATUS_ERROR_CRC (1 << 18) |
#define | TD_STATUS_ERROR_MASK 0xff |
#define | TD_STATUS_ERROR_NAK (1 << 19) |
#define | TD_STATUS_ERROR_POS 16 |
#define | TD_STATUS_ERROR_RESERVED (1 << 16) |
#define | TD_STATUS_ERROR_STALLED (1 << 22) |
#define | TD_STATUS_IOC_FLAG (1 << 24) |
#define | TD_STATUS_ISOCHRONOUS_FLAG (1 << 25) |
#define | TD_STATUS_LOW_SPEED_FLAG (1 << 26) |
#define | TD_STATUS_RESERVED_MASK 0xc000f800 |
#define | TD_STATUS_SPD_FLAG (1 << 29) |
Typedefs | |
typedef transfer_descriptor | td_t |
Transfer Descriptor, defined in UHCI design guide p. | |
Functions | |
static size_t | td_act_size (td_t *instance) |
Helper function for parsing actual size out of TD. | |
void | td_init (td_t *instance, int err_count, size_t size, bool toggle, bool iso, bool low_speed, usb_target_t target, usb_packet_id pid, void *buffer, td_t *next) |
Initialize Transfer Descriptor. | |
static bool | td_is_active (td_t *instance) |
Helper function for parsing value of active bit. | |
static bool | td_is_short (td_t *instance) |
Check whether less than max data were received on SPD marked transfer. | |
void | td_print_status (td_t *instance) |
Print values in status field (dw1) in a human readable way. | |
static void | td_set_ioc (td_t *instance) |
Helper function for setting IOC bit. | |
int | td_status (td_t *instance) |
Convert TD status into standard error code. | |
static int | td_toggle (td_t *instance) |
Helper function for parsing value of toggle bit. |
Definition in file transfer_descriptor.h.