~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/net/irda/irproc.c

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*********************************************************************
  2  *                
  3  * Filename:      irproc.c
  4  * Version:       1.0
  5  * Description:   Various entries in the /proc file system
  6  * Status:        Experimental.
  7  * Author:        Thomas Davis, <ratbert@radiks.net>
  8  * Created at:    Sat Feb 21 21:33:24 1998
  9  * Modified at:   Sun Nov 14 08:54:54 1999
 10  * Modified by:   Dag Brattli <dagb@cs.uit.no>
 11  *
 12  *     Copyright (c) 1998-1999, Dag Brattli <dagb@cs.uit.no>
 13  *     Copyright (c) 1998, Thomas Davis, <ratbert@radiks.net>, 
 14  *     All Rights Reserved.
 15  *      
 16  *     This program is free software; you can redistribute it and/or 
 17  *     modify it under the terms of the GNU General Public License as 
 18  *     published by the Free Software Foundation; either version 2 of 
 19  *     the License, or (at your option) any later version.
 20  *  
 21  *     I, Thomas Davis, provide no warranty for any of this software. 
 22  *     This material is provided "AS-IS" and at no charge. 
 23  *     
 24  ********************************************************************/
 25 
 26 #include <linux/miscdevice.h>
 27 #include <linux/proc_fs.h>
 28 #define __NO_VERSION__
 29 #include <linux/module.h>
 30 
 31 #include <net/irda/irda.h>
 32 #include <net/irda/irmod.h>
 33 #include <net/irda/irlap.h>
 34 #include <net/irda/irlmp.h>
 35 
 36 extern int irlap_proc_read(char *buf, char **start, off_t offset, int len);
 37 extern int irlmp_proc_read(char *buf, char **start, off_t offset, int len);
 38 extern int irttp_proc_read(char *buf, char **start, off_t offset, int len);
 39 extern int irias_proc_read(char *buf, char **start, off_t offset, int len);
 40 extern int discovery_proc_read(char *buf, char **start, off_t offset, int len);
 41 
 42 struct irda_entry {
 43         char *name;
 44         int (*fn)(char*, char**, off_t, int);
 45 };
 46 
 47 struct proc_dir_entry *proc_irda;
 48  
 49 static struct irda_entry dir[] = {
 50         {"discovery",   discovery_proc_read},
 51         {"irttp",       irttp_proc_read},
 52         {"irlmp",       irlmp_proc_read},
 53         {"irlap",       irlap_proc_read},
 54         {"irias",       irias_proc_read},
 55 };
 56 
 57 #define IRDA_ENTRIES_NUM (sizeof(dir)/sizeof(dir[0]))
 58  
 59 /*
 60  * Function irda_proc_register (void)
 61  *
 62  *    Register irda entry in /proc file system
 63  *
 64  */
 65 void irda_proc_register(void) 
 66 {
 67         int i;
 68 
 69         proc_irda = proc_mkdir("net/irda", NULL);
 70         proc_irda->owner = THIS_MODULE;
 71 
 72         for (i=0;i<IRDA_ENTRIES_NUM;i++)
 73                 create_proc_info_entry(dir[i].name,0,proc_irda,dir[i].fn);
 74 }
 75 
 76 /*
 77  * Function irda_proc_unregister (void)
 78  *
 79  *    Unregister irda entry in /proc file system
 80  *
 81  */
 82 void irda_proc_unregister(void) 
 83 {
 84         int i;
 85 
 86         for (i=0;i<IRDA_ENTRIES_NUM;i++)
 87                 remove_proc_entry(dir[i].name, proc_irda);
 88 
 89         remove_proc_entry("net/irda", NULL);
 90 }
 91 
 92 
 93 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.