11#ifndef _EFI_EHCI_URB_H_
12#define _EFI_EHCI_URB_H_
21#define EHC_CTRL_TRANSFER 0x01
22#define EHC_BULK_TRANSFER 0x02
23#define EHC_INT_TRANSFER_SYNC 0x04
24#define EHC_INT_TRANSFER_ASYNC 0x08
26#define EHC_QTD_SIG SIGNATURE_32 ('U', 'S', 'B', 'T')
27#define EHC_QH_SIG SIGNATURE_32 ('U', 'S', 'B', 'H')
28#define EHC_URB_SIG SIGNATURE_32 ('U', 'S', 'B', 'R')
33#define EHC_TYPE_ITD 0x00
34#define EHC_TYPE_QH 0x02
35#define EHC_TYPE_SITD 0x04
36#define EHC_TYPE_FSTN 0x06
38#define QH_NAK_RELOAD 3
39#define QH_HSHBW_MULTI 1
42#define QTD_PID_OUTPUT 0x00
43#define QTD_PID_INPUT 0x01
44#define QTD_PID_SETUP 0x02
46#define QTD_STAT_DO_OUT 0
47#define QTD_STAT_DO_SS 0
48#define QTD_STAT_DO_PING 0x01
49#define QTD_STAT_DO_CS 0x02
50#define QTD_STAT_TRANS_ERR 0x08
51#define QTD_STAT_BABBLE_ERR 0x10
52#define QTD_STAT_BUFF_ERR 0x20
53#define QTD_STAT_HALTED 0x40
54#define QTD_STAT_ACTIVE 0x80
55#define QTD_STAT_ERR_MASK (QTD_STAT_TRANS_ERR | QTD_STAT_BABBLE_ERR | QTD_STAT_BUFF_ERR)
57#define QTD_MAX_BUFFER 4
58#define QTD_BUF_LEN 4096
59#define QTD_BUF_MASK 0x0FFF
61#define QH_MICROFRAME_0 0x01
62#define QH_MICROFRAME_1 0x02
63#define QH_MICROFRAME_2 0x04
64#define QH_MICROFRAME_3 0x08
65#define QH_MICROFRAME_4 0x10
66#define QH_MICROFRAME_5 0x20
67#define QH_MICROFRAME_6 0x40
68#define QH_MICROFRAME_7 0x80
70#define USB_ERR_SHORT_PACKET 0x200
76#define QH_LINK(Addr, Type, Term) \
77 ((UINT32) ((EHC_LOW_32BIT (Addr) & 0xFFFFFFE0) | (Type) | ((Term) ? 1 : 0)))
79#define QTD_LINK(Addr, Term) QH_LINK((Addr), 0, (Term))
97 UINT32 TotalBytes : 15;
98 UINT32 DataToggle : 1;
109 UINT32 DeviceAddr : 7;
114 UINT32 ReclaimHead : 1;
115 UINT32 MaxPacketLen : 11;
117 UINT32 NakReload : 4;
123 UINT32 Multiplier : 2;
137 UINT32 TotalBytes : 15;
138 UINT32 DataToggle : 1;
EHC_QTD * EhcCreateQtd(IN USB2_HC_DEV *Ehc, IN UINT8 *Data, IN UINT8 *DataPhy, IN UINTN DataLen, IN UINT8 PktId, IN UINT8 Toggle, IN UINTN MaxPacket)
EHC_QH * EhcCreateQh(IN USB2_HC_DEV *Ehci, IN USB_ENDPOINT *Ep)
URB * EhcCreateUrb(IN USB2_HC_DEV *Ehc, IN UINT8 DevAddr, IN UINT8 EpAddr, IN UINT8 DevSpeed, IN UINT8 Toggle, IN UINTN MaxPacket, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Hub, IN UINTN Type, IN EFI_USB_DEVICE_REQUEST *Request, IN VOID *Data, IN UINTN DataLen, IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback, IN VOID *Context, IN UINTN Interval)
VOID EhcFreeUrb(IN USB2_HC_DEV *Ehc, IN URB *Urb)
EFI_STATUS(EFIAPI * EFI_ASYNC_USB_TRANSFER_CALLBACK)(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)