IOFireWireLibPriv.h [plain text]
#pragma mark USER SPACE
#import "IOFWUserObjectExporter.h"
#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...) {}
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
extern "C"
{
void * IOFireWireLibFactory(CFAllocatorRef allocator, CFUUIDRef typeID) ;
}
#endif // ifndef KERNEL
#pragma mark -
#pragma mark SHARED
#define kIOFireWireLibConnection 11
namespace IOFireWireLib {
enum CommandType {
kCommandType_Read,
kCommandType_ReadQuadlet,
kCommandType_Write,
kCommandType_WriteQuadlet,
kCommandType_CompareSwap
} ;
enum {
kFireWireCommandStale = (1 << 0),
kFireWireCommandStale_Buffer = (1 << 1),
kFireWireCommandStale_MaxPacket = (1 << 2),
kFireWireCommandStale_Timeout = (1 << 3),
kFireWireCommandStale_Retries = (1 << 4),
kFireWireCommandStale_Speed = (1 << 5)
} ;
typedef enum IOFireWireCommandType_t {
kFireWireCommandType_Read,
kFireWireCommandType_ReadQuadlet,
kFireWireCommandType_Write,
kFireWireCommandType_WriteQuadlet,
kFireWireCommandType_CompareSwap,
kFireWireCommandType_PHY,
kFireWireCommandType_AsyncStream
} IOFireWireCommandType ;
struct WriteQuadParams
{
FWAddress addr ;
UInt32 val ;
Boolean failOnReset ;
UInt32 generation ;
Boolean isAbs ;
} ;
typedef struct
{
FWAddress addr ;
mach_vm_address_t buf ;
UInt32 size ;
Boolean failOnReset ;
UInt32 generation ;
Boolean isAbs ;
} ReadParams, WriteParams, ReadQuadParams ;
struct CompareSwapParams
{
FWAddress addr ;
UInt64 cmpVal ;
UInt64 swapVal ;
UInt32 size ;
Boolean failOnReset ;
UInt32 generation ;
Boolean isAbs ;
} ;
struct CommandSubmitParams
{
UserObjectHandle kernCommandRef ;
IOFireWireCommandType type ;
mach_vm_address_t callback ;
mach_vm_address_t refCon ;
UInt32 flags ;
UInt32 staleFlags ;
UInt64 newTarget ;
mach_vm_address_t newBuffer ;
UInt32 newBufferSize ; Boolean newFailOnReset ;
UInt32 newGeneration ;
UInt32 newMaxPacket ;
UInt32 timeoutDuration;
UInt32 retryCount;
UInt32 maxPacketSpeed;
UInt32 data1;
UInt32 data2;
UInt32 tag;
UInt32 sync;
} __attribute__ ((packed));
struct CommandSubmitResult
{
UserObjectHandle kernCommandRef ;
IOReturn result ;
UInt32 bytesTransferred ;
UInt32 ackCode;
UInt32 responseCode;
mach_vm_address_t refCon;
} __attribute__ ((packed));
struct FWCompareSwapLockInfo
{
Boolean didLock ;
UInt32 value[2];
} __attribute__ ((packed));
struct CompareSwapSubmitResult
{
UserObjectHandle kernCommandRef ;
IOReturn result ;
UInt32 bytesTransferred ;
UInt32 ackCode;
UInt32 responseCode;
FWCompareSwapLockInfo lockInfo ;
} __attribute__ ((packed));
typedef struct LocalIsochPortAllocateParamsStruct
{
UInt32 version ;
UInt32 startEvent ;
UInt32 startState ;
UInt32 startMask ;
mach_vm_address_t programData ;
UInt32 programExportBytes ;
UInt32 bufferRangeCount ;
mach_vm_address_t bufferRanges ;
mach_vm_address_t userObj ;
UInt32 talking ;
UInt32 options ;
} __attribute__ ((packed)) LocalIsochPortAllocateParams;
struct AddressSpaceInfo
{
FWAddress address ;
} ;
struct AddressSpaceCreateParams
{
mach_vm_size_t size ;
mach_vm_address_t backingStore ;
mach_vm_size_t queueSize ;
mach_vm_address_t queueBuffer ;
UInt32 flags ;
mach_vm_address_t refCon ;
Boolean isInitialUnits ;
UInt32 addressLo ;
} __attribute__ ((packed));
struct FWUserAsyncStreamListenerCreateParams
{
UInt32 channel;
mach_vm_size_t queueSize ;
mach_vm_address_t queueBuffer ;
UInt32 flags ;
mach_vm_address_t callback ;
mach_vm_address_t refCon ;
} __attribute__ ((packed));
typedef struct
{
UserObjectHandle data ;
UInt32 dataLength ;
UserObjectHandle text ;
UInt32 textLength ;
} GetKeyValueDataResults ;
typedef struct
{
FWAddress address ;
UserObjectHandle text ;
UInt32 length ;
} GetKeyOffsetResults ;
typedef struct
{
IOPhysicalAddress32 location;
IOPhysicalLength32 length;
} FWPhysicalSegment32;
typedef struct
{
mach_vm_address_t address;
mach_vm_size_t length;
} FWVirtualAddressRange;
enum
{
kNuDCLUser = BIT( 18 ) } ;
enum
{
kDCLExportDataLegacyVersion = 0
, kDCLExportDataNuDCLRosettaVersion = 8
} ;
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,
kAsyncStreamListener_Allocate,
kAsyncStreamListener_ClientCommandIsComplete,
kAsyncStreamListener_GetOverrunCounter,
kAsyncStreamListener_SetFlags,
kAsyncStreamListener_GetFlags,
kAsyncStreamListener_TurnOnNotification,
kAsyncStreamListener_TurnOffNotification,
kAllocateIRMBandwidth,
kReleaseIRMBandwidth,
kAllocateIRMChannel,
kReleaseIRMChannel,
kSetAsyncRef_BusReset,
kSetAsyncRef_BusResetDone,
kSetAsyncRef_Packet,
kSetAsyncRef_SkippedPacket,
kSetAsyncRef_Read,
kCommand_Submit,
kSetAsyncRef_IsochChannelForceStop,
kSetAsyncRef_DCLCallProc,
kSetAsyncStreamRef_Packet,
kSetAsyncStreamRef_SkippedPacket,
kIRMAllocation_Allocate,
kIRMAllocation_SetRef,
kIRMAllocation_AllocateResources,
kIRMAllocation_DeallocateResources,
kIRMAllocation_areResourcesAllocated,
kIRMAllocation_setDeallocateOnRelease,
kCommandCreateAsync,
kVectorCommandSetBuffers,
kVectorCommandSubmit,
kVectorCommandCreate,
kPHYPacketListenerCreate,
kPHYPacketListenerSetPacketCallback,
kPHYPacketListenerSetSkippedCallback,
kPHYPacketListenerActivate,
kPHYPacketListenerDeactivate,
kPHYPacketListenerClientCommandIsComplete,
kNumMethods
} ;
}