Re: [PATCH 3/8] can: CAN Network device driver and SYSFS interface

From: Patrick McHardy
Date: Fri Feb 20 2009 - 04:45:21 EST


Wolfgang Grandegger wrote:
The CAN network device driver interface provides a generic interface to
setup, configure and monitor CAN network devices. It exports a set of
common data structures and functions, which all real CAN network device
drivers should use. Please have a look to the SJA1000 or MSCAN driver
to understand how to use them. The name of the module is can-dev.ko.

Furthermore adds a SYSFS interface to set and get CAN device properties.
When the CAN device is registered, a set of SYSFS files is created in
"/sys/class/net/canX/". These files allow to set and get device
properties like bit-timing parameters, state, controller mode and CAN
statistics.

Is sysfs really the best choice for this? It has the usual problems,
you can't change multiple parameters at once atomically. Now, I don't
know whether this is actually (and currently) a problem for CAN, but
given that we already have a generic netlink interface for creating
network interfaces that can easily support this, what are the reasons
for adding a new interface instead of using the existing one?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/