Chameleon

Chameleon Svn Source Tree

Root/branches/mozodojo/i386/include/IOKit/firewire/IOLocalConfigDirectory.h

1/*
2* Copyright (c) 1998-2002 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 __IOLOCALCONFIGDIRECTORY_H__
24#define __IOLOCALCONFIGDIRECTORY_H__
25
26#include <libkern/c++/OSObject.h>
27#include <IOKit/IOReturn.h>
28#include <IOKit/firewire/IOFireWireFamilyCommon.h>
29#include <IOKit/firewire/IOConfigDirectory.h>
30
31class OSArray;
32class OSData;
33class IOFireWireController;
34class IOFWUserObjectExporter ;
35
36/*! @class IOLocalConfigDirectory
37*/
38class IOLocalConfigDirectory : public IOConfigDirectory
39{
40friend class IOFireWireController;
41friend class IOFireWireUserClient ;
42
43OSDeclareDefaultStructors(IOLocalConfigDirectory);
44
45protected:
46OSArray *fEntries;// Entries for this directory.
47OSData *fROM;// Local ROM, if compiled.
48UInt32 fHeader;// Num entries and CRC.
49
50/*! @struct ExpansionData
51@discussion This structure will be used to expand the capablilties of the class in the future.
52*/
53struct ExpansionData { };
54
55/*! @var reserved
56Reserved for future use. (Internal use only) */
57ExpansionData *reserved;
58
59virtual bool init();
60virtual void free();
61
62virtual const UInt32 *getBase();
63virtual IOConfigDirectory *getSubDir(int start, int type);
64
65public:
66static IOLocalConfigDirectory *create();
67
68/*!
69@function update
70makes sure that the ROM has at least the specified capacity,
71and that the ROM is uptodate from its start to at least the
72specified quadlet offset.
73@result kIOReturnSuccess if the specified offset is now
74accessable at romBase[offset].
75*/
76virtual IOReturn update(UInt32 offset, const UInt32 *&romBase);
77
78virtual IOReturn compile(OSData *rom);
79
80// All flavours of addEntry eat a retain of the desc string
81virtual IOReturn addEntry(int key, UInt32 value, OSString *desc = NULL);
82virtual IOReturn addEntry(int key, IOLocalConfigDirectory *value,
83OSString *desc = NULL);
84virtual IOReturn addEntry(int key, OSData *value, OSString *desc = NULL);
85virtual IOReturn addEntry(int key, FWAddress value, OSString *desc = NULL);
86virtual IOReturn removeSubDir(IOLocalConfigDirectory *value);
87const OSArray *getEntries() const;
88
89virtual IOReturn getIndexValue(int index, IOConfigDirectory *&value);
90
91protected:
92
93virtual const UInt32 * lockData( void );
94virtual void unlockData( void );
95virtual IOReturn updateROMCache( UInt32 offset, UInt32 length );
96virtual IOReturn checkROMState( void );
97
98// call eats a retain count
99virtual IOReturn addEntry(OSString *desc);
100
101IOReturnincrementGeneration( void );
102static voidexporterCleanup( const OSObject * self, IOFWUserObjectExporter * exporter ) ;
103
104private:
105OSMetaClassDeclareReservedUsed(IOLocalConfigDirectory, 0);
106OSMetaClassDeclareReservedUnused(IOLocalConfigDirectory, 1);
107OSMetaClassDeclareReservedUnused(IOLocalConfigDirectory, 2);
108};
109
110#endif /* __IOLOCALCONFIGDIRECTORY_H__ */
111

Archive Download this file

Revision: 1232