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 * Copyright (c) 1999-2002 Apple Computer, Inc.  All rights reserved.
24 *
25 * HISTORY
26 *
27 */
28
29
30#ifndef _IOKIT_IOFWDCLPROGRAM_H
31#define _IOKIT_IOFWDCLPROGRAM_H
32
33#include <libkern/c++/OSObject.h>
34#include <IOKit/firewire/IOFireWireFamilyCommon.h>
35#include <IOKit/firewire/IOFireWireBus.h>
36#include <IOKit/IOMemoryCursor.h>
37
38/*! @class IODCLProgram
39*/
40class IODCLProgram : public OSObject
41{
42    OSDeclareAbstractStructors(IODCLProgram)
43
44	private :
45
46		void * 						reserved0 ;//fDCLTaskToKernel;
47		void * 						reserved1 ;//fDataTaskToKernel;
48		void *		 				reserved2 ;//fDataBase;
49		void *		 				reserved3 ;//		IOMemoryDescriptor *		fDCLDesc;
50		IOMemoryMap *				fBufferMem ;
51		void *		 				reserved5 ;//		IOMemoryCursor *			fDataCursor;
52
53	protected:
54
55	/*! @struct ExpansionData
56		@discussion This structure will be used to expand the capablilties of the class in the future.
57		*/
58		struct ExpansionData
59		{
60			IOFWIsochResourceFlags		resourceFlags ;
61            IODMACommand *              fDMACommand;
62		};
63
64	/*! @var reserved
65		Reserved for future use.  (Internal use only)  */
66		ExpansionData *					fExpansionData ;
67
68	public :
69
70		virtual void			setIsochResourceFlags ( IOFWIsochResourceFlags flags ) ;	// formerly getPhysicalSegs()
71		IOFWIsochResourceFlags	getIsochResourceFlags () const ;
72
73	protected:
74
75		virtual void 			free () ;
76
77	public:
78
79		virtual bool 			init ( IOFireWireBus::DCLTaskInfo * info = NULL ) ;
80		virtual IOReturn 		allocateHW (
81										IOFWSpeed 			speed,
82										UInt32 				chan) = 0;
83		virtual IOReturn 		releaseHW () = 0;
84		virtual IOReturn 		compile (
85										IOFWSpeed 			speed,
86										UInt32 				chan) = 0;
87		virtual IOReturn 		notify (
88												IOFWDCLNotificationType		notificationType,
89												DCLCommand ** 				dclCommandList,
90												UInt32 						numDCLCommands ) = 0;
91		virtual IOReturn 		start () = 0;
92		virtual void 			stop () = 0;
93		virtual IOReturn 		pause ();
94		virtual IOReturn 		resume ();
95
96		virtual void			setForceStopProc(
97												IOFWIsochChannel::ForceStopNotificationProc proc,
98												void * 						refCon,
99												IOFWIsochChannel *			channel ) ;
100	protected :
101
102		void					generateBufferMap( DCLCommand * program ) ;
103		IOReturn				virtualToPhysical(
104												IOVirtualRange						ranges[],
105												unsigned							rangeCount,
106												IOMemoryCursor::IOPhysicalSegment	outSegments[],
107												unsigned &							outPhysicalSegmentCount,
108												unsigned							maxSegments ) ;
109
110	public :
111
112		IOMemoryMap *			getBufferMap() const ;
113
114	public :
115
116		// close/open isoch workloop gate...
117		// clients should not need to call these.
118		virtual void			closeGate() = 0 ;
119		virtual void			openGate() = 0 ;
120
121		virtual IOReturn		synchronizeWithIO() = 0 ;
122
123	private:
124
125		OSMetaClassDeclareReservedUsed(IODCLProgram, 0);
126		OSMetaClassDeclareReservedUsed(IODCLProgram, 1);
127		OSMetaClassDeclareReservedUnused(IODCLProgram, 2);
128		OSMetaClassDeclareReservedUnused(IODCLProgram, 3);
129		OSMetaClassDeclareReservedUnused(IODCLProgram, 4);
130
131};
132
133#endif /* ! _IOKIT_IOFWDCLPROGRAM_H */
134
135