📄 dm6430driver.h
字号:
/* FILE NAME: dm6430driver.h FILE DESCRIPTION: This header file contains driver definitions PROJECT NAME: Linux DM6430 Driver, Library, and Example Programs PROJECT VERSION: (Defined in README.TXT) Copyright 2004 RTD Embedded Technologies, Inc. All Rights Reserved.*/#ifndef __dm6430driver_h__#define __dm6430driver_h__#if (KERNEL_VERSION(2, 4, 0) > LINUX_VERSION_CODE)#include <asm/spinlock.h>#else#include <linux/spinlock.h>#endif#include <asm/byteorder.h>#include <asm/atomic.h>/* * Number of interrupt circuits on the board */#define DM6430HR_IRQS 2/* * Number of DMA circuits on the board */#define DM6430HR_DMAS 2/* * Define a type to be used for kernel driver interrupt handler */typedef void(*isr_handler)(int, void *, struct pt_regs *);/*******************************************************************************Flags which indicate what debugging information is printed when kernel driveris built with -DDEBUG. The "debug=" argument on the insmod command controlsthe information output.*******************************************************************************/enum DBG_FLAGS { /* * Print debugging information about driver module load/unload */ DBG_LOAD = 0x00001, /* * Print debugging information about device registration/unregistration */ DBG_REG_DEVS = 0x00002, /* * Print debugging information about close(), ioctl(), and open() * operations on device files */ DBG_FILEOPS = 0x00004, /* * Print debugging information about ioctl() operations on device files */ DBG_IOCTLS = 0x00008, /* * Print debugging information about reads/writes to board I/O space */ DBG_DEV = 0x00010, /* * Print debugging information about interrupts */ DBG_INT = 0x00020};/* * Length of board's I/O space in bytes */#define DM6430HR_IO_EXTENT 32/*******************************************************************************Device flags*******************************************************************************/enum FLAGS { /* * Indicate that a particular device has been initialized */ INITIALIZED = 0x01};/*******************************************************************************Kernel driver callback information structure. A callback is used to notify auser application that an interrupt has occurred. The callback is implementedvia sending a signal to the user application.*******************************************************************************/struct Callback_t { /* * Address of kernel's process descriptor for execution entity wanting to * be notified */ struct task_struct* process; /* * Signal to be sent to process wanting notification */ int signo; /* * Pointer to user level signal handler context */ void * context;};/*******************************************************************************DMA buffer descriptor structure*******************************************************************************/struct dm_dma_buf { /* * Address of DMA buffer */ char * addr; /* * Length of DMA buffer in bytes */ size_t length;};/*******************************************************************************Driver DM6430 device structure*******************************************************************************/struct Dm6430hrDevice{ /* * Base I/O address of device */ int io; /* * IRQ number assigned to each interrupt circuit */ int irq[DM6430HR_IRQS]; /* * DMA channel number assigned to each DMA circuit */ int dma[DM6430HR_DMAS]; /* * DMA buffer descriptor for each DMA circuit */ struct dm_dma_buf dmabuf[DM6430HR_DMAS]; /* * Number of interrupts occurring on each interrupt circuit */ unsigned long irq_count[DM6430HR_IRQS]; /* * Number of entities having a device file open */ atomic_t counter; /* * Device access serialization spin lock */ spinlock_t lock; /* * Driver callback descriptor for each interrupt circuit */ struct Callback_t callback[DM6430HR_IRQS]; /* * Device flags */ long flags; /* * Temporary register storage */ unsigned short Control_Register, Trigger_Register, IRQ_Register, DIN_Register; /* * Pointer to read buffer used in streaming input from A/D FIFO or * digital FIFO. This is allocated in dm6430hr_register_device() and * freed in dm6430hr_unregister_device(). */ void *stream_buff_p;};#endif /* __dm6430driver_h__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -