From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Fri, 24 Nov 2006 08:39:50 +0000 Subject: Re: Another udev/sysfs question. Message-Id: <20061124083950.GD14340@kroah.com> List-Id: References: <335DD0B75189FB428E5C32680089FB9F80412F@mtk-sms-mail01.digi.com> In-Reply-To: <335DD0B75189FB428E5C32680089FB9F80412F@mtk-sms-mail01.digi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Sat, Nov 18, 2006 at 08:02:53PM -0600, Kilau, Scott wrote: > Hi Greg, all,=20 >=20 > > 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=20 > > real device and not a class? >=20 >=20 > This driver I am trying to port to sysfs is "different" compared to > most serial drivers. >=20 > 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. >=20 > This driver, called RealPort, is a different beast. >=20 > Ultimately it's a serial driver, so eventually I have a bunch of ttys > that are exported to /sys/class/tty. >=20 > 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. >=20 > 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] >=20 > 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/realpo= rtX 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... >=20 > Sorry this email was so long, I just wanted to make sure I design this > correctly in the true spirit of "sysfs". >=20 > (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=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ 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