author | sl@SLION-WIN7.fritz.box |
Fri, 15 Jun 2012 03:10:57 +0200 | |
changeset 0 | bde4ae8d615e |
permissions | -rw-r--r-- |
sl@0 | 1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
sl@0 | 2 |
// All rights reserved. |
sl@0 | 3 |
// This component and the accompanying materials are made available |
sl@0 | 4 |
// under the terms of the License "Eclipse Public License v1.0" |
sl@0 | 5 |
// which accompanies this distribution, and is available |
sl@0 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
sl@0 | 7 |
// |
sl@0 | 8 |
// Initial Contributors: |
sl@0 | 9 |
// Nokia Corporation - initial contribution. |
sl@0 | 10 |
// |
sl@0 | 11 |
// Contributors: |
sl@0 | 12 |
// |
sl@0 | 13 |
// Description: |
sl@0 | 14 |
// scsiprimarycommands.inl |
sl@0 | 15 |
// |
sl@0 | 16 |
// |
sl@0 | 17 |
|
sl@0 | 18 |
/** |
sl@0 | 19 |
@file |
sl@0 | 20 |
@internalTechnology |
sl@0 | 21 |
*/ |
sl@0 | 22 |
|
sl@0 | 23 |
/** Constructor for TEST UNIT READY request */ |
sl@0 | 24 |
inline TScsiClientTestUnitReadyReq::TScsiClientTestUnitReadyReq() |
sl@0 | 25 |
: TScsiClientReq(ETestUnitReady) |
sl@0 | 26 |
{ |
sl@0 | 27 |
__MSFNSLOG |
sl@0 | 28 |
} |
sl@0 | 29 |
|
sl@0 | 30 |
|
sl@0 | 31 |
/** constructor for SCSI REQUEST SENSE request */ |
sl@0 | 32 |
inline TScsiClientRequestSenseReq::TScsiClientRequestSenseReq() |
sl@0 | 33 |
: TScsiClientReq(ERequestSense), |
sl@0 | 34 |
iAllocationLength(KResponseLength) |
sl@0 | 35 |
{ |
sl@0 | 36 |
__MSFNSLOG |
sl@0 | 37 |
} |
sl@0 | 38 |
|
sl@0 | 39 |
|
sl@0 | 40 |
/** |
sl@0 | 41 |
Set SCSI ALLOCATION LENGTH value. |
sl@0 | 42 |
|
sl@0 | 43 |
@param aAllocationLength |
sl@0 | 44 |
*/ |
sl@0 | 45 |
inline void TScsiClientRequestSenseReq::SetAllocationLength(TAllocationLength aAllocationLength) |
sl@0 | 46 |
{ |
sl@0 | 47 |
__MSFNSLOG |
sl@0 | 48 |
iAllocationLength = aAllocationLength; |
sl@0 | 49 |
} |
sl@0 | 50 |
|
sl@0 | 51 |
|
sl@0 | 52 |
inline TInt TScsiClientRequestSenseReq::EncodeRequestL(TDes8& aBuffer) const |
sl@0 | 53 |
{ |
sl@0 | 54 |
__MSFNSLOG |
sl@0 | 55 |
__SCSIPRINT(_L("<-- SCSI REQUEST SENSE")); |
sl@0 | 56 |
TInt length = TScsiClientReq::EncodeRequestL(aBuffer); |
sl@0 | 57 |
|
sl@0 | 58 |
aBuffer[4] = iAllocationLength; |
sl@0 | 59 |
return length; |
sl@0 | 60 |
} |
sl@0 | 61 |
|
sl@0 | 62 |
|
sl@0 | 63 |
/** Constructor for SCSI INQUIRY request */ |
sl@0 | 64 |
inline TScsiClientInquiryReq::TScsiClientInquiryReq() |
sl@0 | 65 |
: TScsiClientReq(EInquiry), |
sl@0 | 66 |
iCmdDt(EFalse), |
sl@0 | 67 |
iEvpd(EFalse), |
sl@0 | 68 |
iAllocationLength(KResponseLength) |
sl@0 | 69 |
{ |
sl@0 | 70 |
__MSFNSLOG |
sl@0 | 71 |
} |
sl@0 | 72 |
|
sl@0 | 73 |
|
sl@0 | 74 |
/** |
sl@0 | 75 |
Set SCSI ALLOCATION LENGTH value. |
sl@0 | 76 |
|
sl@0 | 77 |
@param aAllocationLength |
sl@0 | 78 |
*/ |
sl@0 | 79 |
inline void TScsiClientInquiryReq::SetAllocationLength(TAllocationLength aAllocationLength) |
sl@0 | 80 |
{ |
sl@0 | 81 |
__MSFNSLOG |
sl@0 | 82 |
iAllocationLength = aAllocationLength; |
sl@0 | 83 |
} |
sl@0 | 84 |
|
sl@0 | 85 |
|
sl@0 | 86 |
/** |
sl@0 | 87 |
Set SCSI EVPD and PAGE CODE value. |
sl@0 | 88 |
|
sl@0 | 89 |
@param aPageCode SCSI PAGE CODE value |
sl@0 | 90 |
*/ |
sl@0 | 91 |
inline void TScsiClientInquiryReq::SetEvpd(TUint8 aPageCode) |
sl@0 | 92 |
{ |
sl@0 | 93 |
__MSFNSLOG |
sl@0 | 94 |
iEvpd = ETrue; |
sl@0 | 95 |
iPage = aPageCode; |
sl@0 | 96 |
} |
sl@0 | 97 |
|
sl@0 | 98 |
|
sl@0 | 99 |
/** |
sl@0 | 100 |
Set SCSI CmdDt and OPERATION CODE. |
sl@0 | 101 |
|
sl@0 | 102 |
@param aOperationCode SCSI OPERATION CODE value |
sl@0 | 103 |
*/ |
sl@0 | 104 |
inline void TScsiClientInquiryReq::SetCmdDt(TUint8 aOperationCode) |
sl@0 | 105 |
{ |
sl@0 | 106 |
__MSFNSLOG |
sl@0 | 107 |
iCmdDt = ETrue; |
sl@0 | 108 |
iPage = aOperationCode; |
sl@0 | 109 |
} |
sl@0 | 110 |
|
sl@0 | 111 |
|
sl@0 | 112 |
inline TInt TScsiClientInquiryReq::EncodeRequestL(TDes8& aBuffer) const |
sl@0 | 113 |
{ |
sl@0 | 114 |
__MSFNSLOG |
sl@0 | 115 |
__SCSIPRINT(_L("<-- SCSI INQUIRY")); |
sl@0 | 116 |
TInt length = TScsiClientReq::EncodeRequestL(aBuffer); |
sl@0 | 117 |
|
sl@0 | 118 |
if (iEvpd) |
sl@0 | 119 |
{ |
sl@0 | 120 |
aBuffer[1] |= 0x01; |
sl@0 | 121 |
aBuffer[2] = iPage; |
sl@0 | 122 |
} |
sl@0 | 123 |
else if (iCmdDt) |
sl@0 | 124 |
{ |
sl@0 | 125 |
aBuffer[1] |= 0x02; |
sl@0 | 126 |
aBuffer[2] = iPage; |
sl@0 | 127 |
} |
sl@0 | 128 |
|
sl@0 | 129 |
aBuffer[4] = iAllocationLength; |
sl@0 | 130 |
return length; |
sl@0 | 131 |
} |
sl@0 | 132 |
|
sl@0 | 133 |
|
sl@0 | 134 |
/** |
sl@0 | 135 |
Constructor for SCSI INQUIRY response. |
sl@0 | 136 |
|
sl@0 | 137 |
@param aPeripheralInfo Device perihpheral info data |
sl@0 | 138 |
*/ |
sl@0 | 139 |
inline TScsiClientInquiryResp::TScsiClientInquiryResp(TPeripheralInfo& aPeripheralInfo) |
sl@0 | 140 |
: iPeripheralInfo(aPeripheralInfo) |
sl@0 | 141 |
{ |
sl@0 | 142 |
} |
sl@0 | 143 |
|
sl@0 | 144 |
|
sl@0 | 145 |
/** |
sl@0 | 146 |
Constructor for SCSI PREVENT MEDIA REMOVAL request. |
sl@0 | 147 |
|
sl@0 | 148 |
@param aPrevent |
sl@0 | 149 |
*/ |
sl@0 | 150 |
inline TScsiClientPreventMediaRemovalReq::TScsiClientPreventMediaRemovalReq(TPrevent aPrevent) |
sl@0 | 151 |
: TScsiClientReq(EPreventMediaRemoval), |
sl@0 | 152 |
iPrevent(aPrevent) |
sl@0 | 153 |
{ |
sl@0 | 154 |
__MSFNSLOG |
sl@0 | 155 |
} |
sl@0 | 156 |
|
sl@0 | 157 |