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 TSCSIPRIMARYCMDS_H sl@0: #define TSCSIPRIMARYCMDS_H sl@0: sl@0: sl@0: /** sl@0: Encodes SCSI INQUIRY REQUEST sl@0: Ref SPC-2 7.3.1 sl@0: Ref SPC-3 6.4 sl@0: */ sl@0: class TScsiClientInquiryReq: public TScsiClientReq sl@0: { sl@0: public: sl@0: /** Length of INQUIRY response */ sl@0: static const TUint KResponseLength = 36; sl@0: sl@0: TScsiClientInquiryReq(); sl@0: TInt EncodeRequestL(TDes8& aBuffer) const; sl@0: sl@0: void SetEvpd(TUint8 aPageCode); sl@0: void SetCmdDt(TUint8 aOperationCode); sl@0: void SetAllocationLength(TAllocationLength aAllocationLength); sl@0: sl@0: public: sl@0: /** SCSI CmdDt field */ sl@0: TBool iCmdDt; sl@0: /** SCSI EVPD field */ sl@0: TBool iEvpd; sl@0: /** SCSI PAGE field */ sl@0: TUint8 iPage; sl@0: /** SCSI ALLOCATION LENGTH */ sl@0: TAllocationLength iAllocationLength; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Represents the SCSI INQUIRY RESPONSE PRODUCT IDENTIFICATION information sl@0: */ sl@0: class TMassStorageConfig sl@0: { sl@0: public: sl@0: /** SCSI VENDOR ID field */ sl@0: TBuf<8> iVendorId; sl@0: /** SCSI PRODUCT ID field */ sl@0: TBuf<16> iProductId; sl@0: /** SCSI PRODUCT REVISION field */ sl@0: TBuf<4> iProductRev; sl@0: }; sl@0: sl@0: /** sl@0: Represents the SCSI INQUIRY RESPONSE PERIPHERAL device information sl@0: */ sl@0: class TPeripheralInfo sl@0: { sl@0: public: sl@0: /** Medium removable flag */ sl@0: TBool iRemovable; sl@0: sl@0: /** SCSI PERIPHERAL QUALIFIER */ sl@0: TUint8 iPeripheralQualifier; sl@0: /** SCSI PERIPHEREAL DEVICE TYPE */ sl@0: TUint8 iPeripheralDeviceType; sl@0: /** SCSI RESPONSE DATA FORMAT */ sl@0: TUint8 iResponseDataFormat; sl@0: /** SCSI VERSION */ sl@0: TUint8 iVersion; sl@0: /** Device product information (vendor id, product id, revision) */ sl@0: TMassStorageConfig iIdentification; sl@0: }; sl@0: sl@0: /** sl@0: Decodes SCSI INQUIRY REQUEST sl@0: */ sl@0: class TScsiClientInquiryResp: public TScsiClientResp sl@0: { sl@0: public: sl@0: /** Length of INQUIRY response */ sl@0: static const TInt KResponseLength = 36; sl@0: TScsiClientInquiryResp(TPeripheralInfo& aPeripheralInfo); sl@0: sl@0: TInt DataLength() const {return KResponseLength;} sl@0: void DecodeL(const TDesC8& aPtr); sl@0: sl@0: private: sl@0: void DecodeInquiry(const TDesC8& aPtr); sl@0: sl@0: public: sl@0: /** Device peripheral info fields */ sl@0: TPeripheralInfo& iPeripheralInfo; sl@0: }; sl@0: sl@0: /** sl@0: Data type for PREVENT field sl@0: SPC-2, 7.12 Table 78 sl@0: SPC-3, 6.13 Table 119 sl@0: */ sl@0: typedef TBool TPrevent; sl@0: sl@0: /** sl@0: Encodes SCSI PREVENT MEDIA REMOVAL REQUEST sl@0: SPC-2 7.12 sl@0: SPC-3 6.13 sl@0: */ sl@0: class TScsiClientPreventMediaRemovalReq: public TScsiClientReq sl@0: { sl@0: public: sl@0: TScsiClientPreventMediaRemovalReq(TPrevent aPrevent); sl@0: TInt EncodeRequestL(TDes8& aBuffer) const; sl@0: sl@0: private: sl@0: TPrevent iPrevent; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Encodes SCSI REQUEST SENSE REQUEST sl@0: */ sl@0: class TScsiClientRequestSenseReq: public TScsiClientReq sl@0: { sl@0: public: sl@0: /** Length of REQUEST SENSE request */ sl@0: static const TUint KResponseLength = 18; sl@0: TScsiClientRequestSenseReq(); sl@0: TInt EncodeRequestL(TDes8& aBuffer) const; sl@0: sl@0: private: sl@0: void SetAllocationLength(TAllocationLength aAllocationLength); sl@0: sl@0: public: sl@0: /** SCSI ALLOCATION LENGTH field */ sl@0: TAllocationLength iAllocationLength; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Decodes SCSI SENSE RESPONSE sl@0: */ sl@0: class TScsiClientRequestSenseResp: public TScsiClientResp sl@0: { sl@0: public: sl@0: /** SCSI Response Code, SBC-3 4.5 */ sl@0: enum TResponseCode sl@0: { sl@0: ECurrentErrors = 0x70, sl@0: EDeferredErrors = 0x71 sl@0: }; sl@0: sl@0: /** Length of the REQUEST SENSE response */ sl@0: static const TInt KResponseLength = 18; sl@0: /** Constructor */ sl@0: TScsiClientRequestSenseResp() {}; sl@0: sl@0: TInt DataLength() const {return KResponseLength;} sl@0: void DecodeL(const TDesC8& aPtr); sl@0: sl@0: private: sl@0: void DecodeSenseInfo(const TDesC8& aPtr); sl@0: sl@0: public: sl@0: /** Returned SCSI RESPONSE CODE */ sl@0: TResponseCode iResponseCode; sl@0: /** Returned SCSI Sense Info */ sl@0: TSenseInfo iSenseInfo; sl@0: /** Returned SCSI ADDITIONAL SENSE LENGTH */ sl@0: TUint iAdditionalSenseLength; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Encodes SCSI TEST UNIT READY REQUEST sl@0: Ref SPC-2 7.25 sl@0: Ref SPC-3 6.33 sl@0: */ sl@0: class TScsiClientTestUnitReadyReq: public TScsiClientReq sl@0: { sl@0: public: sl@0: TScsiClientTestUnitReadyReq(); sl@0: TInt EncodeRequestL(TDes8& aBuffer) const; sl@0: }; sl@0: sl@0: sl@0: #include "tscsiprimarycmds.inl" sl@0: sl@0: #endif // TSCSIPRIMARYCMDS_H