Messages in this thread | | | Date | Wed, 7 Jul 2004 14:47:31 -0700 | From | Greg KH <> | Subject | Re: Creation of driver-specific sysfs attributes |
| |
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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |