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

📄 pcidp.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) 2002, Foxen Solutions
// Copyright (C) 2002, FXN
//
// All Rights Reserved.
//*****************************************************************************
//
// ----------------------------------------------------------------------------
// This is PCIDP.h.  It contains the kernel interface description a ring 3
// application uses to access the Cypress PCI-DP NT kernal-mode driver.  
//
// FOR USE WITH MICROSOFT VISUAL C++.
//
// NOTE: Best viewed with Tabs set to 2.
// ----------------------------------------------------------------------------

#ifndef _PCIDP_H
#define _PCIDP_H


// Use the device type and IO control function codes for the PCIDP00 device
// (PCI-DP CY7C09449PV-AC) located in NTCodes.h.
#include "NTCodes.h"



// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_MAP_BASE_REGS -
//
// Map to the address pointed to by one of the five Base Address Registers.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_MAP_BASE_REGS CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC1,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
typedef struct{

	unsigned long RegNumber;	// Number of the Base Address Reg.
	unsigned long Length;			// Length of the section to map

} PCIDP00_MAP_BASE_REGS_SEND, *PPCIDP00_MAP_BASE_REGS_SEND;

// Use the following structure to receive data back from the service.
typedef struct{

	unsigned long Address;	// Virtual address the caller will reference
													// to access the mapped memory space. I/O
													// address if I/O space.
	unsigned long Length;		// Length of the section actually mapped
	unsigned long IOSpace;	// 0 if memory mapped, 1 if I/O space

} PCIDP00_MAP_BASE_REGS_RECV, *PPCIDP00_MAP_BASE_REGS_RECV;


// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_UNMAP -
//
// Unmap from a previous IOCTL_PCIDP00_MAP_BASE_REGS operation.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_UNMAP CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC2,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
typedef struct{

	unsigned long VirtualAddress;	// Virtual address returned from the
																// IOCTL_PCIDP00_MAP_BASE_REGS service

} PCIDP00_UNMAP_SEND, *PPCIDP00_UNMAP_SEND;

// Use the following structure to receive data back from the service.
// NOTE -- Currently there is no data sent back.


// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_MAP_DMA_MEM -
//
// Map to the PCI-DP's DMA Memory space.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_MAP_DMA_MEM CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC3,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
// NOTE -- Currently there is no data sent.

// Use the following structure to receive data back from the service.
typedef struct{

	unsigned long LinearAddress;		// Linear address used by ring 3 application
	unsigned long PhysicalAddress;	// Physical address used to set DMAHBASE register

} PCIDP00_MAP_DMA_MEM_RECV, *PPCIDP00_MAP_DMA_MEM_RECV;


// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_UNMAP_DMA -
//
// Unmap from a previous IOCTL_PCIDP00_MAP_DMA_MEM operation.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_UNMAP_DMA CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC4,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
typedef struct{

	unsigned long LinearAddress;	// Linear address returned from the
																// IOCTL_PCIDP00_MAP_DMA_MEM service

} PCIDP00_UNMAP_DMA_SEND, *PPCIDP00_UNMAP_DMA_SEND;

// Use the following structure to receive data back from the service.
// NOTE -- Currently there is no data sent back.


// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_GET_PCI_CONFIG_REGS -
//
// Get the PCI Configuration Space for the PCI-DP device.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_GET_PCI_CONFIG_REGS CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC5,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
// NOTE -- Currently there is no data sent.

// Use the following structure to receive data back from the service.
typedef struct{

	unsigned long PCIConfigRegs[16];	// PCI Configuration Space

} PCIDP00_GET_PCI_CONFIG_REGS_RECV, *PPCIDP00_GET_PCI_CONFIG_REGS_RECV;


// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_SET_PCI_CONFIG_REGS -
//
// Set the PCI Configuration Space for the PCI-DP device.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_SET_PCI_CONFIG_REGS CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC6,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
typedef struct{

	unsigned long PCIConfigRegs[16];	// PCI Configuration Space

} PCIDP00_SET_PCI_CONFIG_REGS_SEND, *PPCIDP00_SET_PCI_CONFIG_REGS_SEND;


// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_REGISTER_INTERRUPT -
//
// Register an interrupt with the PCI-DP device.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_REGISTER_INTERRUPT CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC7,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
typedef struct {
	
	unsigned long InterruptType;		//PCI-DP board interrupt type to enable

} PCIDP00_REGISTER_INTERRUPT_SEND, *PPCIDP00_REGISTER_INTERRUPT_SEND;

// Use the following structure to receive data back from the service.
// NOTE -- Currently there is no data sent back.


// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_UNREGISTER_INTERRUPT -
//
// Unregister an interrupt with the PCI-DP device.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_UNREGISTER_INTERRUPT CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC8,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
typedef struct {
	
	unsigned long InterruptType;		//PCI-DP board interrupt type to enable

} PCIDP00_UNREGISTER_INTERRUPT_SEND, *PPCIDP00_UNREGISTER_INTERRUPT_SEND;

// Use the following structure to receive data back from the service.
// NOTE -- Currently there is no data sent back.


// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_HELLO -
//
// Used to determine if the device exists.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_HELLO CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC9,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
// NOTE -- Currently there is no data sent.

// Use the following structure to receive data back from the service.
// NOTE -- Currently there is no data sent back.


// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_GET_VERSION -
//
// Returns the current version number in the following format: YYYYMMDD.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_GET_VERSION CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC10,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
typedef struct {
	
	unsigned long Devnode;		//Board number

} PCIDP00_GET_VERSION_SEND, *PPCIDP00_GET_VERSION_SEND;

// Use the following structure to receive data back from the service.
typedef struct {
	
	unsigned long Version;		//Version number

} PCIDP00_GET_VERSION_RECV, *PPCIDP00_GET_VERSION_RECV;


// ----------------------------------------------------------------------------
// IOCTL_PCIDP00_UNMAP_DMA -
//
// Unmap from a previous IOCTL_PCIDP00_MAP_DMA_MEM operation.
// ----------------------------------------------------------------------------
#define IOCTL_PCIDP00_CANCEL_MAP_DMA CTL_CODE(\
	FILE_DEVICE_PCIDP00,\
	PCIDP00_IOCTL_FUNC11,\
	METHOD_BUFFERED,\
	FILE_ANY_ACCESS)

// Use the following structure to send data to the service.
// See PCIDP00_UNMAP_DMA_SEND.

#endif

⌨️ 快捷键说明

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