netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, johannes@sipsolutions.net
Subject: Re: [PATCH] net: Add DEVTYPE support for Ethernet based devices
Date: Fri, 4 Sep 2009 21:49:03 -0700	[thread overview]
Message-ID: <20090904214903.49e5a361@nehalam> (raw)
In-Reply-To: <1251788899-30156-1-git-send-email-marcel@holtmann.org>

On Tue,  1 Sep 2009 00:08:19 -0700
Marcel Holtmann <marcel@holtmann.org> wrote:

> The Ethernet framing is used for a lot of devices these days. Most
> prominent are WiFi and WiMAX based devices. However for userspace
> application it is important to classify these devices correctly and
> not only see them as Ethernet devices. The daemons like HAL, DeviceKit
> or even NetworkManager with udev support tries to do the classification
> in userspace with a lot trickery and extra system calls. This is not
> good and actually reaches its limitations. Especially since the kernel
> does know the type of the Ethernet device it is pretty stupid.
> 
> To solve this problem the underlying device type needs to be set and
> then the value will be exported as DEVTYPE via uevents and available
> within udev.
> 
>   # cat /sys/class/net/wlan0/uevent
>   DEVTYPE=wlan
>   INTERFACE=wlan0
>   IFINDEX=5
> 

The problem with your idea is that there is only a nebulous definition of
what is a Wifi device, and what is a WiMAX device etc.  What userspace should be looking
for is "does device XXX support API yyy?" and if it supports API
yyy then I it can be configured that way. 

There already is some information in sysfs like /sys/class/net/XXX/type
which gives the hardware type (ARPHRD_ETHER, etc).  Why not a better version
of something like this that provides "can do FOO" interface?

Doing a several system calls (open/read/close) per device is not a big
issue. Even an android phone can do open/read/close in less than a millisecond
I bet.


  parent reply	other threads:[~2009-09-05  4:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01  7:08 [PATCH] net: Add DEVTYPE support for Ethernet based devices Marcel Holtmann
2009-09-01  7:25 ` Johannes Berg
2009-09-01  7:33   ` Marcel Holtmann
2009-09-05  0:17 ` Marcel Holtmann
2009-09-05  3:27   ` David Miller
2009-09-05  4:34     ` Marcel Holtmann
2009-09-05  4:46       ` David Miller
2009-09-05  5:52         ` Marcel Holtmann
2009-09-05  5:55           ` David Miller
2009-09-05  4:49 ` Stephen Hemminger [this message]
2009-09-05  5:55   ` Marcel Holtmann
2009-09-11 19:37 ` David Miller

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=20090904214903.49e5a361@nehalam \
    --to=shemminger@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    /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).