Chameleon

Chameleon Svn Source Tree

Root/trunk/i386/include/IOKit/firewire/IOFWAsyncStreamListener.h

1/*
2 * Copyright (c) 1998-2001 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#ifndef _IOKIT_IOFWASYNCSTREAMLISTENER_H
23#define _IOKIT_IOFWASYNCSTREAMLISTENER_H
24
25#include <IOKit/firewire/IOFireWireLink.h>
26#include <IOKit/firewire/IOFWCommand.h>
27#include <IOKit/IOBufferMemoryDescriptor.h>
28#include <IOKit/firewire/IOFWDCLProgram.h>
29
30class IOFWAsyncStreamReceiver;
31class IOFWAsyncStreamReceivePort;
32
33/*! @class IOFWAsyncStreamListener
34*/
35class IOFWAsyncStreamListener : public OSObject
36{
37 OSDeclareDefaultStructors(IOFWAsyncStreamListener)
38
39friend class IOFWAsyncStreamReceiver;
40friend class IOFireWireController;
41
42public:
43
44/*!@function initAll
45@abstract Creates an AsyncStream client for an Isoch channel.
46@param controlPoints to IOFireWireController.
47@param channelIsoch channel for listening.
48@param procCallback on packet reception.
49@param obj Client's callback object.
50@result returns true on success, else false.*/
51bool initAll( IOFireWireController *control, UInt32 channel, FWAsyncStreamReceiveCallback proc, void *refcon );
52
53/*!@function setListenerHandler
54@abstract Set the callback that should be called to handle incoming async stream packets
55@param inReceiver The callback to set.
56@result Returns the callback that was previously set or nil for none.*/
57const FWAsyncStreamReceiveCallback setListenerHandler( FWAsyncStreamReceiveCallback inReceiver );
58
59/*!@function TurnOffNotification
60@abstract Turns off client callback notification.
61@result none.*/
62inline void TurnOffNotification() { fNotify = false; };
63
64/*!@function TurnOnNotification
65@abstract Turns on client callback notification.
66@result none.*/
67inline void TurnOnNotification() { fNotify = true; };
68
69/*!@function IsNotificationOn
70@abstract checks the notification state.
71@result true if ON, else false*/
72inline bool IsNotificationOn() { return fNotify; };
73
74/*!@function setFlags
75@abstract set flags for the listener.
76@param flags indicate performance metrics.
77@result none.*/
78void setFlags( UInt32 flags );
79
80/*!@function getFlags
81@abstract get the flags of listener.
82@param none.
83@result flags.*/
84UInt32 getFlags();
85
86/*!@function getRefCon
87@abstract get the refcon specific to this listener.
88@param none.
89@result fRefCon refcon passed during initialization. */
90inline void* getRefCon() { return fRefCon; };
91
92/*!@function getOverrunCounter
93@abstract get overrun counter from the DCL program.
94@param none.
95@result returns the counter value.*/
96UInt32 getOverrunCounter();
97
98protected:
99
100FWAsyncStreamReceiveCallbackfClientProc;
101void*fRefCon;
102IOFWAsyncStreamReceiver*fReceiver;
103bool fNotify;
104UInt32 fFlags;
105IOFireWireController*fControl;
106
107/*! @struct ExpansionData
108 @discussion This structure will be used to expand the capablilties of the class in the future.
109 */
110 struct ExpansionData { };
111
112/*! @var reserved
113 Reserved for future use. (Internal use only) */
114 ExpansionData *reserved;
115
116 virtual voidfree();
117
118private:
119/*!function getReceiver
120abstract Returns the Async Stream receiver object which tracks multiple
121 IOFWAsyncStreamListeners for the same Isoc channel. */
122inline IOFWAsyncStreamReceiver *getReceiver() { return fReceiver; };
123
124/*!function invokeClients
125abstract Invokes client's callback function with fRefCon.*/
126void invokeClients( UInt8 *buffer );
127
128 OSMetaClassDeclareReservedUnused(IOFWAsyncStreamListener, 0);
129 OSMetaClassDeclareReservedUnused(IOFWAsyncStreamListener, 1);
130};
131#endif // _IOKIT_IOFWASYNCSTREAMLISTENER_H
132
133

Archive Download this file

Revision: 881