2 This file contains the descriptor definination of OHCI spec
4 Copyright (c) 2013-2015 Intel Corporation.
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 #define ED_FUNC_ADD 0x0001
22 #define ED_ENDPT_NUM 0x0002
24 #define ED_SPEED 0x0008
25 #define ED_SKIP 0x0010
26 #define ED_FORMAT 0x0020
27 #define ED_MAX_PACKET 0x0040
28 #define ED_TDTAIL_PTR 0x0080
29 #define ED_HALTED 0x0100
30 #define ED_DTTOGGLE 0x0200
31 #define ED_TDHEAD_PTR 0x0400
32 #define ED_NEXT_EDPTR 0x0800
33 #define ED_PDATA 0x1000
34 #define ED_ZERO 0x2000
36 #define TD_BUFFER_ROUND 0x0001
37 #define TD_DIR_PID 0x0002
38 #define TD_DELAY_INT 0x0004
39 #define TD_DT_TOGGLE 0x0008
40 #define TD_ERROR_CNT 0x0010
41 #define TD_COND_CODE 0x0020
42 #define TD_CURR_BUFFER_PTR 0x0040
43 #define TD_NEXT_PTR 0x0080
44 #define TD_BUFFER_END_PTR 0x0100
45 #define TD_PDATA 0x0200
47 #define ED_FROM_TD_DIR 0x0
48 #define ED_OUT_DIR 0x1
50 #define ED_FROM_TD_ALSO_DIR 0x3
52 #define TD_SETUP_PID 0x00
53 #define TD_OUT_PID 0x01
54 #define TD_IN_PID 0x02
55 #define TD_NODATA_PID 0x03
60 #define TD_NO_ERROR 0x00
61 #define TD_CRC_ERROR 0x01
62 #define TD_BITSTUFFING_ERROR 0x02
63 #define TD_TOGGLE_ERROR 0x03
64 #define TD_DEVICE_STALL 0x04
65 #define TD_NO_RESPONSE 0x05
66 #define TD_PIDCHK_FAIL 0x06
67 #define TD_PID_UNEXPECTED 0x07
68 #define TD_DATA_OVERRUN 0x08
69 #define TD_DATA_UNDERRUN 0x09
70 #define TD_BUFFER_OVERRUN 0x0C
71 #define TD_BUFFER_UNDERRUN 0x0D
72 #define TD_TOBE_PROCESSED 0x0E
73 #define TD_TOBE_PROCESSED_2 0x0F
75 #define TD_NO_DELAY 0x7
83 UINT32 BufferRounding
:1;
85 UINT32 DelayInterrupt
:3;
88 UINT32 ConditionCode
:4;
89 } TD_DESCRIPTOR_WORD0
;
91 typedef struct _TD_DESCRIPTOR
{
92 TD_DESCRIPTOR_WORD0 Word0
;
93 VOID
*CurrBufferPointer
;
94 struct _TD_DESCRIPTOR
*NextTD
;
95 VOID
*BufferEndPointer
;
96 struct _TD_DESCRIPTOR
*NextTDPointer
;
98 UINT32 ActualSendLength
;
102 UINT32 FunctionAddress
:7;
103 UINT32 EndPointNum
:4;
108 UINT32 MaxPacketSize
:11;
110 } ED_DESCRIPTOR_WORD0
;
114 UINT32 ToggleCarry
:1;
116 UINT32 TdHeadPointer
:28;
117 } ED_DESCRIPTOR_WORD2
;
119 typedef struct _ED_DESCRIPTOR
{
120 ED_DESCRIPTOR_WORD0 Word0
;
121 TD_DESCRIPTOR
*TdTailPointer
;
122 ED_DESCRIPTOR_WORD2 Word2
;
123 struct _ED_DESCRIPTOR
*NextED
;
126 #define TD_PTR(p) ((TD_DESCRIPTOR *)((p) << 4))
127 #define ED_PTR(p) ((ED_DESCRIPTOR *)((p) << 4))
128 #define RIGHT_SHIFT_4(p) ((UINT32)(p) >> 4)
135 } DESCRIPTOR_LIST_TYPE
;