Resend of patch to remove /proc/iee80211 and just use
/sys/module/iee80211/parameter/debug instead. It is simpler
and cleaner.
Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Index: netdev-2.6/include/net/ieee80211.h
===================================================================
--- netdev-2.6.orig/include/net/ieee80211.h
+++ netdev-2.6/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, \
Index: netdev-2.6/net/ieee80211/ieee80211_module.c
===================================================================
--- netdev-2.6.orig/net/ieee80211/ieee80211_module.c
+++ netdev-2.6/net/ieee80211/ieee80211_module.c
@@ -60,6 +60,14 @@ MODULE_LICENSE("GPL");
#define DRV_NAME "ieee80211"
+#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
+
static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee)
{
if (ieee->networks)
@@ -180,93 +188,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];
-
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