⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcidpinc.h

📁 一个amccs5933芯片的驱动程序开发源程序和部分文档
💻 H
字号:
//*****************************************************************************
// THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 
// OR IMPLIED. THIS CODE IS LABELED "OPEN SOFTWARE" AND MAY BE FREELY USED, 
// REPRODUCED, MODIFIED, AND/OR REDISTRIBUTED WITH THE STIPULATION THAT THIS 
// NOTICE REMAIN INTACT. REDISTRIBUTION OF ANY KIND IMPLIES THAT ALL
// MODIFICATIONS FALL UNDER THIS "OPEN SOFTWARE" LABEL.
//
// Copyright (C) 2000, Foxen Solutions
// Copyright (C) 2000, FXN
//
// All Rights Reserved.
//*****************************************************************************
//
// ----------------------------------------------------------------------------
// This is PCIDPinc.h.  It is the include file for PCIDP.c.
// ----------------------------------------------------------------------------


#ifndef _PCIDP_INC
#define _PCIDP_INC

// Treat this code as C, not C++, so the assembly PCIDP.asm module doesn't 
// have to deal with decorated names.
//extern "C"{

#include <basedef.h>
#include <vmm.h>
#include <debug.h>
#include <vxdwraps.h>
#include <winerror.h>
#include "configmg.h"
#include "ndis.h"
#include "vpicd.h"
#include "vwin32.h"

// Define PCIDP card attributes
#define MemoryBaseSize 0x8000
#define DMASize 0x4000

// Define PCIDP card register offset.
#define HINT 0x139

// Define interrupt types and bit masks.
#define PCIMasterAbort 0x200
#define PCITargetAbort 0x100
#define I2OOutboundPostFIFONotEmpty 0x80
#define DMAComplete 0x20
#define LocalToHostExternalSignal 0x10
#define LocalToHostMailbox 8
#define I2OPCIFIFOOverflow 2

#define InterruptQueSize 16
#define BoardLimit 8

// Define linked list services constants.
#define LL_NEW 0
#define LL_ACQUIRED 1
#define LL_INSERTED 2
#define LL_AVAILABLE 3
#define LL_CHECKEDOUT 4

// Define any structures, variables, etc.
typedef struct {
  ULONG Type;
	ULONG Event;
} REGISTERED_INTERRUPT, *pREGISTERED_INTERRUPT;

typedef struct _LINKED_LIST{
  struct _LINKED_LIST* Next;
  struct _LINKED_LIST* Prev;
  UCHAR Status;
  REGISTERED_INTERRUPT RegisteredInterrupt;
} LINKED_LIST, *pLINKED_LIST;

typedef struct {
  UCHAR QueNext;
  UCHAR QueNew;
  ULONG Type[InterruptQueSize];
} INTERRUPT_DATA, *pINTERRUPT_DATA;

typedef struct {
  BOOL IsEmpty;
  USHORT InsertedCount;
  USHORT FreeMax;
  pLINKED_LIST CurrentLink;
} LL_DATA, *pLL_DATA;

typedef struct{

  ULONG Devnode;
  ULONG BaseAddresses[6];
  ULONG* MemoryBase;
  ULONG IOBase;
  ULONG InterruptObject;
  INTERRUPT_DATA InterruptData;
  LL_DATA LLData;
	ULONG PhysicalDMAAddress;

} PCIDP_EXTENSION, *pPCIDP_EXTENSION;

#ifndef _DECLARE_GLOBALS_
extern pPCIDP_EXTENSION ObjExt[BoardLimit+1];
#else
pPCIDP_EXTENSION ObjExt[BoardLimit+1] = {0};
#endif

extern DWORD PCIDPISR();				//assembly wrapper for PCIDPISR_C
extern DWORD PCIDPForDpcIsr();	//assembly wrapper for PCIDPForDpcIsr_C

// VxD VMM wrappers
//extern ULONG PageReserveW(ULONG, ULONG, ULONG);
//extern ULONG PageCommitPhysW(ULONG, ULONG, ULONG, ULONG);
//extern ULONG PageCommitContigW(ULONG, ULONG, ULONG, ULONG, ULONG, ULONG);
extern ULONG VWIN32_CloseVxdHandle(ULONG);
extern ULONG VWIN32_Set32Event(ULONG);
extern void MessageBox(char*);
extern void DWORD_to_ASCII_Hex(DWORD, char*);

// Declare the prototypes for the routines that make up this driver.

// Public (System - Plug 'n Play)
unsigned long DeviceIocontrol(PDIOCPARAMETERS Params);

unsigned long PnPNewDevice(
	unsigned long Devnode,
	unsigned long LoadType
);

CONFIGRET CM_HANDLER PnPHandler(
	CONFIGFUNC cfFuncName, 
	SUBCONFIGFUNC scfSubFuncName, 
	DEVNODE dnToDevNode, 
	DWORD dwRefData, 
	ULONG ulFlags
);

CONFIGRET PnPStart(DEVNODE Devnode);
CONFIGRET PnPStop(DEVNODE Devnode);

unsigned long PCIDPISR_C(
	unsigned long IRQHandle,
	unsigned long HWRefData
);

void PCIDPForDpcIsr_C(unsigned long HWRefData);

int FindIndex(DEVNODE Devnode);


// Public
unsigned long PCIDPMapBaseRegs(PDIOCPARAMETERS Params);
unsigned long PCIDPUnMap(PDIOCPARAMETERS Params);
unsigned long PCIDPMapDMAMem(PDIOCPARAMETERS Params);
unsigned long PCIDPUnMapDMA(PDIOCPARAMETERS Params);
unsigned long PCIDPGetPCIRegs(PDIOCPARAMETERS Params);
unsigned long PCIDPSetPCIRegs(PDIOCPARAMETERS Params);
unsigned long PCIDPRegisterInterrupt(PDIOCPARAMETERS Params);
unsigned long PCIDPUnregisterInterrupt(PDIOCPARAMETERS Params);


// Protected
BOOLEAN GetNextEntry(
  pPCIDP_EXTENSION ObjExt,
  pLINKED_LIST* FirstLink,
  pLINKED_LIST* CurrentLink,
  pREGISTERED_INTERRUPT* Entry
);

BOOLEAN PutBackEntry(
  pPCIDP_EXTENSION ObjExt, 
  pLINKED_LIST CurrentLink
);

BOOLEAN FreeEntry(
  IN pPCIDP_EXTENSION ObjExt, 
  pLINKED_LIST CurrentLink
);

pLINKED_LIST GetFreeEntry(IN pPCIDP_EXTENSION ObjExt);

BOOLEAN InsertEntry(
  IN pPCIDP_EXTENSION ObjExt, 
  IN pLINKED_LIST Entry
);

BOOLEAN DeleteAllEntries(IN pPCIDP_EXTENSION ObjExt);


//}	//end extern "C"

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -