IOSCSIParallelInterfaceProtocolTransport.h [plain text]
#ifndef _IO_SCSI_PARALLEL_INTERFACE_PROTOCOL_TRANSPORT_H_
#define _IO_SCSI_PARALLEL_INTERFACE_PROTOCOL_TRANSPORT_H_
#include <IOKit/IOLib.h>
#include <IOKit/IOMessage.h>
#include <IOKit/IOService.h>
#include <IOKit/IOCommandPool.h>
#include <IOKit/IOBufferMemoryDescriptor.h>
#include "IOSCSICommand.h"
#include "SCSIPublic.h"
#include <IOKit/scsi/IOSCSIProtocolServices.h>
class IOSCSIParallelInterfaceProtocolTransport;
struct SCSIClientData
{
IOSCSICommand * cmd;
SCSITaskIdentifier scsiTask;
IOBufferMemoryDescriptor * senseBuffer;
};
typedef struct SCSIClientData SCSIClientData;
class IOSCSIParallelInterfaceProtocolTransport : public IOSCSIProtocolServices
{
OSDeclareDefaultStructors ( IOSCSIParallelInterfaceProtocolTransport )
public:
virtual bool start ( IOService * provider );
virtual void stop ( IOService * provider );
protected:
IOSCSIDevice * fSCSIDevice;
IOCommandGate * fCommandGate;
IOCommandPool * fCommandPool;
bool fBusResetInProgress;
virtual IOReturn message ( UInt32 type, IOService * provider, void * argument = 0 );
virtual bool SendSCSICommand ( SCSITaskIdentifier request,
SCSIServiceResponse * serviceResponse,
SCSITaskStatus * taskStatus );
virtual void CompleteSCSITask ( SCSITaskIdentifier scsiTask,
SCSIServiceResponse serviceResponse,
SCSITaskStatus taskStatus );
virtual SCSIServiceResponse AbortSCSICommand ( SCSITaskIdentifier request );
virtual bool IsProtocolServiceSupported ( SCSIProtocolFeature feature,
void * serviceValue );
virtual bool HandleProtocolServiceFeature ( SCSIProtocolFeature feature,
void * serviceValue );
virtual void SCSICallbackFunction ( IOSCSICommand * cmd, SCSIClientData * clientData );
virtual bool InspectDevice ( IOSCSIDevice * scsiDevice );
private:
static void sSCSICallbackProc ( void * target, void * refCon );
void AllocateSCSICommandObjects ( void );
void DeallocateSCSICommandObjects ( void );
IOSCSICommand * GetSCSICommandObject ( bool okToSleep = true );
void ReturnSCSICommandObject ( IOSCSICommand * cmd );
};
#endif