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