Commit Graph

11 Commits (d9469850ac39792abbd167c061b16e57d8f22182)

Author SHA1 Message Date
Alexander Shiyan d9469850ac Use "%u" printf-format specifier for unsigned variable
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2014-01-31 11:12:14 +01:00
Alexander Stein 94094cc4ee Use strcmp instead of sizeof on char* string
This bug was detected by the clang warning:
libsocketcan.c:384:16: warning: argument to 'sizeof' in 'strncmp' call
is the same expression as the source; did you mean to provide an
explicit length? [-Wsizeof-pointer-memaccess]
sizeof(name)) != 0)
~~~~~~~^~~~~~

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-11-28 13:11:04 +01:00
Andrew Beard 5ba2310d85 Modified do_get_nl_link to potentially process multiple netlink dump replies.
Prior to this commit, do_get_nl_link assumed there would only be a single
reply for a dump request. On my system with multiple can interfaces, this
would cause only half of them to be listed in the dump reply. This change
checks for NLMSG_DONE dump terminator and stops receiving messages once
received.

Signed-off-by: Andrew Beard <abeard@ovro.caltech.edu>
[mkl: fix indention, move variable init out of loop]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2012-08-07 09:40:50 +02:00
Kurt Van Dijck 6db5d772b4 add can_get_device_stats()
When using libsocketcan on git://git.pengutronix.de/git/tools/libsocketcan.git,
I kind of missed a method to fetch the can device statistics.
This patch adds that functionality.
I think this is the proper library to put such function.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2011-10-18 13:26:48 +02:00
Marc Kleine-Budde d99010f50b libsocketcan: remove trailing whitespace
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-10-25 13:36:49 +02:00
Luotao Fu 298e6efc3e add get error counter call
Signed-off-by: Luotao Fu <luotao@alea.(none)>
2010-02-14 18:12:01 +01:00
Luotao Fu 6f0eac7ab9 add doxygen documentation
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
2009-12-08 15:54:53 +01:00
Wolfgang Grandegger 463ac873c7 Add can_get_bittiming_const()
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Luotao Fu <l.fu@pengutronix.de>
2009-12-01 10:20:41 +01:00
Luotao Fu 96b6e75947 lindent, remove debug print
Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
2009-11-27 16:28:36 +01:00
Luotao Fu b2306d4979 splitted up set_bitrate
we now have can_set_bitrate and can_set_bitrate_samplepoint. The second is for
convenience for the developer. We tend to let the kernel use CIA recommnended
sample point value, which can_set_bitrate simply does

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
2009-11-27 13:27:11 +01:00
Luotao Fu 257877f315 rename library and API prefix
library is now called libsocketcan, API carry the prefix can_

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
2009-11-27 11:53:45 +01:00