|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MMCLDD_H_ |
|
20 #define MMCLDD_H_ |
|
21 |
|
22 #include <mmc.h> |
|
23 #include "LddAsyncRequest.h" |
|
24 |
|
25 /** |
|
26 * LDD factory object for MMCSD |
|
27 * |
|
28 */ |
|
29 class DLddFactoryMmcCntrlInterface : public DLogicalDevice |
|
30 { |
|
31 public: |
|
32 DLddFactoryMmcCntrlInterface(); |
|
33 virtual ~DLddFactoryMmcCntrlInterface(); |
|
34 virtual TInt Install(); |
|
35 virtual void GetCaps(TDes8 &aDes) const; |
|
36 virtual TInt Create(DLogicalChannelBase*& aChannel); //overriding pure virtual |
|
37 }; |
|
38 |
|
39 |
|
40 /** |
|
41 * MMCSD LDD logical channel |
|
42 * |
|
43 */ |
|
44 class DLddMmcCntrlInterface : public DLogicalChannel , MAsyncRequestObserver |
|
45 { |
|
46 public: |
|
47 DLddMmcCntrlInterface(); |
|
48 ~DLddMmcCntrlInterface(); |
|
49 protected: |
|
50 virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer); |
|
51 virtual void HandleMsg(class TMessageBase *); |
|
52 private: |
|
53 void DoCancel(TInt aReqNo); |
|
54 TInt DoControl(TInt aFunction, TAny* a1, TAny* a2); |
|
55 TInt MediaChangeDoControl(TInt aFunction, TAny* a1, TAny* a2); |
|
56 TInt PsuDoControl(TInt aFunction, TAny* a1, TAny* a2); |
|
57 TInt SocketDoControl(TInt aFunction, TAny* a1, TAny* a2); |
|
58 TInt StackDoControl(TInt aFunction, TAny* a1, TAny* a2); |
|
59 |
|
60 // async request methods |
|
61 TInt DoRequest(TInt aFunction, TRequestStatus* aStatus, TAny* a1, TAny* a2); |
|
62 TInt SocketDoRequest(TRequestStatus* aStatus, TAny* a1, TAny *a2, TInt aCommand); |
|
63 TInt StackConfigureEffectiveModes(TInt aEffectiveModesFunctionId, TAny* aParam); |
|
64 |
|
65 // FROM MAsyncRequestObserver |
|
66 virtual void Notify(DLddAsyncRequest& aRequest); |
|
67 |
|
68 private: |
|
69 enum TMmcAsyncCmd {EMmcSesNone,EMmcSesReadBlk,EMmcSesWriteBlk, EMmcSesReadCSD, EMmcSesReadExtCSD, EMMcSocketPowerUp, EMMcStackPowerUp}; |
|
70 DMmcSessionAsyncRequest* CreateAsyncSessionRequest(TMmcAsyncCmd aCommand, TRequestStatus* aStatus); |
|
71 DBusEventRequest* CreateAsyncBusEventRequest(TMmcAsyncCmd aCommand, TRequestStatus* aStatus, TInt aUnit); |
|
72 |
|
73 |
|
74 TBool RequestStatusExists(TRequestStatus* aStatus); |
|
75 void ClearRequest(DLddAsyncRequest* aRequest); |
|
76 |
|
77 private: |
|
78 enum TPanic {EReadDes,EWriteDes,EWriteTInt,EUnknownMmcSes}; |
|
79 TInt iStackNum; |
|
80 DMMCPsu* iPsu; |
|
81 DMMCMediaChange* iMediaChange; |
|
82 DMMCSocket* iSocket; |
|
83 DMMCStack* iStack; |
|
84 TMMCard* iCard; |
|
85 |
|
86 DThread* iClient; |
|
87 TCSD iCSD; |
|
88 TExtendedCSD iExtendedCSD; |
|
89 TBool iIsSD; |
|
90 RPointerArray<DLddAsyncRequest> iAsyncList; |
|
91 TMMCStackConfig iStackConfig; |
|
92 TInt iUnit; |
|
93 }; |
|
94 |
|
95 #endif /*MMCLDD_H_*/ |