lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091113142738.1aa81a03@s6510>
Date:	Fri, 13 Nov 2009 14:27:38 -0800
From:	Stephen Hemminger <shemminger@...tta.com>
To:	Kurt Van Dijck <kurt.van.dijck@....be>
Cc:	Oliver Hartkopp <socketcan@...tkopp.net>,
	Wolfgang Grandegger <wg@...ndegger.com>, netdev@...r.kernel.org
Subject: Re: [net-next-2.6 PATCH] allow access to sysfs_groups member

On Fri, 13 Nov 2009 11:51:57 +0100
Kurt Van Dijck <kurt.van.dijck@....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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ