From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Another udev/sysfs question.
Date: Fri, 24 Nov 2006 08:39:50 +0000 [thread overview]
Message-ID: <20061124083950.GD14340@kroah.com> (raw)
In-Reply-To: <335DD0B75189FB428E5C32680089FB9F80412F@mtk-sms-mail01.digi.com>
On Sat, Nov 18, 2006 at 08:02:53PM -0600, Kilau, Scott wrote:
> Hi Greg, all,
>
> > What are you really trying to express here in sysfs? And why do you
> > need to have a new class for your device, shouldn't it be a
> > real device and not a class?
>
>
> This driver I am trying to port to sysfs is "different" compared to
> most serial drivers.
>
> In all our serial drivers, we have a PCI board, with many ports on it.
> That is obviously very easy to express is sysfs, and all those drivers
> have now been ported to use sysfs instead of proc.
>
> This driver, called RealPort, is a different beast.
>
> Ultimately it's a serial driver, so eventually I have a bunch of ttys
> that are exported to /sys/class/tty.
>
> But these serial ports doesn't have a PCI board as its parent.
> Instead, the ttys are actually located all around the
> network on embedded systems over the network, whether
> it be ethernet, wireless, cellular, etc, etc.
>
> So the tree I have is something like:
> Driver -> Network -> Embedded system out on the network somewhere ->
> serial ports.
Heh, that looks like a fun type of device :)
> The idea I wanted to do with this and sysfs, was to have a tree looking
> like:
> /sys/class/digi_realport/node[X]/tty[XYZ]
>
> In fact, I was thinking that the tty[XYZ] values would actually be
> symlinks
> pointing back up to /sys/class/tty/*, which can be done, I think?
No, don't play with classes at all here.
What you need is a real device, just hang it off of the device that you
need to.
For example, your network device could just go at:
/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.2/0000:03:0e.0/eth0/realportX
where realportX is your device.
> The trouble here is that I want to express the "Node[X]" values as a
> class.
Why?
> Its not really a device, because its not something that can be used by
> anyone...
> (ie, it is not addressable by a /dev entry or anything)
That doesn't matter, devices don't have /dev entries, classes do :)
> I currently have made it class_device with a devt of MKDEV(0,0) which is
> close
> to what I want, but it still builds a couple file entries into the
> directory
> where I really don't want anything...
>
> Sorry this email was so long, I just wanted to make sure I design this
> correctly in the true spirit of "sysfs".
>
> (Its currently using /proc, with this same tree, so I was hoping I could
> completely
> ditch using /proc from the driver...)
Yes, you don't want to use /proc for this kind of thing...
Hope this helps,
greg k-h
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CIDÞVDEV
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
prev parent reply other threads:[~2006-11-24 8:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-18 4:08 Another udev/sysfs question Kilau, Scott
2006-11-18 9:03 ` Greg KH
2006-11-19 2:02 ` Kilau, Scott
2006-11-24 8:39 ` Greg KH [this message]
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=20061124083950.GD14340@kroah.com \
--to=greg@kroah.com \
--cc=linux-hotplug@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).