0
|
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 CUSBHOSTMSDEVICE_H
|
|
22 |
#define CUSBHOSTMSDEVICE_H
|
|
23 |
|
|
24 |
#include "tlogicalunitlist.h"
|
|
25 |
|
|
26 |
class MTransport;
|
|
27 |
class CUsbMsIfaceSuspendResume;
|
|
28 |
class TLogicalUnitList;
|
|
29 |
|
|
30 |
class CUsbHostMsDevice : public CBase
|
|
31 |
{
|
|
32 |
public:
|
|
33 |
enum TDeviceState
|
|
34 |
{
|
|
35 |
EActive,
|
|
36 |
ESuspended,
|
|
37 |
};
|
|
38 |
|
|
39 |
static CUsbHostMsDevice* NewL(THostMassStorageConfig& aConfig);
|
|
40 |
~CUsbHostMsDevice();
|
|
41 |
void InitialiseL(const RMessage2& aMessage);
|
|
42 |
void UnInitialiseL();
|
|
43 |
|
|
44 |
TInt AddLunL(TLun aLun);
|
|
45 |
void RemoveLunL(TLun aLun);
|
|
46 |
TLun GetAndSetLunL(const RMessage2& aMessage);
|
|
47 |
CUsbHostMsLogicalUnit& GetLuL(TInt aLunNum) const;
|
|
48 |
|
|
49 |
void SetLunL(TLun aLun);
|
|
50 |
void SetMaxLun(TLun aMaxLun);
|
|
51 |
TLun GetMaxLun() const;
|
|
52 |
|
|
53 |
TBool IsActive();
|
|
54 |
TBool IsSuspended();
|
|
55 |
void InitLunL(TLun aLun);
|
|
56 |
|
|
57 |
void SuspendLunL(TLun aLun);
|
|
58 |
void ResumeL(TRequestStatus &aStatus);
|
|
59 |
void ResumeLogicalUnitsL();
|
|
60 |
void ResumeCompletedL();
|
|
61 |
|
|
62 |
void DoHandleRemoteWakeupL();
|
|
63 |
void DoLunReadyCheckEventL();
|
|
64 |
void DoResumeLogicalUnitsL();
|
|
65 |
|
|
66 |
private:
|
|
67 |
void ConstructL();
|
|
68 |
CUsbHostMsDevice(THostMassStorageConfig& aConfig);
|
|
69 |
MTransport* InitialiseTransportL(TTransportType aTransportId);
|
|
70 |
void StartTimer();
|
|
71 |
void StopTimer();
|
|
72 |
static TInt TimerCallback(TAny* obj);
|
|
73 |
|
|
74 |
private:
|
|
75 |
MTransport* iTransport;
|
|
76 |
TLun iMaxLun;
|
|
77 |
TLogicalUnitList iLuList;
|
|
78 |
THostMassStorageConfig iConfig;
|
|
79 |
CUsbMsIfaceSuspendResume* iDeviceSuspendResume;
|
|
80 |
TDeviceState iState;
|
|
81 |
/** The polling interval time as set by the MM - passed as part of THostMassStorageConfig */
|
|
82 |
TUint8 iStatusPollingInterval;
|
|
83 |
/** An active object which triggers periodic check. */
|
|
84 |
CPeriodic* iTimer;
|
|
85 |
/** The Timer status */
|
|
86 |
TBool iTimerRunning;
|
|
87 |
};
|
|
88 |
|
|
89 |
|
|
90 |
inline TLun CUsbHostMsDevice::GetMaxLun() const
|
|
91 |
{
|
|
92 |
return iMaxLun;
|
|
93 |
}
|
|
94 |
|
|
95 |
#endif // CUSBHOSTMSDEVICE_H
|
|
96 |
|