Public Member Functions | Private Attributes

cdb_ModeSelect Class Reference
[SCSI Library]

SCSI Mode Select command. More...

#include <cdb.h>

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

List of all members.

Public Member Functions

 cdb_ModeSelect (data_Mode &a_mode)
virtual ~cdb_ModeSelect ()
virtual const UInt8_tGetCmdPointer () const
virtual UInt32_t GetCmdSize () const
virtual Direction_e GetTransferDirection () const
virtual UInt8_tGetBufferPointer () const
virtual UInt32_t GetBufferSize () const
const data_ModeGetData () const

Private Attributes

 log_CLASSID_m
cdb_ModeSelect_t m_modeSelectCmd
data_Modem_data

Detailed Description

SCSI Mode Select command.

Definition at line 457 of file cdb.h.


Constructor & Destructor Documentation

cdb_ModeSelect::cdb_ModeSelect ( data_Mode a_mode  ) 

Definition at line 48 of file cdb_modeselect.cpp.

References GetBufferSize(), m_modeSelectCmd, cdb_ModeSelect_t::opcode, cdb_ModeSelect_t::paramLen, and cdb_ModeSelect_t::pf.

    : m_data(a_mode) {

    memset (&m_modeSelectCmd, 0, sizeof(m_modeSelectCmd));
    m_modeSelectCmd.opcode = op_MODE_SELECT;
    m_modeSelectCmd.pf = 1;
    m_modeSelectCmd.paramLen = static_cast<UInt8_t>(GetBufferSize());
}

Here is the call graph for this function:

cdb_ModeSelect::~cdb_ModeSelect (  )  [virtual]

Definition at line 57 of file cdb_modeselect.cpp.

                               {
}


Member Function Documentation

UInt8_t * cdb_ModeSelect::GetBufferPointer (  )  const [virtual]

Reimplemented from scsi_CDB.

Definition at line 60 of file cdb_modeselect.cpp.

References data_Mode::GetModeStruct(), and m_data.

                                                {
    return reinterpret_cast<UInt8_t*>(
        const_cast<data_Mode_t*>(&(m_data.GetModeStruct())) );
}

Here is the call graph for this function:

UInt32_t cdb_ModeSelect::GetBufferSize (  )  const [virtual]

Reimplemented from scsi_CDB.

Definition at line 65 of file cdb_modeselect.cpp.

References data_ModePartPage_t::addPart, data_Mode_t::ait, data_ModePartitions_t::blkDesc, data_Mode_t::compress, data_Mode::GetModeStruct(), data_Mode::GetPage(), data_Mode_t::hdr, log_ERR_m, log_FUNC_m, m_data, data_Mode_t::part, data_ModePartitions_t::partPage, data_Mode::pg_AIT_APPENDPART, data_Mode::pg_AITCFG, data_Mode::pg_COMPRESSION, data_Mode::pg_PART, and size.

Referenced by cdb_ModeSelect().

                                             {

    const data_Mode_t &mode = m_data.GetModeStruct();

    switch (m_data.GetPage()) {
        case data_Mode::pg_PART:
        case data_Mode::pg_AIT_APPENDPART:
        {
            const data_ModePartitions_t &part = mode.part;

            UInt32_t size =
                sizeof(mode.hdr) + sizeof(part.blkDesc) +
                sizeof(part.partPage) +
                sizeof(UInt16_t) * (part.partPage.addPart + 1);
            return size;
            break;
        }
        case data_Mode::pg_AITCFG:
        {
            return sizeof(mode.hdr) + sizeof(mode.ait);;
            break;
        }
        case data_Mode::pg_COMPRESSION:
        {
            return sizeof(mode.hdr) + sizeof(mode.compress);
            break;
        }
        default:
        {
            log_FUNC_m(GetBufferSize);
            log_ERR_m("Unknown page for MODE SELECT.");
            return 0;
            break;
        }
    };
    {
        log_FUNC_m(GetBufferSize);
        log_ERR_m("Unknown page for MODE SELECT.");
        return 0;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

const UInt8_t * cdb_ModeSelect::GetCmdPointer (  )  const [virtual]

Reimplemented from scsi_CDB.

Definition at line 107 of file cdb_modeselect.cpp.

References m_modeSelectCmd.

                                                   {
    return reinterpret_cast<const UInt8_t*>(&m_modeSelectCmd);
}

UInt32_t cdb_ModeSelect::GetCmdSize (  )  const [virtual]

Reimplemented from scsi_CDB.

Definition at line 111 of file cdb_modeselect.cpp.

References m_modeSelectCmd.

                                          {
    return sizeof(m_modeSelectCmd);
}

const data_Mode & cdb_ModeSelect::GetData (  )  const

Definition at line 119 of file cdb_modeselect.cpp.

References m_data.

                                               {
    return m_data;
}

Direction_e cdb_ModeSelect::GetTransferDirection (  )  const [virtual]

Implements scsi_CDB.

Definition at line 115 of file cdb_modeselect.cpp.

                                                       {
    return TRANSFER_OUT;
}


Member Data Documentation

Reimplemented from scsi_CDB.

Definition at line 473 of file cdb.h.

Definition at line 476 of file cdb.h.

Referenced by GetBufferPointer(), GetBufferSize(), and GetData().

Definition at line 475 of file cdb.h.

Referenced by cdb_ModeSelect(), GetCmdPointer(), and GetCmdSize().


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