IOFWUserAsyncStreamListener.h [plain text]
#ifndef __IOFWUSERASYNCSTREAMLISTENER_H__
#define __IOFWUSERASYNCSTREAMLISTENER_H__
#import <IOKit/firewire/IOFireWireFamilyCommon.h>
#import <IOKit/firewire/IOFWAsyncStreamListener.h>
#import "IOFireWireLibPriv.h"
#import "IOFWUserPseudoAddressSpace.h"
#if defined(__BIG_ENDIAN__)
typedef struct {
UInt16 size;
UInt8 tag:2;
UInt8 chan:6;
UInt8 tcode:4;
UInt8 sy:4;
} ISOC_DATA_PKT;
#elif defined(__LITTLE_ENDIAN__)
typedef struct {
UInt8 sy:4;
UInt8 tcode:4;
UInt8 chan:6;
UInt8 tag:2;
UInt16 size;
} ISOC_DATA_PKT;
#else
#error host endian unknown
#endif
class IOFireWireUserClient ;
class IOFWUserAsyncStreamListener: public IOFWAsyncStreamListener
{
OSDeclareDefaultStructors(IOFWUserAsyncStreamListener)
public:
#if IOFIREWIREUSERCLIENTDEBUG > 0
virtual bool serialize(OSSerialize *s) const;
#endif
virtual void free() ;
static void exporterCleanup( OSObject * self, IOFWUserObjectExporter * exporter );
bool completeInit( IOFireWireUserClient* userclient, FWUserAsyncStreamListenerCreateParams* params ) ;
void deactivate();
bool initAsyncStreamListener( IOFireWireUserClient* userclient, FWUserAsyncStreamListenerCreateParams* params ) ;
void doPacket(
UInt32 len,
const void* buf,
IOFWPacketHeader::QueueTag tag,
UInt32* oldVal = NULL) ;
const mach_vm_address_t getUserRefCon() { return fUserRefCon ;}
const IOFireWireUserClient& getUserClient() { return *fUserClient ;}
static void asyncStreamListenerHandler(
void* refCon,
const void* buf) ;
void setAsyncStreamRef_Packet(
OSAsyncReference64 inAsyncRef ) ;
void setAsyncStreamRef_SkippedPacket(
OSAsyncReference64 inAsyncRef ) ;
void clientCommandIsComplete(
FWClientCommandID inCommandID ) ;
void sendPacketNotification(
IOFWPacketHeader* inPacketHeader ) ;
private:
IOMemoryDescriptor* fPacketQueueBuffer ; IOLock* fLock ;
mach_vm_address_t fUserRefCon ;
IOFireWireUserClient* fUserClient ;
IOFWPacketHeader* fLastWrittenHeader ;
IOFWPacketHeader* fLastReadHeader;
UInt32 fBufferAvailable ;
OSAsyncReference64 fSkippedPacketAsyncNotificationRef ;
OSAsyncReference64 fPacketAsyncNotificationRef ;
bool fWaitingForUserCompletion ;
bool fUserLocks ;
UInt32 fFlags ;
Boolean fPacketQueuePrepared ;
} ;
#endif // __IOFWUSERASYNCSTREAMLISTENER_H__