os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiclientreq.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiclientreq.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,94 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @internalTechnology
    1.22 +*/
    1.23 +
    1.24 +#ifndef TSCSICLIENTREQ_H
    1.25 +#define TSCSICLIENTREQ_H
    1.26 +
    1.27 +/**
    1.28 +Data type for GROUP CODE
    1.29 +SAM-2 5.2.2
    1.30 +SPC-3 4.3.4.1
    1.31 +*/
    1.32 +typedef TUint8 TGroupCode;
    1.33 +
    1.34 +/**
    1.35 +Data type for ALLOCATION LENGTH
    1.36 +SPC-2 4.3.4.6
    1.37 +SPC-3 4.3.4.6
    1.38 +*/
    1.39 +typedef TUint TAllocationLength;    // 1 Byte
    1.40 +
    1.41 +/**
    1.42 +Base class to decode SCSI RESPONSE
    1.43 +*/
    1.44 +class TScsiClientResp: public MClientCommandServiceResp
    1.45 +    {
    1.46 +public:
    1.47 +    TScsiClientResp() {};
    1.48 +    };
    1.49 +
    1.50 +
    1.51 +/**
    1.52 +Base class to encode a SCSI REQUEST which implements the SCSI header encoding
    1.53 +*/
    1.54 +class TScsiClientReq: public MClientCommandServiceReq
    1.55 +    {
    1.56 +public:
    1.57 +    /** SCSI OPERATION CODE */
    1.58 +    enum TOperationCode
    1.59 +        {
    1.60 +        ETestUnitReady			= 0x00,
    1.61 +        ERequestSense			= 0x03,
    1.62 +        EInquiry 				= 0x12,
    1.63 +        EModeSense6				= 0x1A,
    1.64 +        EStartStopUnit			= 0x1B,
    1.65 +        EPreventMediaRemoval	= 0x1E,
    1.66 +        EReadFormatCapacities	= 0x23,
    1.67 +        EReadCapacity10			= 0x25,
    1.68 +        ERead10 				= 0x28,
    1.69 +        EWrite10				= 0x2A,
    1.70 +        EVerify10				= 0x2f,
    1.71 +        EModeSense10			= 0x5A,
    1.72 +        EUndefinedCommand		= 0xFF
    1.73 +        };
    1.74 +
    1.75 +    TScsiClientReq(TOperationCode aOperationCode);
    1.76 +
    1.77 +    virtual TInt EncodeRequestL(TDes8& aBuffer) const;
    1.78 +
    1.79 +private:
    1.80 +    TUint8 GetControlByte() const;
    1.81 +    TGroupCode GetGroupCode() const;
    1.82 +
    1.83 +    TBool IsDataDirectionOut() const;
    1.84 +    TUint32 DataLength() const;
    1.85 +
    1.86 +public:
    1.87 +    /** SCSI OPERATION CODE of CDB byte, SAM-2 5.2.2 */
    1.88 +    const TOperationCode iOperationCode;
    1.89 +    /** SCSI NACA field of CDB CONTROL Byte. SAM-2 5.2.3 */
    1.90 +    TBool iNaca;
    1.91 +    /** SCSI LINK field of CDB CONTROL Byte. SAM-2 5.2.3 */
    1.92 +    TBool iLink;
    1.93 +    };
    1.94 +
    1.95 +#include "tscsiclientreq.inl"
    1.96 +
    1.97 +#endif // TSCSICLIENTREQ_H