os/boardsupport/haitest/bspsvs/suite/bsp/mmc/ldd/inc/mmcldd.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/boardsupport/haitest/bspsvs/suite/bsp/mmc/ldd/inc/mmcldd.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,95 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef MMCLDD_H_
    1.23 +#define MMCLDD_H_
    1.24 +
    1.25 +#include <mmc.h>
    1.26 +#include "LddAsyncRequest.h"
    1.27 +
    1.28 +/**
    1.29 + * LDD factory object for MMCSD
    1.30 + *
    1.31 + */
    1.32 +class DLddFactoryMmcCntrlInterface : public DLogicalDevice
    1.33 +	{
    1.34 +public:
    1.35 +	DLddFactoryMmcCntrlInterface();
    1.36 +	virtual ~DLddFactoryMmcCntrlInterface();
    1.37 +	virtual TInt Install();
    1.38 +	virtual void GetCaps(TDes8 &aDes) const;
    1.39 +	virtual TInt Create(DLogicalChannelBase*& aChannel); 	//overriding pure virtual
    1.40 +	};
    1.41 +
    1.42 +	
    1.43 +/**
    1.44 + * MMCSD LDD logical channel
    1.45 + *
    1.46 + */
    1.47 +class DLddMmcCntrlInterface : public DLogicalChannel , MAsyncRequestObserver
    1.48 +	{
    1.49 +public:
    1.50 +	DLddMmcCntrlInterface();
    1.51 +	~DLddMmcCntrlInterface();
    1.52 +protected:
    1.53 +	virtual TInt DoCreate(TInt aUnit, const TDesC8* anInfo, const TVersion& aVer);
    1.54 +	virtual void HandleMsg(class TMessageBase *);
    1.55 +private:
    1.56 +	void DoCancel(TInt aReqNo);
    1.57 +	TInt DoControl(TInt aFunction, TAny* a1, TAny* a2);
    1.58 +	TInt MediaChangeDoControl(TInt aFunction, TAny* a1, TAny* a2);
    1.59 +	TInt PsuDoControl(TInt aFunction, TAny* a1, TAny* a2);
    1.60 +	TInt SocketDoControl(TInt aFunction, TAny* a1, TAny* a2);
    1.61 +	TInt StackDoControl(TInt aFunction, TAny* a1, TAny* a2);
    1.62 +	
    1.63 +	// async request methods
    1.64 +	TInt DoRequest(TInt aFunction, TRequestStatus* aStatus, TAny* a1, TAny* a2);
    1.65 +	TInt SocketDoRequest(TRequestStatus* aStatus, TAny* a1, TAny *a2, TInt aCommand);
    1.66 +	TInt StackConfigureEffectiveModes(TInt aEffectiveModesFunctionId, TAny* aParam);
    1.67 +
    1.68 +	// FROM MAsyncRequestObserver
    1.69 +	virtual void Notify(DLddAsyncRequest& aRequest);
    1.70 +
    1.71 +private:
    1.72 +	enum TMmcAsyncCmd {EMmcSesNone,EMmcSesReadBlk,EMmcSesWriteBlk, EMmcSesReadCSD, EMmcSesReadExtCSD, EMMcSocketPowerUp, EMMcStackPowerUp};	
    1.73 +	DMmcSessionAsyncRequest* CreateAsyncSessionRequest(TMmcAsyncCmd aCommand, TRequestStatus* aStatus);
    1.74 +	DBusEventRequest* CreateAsyncBusEventRequest(TMmcAsyncCmd aCommand, TRequestStatus* aStatus, TInt aUnit);
    1.75 +
    1.76 +	
    1.77 +	TBool RequestStatusExists(TRequestStatus* aStatus);
    1.78 +	void ClearRequest(DLddAsyncRequest* aRequest);
    1.79 +	
    1.80 +private:
    1.81 +    enum TPanic {EReadDes,EWriteDes,EWriteTInt,EUnknownMmcSes};
    1.82 +    TInt iStackNum;
    1.83 +    DMMCPsu* iPsu;
    1.84 +    DMMCMediaChange* iMediaChange;
    1.85 +  	DMMCSocket* iSocket;
    1.86 +  	DMMCStack* iStack;
    1.87 +    TMMCard* iCard;
    1.88 +
    1.89 +	DThread* iClient;
    1.90 +	TCSD iCSD;
    1.91 +	TExtendedCSD iExtendedCSD;
    1.92 +	TBool iIsSD;	
    1.93 +	RPointerArray<DLddAsyncRequest> iAsyncList;
    1.94 +	TMMCStackConfig iStackConfig;
    1.95 +	TInt			iUnit;
    1.96 +	};
    1.97 +
    1.98 +#endif /*MMCLDD_H_*/