sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef TSCSICLIENTREQ_H sl@0: #define TSCSICLIENTREQ_H sl@0: sl@0: /** sl@0: Data type for GROUP CODE sl@0: SAM-2 5.2.2 sl@0: SPC-3 4.3.4.1 sl@0: */ sl@0: typedef TUint8 TGroupCode; sl@0: sl@0: /** sl@0: Data type for ALLOCATION LENGTH sl@0: SPC-2 4.3.4.6 sl@0: SPC-3 4.3.4.6 sl@0: */ sl@0: typedef TUint TAllocationLength; // 1 Byte sl@0: sl@0: /** sl@0: Base class to decode SCSI RESPONSE sl@0: */ sl@0: class TScsiClientResp: public MClientCommandServiceResp sl@0: { sl@0: public: sl@0: TScsiClientResp() {}; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Base class to encode a SCSI REQUEST which implements the SCSI header encoding sl@0: */ sl@0: class TScsiClientReq: public MClientCommandServiceReq sl@0: { sl@0: public: sl@0: /** SCSI OPERATION CODE */ sl@0: enum TOperationCode sl@0: { sl@0: ETestUnitReady = 0x00, sl@0: ERequestSense = 0x03, sl@0: EInquiry = 0x12, sl@0: EModeSense6 = 0x1A, sl@0: EStartStopUnit = 0x1B, sl@0: EPreventMediaRemoval = 0x1E, sl@0: EReadFormatCapacities = 0x23, sl@0: EReadCapacity10 = 0x25, sl@0: ERead10 = 0x28, sl@0: EWrite10 = 0x2A, sl@0: EVerify10 = 0x2f, sl@0: EModeSense10 = 0x5A, sl@0: EUndefinedCommand = 0xFF sl@0: }; sl@0: sl@0: TScsiClientReq(TOperationCode aOperationCode); sl@0: sl@0: virtual TInt EncodeRequestL(TDes8& aBuffer) const; sl@0: sl@0: private: sl@0: TUint8 GetControlByte() const; sl@0: TGroupCode GetGroupCode() const; sl@0: sl@0: TBool IsDataDirectionOut() const; sl@0: TUint32 DataLength() const; sl@0: sl@0: public: sl@0: /** SCSI OPERATION CODE of CDB byte, SAM-2 5.2.2 */ sl@0: const TOperationCode iOperationCode; sl@0: /** SCSI NACA field of CDB CONTROL Byte. SAM-2 5.2.3 */ sl@0: TBool iNaca; sl@0: /** SCSI LINK field of CDB CONTROL Byte. SAM-2 5.2.3 */ sl@0: TBool iLink; sl@0: }; sl@0: sl@0: #include "tscsiclientreq.inl" sl@0: sl@0: #endif // TSCSICLIENTREQ_H