]> git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/storage/IOMediaBSDClient.h
xnu-123.5.tar.gz
[apple/xnu.git] / iokit / IOKit / storage / IOMediaBSDClient.h
1 /*
2 * Copyright (c) 1998-2000 Apple Computer, 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 #ifndef _IOMEDIABSDCLIENT_H
24 #define _IOMEDIABSDCLIENT_H
25
26 #include <IOKit/IOService.h>
27
28 /*
29 * Definitions
30 */
31
32 class AnchorTable;
33 class MinorTable;
34 struct MinorSlot;
35
36 /*
37 * Class
38 */
39
40 class IOMediaBSDClient : public IOService
41 {
42 OSDeclareDefaultStructors(IOMediaBSDClient)
43
44 protected:
45
46 struct ExpansionData { /* */ };
47 ExpansionData * _expansionData;
48
49 AnchorTable * _anchors; /* (table of anchors) */
50 bool _bdevswInstalled; /* (are bdevsw functions installed?) */
51 bool _cdevswInstalled; /* (are cdevsw functions installed?) */
52 MinorTable * _minors; /* (table of minors) */
53 IONotifier * _notifier; /* (media arrival notification) */
54
55 /*
56 * Notification handler for media arrivals.
57 */
58
59 static bool mediaHasArrived(void *, void *, IOService * service);
60
61 /*
62 * Find the whole media that roots this media tree.
63 */
64
65 virtual IOMedia * getWholeMedia( IOMedia * media,
66 UInt32 * slicePathSize = 0,
67 char * slicePath = 0 );
68
69 /*
70 * Create bdevsw and cdevsw nodes for the given media object.
71 */
72
73 virtual bool createNodes(IOMedia * media);
74
75 /*
76 * Free all of this object's outstanding resources.
77 */
78
79 virtual void free();
80
81 public:
82 /*
83 * Initialize this object's minimal state.
84 */
85
86 virtual bool init(OSDictionary * properties = 0);
87
88 /*
89 * This method is called once we have been attached to the provider object.
90 */
91
92 virtual bool start(IOService * provider);
93
94 /*
95 * This method is called before we are detached from the provider object.
96 */
97
98 virtual void stop(IOService * provider);
99
100 /*
101 * Obtain the table of anchors.
102 */
103
104 virtual AnchorTable * getAnchors();
105
106 /*
107 * Obtain the table of minors.
108 */
109
110 virtual MinorTable * getMinors();
111
112 /*
113 * Obtain information for the specified minor ID.
114 */
115
116 virtual MinorSlot * getMinor(UInt32 minorID);
117
118 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 0);
119 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 1);
120 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 2);
121 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 3);
122 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 4);
123 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 5);
124 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 6);
125 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 7);
126 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 8);
127 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 9);
128 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 10);
129 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 11);
130 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 12);
131 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 13);
132 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 14);
133 OSMetaClassDeclareReservedUnused(IOMediaBSDClient, 15);
134 };
135
136 #endif /* !_IOMEDIABSDCLIENT_H */