kernel/eka/include/drivers/rpmbdevice.h
changeset 287 ddfd5aa0d58f
equal deleted inserted replaced
286:48e57fb1237e 287:ddfd5aa0d58f
       
     1 // Copyright (c) 1994-2010 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 // eka\include\drivers\rpmb\rpmbdevice.h
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalTechnology
       
    19 */
       
    20 
       
    21 
       
    22 #include <drivers/mmc.h>
       
    23 #include <e32cmn.h>
       
    24 
       
    25 const TUint KBusNumber = 0;
       
    26 const TUint KDeviceAddress = 0; //Address on card is not applicable to RPMB. This is handled on media device.
       
    27 const TUint8 KIndexNotAssigned = 0xFF;
       
    28 
       
    29 class DRpmbDevice : public DBase
       
    30     {
       
    31    public:
       
    32     
       
    33     IMPORT_C DRpmbDevice();
       
    34     IMPORT_C ~DRpmbDevice();
       
    35     IMPORT_C TInt Open(TUint aDeviceIndex);
       
    36     IMPORT_C TInt SendAccessRequest(TDes8 &aRpmbRequest, TDes8 &aRpmbResponse);
       
    37     IMPORT_C void Close();
       
    38         
       
    39    private:
       
    40    
       
    41     static void SessionEndCallBack(TAny* aSelf);
       
    42     static void BusCallBack(TAny* aPtr, TInt aReason, TAny* a1, TAny* a2);
       
    43     void DoSessionEndCallBack();
       
    44     TInt PowerUpStack();
       
    45 	void SetSynchronisationParms(TUint8 aDeviceIndex);
       
    46 	void ClearSynchronisationParms();
       
    47     
       
    48     DSemaphore* iPowerUpSemaphore;
       
    49 	DSemaphore* iRequestSemaphore;
       
    50 	NFastMutex iSynchronisationParmsMutex;
       
    51 
       
    52 	DMMCSession* iSession;
       
    53     TMMCard* iCard;
       
    54     DMMCSocket* iSocket;
       
    55 
       
    56 	TPBusCallBack iBusCallBack;     
       
    57 	TMMCCallBack iSessionEndCallBack;
       
    58 
       
    59 	TUint8* iIntBuf;	
       
    60 
       
    61 	TUint8 iDeviceIndex;
       
    62 	static DRpmbDevice* DRpmbDevicePtrs[KMaxPBusSockets*4];
       
    63 	
       
    64 	TUint8 iSpare[10]; //for future use
       
    65     
       
    66     };