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

From: Patrick McHardy <[email-masked]>
Date: Fri, 20 Feb 2009 10:44:59 +0100

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?