On Mon, Nov 09, 2009 at 12:12:51PM +0100, Oliver Hartkopp wrote: > > Kurt Van Dijck wrote: > > On Fri, Nov 06, 2009 at 04:58:52PM +0100, Oliver Hartkopp wrote: > >> Kurt, > >> > >> i wondered about the extra 'softing' directory in > >> > >> /sys/class/net/can0/device/softing > >> > >> containing sysfs entries > >> > >> firmware freq hardware license serial txpending > > txpending should go > > the others are IMO good examples of device/driver dependant properties. > >> Should this be streamlined to be used by other CAN drivers? > >> > >> While having consensus now to use sysfs for these things, we should create > >> some common definitions. > > common definitions sound good. > > It would imply you'd use common (driver-independant) udev rules, > > which implies also bus-independant rules. > > If you don't know the specific bus, it gets hard to not conflict with > > bus specific properties. > >> Do you think the directory is necessary? > > I think yes, but it may be renamed to 'id' or something. > > AFAICS there are files like vendor_id1, vendor_id2, etc. in > /sys/class/net/can0/device when you plug a PCMCIA card. > > We should probably take a closer look if other devices already expose entries > like firmware revisions or serial numbers in sysfs. I assume having firmware > revisions is not that unusual. > > If possible, i would tend to omit extra directories in the discussed > device/driver directories. > > Regards, > Oliver >
I prepared a patch, omitting 'txpending', and moving 'softing/' to 'id/'. I called the directory id, similar as the input subsystem. They (a class devices subsystem) suffer the same problem, having all kind of different things to handle. Signed-off-by: Kurt Van Dijck <[email protected]> --- kernel/2.6/drivers/net/can/softing/softing_sysfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) Index: trunk/kernel/2.6/drivers/net/can/softing/softing_sysfs.c =================================================================== --- trunk.orig/kernel/2.6/drivers/net/can/softing/softing_sysfs.c 2009-11-09 11:22:24.000000000 +0100 +++ trunk/kernel/2.6/drivers/net/can/softing/softing_sysfs.c 2009-11-09 11:24:46.000000000 +0100 @@ -81,7 +81,6 @@ CARD_SHOW(hardware , id.hw); CARD_SHOW(license , id.lic); CARD_SHOW(freq , id.freq); -CARD_SHOW(txpending , tx.pending); static const struct softing_attribute card_attr_proto[] = { declare_attr(serial , 0444, show_serial , 0), @@ -89,7 +88,6 @@ declare_attr(hardware , 0444, show_hardware , 0), declare_attr(license , 0444, show_license , 0), declare_attr(freq , 0444, show_freq , 0), - declare_attr(txpending , 0644, show_txpending , 0), }; int softing_card_sysfs_create(struct softing *card) @@ -117,7 +115,7 @@ card->attr[j].dev.attr.mode &= ~(S_IWUGO); } card->grp[size] = 0; - card->sysfs.name = "softing"; + card->sysfs.name = "id"; card->sysfs.attrs = card->grp; if (sysfs_create_group(&card->dev->kobj, &card->sysfs) < 0) goto sysfs_failed; _______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
