1 | /*␊ |
2 | * Copyright (c) 1998-2009 Apple Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * This file contains Original Code and/or Modifications of Original Code␊ |
7 | * as defined in and that are subject to the Apple Public Source License␊ |
8 | * Version 2.0 (the 'License'). You may not use this file except in␊ |
9 | * compliance with the License. Please obtain a copy of the License at␊ |
10 | * http://www.opensource.apple.com/apsl/ and read it before using this␊ |
11 | * file.␊ |
12 | * ␊ |
13 | * The Original Code and all software distributed under the License are␊ |
14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
18 | * Please see the License for the specific language governing rights and␊ |
19 | * limitations under the License.␊ |
20 | * ␊ |
21 | * @APPLE_LICENSE_HEADER_END@␊ |
22 | */␊ |
23 | ␊ |
24 | #ifndef _IOMEDIABSDCLIENT_H␊ |
25 | #define _IOMEDIABSDCLIENT_H␊ |
26 | ␊ |
27 | #include <sys/disk.h>␊ |
28 | ␊ |
29 | #ifdef KERNEL␊ |
30 | #ifdef __cplusplus␊ |
31 | ␊ |
32 | /*␊ |
33 | * Kernel␊ |
34 | */␊ |
35 | ␊ |
36 | #include <sys/conf.h>␊ |
37 | #include <IOKit/storage/IOMedia.h>␊ |
38 | ␊ |
39 | class AnchorTable;␊ |
40 | class MinorTable;␊ |
41 | struct MinorSlot;␊ |
42 | ␊ |
43 | /*␊ |
44 | * Class␊ |
45 | */␊ |
46 | ␊ |
47 | class IOMediaBSDClient : public IOService␊ |
48 | {␊ |
49 | OSDeclareDefaultStructors(IOMediaBSDClient)␊ |
50 | ␊ |
51 | protected:␊ |
52 | ␊ |
53 | struct ExpansionData { /* */ };␊ |
54 | ExpansionData * _expansionData;␊ |
55 | ␊ |
56 | private:␊ |
57 | ␊ |
58 | AnchorTable * _anchors; /* (table of anchors) */␊ |
59 | UInt32 _reserved0064; /* (reserved, do not use) */␊ |
60 | UInt32 _reserved0096; /* (reserved, do not use) */␊ |
61 | MinorTable * _minors; /* (table of minors) */␊ |
62 | UInt32 _reserved0160; /* (reserved, do not use) */␊ |
63 | ␊ |
64 | protected:␊ |
65 | ␊ |
66 | /*␊ |
67 | * Find the whole media that roots the given media tree.␊ |
68 | */␊ |
69 | ␊ |
70 | virtual IOMedia * getWholeMedia( IOMedia * media,␊ |
71 | UInt32 * slicePathSize = 0,␊ |
72 | char * slicePath = 0 );␊ |
73 | ␊ |
74 | /*␊ |
75 | * Create bdevsw and cdevsw nodes for the given media object.␊ |
76 | */␊ |
77 | ␊ |
78 | virtual bool createNodes(IOMedia * media);␊ |
79 | ␊ |
80 | /*␊ |
81 | * Free all of this object's outstanding resources.␊ |
82 | */␊ |
83 | ␊ |
84 | virtual void free();␊ |
85 | ␊ |
86 | public:␊ |
87 | ␊ |
88 | /*␊ |
89 | * Obtain this object's provider. We override the superclass's method to␊ |
90 | * return a more specific subclass of IOService -- IOMedia. This method␊ |
91 | * method serves simply as a convenience to subclass developers.␊ |
92 | */␊ |
93 | ␊ |
94 | virtual IOMedia * getProvider() const;␊ |
95 | ␊ |
96 | /*␊ |
97 | * Initialize this object's minimal state.␊ |
98 | */␊ |
99 | ␊ |
100 | virtual bool init(OSDictionary * properties = 0);␊ |
101 | ␊ |
102 | /*␊ |
103 | * This method is called once we have been attached to the provider object.␊ |
104 | */␊ |
105 | ␊ |
106 | virtual bool start(IOService * provider);␊ |
107 | ␊ |
108 | /*␊ |
109 | * This method is called when we are to terminate from the provider object.␊ |
110 | */␊ |
111 | ␊ |
112 | virtual bool terminate(IOOptionBits options);␊ |
113 | ␊ |
114 | #ifndef __LP64__␊ |
115 | virtual AnchorTable * getAnchors() __attribute__ ((deprecated));␊ |
116 | virtual MinorTable * getMinors() __attribute__ ((deprecated));␊ |
117 | virtual MinorSlot * getMinor(UInt32 minorID) __attribute__ ((deprecated));␊ |
118 | #endif /* !__LP64__ */␊ |
119 | ␊ |
120 | /*␊ |
121 | * Process a foreign ioctl.␊ |
122 | */␊ |
123 | ␊ |
124 | virtual int ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, proc_t proc);␊ |
125 | ␊ |
126 | #ifdef __LP64__␊ |
127 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 0);␊ |
128 | #else /* !__LP64__ */␊ |
129 | OSMetaClassDeclareReservedUsed(IOMediaBSDClient, 0);␊ |
130 | #endif /* !__LP64__ */␊ |
131 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 1);␊ |
132 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 2);␊ |
133 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 3);␊ |
134 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 4);␊ |
135 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 5);␊ |
136 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 6);␊ |
137 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 7);␊ |
138 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 8);␊ |
139 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 9);␊ |
140 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 10);␊ |
141 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 11);␊ |
142 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 12);␊ |
143 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 13);␊ |
144 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 14);␊ |
145 | OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 15);␊ |
146 | };␊ |
147 | ␊ |
148 | #endif /* __cplusplus */␊ |
149 | #endif /* KERNEL */␊ |
150 | #endif /* !_IOMEDIABSDCLIENT_H */␊ |
151 | |