Commit c4558a26 authored by David Howells's avatar David Howells Committed by Al Viro

rtl8187se: Use a dir under /proc/net/r8180/

Create a dir under /proc/net/r8180/ named for the device and create that
device's files under there.  This means that there won't be a problem for
multiple devices in the system (if such is possible) and it means we don't
need to save the 'device directory' PDE any more as we can just do a proc
subtree removal.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Maxim Mikityanskiy <maxtram95@gmail.com>
cc: YAMANE Toshiaki <yamanetoshi@gmail.com>
cc: linux-wireless@vger.kernel.org
cc: devel@driverdev.osuosl.org
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 270b5ac2
...@@ -372,7 +372,6 @@ typedef struct r8180_priv ...@@ -372,7 +372,6 @@ typedef struct r8180_priv
struct Stats stats; struct Stats stats;
struct _link_detect_t link_detect; //YJ,add,080828 struct _link_detect_t link_detect; //YJ,add,080828
struct iw_statistics wstats; struct iw_statistics wstats;
struct proc_dir_entry *dir_dev;
/*RX stuff*/ /*RX stuff*/
u32 *rxring; u32 *rxring;
......
...@@ -288,14 +288,7 @@ void rtl8180_proc_module_remove(void) ...@@ -288,14 +288,7 @@ void rtl8180_proc_module_remove(void)
void rtl8180_proc_remove_one(struct net_device *dev) void rtl8180_proc_remove_one(struct net_device *dev)
{ {
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); remove_proc_subtree(dev->name, rtl8180_proc);
if (priv->dir_dev) {
remove_proc_entry("stats-hw", priv->dir_dev);
remove_proc_entry("stats-tx", priv->dir_dev);
remove_proc_entry("stats-rx", priv->dir_dev);
remove_proc_entry("registers", priv->dir_dev);
priv->dir_dev = NULL;
}
} }
/* /*
...@@ -335,22 +328,19 @@ static const struct rtl8180_proc_file rtl8180_proc_files[] = { ...@@ -335,22 +328,19 @@ static const struct rtl8180_proc_file rtl8180_proc_files[] = {
void rtl8180_proc_init_one(struct net_device *dev) void rtl8180_proc_init_one(struct net_device *dev)
{ {
const struct rtl8180_proc_file *f; const struct rtl8180_proc_file *f;
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); struct proc_dir_entry *dir;
priv->dir_dev = rtl8180_proc; dir = proc_mkdir_data(dev->name, 0, rtl8180_proc, dev);
if (!priv->dir_dev) { if (!dir) {
DMESGE("Unable to initialize /proc/net/r8180/%s\n", DMESGE("Unable to initialize /proc/net/r8180/%s\n", dev->name);
dev->name);
return; return;
} }
priv->dir_dev->data = dev;
for (f = rtl8180_proc_files; f->name[0]; f++) { for (f = rtl8180_proc_files; f->name[0]; f++) {
if (!proc_create_data(f->name, S_IFREG | S_IRUGO, if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir,
priv->dir_dev,
&rtl8180_proc_fops, f->show)) { &rtl8180_proc_fops, f->show)) {
DMESGE("Unable to initialize /proc/net/r8180/%s\n", DMESGE("Unable to initialize /proc/net/r8180/%s/%s\n",
f->name); dev->name, f->name);
return; return;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment