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_cprmv.cpp
19 #include <mmccd_ifc.h>
21 #include <variantmediadef.h>
24 // Factory class for creation of platform specifics
26 class TCPRMCardControllerInterfaceWins : public TMMCardControllerInterface
29 virtual DMMCStack* NewStack(TInt aStackNum, DMMCSocket* aSocket);
30 virtual DMMCMediaChange* NewMediaChange(TInt aMcId);
31 virtual DMMCPsu* NewVcc(TInt aVccNum, TInt aMcId);
32 // Stack initialisation
34 // Machine configuration
35 virtual TBool IsMMCSocket(TInt aSocket,SMediaDeviceInfo& aMediaDeviceInfo);
36 virtual TInt MediaChangeID(TInt aSocket);
37 virtual TInt VccID(TInt aSocket);
40 TInt TCPRMCardControllerInterfaceWins::Init()
42 // Initialise the Controller h/w
48 TInt TCPRMCardControllerInterfaceWins::MediaChangeID(TInt aSocket)
50 // Return the socket's media change index
56 TInt TCPRMCardControllerInterfaceWins::VccID(TInt aSocket)
58 // Return the socket's PSU index
65 static const TInt DriveNumbers[MMC0_DRIVECOUNT]={MMC0_DRIVELIST};
66 _LIT(KLitMmcSocketName,MMC0_DRIVENAME);
67 TBool TCPRMCardControllerInterfaceWins::IsMMCSocket(TInt aSocket,SMediaDeviceInfo& aMediaDeviceInfo)
69 // Confirm whether an MMC stack is supported on the specified
70 // socket and if it is, the Media Info. for that socket.
76 aMediaDeviceInfo.iDevice=MEDIA_DEVICE_MMC;
77 aMediaDeviceInfo.iDriveCount=MMC0_DRIVECOUNT;
78 aMediaDeviceInfo.iDriveList=&DriveNumbers[0];
79 aMediaDeviceInfo.iNumMedia=MMC0_NUMMEDIA;
80 aMediaDeviceInfo.iDeviceName=&KLitMmcSocketName;
87 DMMCStack* TCPRMCardControllerInterfaceWins::NewStack(TInt aStackNum, DMMCSocket* aSocket)
89 // Create a new platform-specific stack
92 return new DWinsCPRMStack(aStackNum, aSocket);
95 DMMCMediaChange* TCPRMCardControllerInterfaceWins::NewMediaChange(TInt aMcId)
97 // Create a new platform-specific media change
100 return new DWinsMMCMediaChange(aMcId);
103 DMMCPsu* TCPRMCardControllerInterfaceWins::NewVcc(TInt aVccNum, TInt aMcId)
105 // Create a new platform-specific PSU
108 return new DWinsMMCPsu(aVccNum, aMcId);
111 DECLARE_STANDARD_EXTENSION()
113 // Extension Entry Point
116 __KTRACE_OPT(KPBUS1,Kern::Printf("Starting CPRM interface"));
119 TCPRMCardControllerInterfaceWins* pI=new TCPRMCardControllerInterfaceWins;
123 __KTRACE_OPT(KPBUS1,Kern::Printf("Returns %d",r));