/*
* IEEE 802.11 support (Linux-specific code)
*/
-#ifndef AUTOCONF_INCLUDED
+#if !defined(AUTOCONF_INCLUDED) && !defined(CONFIG_LOCALVERSION)
#include <linux/config.h>
#endif
#include <linux/version.h>
};
static struct attribute_group ieee80211_attr_grp = {
- .name = NULL, /* No seperate (sub-)directory */
+ .name = NULL, /* No separate (sub-)directory */
.attrs = ieee80211_sysfs_attrs
};
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) */
u_int len;
len = roundup(sizeof(struct ieee80211_frame) + pktlen, 4);
-#ifdef IEEE80211_DEBUG_REFCNT
- skb = ieee80211_dev_alloc_skb_debug(len + align - 1, func, line);
-#else
skb = ieee80211_dev_alloc_skb(len + align - 1);
-#endif
if (skb != NULL) {
u_int off = ((unsigned long) skb->data) % align;
if (off != 0)
}
+#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *proc_madwifi;
static int proc_madwifi_count = 0;
char *p = buf;
const struct ieee80211_node *ni = vap->iv_bss;
- p += sprintf(p, "vap:%p vap->iv_bss: %p\n",
- vap, ni);
- if (ni == NULL)
+ if (ni == NULL) {
+ p += sprintf(p, "ni: NULL\n");
return (p - buf);
+ }
p += sprintf(p, "ni_macaddr: " MAC_FMT "\n"
"ni_bssid: " MAC_FMT "\n"
proc_ieee80211_open(struct inode *inode, struct file *file)
{
struct proc_ieee80211_priv *pv = NULL;
- struct proc_dir_entry *dp = PDE(inode);
- struct ieee80211vap *vap = dp->data;
+ struct ieee80211vap *vap = PDE_DATA(inode);
int result;
result = proc_common_open(inode, file);
proc_doth_open(struct inode *inode, struct file *file)
{
struct proc_ieee80211_priv *pv = NULL;
- struct proc_dir_entry *dp = PDE(inode);
- struct ieee80211vap *vap = dp->data;
+ struct ieee80211vap *vap = PDE_DATA(inode);
int result;
result = proc_common_open(inode, file);
proc_doth_state_open(struct inode *inode, struct file *file)
{
struct proc_ieee80211_priv *pv = NULL;
- struct proc_dir_entry *dp = PDE(inode);
- struct ieee80211vap *vap = dp->data;
+ struct ieee80211vap *vap = PDE_DATA(inode);
int result;
result = proc_common_open(inode, file);
proc_iv_bss_open(struct inode *inode, struct file *file)
{
struct proc_ieee80211_priv *pv = NULL;
- struct proc_dir_entry *dp = PDE(inode);
- struct ieee80211vap *vap = dp->data;
+ struct ieee80211vap *vap = PDE_DATA(inode);
int result;
result = proc_common_open(inode, file);
.open = proc_iv_bss_open,
.release = proc_ieee80211_close,
};
+#endif /* CONFIG_PROC_FS */
#ifdef IEEE80211_DEBUG
static int
return ret;
}
-static const ctl_table ieee80211_sysctl_template[] = {
+static const struct ctl_table ieee80211_sysctl_template[] = {
#ifdef IEEE80211_DEBUG
- { .ctl_name = CTL_AUTO,
+ { ATH_INIT_CTL_NAME(CTL_AUTO)
.procname = "debug",
.mode = 0644,
.proc_handler = ieee80211_sysctl_debug
},
#endif
- { .ctl_name = CTL_AUTO,
+ { ATH_INIT_CTL_NAME(CTL_AUTO)
.procname = "dev_type",
.mode = 0644,
.proc_handler = ieee80211_sysctl_dev_type
},
- { .ctl_name = CTL_AUTO,
+ { ATH_INIT_CTL_NAME(CTL_AUTO)
.procname = "monitor_nods_only",
.mode = 0644,
.proc_handler = ieee80211_sysctl_monitor_nods_only
},
- { .ctl_name = CTL_AUTO,
+ { ATH_INIT_CTL_NAME(CTL_AUTO)
.procname = "monitor_txf_len",
.mode = 0644,
.proc_handler = ieee80211_sysctl_monitor_txf_len
},
- { .ctl_name = CTL_AUTO,
+ { ATH_INIT_CTL_NAME(CTL_AUTO)
.procname = "monitor_phy_errors",
.mode = 0644,
.proc_handler = ieee80211_sysctl_monitor_phy_errors
},
- { .ctl_name = CTL_AUTO,
+ { ATH_INIT_CTL_NAME(CTL_AUTO)
.procname = "monitor_crc_errors",
.mode = 0644,
.proc_handler = ieee80211_sysctl_monitor_crc_errors
},
/* NB: must be last entry before NULL */
- { .ctl_name = CTL_AUTO,
+ { ATH_INIT_CTL_NAME(CTL_AUTO)
.procname = "%parent",
.maxlen = IFNAMSIZ,
.mode = 0444,
.proc_handler = proc_dostring
},
- { 0 }
+ { }
};
void
{
int i, space;
char *devname = NULL;
- struct ieee80211_proc_entry *tmp = NULL;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
int ret;
strncpy(devname, vap->iv_dev->name, strlen(vap->iv_dev->name) + 1);
/* setup the table */
- vap->iv_sysctls[0].ctl_name = CTL_NET;
+ ATH_SET_CTL_NAME(vap->iv_sysctls[0], CTL_NET);
vap->iv_sysctls[0].procname = "net";
vap->iv_sysctls[0].mode = 0555;
vap->iv_sysctls[0].child = &vap->iv_sysctls[2];
/* [1] is NULL terminator */
- vap->iv_sysctls[2].ctl_name = CTL_AUTO;
+ ATH_SET_CTL_NAME(vap->iv_sysctls[2], CTL_AUTO);
vap->iv_sysctls[2].procname = devname; /* XXX bad idea? */
vap->iv_sysctls[2].mode = 0555;
vap->iv_sysctls[2].child = &vap->iv_sysctls[4];
vap->iv_sysctls = NULL;
}
+#ifdef CONFIG_PROC_FS
/* Ensure the base madwifi directory exists */
if (!proc_madwifi && proc_net != NULL) {
proc_madwifi = proc_mkdir("madwifi", proc_net);
/* Recreate any other proc entries that have been registered */
if (vap->iv_proc) {
- tmp = vap->iv_proc_entries;
+ struct ieee80211_proc_entry *tmp = vap->iv_proc_entries;
+
while (tmp) {
if (!tmp->entry) {
- tmp->entry = create_proc_entry(tmp->name,
- PROC_IEEE80211_PERM, vap->iv_proc);
- tmp->entry->data = vap;
- tmp->entry->proc_fops = tmp->fileops;
+ tmp->entry = proc_create_data(tmp->name,
+ PROC_IEEE80211_PERM, vap->iv_proc,
+ tmp->fileops, vap);
}
tmp = tmp->next;
}
}
+#endif /* CONFIG_PROC_FS */
}
+#ifdef CONFIG_PROC_FS
/* Frees all memory used for the list of proc entries */
void
ieee80211_proc_cleanup(struct ieee80211vap *vap)
/* Create the actual proc entry */
if (vap->iv_proc) {
- entry->entry = create_proc_entry(entry->name,
- PROC_IEEE80211_PERM, vap->iv_proc);
- entry->entry->data = vap;
- entry->entry->proc_fops = entry->fileops;
+ entry->entry = proc_create_data(entry->name,
+ PROC_IEEE80211_PERM, vap->iv_proc,
+ entry->fileops, vap);
}
/* Add it to the list */
return 0;
}
EXPORT_SYMBOL(ieee80211_proc_vcreate);
+#endif /* CONFIG_PROC_FS */
void
ieee80211_virtfs_vdetach(struct ieee80211vap *vap)
{
- struct ieee80211_proc_entry *tmp=NULL;
-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
sysfs_remove_group(&vap->iv_dev->dev.kobj, &ieee80211_attr_grp);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
vap->iv_sysctl_header = NULL;
}
+#ifdef CONFIG_PROC_FS
if (vap->iv_proc) {
/* Remove child proc entries but leave them in the list */
- tmp = vap->iv_proc_entries;
+ struct ieee80211_proc_entry *tmp = vap->iv_proc_entries;
+
while (tmp) {
if (tmp->entry) {
- remove_proc_entry(tmp->name, vap->iv_proc);
+ proc_remove(tmp->entry);
tmp->entry = NULL;
}
tmp = tmp->next;
}
- remove_proc_entry(vap->iv_proc->name, proc_madwifi);
+ proc_remove(vap->iv_proc);
if (proc_madwifi_count == 1) {
- remove_proc_entry("madwifi", proc_net);
+ proc_remove(proc_madwifi);
proc_madwifi = NULL;
}
proc_madwifi_count--;
}
+#endif /* CONFIG_PROC_FS */
if (vap->iv_sysctls && vap->iv_sysctls[2].procname) {
kfree(vap->iv_sysctls[2].procname);
ieee80211_rcv_dev_event(struct notifier_block *this, unsigned long event,
void *ptr)
{
- struct net_device *dev = (struct net_device *)ptr;
+ struct net_device *dev = netdev_notifier_info_to_dev(ptr);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
if (!dev || dev->open != &ieee80211_open)