* Creation of driver-specific sysfs attributes
@ 2004-07-07 15:21 Marcelo Tosatti
2004-07-07 21:47 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Tosatti @ 2004-07-07 15:21 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel
Hi Greg, others,
Hope this is not a FAQ.
I want to export some read-only attributes (statistics) from cyclades.c char
driver to userspace via sysfs.
I can't figure out the right place to do it - I could create a class under
/sys/class/cyclades for example, but that doesnt sound right since this
is not a "class" of device, but a device itself.
Hooking the statistics into /sys/class/tty/ttyC$/ sounds reasonable, but
its not possible it seems because "tty" is a class_simple class, which only implements
the "dev" attribute.
What is the appropriate place for such driver-specific attributes?
TIA
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Creation of driver-specific sysfs attributes
2004-07-07 15:21 Creation of driver-specific sysfs attributes Marcelo Tosatti
@ 2004-07-07 21:47 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-07-07 21:47 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: linux-kernel
On Wed, Jul 07, 2004 at 12:21:06PM -0300, Marcelo Tosatti wrote:
> Hi Greg, others,
>
> Hope this is not a FAQ.
>
> I want to export some read-only attributes (statistics) from cyclades.c char
> driver to userspace via sysfs.
>
> I can't figure out the right place to do it - I could create a class under
> /sys/class/cyclades for example, but that doesnt sound right since this
> is not a "class" of device, but a device itself.
For a driver only attribute, you want them to show up in the place for
the driver (like under /sys/bus/pci/driver/MY_FOO_DRIVER/). To do that
use the DRIVER_ATTR() and the driver_add_file() functions. For
examples, see the other drivers that use these functions.
Hope this helps,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-07-07 21:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-07 15:21 Creation of driver-specific sysfs attributes Marcelo Tosatti
2004-07-07 21:47 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox