Chameleon

Chameleon Svn Source Tree

Root/branches/rewrite/i386/include/IOKit/ata/IOATABusInfo.h

Source at commit 1129 created 12 years 11 months ago.
By meklort, Change options.o so that it reloads the system config as well. Also change it so that it uses that config for variables (NOTE: if the calue exists in chameleonConfig, it's used instead.
1/*
2 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23
24#ifndef _IOATABUSINFO_H
25#define _IOATABUSINFO_H
26
27#include <libkern/c++/OSObject.h>
28#include <IOKit/IOTypes.h>
29#include "IOATATypes.h"
30
31/*!
32@class IOATABusInfo
33@discussion used to indicate the capabilities of the bus the device is connected to, PIO and DMA modes supported, etc.
34*/
35
36class IOATABusInfo : public OSObject
37{
38OSDeclareDefaultStructors( IOATABusInfo );
39
40public:
41
42/*!@function atabusinfo
43@abstract factory method
44*/
45static IOATABusInfo* atabusinfo(void);
46
47/*!@function zeroData
48@abstract set this object to a blank state.
49*/
50virtual void zeroData(void);
51
52// Used by clients of ATAControllers to find out about the bus
53// capability.
54
55/*!@function getSocketType
56@abstract returns the socket type, internal fixed, media-bay, PC-Card
57Used by clients of ATAControllers to find out about the bus
58*/
59ataSocketType getSocketType( void );
60
61/*!@function getPIOModes
62@abstract returns the bit-significant map of PIO mode(s) supported on the bus.
63Used by clients of ATAControllers to find out about the bus.
64*/
65UInt8 getPIOModes( void );
66
67/*!@function getDMAModes
68@abstract bit-significant map of DMA mode(s) supported on the bus.
69Used by clients of ATAControllers to find out about the bus.
70*/
71UInt8 getDMAModes( void );
72
73/*!@function getUltraModes
74@abstract bit-significant map of Ultra mode(s) supported on the bus.
75Used by clients of ATAControllers to find out about the bus.
76*/
77UInt8 getUltraModes( void );
78
79/*!@function getUnits
80@abstract How many devices are present on bus.
81Used by clients of ATAControllers to find out about the bus.
82*/
83UInt8 getUnits( void );
84
85/*!@function supportsDMA
86@abstract True = DMA supported on bus - inferred by looking at the DMA mode bits.
87Used by clients of ATAControllers to find out about the bus.
88*/
89bool supportsDMA( void );
90
91/*!@function supportsExtendedLBA
92@abstract Supports 48-bit LBA if true.
93Used by clients of ATAControllers to find out about the bus.
94*/
95bool supportsExtendedLBA( void );
96
97/*!@function maxBlocksExtended
98@abstract The maximum number of 512-byte blocks this controller supports
99in a single Extended LBA transfer. Some controllers may be limited to less than
100the maximum sector count allowed under extended LBA protocol.
101*/
102UInt16 maxBlocksExtended(void);
103
104/*!@function supportsOverlapped
105@abstract Supports overlapped packet feature set if true.
106Used by clients of ATAControllers to find out about the bus.
107*/
108bool supportsOverlapped( void );
109
110/*!@function supportsDMAQueued
111@abstract Supports DMA Queued Feature set if true.
112Used by clients of ATAControllers to find out about the bus.
113*/
114bool supportsDMAQueued( void );
115
116
117// Used by ATAControllers to generate an information object.
118// Would not be used by disk device drivers normally.
119// Bus controllers should set these items everytime.
120
121/*!@function setSocketType
122@abstract internal fixed, media-bay, PC-Card. Set by ATAControllers.
123*/
124void setSocketType( ataSocketType inSocketType );
125
126/*!@function setPIOModes
127@abstract Bit significant map of supported transfer modes. Set by ATAControllers.
128*/
129void setPIOModes( UInt8 inModeBitMap);
130
131/*!@function setDMAModes
132@abstract Bit significant map of supported transfer modes. Set by ATAControllers.
133*/
134void setDMAModes( UInt8 inModeBitMap );
135
136/*!@function setUltraModes
137@abstract Bit significant map of supported transfer modes. Set by ATAControllers.
138*/
139void setUltraModes( UInt8 inModeBitMap );
140
141/*!@function setUnits
142@abstract set to indicate how many devices are on this bus. Set by ATAControllers.
143*/
144void setUnits( UInt8 inNumUnits );
145
146// Optional bus protocols some busses may support
147/*!@function setExtendedLBA
148@abstract Set true for supports 48-bit LBA. Set by ATAControllers.
149*/
150void setExtendedLBA( boolinState );
151
152/*!function setMaxBlocksExtended
153 @abstract value set by controllers to indicate the maximum number of blocks
154 allowed in a single transfer of data. Some dma engines may not be capable of supporting the full
155 16-bit worth of sector count allowed under 48 bit extended LBA. Default is 256 blocks, same as
156 standard ATA.
157 */
158void setMaxBlocksExtended( UInt16 inMaxBlocks);
159
160/*!@function setOverlapped
161@abstract Set true for supports overlapped packet feature set. Set by ATAControllers.
162*/
163void setOverlapped( bool inState);
164
165/*!@function setDMAQueued
166@abstract Set true if supports DMA Queued Feature. Set by ATAControllers.
167*/
168void setDMAQueued( bool inState); //
169
170protected:
171
172UInt8 _PIOModes;/* PIO modes supported (bit-significant) */
173UInt8 _MultiDMAModes;/* <--: Multiword DMA modes supported (b-sig) */
174UInt8 _UltraDMAModes;/* <--: Ultra DMA modes supported (b-sig) */
175bool_ExtendedLBA; /* <--: Suppports 48-bit LBA protocol */
176bool_Overlapped;/* <--: Supports overlapped packet feature set */
177bool_DMAQueued;/* <--: Supports DMA Queued Feature set */
178ataSocketType_SocketType;/* <--: Indicates bus is fixed internal, removable media-bay, removable PC-Card or unknown type */
179UInt8_numUnits;/* <--: How many devices on this bus */
180UInt16_maxBlocksExtended;
181
182protected:
183/*! @struct ExpansionData
184 @discussion This structure will be used to expand the capablilties of the IOWorkLoop in the future.
185 */
186 struct ExpansionData { };
187
188/*! @var reserved
189 Reserved for future use. (Internal use only) */
190 ExpansionData *reserved;
191
192virtual bool init();
193
194private:
195 OSMetaClassDeclareReservedUnused(IOATABusInfo, 0);
196 OSMetaClassDeclareReservedUnused(IOATABusInfo, 1);
197 OSMetaClassDeclareReservedUnused(IOATABusInfo, 2);
198 OSMetaClassDeclareReservedUnused(IOATABusInfo, 3);
199 OSMetaClassDeclareReservedUnused(IOATABusInfo, 4);
200 OSMetaClassDeclareReservedUnused(IOATABusInfo, 5);
201 OSMetaClassDeclareReservedUnused(IOATABusInfo, 6);
202 OSMetaClassDeclareReservedUnused(IOATABusInfo, 7);
203 OSMetaClassDeclareReservedUnused(IOATABusInfo, 8);
204 OSMetaClassDeclareReservedUnused(IOATABusInfo, 9);
205 OSMetaClassDeclareReservedUnused(IOATABusInfo, 10);
206 OSMetaClassDeclareReservedUnused(IOATABusInfo, 11);
207 OSMetaClassDeclareReservedUnused(IOATABusInfo, 12);
208 OSMetaClassDeclareReservedUnused(IOATABusInfo, 13);
209 OSMetaClassDeclareReservedUnused(IOATABusInfo, 14);
210 OSMetaClassDeclareReservedUnused(IOATABusInfo, 15);
211 OSMetaClassDeclareReservedUnused(IOATABusInfo, 16);
212 OSMetaClassDeclareReservedUnused(IOATABusInfo, 17);
213 OSMetaClassDeclareReservedUnused(IOATABusInfo, 18);
214 OSMetaClassDeclareReservedUnused(IOATABusInfo, 19);
215 OSMetaClassDeclareReservedUnused(IOATABusInfo, 20);
216};
217
218
219#endif /* !_IOATABUSINFO_H */
220

Archive Download this file

Revision: 1129