IOFireWireAVCProtocolUserClient.h [plain text]
#ifndef _IOKIT_IOFIREWIREAVCPROTOCOLUSERCLIENT_H
#define _IOKIT_IOFIREWIREAVCPROTOCOLUSERCLIENT_H
#include <IOKit/IOUserClient.h>
#include <IOKit/firewire/IOFWAddressSpace.h>
#include <IOKit/avc/IOFireWireAVCUserClientCommon.h>
#include <IOKit/avc/IOFireWireAVCTargetSpace.h>
class IOFireWireNub;
class IOFireWirePCRSpace;
class IOFireWireAVCTargetSpace;
class IOFireWireAVCProtocolUserClient : public IOUserClient
{
OSDeclareDefaultStructors(IOFireWireAVCProtocolUserClient)
protected:
static IOExternalAsyncMethod sAsyncMethods[kIOFWAVCProtocolUserClientNumAsyncCommands];
static IOExternalMethod sMethods[kIOFWAVCProtocolUserClientNumCommands];
task_t fTask;
bool fStarted;
IOFireWireNub * fDevice;
IOFireWireBus * fBus;
IOFireWirePCRSpace * fPCRSpace;
IOFireWireAVCTargetSpace * fAVCTargetSpace;
OSSet * fInputPlugs;
OSSet * fOutputPlugs;
static void forwardPlugWrite(void *refcon, UInt16 nodeID, UInt32 plug, UInt32 oldVal, UInt32 newVal);
static void avcTargetCommandHandler(const AVCCommandHandlerInfo *pCmdInfo,
UInt32 generation,
UInt16 nodeID,
const void *command,
UInt32 cmdLen,
IOFWSpeed &speed,
UInt32 handlerSearchIndex);
static void avcSubunitPlugHandler(const AVCSubunitInfo *pSubunitInfo,
IOFWAVCSubunitPlugMessages plugMessage,
IOFWAVCPlugTypes plugType,
UInt32 plugNum,
UInt32 messageParams,
UInt32 generation,
UInt16 nodeID);
virtual IOReturn setAVCRequestCallback(OSAsyncReference asyncRef, UInt32 subUnitType, UInt32 subUnitID);
virtual IOReturn sendAVCResponse(UInt32 generation, UInt16 nodeID, const char *buffer, UInt32 size);
virtual IOReturn allocateInputPlug(OSAsyncReference asyncRef, void *userRefcon, UInt32 *plug);
virtual IOReturn freeInputPlug(UInt32 plug);
virtual IOReturn readInputPlug(UInt32 plug, UInt32 *val);
virtual IOReturn updateInputPlug(UInt32 plug, UInt32 oldVal, UInt32 newVal);
virtual IOReturn allocateOutputPlug(OSAsyncReference asyncRef, void *userRefcon, UInt32 *plug);
virtual IOReturn freeOutputPlug(UInt32 plug);
virtual IOReturn readOutputPlug(UInt32 plug, UInt32 *val);
virtual IOReturn updateOutputPlug(UInt32 plug, UInt32 oldVal, UInt32 newVal);
virtual IOReturn readOutputMasterPlug(UInt32 *val);
virtual IOReturn updateOutputMasterPlug(UInt32 oldVal, UInt32 newVal);
virtual IOReturn readInputMasterPlug(UInt32 *val);
virtual IOReturn updateInputMasterPlug(UInt32 oldVal, UInt32 newVal);
virtual IOReturn publishAVCUnitDirectory(void);
virtual IOReturn installAVCCommandHandler(OSAsyncReference asyncRef, UInt32 subUnitTypeAndID, UInt32 opCode, UInt32 callback, UInt32 refCon);
virtual IOReturn addSubunit(OSAsyncReference asyncRef,
UInt32 subunitType,
UInt32 numSourcePlugs,
UInt32 numDestPlugs,
UInt32 callBack,
UInt32 refCon,
UInt32 *subUnitTypeAndID);
virtual IOReturn setSubunitPlugSignalFormat(UInt32 subunitTypeAndID,
IOFWAVCPlugTypes plugType,
UInt32 plugNum,
UInt32 signalFormat);
virtual IOReturn getSubunitPlugSignalFormat(UInt32 subunitTypeAndID,
IOFWAVCPlugTypes plugType,
UInt32 plugNum,
UInt32 *pSignalFormat);
virtual IOReturn connectTargetPlugs(AVCConnectTargetPlugsInParams *inParams,
AVCConnectTargetPlugsOutParams *outParams);
virtual IOReturn disconnectTargetPlugs(UInt32 sourceSubunitTypeAndID,
IOFWAVCPlugTypes sourcePlugType,
UInt32 sourcePlugNum,
UInt32 destSubunitTypeAndID,
IOFWAVCPlugTypes destPlugType,
UInt32 destPlugNum);
virtual IOReturn getTargetPlugConnection(AVCGetTargetPlugConnectionInParams *inParams,
AVCGetTargetPlugConnectionOutParams *outParams);
virtual IOReturn AVCRequestNotHandled(UInt32 generation,
UInt16 nodeID,
IOFWSpeed speed,
UInt32 handlerSearchIndex,
const char *pCmdBuf,
UInt32 cmdLen);
virtual IOExternalMethod * getTargetAndMethodForIndex(IOService **target, UInt32 index);
virtual IOExternalAsyncMethod * getAsyncTargetAndMethodForIndex(IOService **target, UInt32 index);
virtual void free();
public:
virtual bool start( IOService * provider );
virtual IOReturn newUserClient( task_t owningTask, void * securityID,
UInt32 type, OSDictionary * properties,
IOUserClient ** handler );
virtual IOReturn clientClose( void );
virtual IOReturn clientDied( void );
virtual bool matchPropertyTable(OSDictionary * table);
};
#endif // _IOKIT_IOFIREWIREAVCPROTOCOLUSERCLIENT_H