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

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

Version: ~ [ linux-6.4-rc3 ] ~ [ linux-6.3.4 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.30 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.113 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.180 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.243 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.283 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.315 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
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 #include <linux/seq_file.h>
 29 #include <linux/module.h>
 30 #include <linux/init.h>
 31 
 32 #include <net/irda/irda.h>
 33 #include <net/irda/irlap.h>
 34 #include <net/irda/irlmp.h>
 35 
 36 extern struct file_operations discovery_seq_fops;
 37 extern struct file_operations irlap_seq_fops;
 38 extern struct file_operations irlmp_seq_fops;
 39 extern struct file_operations irttp_seq_fops;
 40 extern struct file_operations irias_seq_fops;
 41 
 42 struct irda_entry {
 43         const char *name;
 44         struct file_operations *fops;
 45 };
 46 
 47 struct proc_dir_entry *proc_irda;
 48  
 49 static struct irda_entry irda_dirs[] = {
 50         {"discovery",   &discovery_seq_fops},
 51         {"irttp",       &irttp_seq_fops},
 52         {"irlmp",       &irlmp_seq_fops},
 53         {"irlap",       &irlap_seq_fops},
 54         {"irias",       &irias_seq_fops},
 55 };
 56 
 57 /*
 58  * Function irda_proc_register (void)
 59  *
 60  *    Register irda entry in /proc file system
 61  *
 62  */
 63 void __init irda_proc_register(void) 
 64 {
 65         int i;
 66         struct proc_dir_entry *d;
 67 
 68         proc_irda = proc_mkdir("irda", proc_net);
 69         if (proc_irda == NULL)
 70                 return;
 71         proc_irda->owner = THIS_MODULE;
 72 
 73         for (i=0; i<ARRAY_SIZE(irda_dirs); i++) {
 74                 d = create_proc_entry(irda_dirs[i].name, 0, proc_irda);
 75                 if (d) 
 76                         d->proc_fops = irda_dirs[i].fops;
 77         }
 78 }
 79 
 80 /*
 81  * Function irda_proc_unregister (void)
 82  *
 83  *    Unregister irda entry in /proc file system
 84  *
 85  */
 86 void __exit irda_proc_unregister(void) 
 87 {
 88         int i;
 89 
 90         if (proc_irda) {
 91                 for (i=0; i<ARRAY_SIZE(irda_dirs); i++)
 92                         remove_proc_entry(irda_dirs[i].name, proc_irda);
 93 
 94                 remove_proc_entry("irda", proc_net);
 95                 proc_irda = NULL;
 96         }
 97 }
 98 
 99 
100 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp