IOFireWireLibPriv.h [plain text]
#pragma mark USER SPACE
#ifndef KERNEL
#import "IOFireWireLib.h"
#define kIOFireWireLibFactoryID CFUUIDGetConstantUUIDWithBytes(kCFAllocatorDefault, 0xA1, 0x47, 0x80, 0x10,0xF1, 0x97, 0x11, 0xD4, 0xA2, 0x8B, 0x00, 0x05,0x02, 0x07, 0x2F, 0x80)
#if (IOFIREWIRELIBDEBUG)
# include <syslog.h>
# define DebugLog( x... ) { printf( "%s %u:", __FILE__, __LINE__ ); printf( x ) ; }
# define DebugLogCond( x, y... ) { if (x) DebugLog( y ) ; }
# else
# define DebugLog(x...)
# define DebugLogCond( x, y... )
# endif
#define InfoLog(x...) {}
extern "C"
{
void * IOFireWireLibFactory(CFAllocatorRef allocator, CFUUIDRef typeID) ;
}
#endif // ifndef KERNEL
#pragma mark -
#pragma mark SHARED
#define kIOFireWireLibConnection 11
namespace IOFireWireLib {
typedef struct AKernelObject* UserObjectHandle ;
enum CommandType {
kCommandType_Read,
kCommandType_ReadQuadlet,
kCommandType_Write,
kCommandType_WriteQuadlet,
kCommandType_CompareSwap
} ;
enum {
kFireWireCommandStale = (1 << 0),
kFireWireCommandStale_Buffer = (1 << 1),
kFireWireCommandStale_MaxPacket = (1 << 2)
} ;
typedef enum IOFireWireCommandType_t {
kFireWireCommandType_Read,
kFireWireCommandType_ReadQuadlet,
kFireWireCommandType_Write,
kFireWireCommandType_WriteQuadlet,
kFireWireCommandType_CompareSwap
} IOFireWireCommandType ;
struct WriteQuadParams
{
FWAddress addr ;
UInt32 val ;
Boolean failOnReset ;
UInt32 generation ;
Boolean isAbs ;
} ;
typedef struct
{
FWAddress addr ;
const void* buf ;
UInt32 size ;
Boolean failOnReset ;
UInt32 generation ;
Boolean isAbs ;
} ReadParams, WriteParams, ReadQuadParams ;
struct CompareSwapParams
{
FWAddress addr ;
UInt64 cmpVal ;
UInt64 swapVal ;
IOByteCount size ;
Boolean failOnReset ;
UInt32 generation ;
Boolean isAbs ;
} ;
struct CommandSubmitParams
{
UserObjectHandle kernCommandRef ;
IOFireWireCommandType type ;
void* callback ;
void* refCon ;
UInt32 flags ;
UInt32 staleFlags ;
FWAddress newTarget ;
void* newBuffer ;
IOByteCount newBufferSize ; Boolean newFailOnReset ;
UInt32 newGeneration ;
IOByteCount newMaxPacket ;
} ;
struct CommandSubmitResult
{
UserObjectHandle kernCommandRef ;
IOReturn result ;
IOByteCount bytesTransferred ;
} ;
struct FWCompareSwapLockInfo
{
Boolean didLock ;
UInt64 value ;
} ;
struct CompareSwapSubmitResult
{
UserObjectHandle kernCommandRef ;
IOReturn result ;
IOByteCount bytesTransferred ;
FWCompareSwapLockInfo lockInfo ;
} ;
struct LocalIsochPortAllocateParams
{
unsigned version ;
bool talking ;
unsigned startEvent ;
unsigned startState ;
unsigned startMask ;
IOByteCount programExportBytes ;
IOVirtualAddress programData ;
unsigned bufferRangeCount ;
IOVirtualRange * bufferRanges ;
void* userObj ;
} ;
struct AddressSpaceInfo
{
FWAddress address ;
} ;
struct AddressSpaceCreateParams
{
UInt32 size ;
void* backingStore ;
UInt32 queueSize ;
void* queueBuffer ;
UInt32 flags ;
void* refCon ;
Boolean isInitialUnits ;
UInt32 addressLo ;
} ;
typedef struct
{
UserObjectHandle data ;
IOByteCount dataLength ;
UserObjectHandle text ;
UInt32 textLength ;
} GetKeyValueDataResults ;
typedef struct
{
FWAddress address ;
UserObjectHandle text ;
UInt32 length ;
} GetKeyOffsetResults ;
struct BufferFillIsochPortCreateParams
{
UInt32 interruptUSec ;
IOByteCount expectedBytesPerSecond ;
} ;
enum
{
kNuDCLUser = BIT( 18 ) } ;
enum MethodSelector
{
kOpen = 0,
kOpenWithSessionRef,
kClose,
kReadQuad,
kRead,
kWriteQuad,
kWrite,
kCompareSwap,
kBusReset,
kCycleTime,
kGetGenerationAndNodeID,
kGetLocalNodeID,
kGetResetTime,
kReleaseUserObject,
kGetOSStringData,
kGetOSDataData,
kLocalConfigDirectory_Create,
kLocalConfigDirectory_AddEntry_Buffer,
kLocalConfigDirectory_AddEntry_UInt32,
kLocalConfigDirectory_AddEntry_FWAddr,
kLocalConfigDirectory_AddEntry_UnitDir,
kLocalConfigDirectory_Publish,
kLocalConfigDirectory_Unpublish,
kPseudoAddrSpace_Allocate,
kPseudoAddrSpace_GetFWAddrInfo,
kPseudoAddrSpace_ClientCommandIsComplete,
kPhysicalAddrSpace_Allocate,
kPhysicalAddrSpace_GetSegmentCount_d,
kPhysicalAddrSpace_GetSegments,
kConfigDirectory_Create,
kConfigDirectory_GetKeyType,
kConfigDirectory_GetKeyValue_UInt32,
kConfigDirectory_GetKeyValue_Data,
kConfigDirectory_GetKeyValue_ConfigDirectory,
kConfigDirectory_GetKeyOffset_FWAddress,
kConfigDirectory_GetIndexType,
kConfigDirectory_GetIndexKey,
kConfigDirectory_GetIndexValue_UInt32,
kConfigDirectory_GetIndexValue_Data,
kConfigDirectory_GetIndexValue_String,
kConfigDirectory_GetIndexValue_ConfigDirectory,
kConfigDirectory_GetIndexOffset_FWAddress,
kConfigDirectory_GetIndexOffset_UInt32,
kConfigDirectory_GetIndexEntry,
kConfigDirectory_GetSubdirectories,
kConfigDirectory_GetKeySubdirectories,
kConfigDirectory_GetType,
kConfigDirectory_GetNumEntries,
kIsochPort_GetSupported,
kIsochPort_AllocatePort_d,
kIsochPort_ReleasePort_d,
kIsochPort_Start_d,
kIsochPort_Stop_d,
kLocalIsochPort_Allocate,
kLocalIsochPort_ModifyJumpDCL_d,
kLocalIsochPort_Notify_d,
kLocalIsochPort_SetChannel,
kIsochChannel_Allocate,
kIsochChannel_UserAllocateChannelBegin,
kIsochChannel_UserReleaseChannelComplete_d,
kCommand_Cancel_d,
kSeize,
kFireLog,
kGetBusCycleTime,
kGetBusGeneration,
kGetLocalNodeIDWithGeneration,
kGetRemoteNodeID,
kGetSpeedToNode,
kGetSpeedBetweenNodes,
kGetIRMNodeID,
kClipMaxRec2K,
kIsochPort_SetIsochResourceFlags_d,
kGetSessionRef,
kNumMethods
} ;
typedef enum
{
kSetAsyncRef_BusReset,
kSetAsyncRef_BusResetDone,
kSetAsyncRef_Packet,
kSetAsyncRef_SkippedPacket,
kSetAsyncRef_Read,
kCommand_Submit,
kSetAsyncRef_IsochChannelForceStop,
kSetAsyncRef_DCLCallProc,
kNumAsyncMethods
} AsyncMethodSelector ;
}