os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/controller/include/cusbhostmslogicalunit.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/server/controller/include/cusbhostmslogicalunit.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,98 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @internalTechnology
1.22 +*/
1.23 +
1.24 +#ifndef CUSBHOSTMSLOGICALUNIT_H
1.25 +#define CUSBHOSTMSLOGICALUNIT_H
1.26 +
1.27 +
1.28 +class MTransport;
1.29 +class MProtocol;
1.30 +class THostMassStorageConfig;
1.31 +class TReadWrite;
1.32 +
1.33 +/**
1.34 +This class represents a Logical Unit supporting SCSI Mass Storage Class. The
1.35 +class provides inteface methods to read, write and get the media capacity of the
1.36 +Logical Unit. Each instance is identified by the LUN.
1.37 +*/
1.38 +class CUsbHostMsLogicalUnit : public CBase
1.39 +{
1.40 +public:
1.41 + static CUsbHostMsLogicalUnit* NewL(TLun aLun);
1.42 + ~CUsbHostMsLogicalUnit();
1.43 +private:
1.44 + void ConstructL();
1.45 + CUsbHostMsLogicalUnit(TLun aLun);
1.46 +
1.47 +public:
1.48 + void InitL();
1.49 + void UnInitL();
1.50 + void ReadL(const RMessage2& aMessage);
1.51 + void WriteL(const RMessage2& aMessage);
1.52 + void EraseL(const RMessage2& aMessage);
1.53 + void CapsL(const RMessage2& aMessage);
1.54 +
1.55 + void NotifyChange(const RMessage2& aMessage);
1.56 + void ForceCompleteNotifyChangeL();
1.57 + void CancelChangeNotifierL();
1.58 +
1.59 + void ReadyToSuspend();
1.60 + TBool IsConnected();
1.61 + TBool IsReadyToSuspend();
1.62 + void CancelReadyToSuspend();
1.63 +
1.64 + void SuspendL();
1.65 + void ResumeL();
1.66 + void DoLunReadyCheckL();
1.67 +
1.68 + TInt InitialiseProtocolL(TLun aLun,
1.69 + THostMassStorageConfig& aConfig,
1.70 + MTransport& aTransport);
1.71 +
1.72 + TLun Lun() const;
1.73 +
1.74 +private:
1.75 + TInt CheckPosition(const TReadWrite& aReadWrite);
1.76 +
1.77 + /** The Protocol interface (Owned by this class) */
1.78 + MProtocol* iProtocol;
1.79 + /** LUN */
1.80 + TLun iLun;
1.81 + /** The Size (updated by CapsL) */
1.82 + TPos iSize;
1.83 +
1.84 + TBool iSuspendRequest;
1.85 +
1.86 + RBuf8 iDataBuf;
1.87 +};
1.88 +
1.89 +
1.90 +/**
1.91 +Get the LUN
1.92 +
1.93 +@return TLun The LUN
1.94 +*/
1.95 +inline TLun CUsbHostMsLogicalUnit::Lun() const
1.96 + {
1.97 + return iLun;
1.98 + }
1.99 +
1.100 +#endif // CUSBHOSTMSLOGICALUNIT_H
1.101 +