userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/tscsiprimarycmds.inl
changeset 297 b2826f67641f
parent 0 a41df078684a
equal deleted inserted replaced
296:94f2adf59133 297:b2826f67641f
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 // scsiprimarycommands.inl
    14 // scsiprimarycommands.inl
    15 // 
    15 //
    16 //
    16 //
    17 
    17 
    18 /**
    18 /**
    19  @file
    19  @file
    20  @internalTechnology
    20  @internalTechnology
    22 
    22 
    23 /** Constructor for TEST UNIT READY request */
    23 /** Constructor for TEST UNIT READY request */
    24 inline TScsiClientTestUnitReadyReq::TScsiClientTestUnitReadyReq()
    24 inline TScsiClientTestUnitReadyReq::TScsiClientTestUnitReadyReq()
    25 :   TScsiClientReq(ETestUnitReady)
    25 :   TScsiClientReq(ETestUnitReady)
    26     {
    26     {
    27     __MSFNSLOG
       
    28     }
    27     }
    29 
    28 
    30 
    29 
    31 /** constructor for SCSI REQUEST SENSE request */
    30 /** constructor for SCSI REQUEST SENSE request */
    32 inline TScsiClientRequestSenseReq::TScsiClientRequestSenseReq()
    31 inline TScsiClientRequestSenseReq::TScsiClientRequestSenseReq()
    33 :   TScsiClientReq(ERequestSense),
    32 :   TScsiClientReq(ERequestSense),
    34     iAllocationLength(KResponseLength)
    33     iAllocationLength(KResponseLength)
    35     {
    34     {
    36     __MSFNSLOG
       
    37     }
    35     }
    38 
    36 
    39 
    37 
    40 /**
    38 /**
    41 Set SCSI ALLOCATION LENGTH value.
    39 Set SCSI ALLOCATION LENGTH value.
    42 
    40 
    43 @param aAllocationLength
    41 @param aAllocationLength
    44 */
    42 */
    45 inline void TScsiClientRequestSenseReq::SetAllocationLength(TAllocationLength aAllocationLength)
    43 inline void TScsiClientRequestSenseReq::SetAllocationLength(TAllocationLength aAllocationLength)
    46     {
    44     {
    47     __MSFNSLOG
       
    48     iAllocationLength = aAllocationLength;
    45     iAllocationLength = aAllocationLength;
    49     }
    46     }
    50 
    47 
    51 
    48 
    52 inline TInt TScsiClientRequestSenseReq::EncodeRequestL(TDes8& aBuffer) const
    49 inline TInt TScsiClientRequestSenseReq::EncodeRequestL(TDes8& aBuffer) const
    53     {
    50     {
    54     __MSFNSLOG
       
    55     __SCSIPRINT(_L("<-- SCSI REQUEST SENSE"));
       
    56     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
    51     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
    57 
    52 
    58     aBuffer[4] = iAllocationLength;
    53     aBuffer[4] = iAllocationLength;
    59     return length;
    54     return length;
    60     }
    55     }
    65 :   TScsiClientReq(EInquiry),
    60 :   TScsiClientReq(EInquiry),
    66     iCmdDt(EFalse),
    61     iCmdDt(EFalse),
    67     iEvpd(EFalse),
    62     iEvpd(EFalse),
    68     iAllocationLength(KResponseLength)
    63     iAllocationLength(KResponseLength)
    69     {
    64     {
    70     __MSFNSLOG
       
    71     }
    65     }
    72 
    66 
    73 
    67 
    74 /**
    68 /**
    75 Set SCSI ALLOCATION LENGTH value.
    69 Set SCSI ALLOCATION LENGTH value.
    76 
    70 
    77 @param aAllocationLength
    71 @param aAllocationLength
    78 */
    72 */
    79 inline void TScsiClientInquiryReq::SetAllocationLength(TAllocationLength aAllocationLength)
    73 inline void TScsiClientInquiryReq::SetAllocationLength(TAllocationLength aAllocationLength)
    80     {
    74     {
    81     __MSFNSLOG
       
    82     iAllocationLength = aAllocationLength;
    75     iAllocationLength = aAllocationLength;
    83     }
    76     }
    84 
    77 
    85 
    78 
    86 /**
    79 /**
    88 
    81 
    89 @param aPageCode SCSI PAGE CODE value
    82 @param aPageCode SCSI PAGE CODE value
    90 */
    83 */
    91 inline void TScsiClientInquiryReq::SetEvpd(TUint8 aPageCode)
    84 inline void TScsiClientInquiryReq::SetEvpd(TUint8 aPageCode)
    92     {
    85     {
    93     __MSFNSLOG
       
    94     iEvpd = ETrue;
    86     iEvpd = ETrue;
    95     iPage = aPageCode;
    87     iPage = aPageCode;
    96     }
    88     }
    97 
    89 
    98 
    90 
   101 
    93 
   102 @param aOperationCode SCSI OPERATION CODE value
    94 @param aOperationCode SCSI OPERATION CODE value
   103 */
    95 */
   104 inline void TScsiClientInquiryReq::SetCmdDt(TUint8 aOperationCode)
    96 inline void TScsiClientInquiryReq::SetCmdDt(TUint8 aOperationCode)
   105     {
    97     {
   106     __MSFNSLOG
       
   107     iCmdDt = ETrue;
    98     iCmdDt = ETrue;
   108     iPage = aOperationCode;
    99     iPage = aOperationCode;
   109     }
   100     }
   110 
   101 
   111 
   102 
   112 inline TInt TScsiClientInquiryReq::EncodeRequestL(TDes8& aBuffer) const
   103 inline TInt TScsiClientInquiryReq::EncodeRequestL(TDes8& aBuffer) const
   113     {
   104     {
   114     __MSFNSLOG
       
   115     __SCSIPRINT(_L("<-- SCSI INQUIRY"));
       
   116     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
   105     TInt length = TScsiClientReq::EncodeRequestL(aBuffer);
   117 
   106 
   118     if (iEvpd)
   107     if (iEvpd)
   119         {
   108         {
   120         aBuffer[1] |= 0x01;
   109         aBuffer[1] |= 0x01;
   149 */
   138 */
   150 inline TScsiClientPreventMediaRemovalReq::TScsiClientPreventMediaRemovalReq(TPrevent aPrevent)
   139 inline TScsiClientPreventMediaRemovalReq::TScsiClientPreventMediaRemovalReq(TPrevent aPrevent)
   151 :   TScsiClientReq(EPreventMediaRemoval),
   140 :   TScsiClientReq(EPreventMediaRemoval),
   152     iPrevent(aPrevent)
   141     iPrevent(aPrevent)
   153     {
   142     {
   154     __MSFNSLOG
       
   155     }
   143     }
   156 
   144 
   157 
   145