opl_reg_mmap.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 <opl_hw_ops.h>
#include <opl_reg_mmap.h>
| #define | OPL_REG_MAJOR 110 |
| #define | OPL_REG_DEVICE "opl_reg" |
local function declaration | |
| int | opl_reg_open (struct inode *inode, struct file *filp) |
| ssize_t | opl_reg_read (struct file *filp, char *buffer, size_t length, loff_t *offset) |
| description: | |
| ssize_t | opl_reg_write (struct file *filp, const char *buffer, size_t length, loff_t *offset) |
| int | opl_reg_mmap (struct file *file, struct vm_area_struct *vma) |
| description: memory map the ipmux register into user space to access it. | |
| int | opl_reg_release (struct inode *inode, struct file *filp) |
local variable declaration and definition | |
| u32 | opl_reg_open_count = 0 |
| u32 | opl_reg_is_open = 0 |
| file_operations | opl_reg_fops |
函数 | |
| int __init | opl_reg_init (void) |
| description: The driver module entry.to register the chrdev and request irq. | |
| void __exit | opl_reg_exit (void) |
| description: it is called when the module removed. | |
| module_init (opl_reg_init) | |
| module_exit (opl_reg_exit) | |
| MODULE_LICENSE ("GPL2") | |
| MODULE_AUTHOR ("stephanxu <[email protected]>") | |
| MODULE_DESCRIPTION ("dedicated the module for mmap the opulan switch chip register.") | |
Generated at Mon Jul 30 16:43:48 2007 for IPMUX1IPMUX2IPMUX3 by
1.3.9.1