/******************************************************************************* NAME $RCSfile: init.c,v $ SUMMARY Initial module process VERSION $Revision: 1.2 $ UPDATE DATE $Date: 2010/07/14 08:13:16 $ PROGRAMMER $Author: alan $ Copyright 2009 LSI Corporation. All Rights Reserved. DESCRIPTION: The functions used to report diagnostics status REFERENCE: *******************************************************************************/ /*** INCLUDES ***/ #include #include #include #include #include "entry.h" /******************************************************************************* * PROCEDURE * * NAME: diagInit * SUMMARY: * SCOPE: public * * DESCRIPTION: * * RETURNS: * * NOTES: * */ /*** proc_dir_entry /proc/daigTable ***/ struct proc_dir_entry *diagTableProcEntry; /*** proc_dir_entry /proc/ConfProc ***/ struct proc_dir_entry *userConfProcEntry; static const struct file_operations table_fops = { .read = diagTableEntryRead, .write = diagTableEntryWrite, }; static const struct file_operations conf_fops = { .read = userConfEntryRead, .write = userConfEntryWrite, }; /******************************************************************************* * PROCEDURE * * NAME: entry_init * SUMMARY: * SCOPE: public * * DESCRIPTION: * * RETURNS: * * NOTES: * */ static int __init entry_init(void) { diagTableProcEntry = proc_create_data("diagTable", 0644, NULL, &table_fops, NULL); if (!diagTableProcEntry){ printk("Failed to init proc diagTable entry\n"); } userConfProcEntry = proc_create_data("userConf", 0, NULL, &conf_fops, NULL); if (!userConfProcEntry){ printk("[PROC_DBG] /proc/userConfProc create ERROR!\n"); } return (0); } /******************************************************************************* * PROCEDURE * * NAME: entry_exit * SUMMARY: * SCOPE: public * * DESCRIPTION: * * RETURNS: * * NOTES: * */ static void __exit entry_exit(void) { remove_proc_entry("diagTable", NULL); remove_proc_entry("userConf", NULL); } module_init(entry_init); module_exit(entry_exit); MODULE_LICENSE("GPL");