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 CUSBHOSTMSLOGICALUNIT_H sl@0: #define CUSBHOSTMSLOGICALUNIT_H sl@0: sl@0: sl@0: class MTransport; sl@0: class MProtocol; sl@0: class THostMassStorageConfig; sl@0: class TReadWrite; sl@0: sl@0: /** sl@0: This class represents a Logical Unit supporting SCSI Mass Storage Class. The sl@0: class provides inteface methods to read, write and get the media capacity of the sl@0: Logical Unit. Each instance is identified by the LUN. sl@0: */ sl@0: class CUsbHostMsLogicalUnit : public CBase sl@0: { sl@0: public: sl@0: static CUsbHostMsLogicalUnit* NewL(TLun aLun); sl@0: ~CUsbHostMsLogicalUnit(); sl@0: private: sl@0: void ConstructL(); sl@0: CUsbHostMsLogicalUnit(TLun aLun); sl@0: sl@0: public: sl@0: void InitL(); sl@0: void UnInitL(); sl@0: void ReadL(const RMessage2& aMessage); sl@0: void WriteL(const RMessage2& aMessage); sl@0: void EraseL(const RMessage2& aMessage); sl@0: void CapsL(const RMessage2& aMessage); sl@0: sl@0: void NotifyChange(const RMessage2& aMessage); sl@0: void ForceCompleteNotifyChangeL(); sl@0: void CancelChangeNotifierL(); sl@0: sl@0: void ReadyToSuspend(); sl@0: TBool IsConnected(); sl@0: TBool IsReadyToSuspend(); sl@0: void CancelReadyToSuspend(); sl@0: sl@0: void SuspendL(); sl@0: void ResumeL(); sl@0: void DoLunReadyCheckL(); sl@0: sl@0: TInt InitialiseProtocolL(TLun aLun, sl@0: THostMassStorageConfig& aConfig, sl@0: MTransport& aTransport); sl@0: sl@0: TLun Lun() const; sl@0: sl@0: private: sl@0: TInt CheckPosition(const TReadWrite& aReadWrite); sl@0: sl@0: /** The Protocol interface (Owned by this class) */ sl@0: MProtocol* iProtocol; sl@0: /** LUN */ sl@0: TLun iLun; sl@0: /** The Size (updated by CapsL) */ sl@0: TPos iSize; sl@0: sl@0: TBool iSuspendRequest; sl@0: sl@0: RBuf8 iDataBuf; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Get the LUN sl@0: sl@0: @return TLun The LUN sl@0: */ sl@0: inline TLun CUsbHostMsLogicalUnit::Lun() const sl@0: { sl@0: return iLun; sl@0: } sl@0: sl@0: #endif // CUSBHOSTMSLOGICALUNIT_H sl@0: