Update contrib.
1 // Copyright (c) 1995-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 "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // wins\specific\pp_scdv.cpp
19 #include <mmccd_ifc.h>
21 #include <variantmediadef.h>
23 class TSDCardControllerInterfaceWins : public TMMCardControllerInterface
26 virtual DMMCSocket* NewSocket(TInt aSocketNum, TMMCPasswordStore* aPasswordStore);
27 virtual DMMCStack* NewStack(TInt aStackNum, DMMCSocket* aSocket);
28 virtual DMMCMediaChange* NewMediaChange(TInt aMcId);
29 virtual DMMCPsu* NewVcc(TInt aVccNum, TInt aMcId);
30 // Stack initialisation
32 // Machine configuration
33 virtual TBool IsMMCSocket(TInt aSocket,SMediaDeviceInfo& aMediaDeviceInfo);
34 virtual TInt MediaChangeID(TInt aSocket);
35 virtual TInt VccID(TInt aSocket);
39 TInt TSDCardControllerInterfaceWins::Init()
41 // Initialise the Controller h/w
47 TInt TSDCardControllerInterfaceWins::MediaChangeID(TInt aSocket)
49 // Return the socket's media change index
55 TInt TSDCardControllerInterfaceWins::VccID(TInt aSocket)
57 // Return the socket's PSU index
63 static const TInt DriveNumbers[MMC0_DRIVECOUNT]={MMC0_DRIVELIST};
64 _LIT(KLitMmcSocketName,MMC0_DRIVENAME);
65 TBool TSDCardControllerInterfaceWins::IsMMCSocket(TInt aSocket,SMediaDeviceInfo& aMediaDeviceInfo)
67 // Confirm whether an MMC stack is supported on the specified
68 // socket and if it is, the Media Info. for that socket.
74 aMediaDeviceInfo.iDevice=MEDIA_DEVICE_MMC;
75 aMediaDeviceInfo.iDriveCount=MMC0_DRIVECOUNT;
76 aMediaDeviceInfo.iDriveList=&DriveNumbers[0];
77 aMediaDeviceInfo.iNumMedia=MMC0_NUMMEDIA;
78 aMediaDeviceInfo.iDeviceName=&KLitMmcSocketName;
85 DMMCSocket* TSDCardControllerInterfaceWins::NewSocket(TInt aSocketNum, TMMCPasswordStore* aPasswordStore)
87 // Create a new platform-specific socket
90 return new DSDIOSocket(aSocketNum, aPasswordStore);
93 DMMCStack* TSDCardControllerInterfaceWins::NewStack(TInt aStackNum, DMMCSocket* aSocket)
95 // Create a new platform-specific stack
98 return new DWinsSDIOStack(aStackNum, aSocket);
101 DMMCMediaChange* TSDCardControllerInterfaceWins::NewMediaChange(TInt aMcId)
103 // Create a new platform-specific media change
106 return new DWinsMMCMediaChange(aMcId);
109 DMMCPsu* TSDCardControllerInterfaceWins::NewVcc(TInt aVccNum, TInt aMcId)
111 // Create a new platform-specific PSU
114 return new DWinsSDIOPsu(aVccNum, aMcId);
117 /********************************************
118 * Extension entry point
119 ********************************************/
121 DECLARE_STANDARD_EXTENSION()
123 __KTRACE_OPT(KPBUS1,Kern::Printf("Starting SD interface"));
126 TSDCardControllerInterfaceWins* pI=new TSDCardControllerInterfaceWins;
130 __KTRACE_OPT(KPBUS1,Kern::Printf("Returns %d",r));