10#ifndef _EFI_EHCI_URB_H_
11#define _EFI_EHCI_URB_H_
17#define EHC_CTRL_TRANSFER 0x01
18#define EHC_BULK_TRANSFER 0x02
19#define EHC_INT_TRANSFER_SYNC 0x04
20#define EHC_INT_TRANSFER_ASYNC 0x08
22#define EHC_QTD_SIG SIGNATURE_32 ('U', 'S', 'B', 'T')
23#define EHC_QH_SIG SIGNATURE_32 ('U', 'S', 'B', 'H')
24#define EHC_URB_SIG SIGNATURE_32 ('U', 'S', 'B', 'R')
29#define EHC_TYPE_ITD 0x00
30#define EHC_TYPE_QH 0x02
31#define EHC_TYPE_SITD 0x04
32#define EHC_TYPE_FSTN 0x06
34#define QH_NAK_RELOAD 3
35#define QH_HSHBW_MULTI 1
38#define QTD_PID_OUTPUT 0x00
39#define QTD_PID_INPUT 0x01
40#define QTD_PID_SETUP 0x02
42#define QTD_STAT_DO_OUT 0
43#define QTD_STAT_DO_SS 0
44#define QTD_STAT_DO_PING 0x01
45#define QTD_STAT_DO_CS 0x02
46#define QTD_STAT_TRANS_ERR 0x08
47#define QTD_STAT_BABBLE_ERR 0x10
48#define QTD_STAT_BUFF_ERR 0x20
49#define QTD_STAT_HALTED 0x40
50#define QTD_STAT_ACTIVE 0x80
51#define QTD_STAT_ERR_MASK (QTD_STAT_TRANS_ERR | QTD_STAT_BABBLE_ERR | QTD_STAT_BUFF_ERR)
53#define QTD_MAX_BUFFER 4
54#define QTD_BUF_LEN 4096
55#define QTD_BUF_MASK 0x0FFF
57#define QH_MICROFRAME_0 0x01
58#define QH_MICROFRAME_1 0x02
59#define QH_MICROFRAME_2 0x04
60#define QH_MICROFRAME_3 0x08
61#define QH_MICROFRAME_4 0x10
62#define QH_MICROFRAME_5 0x20
63#define QH_MICROFRAME_6 0x40
64#define QH_MICROFRAME_7 0x80
66#define USB_ERR_SHORT_PACKET 0x200
72#define QH_LINK(Addr, Type, Term) \
73 ((UINT32) ((EHC_LOW_32BIT (Addr) & 0xFFFFFFE0) | (Type) | ((Term) ? 1 : 0)))
75#define QTD_LINK(Addr, Term) QH_LINK((Addr), 0, (Term))
93 UINT32 TotalBytes : 15;
94 UINT32 DataToggle : 1;
105 UINT32 DeviceAddr : 7;
110 UINT32 ReclaimHead : 1;
111 UINT32 MaxPacketLen : 11;
113 UINT32 NakReload : 4;
119 UINT32 Multiplier : 2;
133 UINT32 TotalBytes : 15;
134 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)