Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

scsi_WinSG Class Reference

#include <scsi_winsg.h>

Inheritance diagram for scsi_WinSG:
Inheritance graph
[legend]
Collaboration diagram for scsi_WinSG:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 scsi_WinSG ()
 scsi_WinSG (const string &a_deviceID)
virtual ~scsi_WinSG ()
virtual bool IsOpen ()
virtual void Close ()

Protected Member Functions

virtual void OpenByDeviceName ()
 Open SCSI device by its (platform specific!) name.
virtual void OpenBySCSIID ()
 Open SCSI device by its (current) SCSI ID.
virtual void OpenBySerialNumber ()
 Open SCSI device by its unique identification.
virtual void InqSCSIID ()
 Get SCSI ID of the currently opened device.
int DoIOCtl (const scsi_CDB &a_cdb, UInt32_t a_timeout)
 Function to actually execute CDB commands.
virtual scsi_Status_e GetCDBStatus ()
virtual void CheckDriverStatus (UInt8_t a_cdbCode)
 Checks the status of the driver after the execution of CDB.
virtual void CheckHostStatus (UInt8_t a_cdbCode)
 Checks the status of the host (if available) after the execution of CDB.
virtual bool IsSenseValid ()

Private Member Functions

void SGOpen (bool a_readOnly=false, bool a_excl=false)
void OpenDeviceHandle (bool a_readOnly=false, bool a_openGeneric=false)

Private Attributes

 log_CLASSID_m
HANDLE m_handle
ULONG m_alignmentMask
ULONG m_maxTransferLen
string m_genericDeviceName
scsi_PassThroughDirectWithBuffer_t m_sptdwb

Detailed Description

Definition at line 40 of file scsi_winsg.h.


Constructor & Destructor Documentation

scsi_WinSG::scsi_WinSG (  ) 
scsi_WinSG::scsi_WinSG ( const string &  a_deviceID  ) 
virtual scsi_WinSG::~scsi_WinSG (  )  [virtual]

Member Function Documentation

virtual void scsi_WinSG::CheckDriverStatus ( UInt8_t  a_cdbCode  )  [protected, virtual]

Checks the status of the driver after the execution of CDB.

Reimplemented from scsi_IO.

virtual void scsi_WinSG::CheckHostStatus ( UInt8_t  a_cdbCode  )  [protected, virtual]

Checks the status of the host (if available) after the execution of CDB.

Reimplemented from scsi_IO.

virtual void scsi_WinSG::Close (  )  [virtual]

Implements scsi_IO.

int scsi_WinSG::DoIOCtl ( const scsi_CDB a_cdb,
UInt32_t  a_timeout 
) [protected, virtual]

Function to actually execute CDB commands.

Returns:
result code of platform specific ioctl command.

Implements scsi_IO.

virtual scsi_Status_e scsi_WinSG::GetCDBStatus (  )  [inline, protected, virtual]

Implements scsi_IO.

Definition at line 60 of file scsi_winsg.h.

                                         {
        return (scsi_Status_e)(m_sptdwb.sptd.ScsiStatus & st_STATUS_MASK);
    }

virtual void scsi_WinSG::InqSCSIID (  )  [protected, virtual]

Get SCSI ID of the currently opened device.

Implements scsi_IO.

virtual bool scsi_WinSG::IsOpen (  )  [virtual]

Implements scsi_IO.

virtual bool scsi_WinSG::IsSenseValid (  )  [inline, protected, virtual]

Implements scsi_IO.

Definition at line 66 of file scsi_winsg.h.

References scsi_IO::GetCDBStatus(), st_BUSY, st_CHECK_CONDITION, and st_COMMAND_TERMINATED.

                                {
        scsi_Status_e status    = GetCDBStatus();

        if (status == st_CHECK_CONDITION ||
            status == st_COMMAND_TERMINATED ||
            status == st_BUSY ) {
            return true;
        }
        else {
            return false;
        }
    }

Here is the call graph for this function:

virtual void scsi_WinSG::OpenByDeviceName (  )  [protected, virtual]

Open SCSI device by its (platform specific!) name.

Implements scsi_IO.

virtual void scsi_WinSG::OpenBySCSIID (  )  [protected, virtual]

Open SCSI device by its (current) SCSI ID.

Warning:
Implementations must take care to close the device if an error occurs.

Implements scsi_IO.

virtual void scsi_WinSG::OpenBySerialNumber (  )  [protected, virtual]

Open SCSI device by its unique identification.

Warning:
Implementations must take care to close the device if an error occurs.

Implements scsi_IO.

void scsi_WinSG::OpenDeviceHandle ( bool  a_readOnly = false,
bool  a_openGeneric = false 
) [private]
void scsi_WinSG::SGOpen ( bool  a_readOnly = false,
bool  a_excl = false 
) [private]

Member Data Documentation

Reimplemented from scsi_IO.

Definition at line 80 of file scsi_winsg.h.

ULONG scsi_WinSG::m_alignmentMask [private]

Definition at line 83 of file scsi_winsg.h.

Definition at line 85 of file scsi_winsg.h.

HANDLE scsi_WinSG::m_handle [private]

Definition at line 82 of file scsi_winsg.h.

Definition at line 84 of file scsi_winsg.h.

Definition at line 87 of file scsi_winsg.h.


The documentation for this class was generated from the following file: