netdev
[Top] [All Lists]

Re: [PATCH] Add ability to register class interfaces for network class

To: Timo Teräs <ext-timo.teras@xxxxxxxxx>
Subject: Re: [PATCH] Add ability to register class interfaces for network class
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Wed, 27 Oct 2004 08:59:06 -0700
Cc: ext ext Christoph Hellwig <hch@xxxxxxxxxxxxx>, davem@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <417F86F8.6020004@nokia.com>
Organization: Open Source Development Lab
References: <20041026183526.GA23535@two.research.nokia.com> <20041026184838.GB16621@infradead.org> <20041026205239.GA23825@two.research.nokia.com> <20041027111317.GA27240@infradead.org> <417F86F8.6020004@nokia.com>
Sender: netdev-bounce@xxxxxxxxxxx
On Wed, 27 Oct 2004 14:31:04 +0300
Timo Teräs <ext-timo.teras@xxxxxxxxx> wrote:

> ext ext Christoph Hellwig wrote:
> >>I pointed out the reason why I need it: to add an attribute:
> >>/sys/class/net/<interface>/<new_attribute>. Others might want to do this
> >>too.
> >>
> >>Also the interface subsystem is used in many places (eg. i2o) to create
> >>all the sysfs entries. Maybe it'd be useful to do in net class as well.
> >>And if'd make separate interfaces for standard attributes and wireless
> >>attributes. That way you'd get rid of the #ifdefs of WIRELESS_EXT in
> >>net-sysfs.c.
> >>
> >>On the other hand you didn't answer my question: why the
> >>interface registration should not be possible?
> >>Documentation/driver-model/interface.txt states that this is exactly the
> >>thing it should be used for.
> > 
> > Because we don't add interfaces for the sake of it. You still haven't show
> > the user that wants this.  i you presented a sane user the review would be
> > quite different.

The Ethernet bridge code creates attribute groups in several places
without additional interfaces.  How hard is it to do:

int br_sysfs_addbr(struct net_device *dev)
{
        struct kobject *brobj = &dev->class_dev.kobj;
        struct net_bridge *br = netdev_priv(dev);
        int err;

        err = sysfs_create_group(brobj, &bridge_group);
        if (err) {
                pr_info("%s: can't create group %s/%s\n",
                        __FUNCTION__, dev->name, bridge_group.name);
                goto out1;
        }


<Prev in Thread] Current Thread [Next in Thread>