Chameleon

Chameleon Svn Source Tree

Root/tags/2.3/i386/include/IOKit/firewire/IOFWDCLTranslator.h

Source at commit 2862 created 7 years 25 days ago.
By ifabio, Tag 2.3 release, bump svn to 2.4
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 * A DCL program to interpret (in software) a program that's too complicated
26 * for the DMA engine.
27 *
28 * HISTORY
29 *
30 */
31
32
33#ifndef _IOKIT_IOFWDCLTRANSLATOR_H
34#define _IOKIT_IOFWDCLTRANSLATOR_H
35
36#include <libkern/c++/OSObject.h>
37#include <IOKit/firewire/IOFWDCLProgram.h>
38
39
40/*! @class IODCLTranslator
41*/
42
43class IODCLTranslator : public IODCLProgram
44{
45 OSDeclareAbstractStructors(IODCLTranslator)
46
47protected:
48 enum
49 {
50 kNumPingPongs= 2,
51 kNumPacketsPerPingPong= 500,
52 kMaxIsochPacketSize= 1000,
53 kPingPongBufferSize= kNumPingPongs * kNumPacketsPerPingPong * kMaxIsochPacketSize
54 };
55
56 // Opcodes and buffer for pingpong program
57 DCLLabelfStartLabel;
58 DCLTransferPacketfTransfers[kNumPingPongs*kNumPacketsPerPingPong];
59 DCLCallProcfCalls[kNumPingPongs];
60 DCLJumpfJumpToStart;
61 UInt8fBuffer[kPingPongBufferSize];
62
63 IODCLProgram *fHWProgram;// Hardware program executing our opcodes
64 DCLCommand*fToInterpret;// The commands to interpret
65 DCLCommand*fCurrentDCLCommand;// Current command to interpret
66 intfPingCount;// Are we pinging or ponging?
67 UInt32fPacketHeader;
68
69 static void ListeningDCLPingPongProc(DCLCommand* pDCLCommand);
70 static void TalkingDCLPingPongProc(DCLCommand* pDCLCommand);
71
72public:
73 virtual bool init(DCLCommand* toInterpret);
74 virtual IOReturn allocateHW(IOFWSpeed speed, UInt32 chan);
75 virtual IOReturn releaseHW();
76 virtual IOReturn notify(IOFWDCLNotificationType notificationType,
77DCLCommand** dclCommandList, UInt32 numDCLCommands);
78 virtual void stop();
79
80 DCLCommand* getTranslatorOpcodes();
81 void setHWProgram(IODCLProgram *program);
82};
83
84/*! @class IODCLTranslateTalk
85*/
86
87class IODCLTranslateTalk : public IODCLTranslator
88{
89 OSDeclareDefaultStructors(IODCLTranslateTalk)
90
91protected:
92
93public:
94 virtual IOReturn compile(IOFWSpeed speed, UInt32 chan);
95 virtual IOReturn start();
96
97};
98
99/*! @class IODCLTranslateListen
100*/
101
102class IODCLTranslateListen : public IODCLTranslator
103{
104 OSDeclareDefaultStructors(IODCLTranslateListen)
105
106protected:
107
108public:
109 virtual IOReturn compile(IOFWSpeed speed, UInt32 chan);
110 virtual IOReturn start();
111
112};
113#endif /* ! _IOKIT_IOFWDCLPROGRAM_H */
114
115

Archive Download this file

Revision: 2862