IPMUX1IPMUX2IPMUX3: opl_minte.c文件参考

RTL96xx (RTL9607,...)

opl_minte.c文件参考

#include <linux/init.h> #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <opl_minte.h>
#include <ipmux_interrupt.h>

浏览该文件的源代码。

#define OPL_MINTE_MAJOR   120
#define OPL_MINTE_DEVICE   "opl_minte"

the variable and function imported.

u32 get_irq_pending (void)
void clear_irq_pending (void)
void ipmux_irq_enable (unsigned int irq)
void ipmux_irq_disable (unsigned int irq)

local function declaration

int opl_minte_open (struct inode *inode, struct file *filp)
ssize_t opl_minte_read (struct file *filp, char *buffer, size_t length, loff_t *offset)
 description: copy the opl_chip_irq_pending(indicate which interrupt occured) to user App, which will handle its interrupt.if the no irq pending occured,the process will sleep until the isr wake up it.
ssize_t opl_minte_write (struct file *filp, const char *buffer, size_t length, loff_t *offset)
 description: because the enable irq or disable irq will be in atomic mode,so it should be operated in kernel mode is correct.
int opl_minte_release (struct inode *inode, struct file *filp)

the global variable declaration and definition.

u32 g_opl_chip_irq_event = 0
wait_queue_head_t g_opl_chip_waitq

local variable declaration and definition

u32 opl_minte_open_count = 0
u32 opl_minte_is_open = 0
file_operations opl_minte_fops

函数

int __init opl_minte_init (void)
 description: The driver module entry.to register the chrdev and request irq.
void __exit opl_minte_exit (void)
 description: it is called when the module removed.
 module_init (opl_minte_init)
 module_exit (opl_minte_exit)
 MODULE_LICENSE ("GPL2")
 MODULE_AUTHOR ("stephanxu <[email protected]>")
 MODULE_DESCRIPTION ("control interface for opulan ipmux-e switch chip")

Generated at Mon Jul 30 16:43:48 2007 for IPMUX1IPMUX2IPMUX3 by  doxygen 1.3.9.1