Skip to content

Commit

Permalink
net: Allow devices to specify a device specific sysfs group.
Browse files Browse the repository at this point in the history
This isn't beautifully abstracted, but it is simple,
simplifies uses and so far is only needed for the bonding driver.

Signed-off-by: Eric W. Biederman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Eric W. Biederman authored and davem330 committed Oct 30, 2009
1 parent 0bd8d53 commit 0c509a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,8 @@ struct net_device

/* class/net/name entry */
struct device dev;
/* space for optional statistics and wireless sysfs groups */
const struct attribute_group *sysfs_groups[3];
/* space for optional device, statistics, and wireless sysfs groups */
const struct attribute_group *sysfs_groups[4];

/* rtnetlink link ops */
const struct rtnl_link_ops *rtnl_link_ops;
Expand Down
5 changes: 4 additions & 1 deletion net/core/net-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,11 @@ int netdev_register_kobject(struct net_device *net)
dev_set_name(dev, "%s", net->name);

#ifdef CONFIG_SYSFS
*groups++ = &netstat_group;
/* Allow for a device specific group */
if (*groups)
groups++;

*groups++ = &netstat_group;
#ifdef CONFIG_WIRELESS_EXT_SYSFS
if (net->ieee80211_ptr)
*groups++ = &wireless_group;
Expand Down

0 comments on commit 0c509a6

Please sign in to comment.