|
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 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalTechnology |
|
19 */ |
|
20 |
|
21 #ifndef CUSBHOSTMSLOGICALUNIT_H |
|
22 #define CUSBHOSTMSLOGICALUNIT_H |
|
23 |
|
24 |
|
25 class MTransport; |
|
26 class MProtocol; |
|
27 |
|
28 /** |
|
29 This class represents a Logical Unit supporting SCSI Mass Storage Class. The |
|
30 class provides inteface methods to read, write and get the media capacity of the |
|
31 Logical Unit. Each instance is identified by the LUN. |
|
32 */ |
|
33 class CUsbHostMsLogicalUnit : public CBase |
|
34 { |
|
35 public: |
|
36 static CUsbHostMsLogicalUnit* NewL(TLun aLun); |
|
37 ~CUsbHostMsLogicalUnit(); |
|
38 private: |
|
39 void ConstructL(); |
|
40 CUsbHostMsLogicalUnit(TLun aLun); |
|
41 |
|
42 public: |
|
43 void InitL(); |
|
44 void UnInitL(); |
|
45 void ReadL(const RMessage2& aMessage); |
|
46 void WriteL(const RMessage2& aMessage); |
|
47 void EraseL(const RMessage2& aMessage); |
|
48 void CapsL(const RMessage2& aMessage); |
|
49 |
|
50 void NotifyChange(const RMessage2& aMessage); |
|
51 void ForceCompleteNotifyChangeL(); |
|
52 void CancelChangeNotifierL(); |
|
53 |
|
54 void ReadyToSuspend(); |
|
55 TBool IsConnected(); |
|
56 TBool IsReadyToSuspend(); |
|
57 void CancelReadyToSuspend(); |
|
58 |
|
59 void SuspendL(); |
|
60 void ResumeL(); |
|
61 void DoLunReadyCheckL(); |
|
62 |
|
63 TInt InitialiseProtocolL(TLun aLun, |
|
64 THostMassStorageConfig& aConfig, |
|
65 MTransport& aTransport); |
|
66 |
|
67 TLun Lun() const; |
|
68 |
|
69 private: |
|
70 TInt CheckPosition(const TReadWrite& aReadWrite); |
|
71 |
|
72 /** The Protocol interface (Owned by this class) */ |
|
73 MProtocol* iProtocol; |
|
74 /** LUN */ |
|
75 TLun iLun; |
|
76 /** The Size (updated by CapsL) */ |
|
77 TPos iSize; |
|
78 |
|
79 TBool iSuspendRequest; |
|
80 |
|
81 RBuf8 iDataBuf; |
|
82 }; |
|
83 |
|
84 |
|
85 /** |
|
86 Get the LUN |
|
87 |
|
88 @return TLun The LUN |
|
89 */ |
|
90 inline TLun CUsbHostMsLogicalUnit::Lun() const |
|
91 { |
|
92 return iLun; |
|
93 } |
|
94 |
|
95 #endif // CUSBHOSTMSLOGICALUNIT_H |
|
96 |