* Re: Another udev/sysfs question.
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
2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2006-11-18 9:03 UTC (permalink / raw)
To: linux-hotplug
On Fri, Nov 17, 2006 at 10:08:38PM -0600, Kilau, Scott wrote:
> Hi everyone,
>
> This is really just a sysfs question.
> Not sure if both udev and sysfs questions are dealt with on this list.
>
> I have a different driver that I am working on now, and porting it to
> use sysfs as well.
>
> This driver is a "virtual" driver, it doesn't control a board, like on
> a PCI bus, ISA bus, etc, etc.
>
> I create a "class" for this driver, so it will hang out in /sys/class
> I have gotten my files made in there, so that's working fine.
>
> Is there a way to create a subdirectory inside of the directory that
> I made in /sys/class ?
>
> For example, I have /sys/class/digi_realport as the "base" class.
>
> I would like to hang off subdirectories in there that describe the
> "virtual" nodes for the driver, for example:
> /sys/class/digi_realport/node1 and /sys/class/digi_realport/node2, etc,
> etc.
>
> Is this possible to do?
"possible" yes. Should you do it? No.
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?
If it's a device, you can easily create children of that device using
the driver model.
thanks,
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Another udev/sysfs question.
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
2 siblings, 0 replies; 4+ messages in thread
From: Kilau, Scott @ 2006-11-19 2:02 UTC (permalink / raw)
To: linux-hotplug
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.
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?
The trouble here is that I want to express the "Node[X]" values as a
class.
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)
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...)
Thanks!
Scott Kilau
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Another udev/sysfs question.
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
2 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2006-11-24 8:39 UTC (permalink / raw)
To: linux-hotplug
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
^ permalink raw reply [flat|nested] 4+ messages in thread