os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/protocol/include/mprotocol.h
First public contribution.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
30 Interface class to control a Mass Storage device
35 /** Command to initialise LUN */
36 virtual void InitialiseUnitL() = 0;
38 /** Command to uninitialise the LUN */
39 virtual void UninitialiseUnitL() = 0;
42 Command to read the media.
48 virtual void ReadL(TUint64 aPos, TDes8& aCopybuf, TInt aLen) = 0;
51 Command to write to the media.
57 virtual void WriteL(TUint64 aPos, TDesC8& aCopybuf, TInt aLen) = 0;
60 command to find the capacity of the media
64 virtual void GetCapacityL(TCapsInfo& aCapsInfo) = 0;
67 virtual void CreateSbcInterfaceL(TUint32 aBlockLen, TUint32 aLastLba) = 0;
69 virtual void DoScsiReadyCheckEventL() = 0;
72 Media change notification
76 virtual void NotifyChange(const RMessage2& aMessage) = 0;
79 Force notification to be sent
81 virtual void ForceCompleteNotifyChangeL() = 0;
83 Force notification to be sent
85 virtual void CancelChangeNotifierL() = 0;
87 Suspends the logical unit
89 virtual void SuspendL() = 0;
91 Resumes the logical unit
93 virtual void ResumeL() = 0;
95 Resets the media change and finalisation request status check timer
97 virtual TBool IsConnected() = 0;
100 virtual ~MProtocol();
103 inline MProtocol::~MProtocol()
108 Interface class to encode SCSI request into a byte stream
110 class MClientCommandServiceReq
114 Encode the command data into a byte stream.
116 @param aBuffer Buffer to place the encoded data into
117 @return TInt Length of the encoded data
119 virtual TInt EncodeRequestL(TDes8& aBuffer) const = 0;
124 Interface class to decode a SCSI response from byte stream into corresponding
127 class MClientCommandServiceResp
131 Returns the length of the RESPONSE data stream.
133 @return TInt Length in bytes
135 virtual TInt DataLength() const = 0;
138 Decode data into RESPONSE structure of implementation class.
140 @param aPtr Descriptor (byte stream) containing the data to be decoded
142 virtual void DecodeL(const TDesC8& aPtr) = 0;
146 #endif // MPROTOCOL_H