15 #if (__WORDSIZE == 64)
17 APTR
usbGetBuffer(APTR data
, ULONG len
, UWORD dir
);
18 void usbReleaseBuffer(APTR buffer
, APTR data
, ULONG len
, UWORD dir
);
22 /* On 32-bit systems we don't need mirroring */
24 #define usbGetBuffer(data, len, dir) data
25 #define usbReleaseBuffer(buffer, data, len, dir)
29 struct Unit
*Open_Unit(struct IOUsbHWReq
*ioreq
, LONG unitnr
, struct PCIDevice
*base
);
30 void Close_Unit(struct PCIDevice
*base
, struct PCIUnit
*unit
, struct IOUsbHWReq
*ioreq
);
32 void SureCause(struct PCIDevice
*base
, struct Interrupt
*interrupt
);
33 BOOL
uhwOpenTimer(struct PCIUnit
*unit
, struct PCIDevice
*base
);
34 void uhwDelayMS(ULONG milli
, struct PCIUnit
*unit
);
35 void uhwCheckSpecialCtrlTransfers(struct PCIController
*hc
, struct IOUsbHWReq
*ioreq
);
36 void uhwCheckRootHubChanges(struct PCIUnit
*unit
);
38 WORD
cmdReset(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
39 WORD
cmdUsbReset(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
40 WORD
cmdUsbResume(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
41 WORD
cmdUsbSuspend(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
42 WORD
cmdUsbOper(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
44 WORD
cmdQueryDevice(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
46 WORD
cmdControlXFer(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
47 WORD
cmdBulkXFer(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
48 WORD
cmdIntXFer(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
49 WORD
cmdIsoXFer(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
51 WORD
cmdFlush(struct IOUsbHWReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
53 WORD
cmdNSDeviceQuery(struct IOStdReq
*ioreq
, struct PCIUnit
*unit
, struct PCIDevice
*base
);
55 BOOL
cmdAbortIO(struct IOUsbHWReq
*ioreq
, struct PCIDevice
*base
);
57 void TermIO(struct IOUsbHWReq
*ioreq
, struct PCIDevice
*base
);
59 AROS_UFP1(void, uhwNakTimeoutInt
,
60 AROS_UFPA(struct PCIUnit
*, unit
, A1
));
62 BOOL
pciInit(struct PCIDevice
*hd
);
63 void pciExpunge(struct PCIDevice
*hd
);
64 BOOL
pciAllocUnit(struct PCIUnit
*hu
);
65 void pciFreeUnit(struct PCIUnit
*hu
);
66 APTR
pciGetPhysical(struct PCIController
*hc
, APTR virtaddr
);
68 /* uhcichip.c, in order of appearance */
69 void uhciFreeQContext(struct PCIController
*hc
, struct UhciQH
*uqh
);
70 void uhciUpdateIntTree(struct PCIController
*hc
);
71 void uhciCheckPortStatusChange(struct PCIController
*hc
);
72 void uhciHandleFinishedTDs(struct PCIController
*hc
);
73 void uhciScheduleCtrlTDs(struct PCIController
*hc
);
74 void uhciScheduleIntTDs(struct PCIController
*hc
);
75 void uhciScheduleBulkTDs(struct PCIController
*hc
);
76 void uhciUpdateFrameCounter(struct PCIController
*hc
);
77 void uhciCompleteInt(struct PCIController
*hc
);
78 void uhciIntCode(HIDDT_IRQ_Handler
*irq
, HIDDT_IRQ_HwInfo
*hw
);
79 BOOL
uhciInit(struct PCIController
*hc
, struct PCIUnit
*hu
);
80 void uhciFree(struct PCIController
*hc
, struct PCIUnit
*hu
);
82 static inline struct UhciQH
* uhciAllocQH(struct PCIController
*hc
);
83 static inline void uhciFreeQH(struct PCIController
*hc
, struct UhciQH
*uqh
);
84 static inline struct UhciTD
* uhciAllocTD(struct PCIController
*hc
);
85 static inline void uhciFreeTD(struct PCIController
*hc
, struct UhciTD
*utd
);
87 /* ehcichip.c, in order of appearance */
88 void ehciFreeAsyncContext(struct PCIController
*hc
, struct EhciQH
*eqh
);
89 void ehciFreePeriodicContext(struct PCIController
*hc
, struct EhciQH
*eqh
);
90 void ehciFreeQHandTDs(struct PCIController
*hc
, struct EhciQH
*eqh
);
91 void ehciUpdateIntTree(struct PCIController
*hc
);
92 void ehciHandleFinishedTDs(struct PCIController
*hc
);
93 void ehciScheduleCtrlTDs(struct PCIController
*hc
);
94 void ehciScheduleIntTDs(struct PCIController
*hc
);
95 void ehciScheduleBulkTDs(struct PCIController
*hc
);
96 void ehciUpdateFrameCounter(struct PCIController
*hc
);
97 void ehciCompleteInt(struct PCIController
*hc
);
98 void ehciIntCode(HIDDT_IRQ_Handler
*irq
, HIDDT_IRQ_HwInfo
*hw
);
99 BOOL
ehciInit(struct PCIController
*hc
, struct PCIUnit
*hu
);
100 void ehciFree(struct PCIController
*hc
, struct PCIUnit
*hu
);
102 static inline struct EhciQH
* ehciAllocQH(struct PCIController
*hc
);
103 static inline void ehciFreeQH(struct PCIController
*hc
, struct EhciQH
*eqh
);
104 static inline struct EhciTD
* ehciAllocTD(struct PCIController
*hc
);
105 static inline void ehciFreeTD(struct PCIController
*hc
, struct EhciTD
*etd
);
108 /* xhcichip.c, in order of appearance */
109 void xhciCompleteInt(struct PCIController
*hc
);
110 void xhciIntCode(HIDDT_IRQ_Handler
*irq
, HIDDT_IRQ_HwInfo
*hw
);
111 IPTR
xhciExtCap(struct PCIController
*hc
, ULONG id
, IPTR extcap
);
112 BOOL
xhciHaltHC(struct PCIController
*hc
);
113 BOOL
xhciResetHC(struct PCIController
*hc
);
114 BOOL
xhciInit(struct PCIController
*hc
, struct PCIUnit
*hu
);
115 void xhciFree(struct PCIController
*hc
, struct PCIUnit
*hu
);
118 UBYTE
PCIXReadConfigByte(struct PCIController
*hc
, UBYTE offset
);
119 UWORD
PCIXReadConfigWord(struct PCIController
*hc
, UBYTE offset
);
120 ULONG
PCIXReadConfigLong(struct PCIController
*hc
, UBYTE offset
);
121 void PCIXWriteConfigByte(struct PCIController
*hc
, ULONG offset
, UBYTE value
);
122 void PCIXWriteConfigWord(struct PCIController
*hc
, ULONG offset
, UWORD value
);
123 void PCIXWriteConfigLong(struct PCIController
*hc
, ULONG offset
, ULONG value
);
125 struct my_NSDeviceQueryResult
127 ULONG DevQueryFormat
; /* this is type 0 */
128 ULONG SizeAvailable
; /* bytes available */
129 UWORD DeviceType
; /* what the device does */
130 UWORD DeviceSubType
; /* depends on the main type */
131 const UWORD
*SupportedCommands
; /* 0 terminated list of cmd's */
134 /* /// "uhciAllocQH()" */
135 static inline struct UhciQH
* uhciAllocQH(struct PCIController
*hc
)
137 struct UhciQH
*uqh
= hc
->hc_UhciQHPool
;
142 KPRINTF(20, ("Out of QHs!\n"));
146 hc
->hc_UhciQHPool
= (struct UhciQH
*) uqh
->uqh_Succ
;
151 /* /// "uhciFreeQH()" */
152 static inline void uhciFreeQH(struct PCIController
*hc
, struct UhciQH
*uqh
)
154 uqh
->uqh_Succ
= (struct UhciXX
*) hc
->hc_UhciQHPool
;
155 hc
->hc_UhciQHPool
= uqh
;
159 /* /// "uhciAllocTD()" */
160 static inline struct UhciTD
* uhciAllocTD(struct PCIController
*hc
)
162 struct UhciTD
*utd
= hc
->hc_UhciTDPool
;
167 KPRINTF(20, ("Out of TDs!\n"));
171 hc
->hc_UhciTDPool
= (struct UhciTD
*) utd
->utd_Succ
;
176 /* /// "uhciFreeTD()" */
177 static inline void uhciFreeTD(struct PCIController
*hc
, struct UhciTD
*utd
)
179 utd
->utd_Succ
= (struct UhciXX
*) hc
->hc_UhciTDPool
;
180 hc
->hc_UhciTDPool
= utd
;
184 /* /// "ehciAllocQH()" */
185 static inline struct EhciQH
* ehciAllocQH(struct PCIController
*hc
)
187 struct EhciQH
*eqh
= hc
->hc_EhciQHPool
;
192 KPRINTF(20, ("Out of QHs!\n"));
196 hc
->hc_EhciQHPool
= (struct EhciQH
*) eqh
->eqh_Succ
;
201 /* /// "ehciFreeQH()" */
202 static inline void ehciFreeQH(struct PCIController
*hc
, struct EhciQH
*eqh
)
204 eqh
->eqh_Succ
= hc
->hc_EhciQHPool
;
205 hc
->hc_EhciQHPool
= eqh
;
209 /* /// "ehciAllocTD()" */
210 static inline struct EhciTD
* ehciAllocTD(struct PCIController
*hc
)
212 struct EhciTD
*etd
= hc
->hc_EhciTDPool
;
217 KPRINTF(20, ("Out of TDs!\n"));
221 hc
->hc_EhciTDPool
= (struct EhciTD
*) etd
->etd_Succ
;
226 /* /// "ehciFreeTD()" */
227 static inline void ehciFreeTD(struct PCIController
*hc
, struct EhciTD
*etd
)
229 etd
->etd_Succ
= hc
->hc_EhciTDPool
;
230 hc
->hc_EhciTDPool
= etd
;
234 #endif /* UHWCMD_H */