SCSIPathManagers.h [plain text]
#ifndef __IOKIT_SCSI_PATH_MANAGERS_H__
#define __IOKIT_SCSI_PATH_MANAGERS_H__
#include <libkern/c++/OSArray.h>
#include <IOKit/IOLocks.h>
#include <IOKit/scsi/spi/IOSCSIParallelInterfaceController.h>
#include "SCSITargetDevicePathManager.h"
class SCSIPathSet : public OSArray
{
OSDeclareDefaultStructors ( SCSIPathSet )
public:
static SCSIPathSet * withCapacity ( unsigned int capacity );
bool setObject ( const SCSITargetDevicePath * path );
bool member ( const SCSITargetDevicePath * path ) const;
bool member ( const IOSCSIProtocolServices * interface ) const;
void removeObject ( const IOSCSIProtocolServices * interface );
SCSITargetDevicePath * getAnyObject ( void ) const;
SCSITargetDevicePath * getObject ( unsigned int index ) const;
SCSITargetDevicePath * getObjectWithInterface ( const IOSCSIProtocolServices * interface ) const;
};
class SCSIFailoverPathManager : public SCSITargetDevicePathManager
{
OSDeclareDefaultStructors ( SCSIFailoverPathManager )
private:
SCSIPathSet * fPathSet;
SCSIPathSet * fInactivePathSet;
IOLock * fLock;
protected:
bool InitializePathManagerForTarget (
IOSCSITargetDevice * target,
IOSCSIProtocolServices * initialPath );
void free ( void );
public:
static SCSIFailoverPathManager * Create (
IOSCSITargetDevice * target,
IOSCSIProtocolServices * initialPath );
void ExecuteCommand ( SCSITaskIdentifier request );
virtual SCSIServiceResponse AbortTask ( SCSILogicalUnitNumber theLogicalUnit, SCSITaggedTaskIdentifier theTag );
virtual SCSIServiceResponse AbortTaskSet ( SCSILogicalUnitNumber theLogicalUnit );
virtual SCSIServiceResponse ClearACA ( SCSILogicalUnitNumber theLogicalUnit );
virtual SCSIServiceResponse ClearTaskSet ( SCSILogicalUnitNumber theLogicalUnit );
virtual SCSIServiceResponse LogicalUnitReset ( SCSILogicalUnitNumber theLogicalUnit );
virtual SCSIServiceResponse TargetReset ( void );
bool AddPath ( IOSCSIProtocolServices * path );
void ActivatePath ( IOSCSIProtocolServices * path );
void InactivatePath ( IOSCSIProtocolServices * path );
void RemovePath ( IOSCSIProtocolServices * path );
void PathStatusChanged ( IOSCSIProtocolServices * path, SPIPortStatus newStatus );
};
class SCSIRoundRobinPathManager : public SCSITargetDevicePathManager
{
OSDeclareDefaultStructors ( SCSIRoundRobinPathManager )
private:
SCSIPathSet * fPathSet;
SCSIPathSet * fInactivePathSet;
IOLock * fLock;
UInt32 fPathNumber;
protected:
bool InitializePathManagerForTarget (
IOSCSITargetDevice * target,
IOSCSIProtocolServices * initialPath );
void free ( void );
public:
static SCSIRoundRobinPathManager * Create (
IOSCSITargetDevice * target,
IOSCSIProtocolServices * initialPath );
void ExecuteCommand ( SCSITaskIdentifier request );
virtual SCSIServiceResponse AbortTask ( SCSILogicalUnitNumber theLogicalUnit, SCSITaggedTaskIdentifier theTag );
virtual SCSIServiceResponse AbortTaskSet ( SCSILogicalUnitNumber theLogicalUnit );
virtual SCSIServiceResponse ClearACA ( SCSILogicalUnitNumber theLogicalUnit );
virtual SCSIServiceResponse ClearTaskSet ( SCSILogicalUnitNumber theLogicalUnit );
virtual SCSIServiceResponse LogicalUnitReset ( SCSILogicalUnitNumber theLogicalUnit );
virtual SCSIServiceResponse TargetReset ( void );
bool AddPath ( IOSCSIProtocolServices * path );
void ActivatePath ( IOSCSIProtocolServices * path );
void InactivatePath ( IOSCSIProtocolServices * path );
void RemovePath ( IOSCSIProtocolServices * path );
void PathStatusChanged ( IOSCSIProtocolServices * path, SPIPortStatus newStatus );
};
#endif