1 | /*␊ |
2 | * Copyright (c) 1998-2008 Apple Inc. All rights reserved.␊ |
3 | *␊ |
4 | * ␊ |
5 | * The contents of this file constitute Original Code as defined in and␊ |
6 | * are subject to the Apple Public Source License Version 1.1 (the␊ |
7 | * "License"). You may not use this file except in compliance with the␊ |
8 | * License. Please obtain a copy of the License at␊ |
9 | * http://www.apple.com/publicsource and read it before using this file.␊ |
10 | * ␊ |
11 | * This Original Code and all software distributed under the License are␊ |
12 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
13 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
14 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
15 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the␊ |
16 | * License for the specific language governing rights and limitations␊ |
17 | * under the License.␊ |
18 | * ␊ |
19 | */␊ |
20 | ␊ |
21 | /*!␊ |
22 | @header ATADeviceNub.h␊ |
23 | @abstract A concrete implementation of IOATADevice.␊ |
24 | */␊ |
25 | ␊ |
26 | #ifndef _ATADEVICENUB_H␊ |
27 | #define _ATADEVICENUB_H␊ |
28 | ␊ |
29 | #include <IOKit/IOTypes.h>␊ |
30 | #include "IOATATypes.h"␊ |
31 | #include "IOATADevice.h"␊ |
32 | #include "IOATAController.h"␊ |
33 | ␊ |
34 | #include "IOATABusCommand.h"␊ |
35 | ␊ |
36 | ␊ |
37 | /*!␊ |
38 | @class ATADeviceNub␊ |
39 | @abstract ATADeviceNub is a concrete implementation of IOATADevice.␊ |
40 | @discussion clients of IOATA (disk drivers) should use the interface presented␊ |
41 | by IOATADevice. Concrete nubs are private to the IOATA family and ␊ |
42 | specific subclasses of IOATADevice are instantiated by controller ␊ |
43 | drivers to provide the abstract interface to clients.␊ |
44 | ␊ |
45 | */␊ |
46 | class ATADeviceNub : public IOATADevice␊ |
47 | {␊ |
48 | OSDeclareDefaultStructors(ATADeviceNub);␊ |
49 | ␊ |
50 | public:␊ |
51 | ␊ |
52 | ␉/*!@function ataDeviceNub␊ |
53 | ␉@abstract static creator function - used by IOATAControllers to create nubs.␊ |
54 | ␉*/␊ |
55 | ␉static ATADeviceNub* ataDeviceNub( IOATAController* provider, ataUnitID unit, ataDeviceType devType);␊ |
56 | ␊ |
57 | ␉/*!@function attach␊ |
58 | ␉@abstract override of IOService method.␊ |
59 | ␉*/␊ |
60 | virtual bool attach(IOService* provider );␊ |
61 | ␊ |
62 | ␊ |
63 | ␉// overrides from IOATADevice to provide actual client interface␊ |
64 | ␉␊ |
65 | ␊ |
66 | ␉/*!@function executeCommand␊ |
67 | ␉@abstract Submit IO requests ␊ |
68 | ␉*/␊ |
69 | virtual IOReturn executeCommand(IOATACommand* command);␊ |
70 | ␊ |
71 | ␉// create and destroy IOATACommands␊ |
72 | ␉/*!@function allocCommand␊ |
73 | ␉@abstract create command objects for clients.␊ |
74 | ␉*/␊ |
75 | ␉virtual IOATACommand*␉allocCommand( void );␊ |
76 | ␉␊ |
77 | ␉/*!@function freeCommand␊ |
78 | ␉@abstract Clients use this method to dispose of command objects.␊ |
79 | ␉*/␊ |
80 | ␉virtual void freeCommand( IOATACommand* inCommand); ␊ |
81 | ␉␊ |
82 | ␉␊ |
83 | protected:␊ |
84 | ␉␊ |
85 | /*!@function init␊ |
86 | ␉@abstract used after creating the nub.␊ |
87 | ␉*/␊ |
88 | virtual bool init(IOATAController* provider, ataUnitID unit, ataDeviceType devType);␊ |
89 | ␉␊ |
90 | ␉/*!@function publishProperties␊ |
91 | ␉@abstract publish the nub's properties in the device tree.␊ |
92 | ␉*/␊ |
93 | ␉virtual void publishProperties( void );␊ |
94 | ␉␊ |
95 | ␉/*!@function publishBusProperties␊ |
96 | ␉@abstract puts info about this device's bus capability in the device tree.␊ |
97 | ␉*/␊ |
98 | ␉virtual void publishBusProperties(void);␊ |
99 | ␉␊ |
100 | ␉/*!@function publishVendorProperties␊ |
101 | ␉@abstract will be deprecated.␊ |
102 | ␉*/␊ |
103 | ␉virtual void publishVendorProperties( void );␊ |
104 | ␊ |
105 | ␉/*!@function getDeviceID␊ |
106 | ␉@abstract get the unit id of this drive (0 or 1)␊ |
107 | ␉*/␊ |
108 | ␉virtual IOReturn getDeviceID(void);␊ |
109 | ␊ |
110 | ␉/*!@function MyATACallback␊ |
111 | ␉@abstract to be deprecated.␊ |
112 | ␉*/␊ |
113 | ␉static void MyATACallback(IOATACommand* command );␊ |
114 | ␉␊ |
115 | ␉/*!@function processCallback␊ |
116 | ␉@abstract to be deprecated.␊ |
117 | ␉*/␊ |
118 | ␉void processCallback(IOATACommand* command );␊ |
119 | ␉␊ |
120 | ␉/*!@function swapBytes16␊ |
121 | ␉@abstract to be deprecated.␊ |
122 | ␉*/␊ |
123 | ␉void swapBytes16( UInt8* dataBuffer, IOByteCount length);␊ |
124 | ␊ |
125 | UInt8* buffer;␊ |
126 | ␉␊ |
127 | protected:␊ |
128 | /*! @struct ExpansionData␊ |
129 | @discussion This structure will be used to expand the capablilties of the ATADeviceNub in the future.␊ |
130 | */␊ |
131 | struct ExpansionData { };␊ |
132 | ␊ |
133 | /*! @var reserved␊ |
134 | Reserved for future use. (Internal use only) */␊ |
135 | ExpansionData *reserved;␊ |
136 | ␊ |
137 | private:␊ |
138 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 0);␊ |
139 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 1);␊ |
140 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 2);␊ |
141 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 3);␊ |
142 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 4);␊ |
143 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 5);␊ |
144 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 6);␊ |
145 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 7);␊ |
146 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 8);␊ |
147 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 9);␊ |
148 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 10);␊ |
149 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 11);␊ |
150 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 12);␊ |
151 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 13);␊ |
152 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 14);␊ |
153 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 15);␊ |
154 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 16);␊ |
155 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 17);␊ |
156 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 18);␊ |
157 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 19);␊ |
158 | OSMetaClassDeclareReservedUnused(ATADeviceNub, 20);␊ |
159 | ␊ |
160 | };␊ |
161 | ␊ |
162 | #endif /* !_IOATABUSNUB_H */␊ |
163 | |