netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Kurt Van Dijck <kurt.van.dijck@eia.be>
Cc: Oliver Hartkopp <socketcan@hartkopp.net>,
	Wolfgang Grandegger <wg@grandegger.com>,
	netdev@vger.kernel.org
Subject: Re: [net-next-2.6 PATCH] allow access to sysfs_groups member
Date: Fri, 13 Nov 2009 14:27:38 -0800	[thread overview]
Message-ID: <20091113142738.1aa81a03@s6510> (raw)
In-Reply-To: <20091113105157.GA322@e-circ.dyndns.org>

On Fri, 13 Nov 2009 11:51:57 +0100
Kurt Van Dijck <kurt.van.dijck@eia.be> wrote:

> +/* Add a sysfs group to the netdev groups */
> +int netdev_sysfs_add_group(struct net_device *net,
> +		struct attribute_group *grp)
> +{
> +	struct attribute_group **groups = net->sysfs_groups;
> +	struct attribute_group **end;
> +
> +	/* end pointer, with room for null terminator */
> +	end = &net->sysfs_groups[ARRAY_SIZE(net->sysfs_groups) - 1];
> +	for (; groups < end; ++groups) {
> +		if (!*groups) {
> +			*groups = grp;
> +			return 0;
> +		}
> +	}
> +	return -ENOSPC;
> +}
> +EXPORT_SYMBOL(netdev_sysfs_add_group);

EXPORT_SYMBOL_GPL() for all device/sysfs related stuff.

Also, need some way to BUG() if this is done after device has
been registered.  

Another way to add sub-directories which is what bridge, bonding,
and others do is to use another kobject. I think this is what you
want for the case of two CAN objects under one netdevice.

  reply	other threads:[~2009-11-13 22:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-13 10:51 [net-next-2.6 PATCH] allow access to sysfs_groups member Kurt Van Dijck
2009-11-13 22:27 ` Stephen Hemminger [this message]
2009-11-14 16:54   ` [net-next-2.6 PATCH v2] " Kurt Van Dijck
2009-11-16 16:46     ` Stephen Hemminger
2009-11-17 16:21       ` Kurt Van Dijck
2009-11-18 15:43       ` Kurt Van Dijck
2009-11-18 16:08         ` David Miller
2009-11-18 16:41           ` Kurt Van Dijck
2009-11-18 17:57             ` David Miller
2009-11-18 20:57               ` Kurt Van Dijck
2009-11-18 20:59               ` Kurt Van Dijck
2009-11-18 21:08                 ` David Miller
2009-11-18 21:42                   ` Kurt Van Dijck
2009-11-20  1:11                     ` Eric W. Biederman
2009-11-20 10:21                       ` Kurt Van Dijck
2009-11-20 16:32                         ` Eric W. Biederman
2009-11-21 11:47                           ` Kurt Van Dijck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091113142738.1aa81a03@s6510 \
    --to=shemminger@vyatta.com \
    --cc=kurt.van.dijck@eia.be \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan@hartkopp.net \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).