mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Timo Teräs" <ext-timo.teras@nokia.com>
To: ext Greg KH <greg@kroah.com>
Cc: Robert Love <rml@novell.com>, linux-kernel@vger.kernel.org
Subject: Re: kobject events questions
Date: Wed, 06 Oct 2004 13:39:32 +0300	[thread overview]
Message-ID: <4163CB64.1050000@nokia.com> (raw)
In-Reply-To: <20041001192238.GA24404@kroah.com>


[-- Attachment #1.1: Type: text/plain, Size: 969 bytes --]

ext Greg KH wrote:
> That's the point.  It should "be difficult" in that you need to present
> a valid reason to the whole kernel community as to why a new event needs
> to be added.  But if you make a point that others agree with, then there
> should be no problem in adding it.

Ok. Now that I can implement my iptables plugin I need either:

1) A new event: something like "went idle". Which would be sent from the 
class_device kobject of related network interface.

or

2) I could use the class interface system to add an kobject (instead of 
writing a new class) for each network devices class_device. But to 
accomplish this I have to be able to register interfaces with net_class 
defined net-sysfs.c. See applied patch. It's provides similar functions 
as scsi layer (see scsi_register_interface).

Which one would be better choice? At least the option #2 is general 
purpose and some others might find it useful too. To whom/where I should 
send it?

- Timo


[-- Attachment #1.2: netdev_interface.diff --]
[-- Type: text/plain, Size: 1061 bytes --]

Index: linux/net/core/net-sysfs.c
===================================================================
--- linux.orig/net/core/net-sysfs.c	2004-09-27 18:27:16.000000000 +0300
+++ linux/net/core/net-sysfs.c	2004-10-06 13:22:07.347392792 +0300
@@ -448,3 +448,11 @@
 {
 	return class_register(&net_class);
 }
+
+int netdev_register_interface(struct class_interface *intf)
+{
+	intf->class = &net_class;
+	return class_interface_register(intf);
+}
+
+EXPORT_SYMBOL_GPL(netdev_register_interface);
Index: linux/include/linux/netdevice.h
===================================================================
--- linux.orig/include/linux/netdevice.h	2004-09-27 18:27:54.000000000 +0300
+++ linux/include/linux/netdevice.h	2004-10-06 13:29:51.031902032 +0300
@@ -953,6 +953,12 @@
 extern char *net_sysctl_strdup(const char *s);
 #endif
 
+#ifdef CONFIG_SYSFS
+extern int netdev_register_interface(struct class_interface *intf);
+#define netdev_unregister_interface(intf) \
+	class_interface_unregister(intf)
+#endif
+
 #endif /* __KERNEL__ */
 
 #endif	/* _LINUX_DEV_H */

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

  reply	other threads:[~2004-10-06 10:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-29 13:37 Timo Teräs
2004-09-29 19:39 ` Robert Love
2004-10-01  9:51   ` Timo Teräs
2004-10-01 16:47     ` Greg KH
2004-10-01 18:47       ` Teras Timo (EXT-YomiGroup/Helsinki)
2004-10-01 19:22         ` Greg KH
2004-10-06 10:39           ` Timo Teräs [this message]
2004-09-29 23:35 ` Greg KH

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=4163CB64.1050000@nokia.com \
    --to=ext-timo.teras@nokia.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@novell.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

Powered by JetHome