TianoCore EDK2 master
Loading...
Searching...
No Matches
UhciSched.h
Go to the documentation of this file.
1
10#ifndef _EFI_UHCI_SCHED_H_
11#define _EFI_UHCI_SCHED_H_
12
13#define UHCI_ASYNC_INT_SIGNATURE SIGNATURE_32 ('u', 'h', 'c', 'a')
14//
15// The failure mask for USB transfer return status. If any of
16// these bit is set, the transfer failed. EFI_USB_ERR_NOEXECUTE
17// and EFI_USB_ERR_NAK are not considered as error condition:
18// the transfer is still going on.
19//
20#define USB_ERR_FAIL_MASK (EFI_USB_ERR_STALL | EFI_USB_ERR_BUFFER | \
21 EFI_USB_ERR_BABBLE | EFI_USB_ERR_CRC | \
22 EFI_USB_ERR_TIMEOUT | EFI_USB_ERR_BITSTUFF | \
23 EFI_USB_ERR_SYSTEM)
24
25//
26// Structure to return the result of UHCI QH execution.
27// Result is the final result of the QH's QTD. NextToggle
28// is the next data toggle to use. Complete is the actual
29// length of data transferred.
30//
31typedef struct {
32 UINT32 Result;
33 UINT8 NextToggle;
34 UINTN Complete;
36
38
39//
40// Structure used to manager the asynchronous interrupt transfers.
41//
43 UINTN Signature;
44 LIST_ENTRY Link;
45 UHCI_ASYNC_REQUEST *Recycle;
46
47 //
48 // Endpoint attributes
49 //
50 UINT8 DevAddr;
51 UINT8 EndPoint;
52 BOOLEAN IsLow;
53 UINTN Interval;
54
55 //
56 // Data and UHC structures
57 //
58 UHCI_QH_SW *QhSw;
59 UHCI_TD_SW *FirstTd;
60 UINT8 *Data; // Allocated host memory, not mapped memory
61 UINTN DataLen;
62 VOID *Mapping;
63
64 //
65 // User callback and its context
66 //
68 VOID *Context;
69};
70
71#define UHCI_ASYNC_INT_FROM_LINK(a) \
72 CR (a, UHCI_ASYNC_REQUEST, Link, UHCI_ASYNC_INT_SIGNATURE)
73
86 IN USB_HC_DEV *Uhc
87 );
88
97VOID
99 IN USB_HC_DEV *Uhc
100 );
101
111UINTN
113 IN UINTN Interval
114 );
115
124VOID
126 USB_HC_DEV *Uhc,
127 UHCI_QH_SW *Qh
128 );
129
139VOID
141 USB_HC_DEV *Uhc,
142 UHCI_QH_SW *Qh
143 );
144
161 IN USB_HC_DEV *Uhc,
162 IN UHCI_QH_SW *Qh,
163 IN UHCI_TD_SW *Td,
164 IN UINTN TimeOut,
165 IN BOOLEAN IsLow,
166 OUT UHCI_QH_RESULT *QhResult
167 );
168
191 IN USB_HC_DEV *Uhc,
192 IN UHCI_QH_SW *Qh,
193 IN UHCI_TD_SW *FirstTd,
194 IN UINT8 DevAddr,
195 IN UINT8 EndPoint,
196 IN UINTN DataLen,
197 IN UINTN Interval,
198 IN UINT8 *Data,
200 IN VOID *Context,
201 IN BOOLEAN IsLow
202 );
203
219 IN USB_HC_DEV *Uhc,
220 IN UINT8 DevAddr,
221 IN UINT8 EndPoint,
222 OUT UINT8 *Toggle
223 );
224
233VOID
235 IN USB_HC_DEV *Uhc
236 );
237
247VOID
248EFIAPI
250 IN EFI_EVENT Event,
251 IN VOID *Context
252 );
253
254#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_ASYNC_USB_TRANSFER_CALLBACK)(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)
Definition: UsbIo.h:80
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
EFI_STATUS UhciInitFrameList(IN USB_HC_DEV *Uhc)
Definition: UhciSched.c:23
EFI_STATUS UhciExecuteTransfer(IN USB_HC_DEV *Uhc, IN UHCI_QH_SW *Qh, IN UHCI_TD_SW *Td, IN UINTN TimeOut, IN BOOLEAN IsLow, OUT UHCI_QH_RESULT *QhResult)
Definition: UhciSched.c:558
VOID UhciFreeAllAsyncReq(IN USB_HC_DEV *Uhc)
Definition: UhciSched.c:907
VOID EFIAPI UhciMonitorAsyncReqList(IN EFI_EVENT Event, IN VOID *Context)
Definition: UhciSched.c:943
VOID UhciLinkQhToFrameList(USB_HC_DEV *Uhc, UHCI_QH_SW *Qh)
Definition: UhciSched.c:247
VOID UhciDestoryFrameList(IN USB_HC_DEV *Uhc)
Definition: UhciSched.c:159
EFI_STATUS UhciRemoveAsyncReq(IN USB_HC_DEV *Uhc, IN UINT8 DevAddr, IN UINT8 EndPoint, OUT UINT8 *Toggle)
Definition: UhciSched.c:808
UINTN UhciConvertPollRate(IN UINTN Interval)
Definition: UhciSched.c:209
EFI_STATUS UhciCreateAsyncReq(IN USB_HC_DEV *Uhc, IN UHCI_QH_SW *Qh, IN UHCI_TD_SW *FirstTd, IN UINT8 DevAddr, IN UINT8 EndPoint, IN UINTN DataLen, IN UINTN Interval, IN UINT8 *Data, IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback, IN VOID *Context, IN BOOLEAN IsLow)
Definition: UhciSched.c:683
VOID UhciUnlinkQhFromFrameList(USB_HC_DEV *Uhc, UHCI_QH_SW *Qh)
Definition: UhciSched.c:355