📄 pcmciasock.h
字号:
/*
*
* Copyright (C) 2003-2004, MOTOROLA, INC. All Rights Reserved
* THIS SOURCE CODE IS CONFIDENTIAL AND PROPRIETARY AND MAY NOT
* BE USED OR DISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF
* MOTOROLA, INC.
*
* Copyright (C) 2004-2006, Freescale Semiconductor, Inc. All Rights Reserved.
* THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
* AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT
*
*/
#ifndef __PCMCIASOCK_H_
#define __PCMCIASOCK_H_
/*+Public include files******************************************************
Include any files to export any inherited data type *necessary* needed by
client to use the services of this module. Files which are included for
internal use within this module should be done in a later section, and should
*not* be exported un-necessarily.
**************************************************************************-*/
#include <windows.h>
#include <types.h>
#include <socksv2.h>
#include <memory.h>
#include <ceddk.h>
#include <debug.h>
#include "pcmciabridge.h"
#include "pcmciasock.h"
#include "pcmciawin.h"
#include "socket.h"
#include "pddmain.h"
#include "csp.h"
/*+Public Macro definitions**************************************************
Define all public macros or macros to be used only within the module for
bootstapping the definitions of other items
**************************************************************************-*/
#define NUM_POWER_ENTRIES 4
/*+Public Type definitions***************************************************
Define all types which will be exported from this module. Type definitions
to be used within the module should be defined in the later section.
**************************************************************************-*/
class CPcmciaSocket;
class CPcmciaBusBridge;
class CPcmciaMemWindows;
class CPcmciaIoWindows;
class CPcmciaSocket : public CPCMCIASocketBase<CPcmciaMemWindows, CPcmciaIoWindows, CStaticWindowBridgeContainer<CPcmciaBusBridge>, CPcmciaBusBridge>
{
public:
CPcmciaSocket( CPcmciaBusBridge* pBriedge);
~CPcmciaSocket();
virtual void SocketEventHandle( DWORD dwEvent, DWORD dwPresentStateReg ); // Event Handle from Interrupt.
virtual STATUS CardGetSocket( PSS_SOCKET_STATE pState );
virtual STATUS CardSetSocket( PSS_SOCKET_STATE pState );
virtual STATUS CardResetSocket();
virtual STATUS CardInquireSocket( PSS_SOCKET_INFO pSocketInfo );
virtual STATUS GetPowerEntry( PDWORD pdwNumOfEnery,
PSS_POWER_ENTRY pPowerEntry );
virtual STATUS CardAccessMemory( PSS_MEMORY_ACCESS /*pMemoryAccess*/ )
{
DEBUGCHK( FALSE );
return CERR_UNSUPPORTED_SERVICE;
}
HANDLE GetSocketHandle()
{
return ( HANDLE ) m_dwSocketIndex;
};
private:
static const SS_POWER_ENTRY m_rgPowerEntries[NUM_POWER_ENTRIES];
static const SS_SOCKET_STATE ms_SocketInitState;
static const SS_SOCKET_INFO ms_SocketInitInfo;
static DWORD ms_dwSocketLastIndex;
SS_SOCKET_STATE m_SocketState;
SS_SOCKET_INFO m_SocketInfo;
DWORD m_dwSocketIndex;
void PowerMgrCallback( BOOL bPowerOff );
void PowerOnProcedure( UINT8 fVcc );
void PowerCycleEvent();
void CardInjectEvent();
};
/*+Local include files*******************************************************
Include all files that will be used only within this module here.
**************************************************************************-*/
#ifdef __PCMCIASOCK_CPP__
/*-------------------------- Local context - START ---------------------------*/
#define VISIBLE /* Mark as LOCAL context */
/*+Local Macro definitions***************************************************
Define all macros that will only be used within the module here.
**************************************************************************-*/
#define PCMCIA_VCC_DEFAULT_INDEX 2
/*+Local function prototypes*************************************************
Declare all proto-types for functions/procedures only used within the module.
**************************************************************************-*/
/*+Local data declarations***************************************************
Define all data objects that will used within the module here.
**************************************************************************-*/
const SS_SOCKET_INFO CPcmciaSocket::ms_SocketInitInfo =
{
SOCK_CAP_IO_MEMORY_CARD, // Socket Interrupt Capability Set follow bitmap.
SOCK_CAP_PWRCYCLE |
SOCK_CAP_BVD1|
SOCK_CAP_BVD2|
SOCK_CAP_CD |
SOCK_CAP_WP , // Socket Interrupt Capability Set follow bitmap.
0, // Socket status report capability
0, // Socket status indicate capability
4, // Number of power entry this socket have.
5, // Number of Window supported in this Socket.
Internal, // CardBus Bus Type is Internal.
( DWORD ) -1, // CardBus Card Number.
{ - 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}
};
const SS_SOCKET_STATE CPcmciaSocket::ms_SocketInitState =
{
SOCK_EVENT_PWRCYCLE |
SOCK_EVENT_BVD1|
SOCK_EVENT_BVD2|
SOCK_EVENT_CD|
SOCK_EVENT_WP, // dwEventMask - PC Card event that will generate the callback function
0, // dwEventChanged - PC Card event that has occured
0, // dwEventStatus - Current event status
CFG_IFACE_MEMORY, // dwInterfaceType - Interface type
0, // dwInterruptStatus - Interrupt status
0, // fIREQRouting - IRQ routing value
0, // fVcc - Vcc power index and value
0, // Vpp1 - Vpp1 power entry index
0 // Vpp2 - Vpp2 power entry index
};
const SS_POWER_ENTRY CPcmciaSocket::m_rgPowerEntries[NUM_POWER_ENTRIES] =
{
{ 0, PWR_SUPPLY_VCC | PWR_SUPPLY_VPP1 | PWR_SUPPLY_VPP2 },
{ 33, PWR_SUPPLY_VCC | PWR_SUPPLY_VPP1 | PWR_SUPPLY_VPP2 },
{ 50, PWR_SUPPLY_VCC | PWR_SUPPLY_VPP1 | PWR_SUPPLY_VPP2 },
{ 120, PWR_SUPPLY_VPP1 | PWR_SUPPLY_VPP2 }
};
DWORD CPcmciaSocket::ms_dwSocketLastIndex = 1;
/*-------------------------- Local context - END ---------------------------*/
#else // !__PCMCIASOCK_CPP__
#define VISIBLE extern /* Mark as GLOBAL context */
#endif //__PCMCIASOCK_CPP__
/*------------------------- Global context - START -------------------------*/
/*+Public data declarations**************************************************
Define all data objects that will be exported here.
**************************************************************************-*/
/*+Public function prototypes************************************************
Define all proto-types for public functions/procedures here.
**************************************************************************-*/
/*-------------------------- Global context - END --------------------------*/
#undef VISIBLE
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -