Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] mac80211: use debugfs_rename
@ 2007-05-21 19:04 Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2007-05-21 19:04 UTC (permalink / raw)
  To: linux-wireless; +Cc: John Linville

Use the new debugfs_rename function in mac80211's debugfs where
necessary.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

---
debugfs_rename hasn't actually been merged yet, but I hope it will be
merged soon. URL is
http://article.gmane.org/gmane.linux.file-systems/14819

This patch should also apply against net-2.6

 net/mac80211/debugfs_netdev.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- wireless-dev.orig/net/mac80211/debugfs_netdev.c	2007-05-21 17:59:03.538418048 +0200
+++ wireless-dev/net/mac80211/debugfs_netdev.c	2007-05-21 18:03:31.768418048 +0200
@@ -398,6 +398,8 @@ static int netdev_notify(struct notifier
 {
 	struct net_device *dev = ndev;
 	char buf[10+IFNAMSIZ];
+	struct dentry *dir;
+	struct ieee80211_sub_if_data *sdata;
 
 	if (state != NETDEV_CHANGENAME)
 		return 0;
@@ -408,10 +410,12 @@ static int netdev_notify(struct notifier
 	if (dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid)
 		return 0;
 
-	/* TODO
 	sprintf(buf, "netdev:%s", dev->name);
-	debugfs_rename(IEEE80211_DEV_TO_SUB_IF(dev)->debugfsdir, buf);
-	*/
+	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	dir = sdata->debugfsdir;
+	if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf))
+		printk(KERN_ERR "mac80211: debugfs: failed to rename debugfs "
+		       "dir to %s\n", buf);
 
 	return 0;
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH] mac80211: use debugfs_rename
@ 2007-06-21 16:30 Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2007-06-21 16:30 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless


Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

---
 net/mac80211/debugfs_netdev.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

--- wireless-dev.orig/net/mac80211/debugfs_netdev.c	2007-06-13 22:45:54.798817885 +0200
+++ wireless-dev/net/mac80211/debugfs_netdev.c	2007-06-13 23:06:25.448817885 +0200
@@ -734,9 +734,9 @@ static int netdev_notify(struct notifier
 			 void *ndev)
 {
 	struct net_device *dev = ndev;
-	/* TODO
 	char buf[10+IFNAMSIZ];
-	*/
+	struct dentry *dir;
+	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
 	if (state != NETDEV_CHANGENAME)
 		return 0;
@@ -747,10 +747,12 @@ static int netdev_notify(struct notifier
 	if (dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid)
 		return 0;
 
-	/* TODO
 	sprintf(buf, "netdev:%s", dev->name);
-	debugfs_rename(IEEE80211_DEV_TO_SUB_IF(dev)->debugfsdir, buf);
-	*/
+	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	dir = sdata->debugfsdir;
+	if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf))
+		printk(KERN_ERR "mac80211: debugfs: failed to rename debugfs "
+		       "dir to %s\n", buf);
 
 	return 0;
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-22  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-21 19:04 [PATCH] mac80211: use debugfs_rename Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2007-06-21 16:30 Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox