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 *  IOFireWireLibUnitDirectory.h
24 *  IOFireWireLib
25 *
26 *  Created by NWG on Thu Apr 27 2000.
27 *  Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
28 *
29 */
30
31#import "IOFireWireLibIUnknown.h"
32#import "IOFireWireLibPriv.h"
33
34namespace IOFireWireLib {
35
36	class Device ;
37	class LocalUnitDirectory: public IOFireWireIUnknown
38	{
39		typedef ::IOFireWireLocalUnitDirectoryInterface 	Interface ;
40		typedef ::IOFireWireLibLocalUnitDirectoryRef		DirRef ;
41
42		protected:
43
44			static Interface		sInterface ;
45			UserObjectHandle mKernUnitDirRef ;
46			Device&					mUserClient ;
47			bool					mPublished ;
48
49			HRESULT					QueryInterface(
50											REFIID				iid,
51											void **				ppv ) ;
52		public:
53			// --- constructor/destructor ----------
54									LocalUnitDirectory( Device& userclient ) ;
55			virtual					~LocalUnitDirectory() ;
56
57			// --- adding to ROM -------------------
58			IOReturn				AddEntry(
59											int 				key,
60											void*				inBuffer,
61											size_t				inLen,
62											CFStringRef			inDesc = NULL) ;
63			IOReturn				AddEntry(
64											int					key,
65											UInt32				value,
66											CFStringRef			inDesc = NULL) ;
67			IOReturn				AddEntry(
68											int					key,
69											const FWAddress &	value,
70											CFStringRef			inDesc = NULL) ;
71
72			IOReturn				Publish() ;
73			IOReturn				Unpublish() ;
74
75			// --- IUNKNOWN support ----------------
76			static Interface**		Alloc( Device& userclient ) ;
77
78			// --- adding to ROM -------------------
79			static IOReturn			SAddEntry_Ptr(
80											DirRef self,
81											int 				key,
82											void*				inBuffer,
83											size_t				inLen,
84											CFStringRef			inDesc = NULL) ;
85			static IOReturn			SAddEntry_UInt32(
86											DirRef self,
87											int					key,
88											UInt32				value,
89											CFStringRef			inDesc = NULL) ;
90			static IOReturn			SAddEntry_FWAddress(
91											DirRef self,
92											int					key,
93											const FWAddress*	value,
94											CFStringRef			inDesc = NULL) ;
95
96			// Use this function to cause your unit directory to appear in the Mac's config ROM.
97			static IOReturn			SPublish( DirRef self ) ;
98			static IOReturn			SUnpublish( DirRef self ) ;
99	} ;
100}
101