The ieee80211 code sets up a /proc entry just do deal with
changing the debug level. There is already a nicer interface
to do that via /sys/module/ieee80211/parameters/debug and that
should be used instead.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

---

 include/net/ieee80211.h          |    2 -
 net/ieee80211/ieee80211_module.c |   99 +++-----------------------------------
 2 files changed, 10 insertions(+), 91 deletions(-)

diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -121,7 +121,7 @@ struct ieee80211_hdr_3addr {
 /* debug macros */
 
 #ifdef CONFIG_IEEE80211_DEBUG
-extern u32 ieee80211_debug_level;
+extern unsigned int ieee80211_debug_level;
 #define IEEE80211_DEBUG(level, fmt, args...) \
 do { if (ieee80211_debug_level & (level)) \
   printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -40,7 +40,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/netdevice.h>
-#include <linux/proc_fs.h>
 #include <linux/skbuff.h>
 #include <linux/slab.h>
 #include <linux/tcp.h>
@@ -57,6 +56,15 @@ MODULE_DESCRIPTION("802.11 data/manageme
 MODULE_AUTHOR("Copyright (C) 2004 Intel Corporation <[EMAIL PROTECTED]>");
 MODULE_LICENSE("GPL");
 
+#ifdef CONFIG_IEEE80211_DEBUG
+unsigned int ieee80211_debug_level = 0;
+
+#include <linux/moduleparam.h>
+module_param_named(debug, ieee80211_debug_level, uint, 0644);
+MODULE_PARM_DESC(debug, "debug output mask");
+#endif
+
+
 #define DRV_NAME "ieee80211"
 
 static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee)
@@ -181,95 +189,6 @@ void free_ieee80211(struct net_device *d
        free_netdev(dev);
 }
 
-#ifdef CONFIG_IEEE80211_DEBUG
-
-static int debug = 0;
-u32 ieee80211_debug_level = 0;
-struct proc_dir_entry *ieee80211_proc = NULL;
-
-static int show_debug_level(char *page, char **start, off_t offset,
-                           int count, int *eof, void *data)
-{
-       return snprintf(page, count, "0x%08X\n", ieee80211_debug_level);
-}
-
-static int store_debug_level(struct file *file, const char __user *buffer,
-                            unsigned long count, void *data)
-{
-       char buf[] = "0x00000000";
-       char *p = (char *)buf;
-       unsigned long val;
-
-       if (count > sizeof(buf) - 1)
-               count = sizeof(buf) - 1;
-
-       if (copy_from_user(buf, buffer, count))
-               return count;
-       buf[count] = 0;
-       /*
-        * what a FPOS...  What, sscanf(buf, "%i", &val) would be too
-        * scary?
-        */
-       if (p[1] == 'x' || p[1] == 'X' || p[0] == 'x' || p[0] == 'X') {
-               p++;
-               if (p[0] == 'x' || p[0] == 'X')
-                       p++;
-               val = simple_strtoul(p, &p, 16);
-       } else
-               val = simple_strtoul(p, &p, 10);
-       if (p == buf)
-               printk(KERN_INFO DRV_NAME
-                      ": %s is not in hex or decimal form.\n", buf);
-       else
-               ieee80211_debug_level = val;
-
-       return strlen(buf);
-}
-
-static int __init ieee80211_init(void)
-{
-       struct proc_dir_entry *e;
-
-       ieee80211_debug_level = debug;
-       ieee80211_proc = create_proc_entry(DRV_NAME, S_IFDIR, proc_net);
-       if (ieee80211_proc == NULL) {
-               IEEE80211_ERROR("Unable to create " DRV_NAME
-                               " proc directory\n");
-               return -EIO;
-       }
-       e = create_proc_entry("debug_level", S_IFREG | S_IRUGO | S_IWUSR,
-                             ieee80211_proc);
-       if (!e) {
-               remove_proc_entry(DRV_NAME, proc_net);
-               ieee80211_proc = NULL;
-               return -EIO;
-       }
-       e->read_proc = show_debug_level;
-       e->write_proc = store_debug_level;
-       e->data = NULL;
-
-       return 0;
-}
-
-static void __exit ieee80211_exit(void)
-{
-       if (ieee80211_proc) {
-               remove_proc_entry("debug_level", ieee80211_proc);
-               remove_proc_entry(DRV_NAME, proc_net);
-               ieee80211_proc = NULL;
-       }
-}
-
-#include <linux/moduleparam.h>
-module_param(debug, int, 0444);
-MODULE_PARM_DESC(debug, "debug output mask");
-
-
-module_exit(ieee80211_exit);
-module_init(ieee80211_init);
-#endif
-
-
 const char *escape_essid(const char *essid, u8 essid_len) {
        static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
        const char *s = essid;
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to