|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /*
26: File: OHCIRootHub.h
27:
28: Contains: xxx put contents here xxx
29:
30: Version: xxx put version here xxx
31:
32: Copyright: � 1998 by Apple Computer, Inc., all rights reserved.
33:
34: File Ownership:
35:
36: DRI: xxx put dri here xxx
37:
38: Other Contact: xxx put other contact here xxx
39:
40: Technology: xxx put technology here xxx
41:
42: Writers:
43:
44: (TC) Tom Clark
45: (CJK) Craig Keithley
46: (BT) Barry Twycross
47:
48: Change History (most recent first):
49:
50: <USB8> 8/12/98 BT Move root hub into UIM again
51: <USB7> 7/10/98 TC Back out previous rev.
52: <USB6> 6/30/98 BT Move Root hub sim into UIM
53: <USB5> 6/11/98 BT Fix hub descriptor so it knows about overcurrent and power mode
54: <USB4> 5/28/98 CJK change file creater to 'MPS '
55: <USB3> 4/23/98 BT Add reset portsuspend change
56: <USB2> 4/15/98 BT Add over current change reset
57: <1> 3/19/98 BT first checked in
58: */
59:
60: #ifndef __OHCIROOTHUB__
61: #define __OHCIROOTHUB__
62:
63: #ifdef __cplusplus
64: extern "C" {
65: #endif
66:
67: #if PRAGMA_IMPORT_SUPPORTED
68: #pragma import on
69: #endif
70:
71: #if PRAGMA_ALIGN_SUPPORTED
72: #pragma options align=power
73: #endif
74:
75:
76:
77: // Root hub sttaus reg
78: enum
79: {
80: kOHCIHcRhStatus_LPS = kOHCIBit0,
81: kOHCIHcRhStatus_OCI = kOHCIBit1,
82: kOHCIHcRhStatus_DRWE = kOHCIBit15,
83: kOHCIHcRhStatus_LPSC = kOHCIBit16,
84: kOHCIHcRhStatus_OCIC = kOHCIBit17,
85: kOHCIHcRhStatus_CRWE = kOHCIBit31,
86: kOHCIHcRhStatus_Change = kOHCIHcRhStatus_LPSC|kOHCIHcRhStatus_OCIC
87: };
88:
89: // Port status reg
90: enum
91: {
92: kOHCIHcRhPortStatus_CCS = kOHCIBit0,
93: kOHCIHcRhPortStatus_PES = kOHCIBit1,
94: kOHCIHcRhPortStatus_PSS = kOHCIBit2,
95: kOHCIHcRhPortStatus_POCI = kOHCIBit3,
96: kOHCIHcRhPortStatus_PPS = kOHCIBit8,
97: kOHCIHcRhPortStatus_LSDA = kOHCIBit9,
98: kOHCIHcRhPortStatus_CSC = kOHCIBit16,
99: kOHCIHcRhPortStatus_PESC = kOHCIBit17,
100: kOHCIHcRhPortStatus_PSSC = kOHCIBit18,
101: kOHCIHcRhPortStatus_OCIC = kOHCIBit19,
102: kOHCIHcRhPortStatus_PRSC = kOHCIBit20,
103: kOHCIHcRhPortStatus_Change = kOHCIHcRhPortStatus_CSC|kOHCIHcRhPortStatus_PESC|
104: kOHCIHcRhPortStatus_PSSC|kOHCIHcRhPortStatus_OCIC|kOHCIHcRhPortStatus_PRSC
105: };
106:
107:
108: enum
109: {
110: kOHCINumPortsMask = OHCIBitRange (0, 7),
111: kOHCIPowerSwitchingMask = OHCIBitRange (9, 9),
112: kOHCIGangedSwitchingMask = OHCIBitRange (8, 8),
113: kOHCICompoundDeviceMask = OHCIBitRange (10, 10),
114: kOHCIOverCurrentMask = OHCIBitRange (12, 12),
115: kOHCIGlobalOverCurrentMask = OHCIBitRange (11, 11),
116: kOHCIDeviceRemovableMask = OHCIBitRange (0, 15),
117: kOHCIGangedPowerMask = OHCIBitRange (16, 31),
118:
119: kOHCIPowerSwitchingOffset = 9,
120: kOHCIGangedSwitchingOffset = 8,
121: kOHCICompoundDeviceOffset = 10,
122: kOHCIOverCurrentOffset = 12,
123: kOHCIGlobalOverCurrentOffset = 11,
124: kOHCIGangedPowerOffset = 0,
125: kOHCIDeviceRemovableOffset = 16,
126:
127: kOHCIPortFlagsMask = OHCIBitRange (0, 16),
128:
129: kOHCIportChangeFlagsOffset = 16
130: };
131:
132:
133:
134:
135: OSStatus OHCIGetRootDescriptor(
136: uslBusRef bus,
137: uslRootHubDescriptorPtr descr);
138:
139: OSStatus OHCIRootHubResetChangeConnection(
140: uslBusRef bus,
141: short port);
142:
143: OSStatus OHCIRootHubResetResetChange(
144: uslBusRef bus,
145: short port);
146:
147: OSStatus OHCIRootHubResetSuspendChange(
148: uslBusRef bus,
149: short port);
150:
151: OSStatus OHCIRootHubResetEnableChange(
152: uslBusRef bus,
153: short port);
154:
155: OSStatus OHCIRootHubResetOverCurrentChange(
156: uslBusRef bus,
157: short port);
158:
159: OSStatus OHCIGetInterruptStatus(
160: uslBusRef bus,
161: UInt32 *status);
162:
163:
164: OSStatus OHCIClearInterruptStatus(
165: uslBusRef bus,
166: UInt32 status);
167:
168: OSStatus OHCIGetRhStatus(
169: uslBusRef bus,
170: UInt32 *status);
171:
172: OSStatus OHCIRootHubGetPortStatus(
173: uslBusRef bus,
174: short port,
175: uslRootHubPortStatusPtr portStatus);
176:
177: void OHCIPollRootHubSim (
178: uslBusRef bus);
179:
180: OSStatus OHCIResetRootHub (
181: uslBusRef bus);
182:
183: OSStatus OHCIRootHubPortSuspend(
184: uslBusRef bus,
185: short port,
186: Boolean on);
187:
188: OSStatus OHCIRootHubPower(
189: uslBusRef bus,
190: Boolean on);
191:
192: OSStatus OHCIRootHubResetPort (
193: uslBusRef bus,
194: short port);
195:
196: OSStatus OHCIRootHubPortEnable(
197: uslBusRef bus,
198: short port,
199: Boolean on);
200:
201: OSStatus OHCIRootHubPortPower(
202: uslBusRef bus,
203: short port,
204: Boolean on);
205:
206:
207: #if PRAGMA_ALIGN_SUPPORTED
208: #pragma options align=reset
209: #endif
210:
211: #if PRAGMA_IMPORT_SUPPORTED
212: #pragma import off
213: #endif
214:
215: #ifdef __cplusplus
216: }
217: #endif
218:
219: #endif /* __OHCIROOTHUB__ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.