409c188c | 27-Jul-2022 |
Vincent Mailhol <mailhol.vincent@wanadoo.fr> |
can: tree-wide: advertise software timestamping capabilities
Currently, some CAN drivers support hardware timestamping, some do not. But userland has no method to query which features are supported
can: tree-wide: advertise software timestamping capabilities
Currently, some CAN drivers support hardware timestamping, some do not. But userland has no method to query which features are supported (aside maybe of getting RX messages and observe whether or not hardware timestamps stay at zero).
The canonical way for a network driver to advertised what kind of timestamping it supports is to implement ethtool_ops::get_ts_info().
This patch only targets the CAN drivers which *do not* support hardware timestamping. For each of those CAN drivers, implement the get_ts_info() using the generic ethtool_op_get_ts_info().
This way, userland can do:
| $ ethtool --show-time-stamping canX
to confirm the device timestamping capacities.
N.B. the drivers which support hardware timestamping will be migrated in separate patches.
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20220727101641.198847-6-mailhol.vincent@wanadoo.fr [mkl: mscan: add missing mscan_ethtool_ops] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
6153a7ea | 27-Jul-2022 |
Vincent Mailhol <mailhol.vincent@wanadoo.fr> |
can: slcan: add software tx timestamps
TX timestamps were added to the can_put_echo_skb() function of can_dev modules in [1]. However, slcan does not rely on that function and as such does not offer
can: slcan: add software tx timestamps
TX timestamps were added to the can_put_echo_skb() function of can_dev modules in [1]. However, slcan does not rely on that function and as such does not offer TX timestamping.
Add a call to skb_tx_timestamp() in the slc_xmit() function so that the module now supports TX software timestamps.
[1] commit 741b91f1b0ea ("can: dev: can_put_echo_skb(): add software tx timestamps") Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=741b91f1b0ea34f00f6a7d4539b767c409291fcf
CC: Dario Binacchi <dario.binacchi@amarulasolutions.com> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Link: https://lore.kernel.org/all/20220727101641.198847-4-mailhol.vincent@wanadoo.fr Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
4aeccfd8 | 28-Jul-2022 |
Dario Binacchi <dario.binacchi@amarulasolutions.com> |
MAINTAINERS: Add maintainer for the slcan driver
At the suggestion of its author Oliver Hartkopp ([1]), I take over the maintainer-ship and add myself to the authors of the driver.
[1] https://lore
MAINTAINERS: Add maintainer for the slcan driver
At the suggestion of its author Oliver Hartkopp ([1]), I take over the maintainer-ship and add myself to the authors of the driver.
[1] https://lore.kernel.org/all/507b5973-d673-4755-3b64-b41cb9a13b6f@hartkopp.net
Suggested-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Link: https://lore.kernel.org/all/20220728070254.267974-8-dario.binacchi@amarulasolutions.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
3e720131 | 28-Jul-2022 |
Dario Binacchi <dario.binacchi@amarulasolutions.com> |
can: slcan: add support for listen-only mode
For non-legacy, i.e. ip based configuration, add support for listen-only mode. If listen-only is requested send a listen-only ("L\r") command instead of
can: slcan: add support for listen-only mode
For non-legacy, i.e. ip based configuration, add support for listen-only mode. If listen-only is requested send a listen-only ("L\r") command instead of an open ("O\r") command to the adapter.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Link: https://lore.kernel.org/all/20220728070254.267974-7-dario.binacchi@amarulasolutions.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
341c5724 | 28-Jul-2022 |
Dario Binacchi <dario.binacchi@amarulasolutions.com> |
can: slcan: use the generic can_change_mtu()
It is useless to define a custom function that does nothing but always return the same error code. Better to use the generic can_change_mtu() function.
can: slcan: use the generic can_change_mtu()
It is useless to define a custom function that does nothing but always return the same error code. Better to use the generic can_change_mtu() function.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Link: https://lore.kernel.org/all/20220728070254.267974-6-dario.binacchi@amarulasolutions.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
0cef03b1 | 28-Jul-2022 |
Dario Binacchi <dario.binacchi@amarulasolutions.com> |
can: slcan: change every `slc' occurrence in `slcan'
In the driver there are parts of code where the prefix `slc' is used and others where the prefix `slcan' is used instead. The patch replaces ever
can: slcan: change every `slc' occurrence in `slcan'
In the driver there are parts of code where the prefix `slc' is used and others where the prefix `slcan' is used instead. The patch replaces every occurrence of `slc' with `slcan', except for the netdev functions where, to avoid compilation conflicts, it was necessary to replace `slc' with `slcan_netdev'.
The patch does not make any functional changes.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Link: https://lore.kernel.org/all/20220728070254.267974-5-dario.binacchi@amarulasolutions.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
cfcb4465 | 28-Jul-2022 |
Dario Binacchi <dario.binacchi@amarulasolutions.com> |
can: slcan: remove legacy infrastructure
Taking inspiration from the drivers/net/can/can327.c driver and at the suggestion of its author Max Staudt, I removed legacy stuff like `SLCAN_MAGIC' and `sl
can: slcan: remove legacy infrastructure
Taking inspiration from the drivers/net/can/can327.c driver and at the suggestion of its author Max Staudt, I removed legacy stuff like `SLCAN_MAGIC' and `slcan_devs' resulting in simplification of the code and its maintainability.
The use of slcan_devs is derived from a very old kernel, since slip.c is about 30 years old, so today's kernel allows us to remove it.
The .hangup() ldisc function, which only called the ldisc .close(), has been removed since the ldisc layer calls .close() in a good place anyway.
The old slcanX name has been dropped in order to use the standard canX interface naming. The ioctl SIOCGIFNAME can be used to query the name of the created interface. Furthermore, there are several ways to get stable interfaces names in user space, e.g. udev or systemd-networkd.
The `maxdev' module parameter has also been removed.
CC: Max Staudt <max@enpas.org> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Reviewed-by: Max Staudt <max@enpas.org> Link: https://lore.kernel.org/all/20220728070254.267974-4-dario.binacchi@amarulasolutions.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
7a1fc3ee | 28-Jul-2022 |
Dario Binacchi <dario.binacchi@amarulasolutions.com> |
can: slcan: remove useless header inclusions
Include only the necessary headers.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Link: https://lore.kernel.org/all/20220728070254
can: slcan: remove useless header inclusions
Include only the necessary headers.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Link: https://lore.kernel.org/all/20220728070254.267974-3-dario.binacchi@amarulasolutions.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
e2c9bb02 | 28-Jul-2022 |
Vincent Mailhol <mailhol.vincent@wanadoo.fr> |
can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded names
The driver uses the string "slcan" to populate tty_ldisc_ops::name. KBUILD_MODNAME also evaluates to "slcan". Use KBUILD_M
can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded names
The driver uses the string "slcan" to populate tty_ldisc_ops::name. KBUILD_MODNAME also evaluates to "slcan". Use KBUILD_MODNAME to get rid on the hardcoded string names.
Similarly, the pr_info() and pr_err() hardcoded the "slcan" prefix. Define pr_fmt so that the "slcan" prefix gets automatically added.
CC: Dario Binacchi <dario.binacchi@amarulasolutions.com> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Link: https://lore.kernel.org/all/20220728070254.267974-2-dario.binacchi@amarulasolutions.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
ce0e7aeb | 19-Jul-2022 |
Vincent Mailhol <mailhol.vincent@wanadoo.fr> |
can: slcan: do not report txerr and rxerr during bus-off
During bus off, the error count is greater than 255 and can not fit in a u8.
alloc_can_err_skb() already sets cf to NULL if the allocation f
can: slcan: do not report txerr and rxerr during bus-off
During bus off, the error count is greater than 255 and can not fit in a u8.
alloc_can_err_skb() already sets cf to NULL if the allocation fails [1], so the redundant cf = NULL assignment gets removed.
[1] https://elixir.bootlin.com/linux/latest/source/drivers/net/can/dev/skb.c#L187
Fixes: 0a9cdcf098a4 ("can: slcan: extend the protocol with CAN state info") Link: https://lore.kernel.org/all/20220719143550.3681-5-mailhol.vincent@wanadoo.fr CC: Dario Binacchi <dario.binacchi@amarulasolutions.com> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
c6887023 | 15-Jul-2022 |
Dario Binacchi <dario.binacchi@amarulasolutions.com> |
can: slcan: do not sleep with a spin lock held
We can't call close_candev() with a spin lock held, so release the lock before calling it. After calling close_candev(), we can update the fields of th
can: slcan: do not sleep with a spin lock held
We can't call close_candev() with a spin lock held, so release the lock before calling it. After calling close_candev(), we can update the fields of the private `struct can_priv' without having to acquire the lock.
Fixes: c4e54b063f42f ("can: slcan: use CAN network device driver API") Link: https://lore.kernel.org/linux-kernel/Ysrf1Yc5DaRGN1WE@xsang-OptiPlex-9020/ Link: https://lore.kernel.org/all/20220715072951.859586-1-dario.binacchi@amarulasolutions.com Reported-by: kernel test robot <oliver.sang@intel.com> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
18de712a | 03-Jul-2022 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: slcan: clean up if/else
Remove braces after if() for single statement blocks, also remove else after return() in if() block.
Link: https://lore.kernel.org/all/20220704125954.1587880-6-mkl@peng
can: slcan: clean up if/else
Remove braces after if() for single statement blocks, also remove else after return() in if() block.
Link: https://lore.kernel.org/all/20220704125954.1587880-6-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
69a65396 | 03-Jul-2022 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: slcan: convert comparison to NULL into !val
All comparison to NULL could be written "!val", convert them to make checkpatch happy.
Link: https://lore.kernel.org/all/20220704125954.1587880-5-mk
can: slcan: convert comparison to NULL into !val
All comparison to NULL could be written "!val", convert them to make checkpatch happy.
Link: https://lore.kernel.org/all/20220704125954.1587880-5-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
f07d9e3c | 03-Jul-2022 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: slcan: fix whitespace issues
Add and remove whitespace to make checkpatch happy.
Link: https://lore.kernel.org/all/20220704125954.1587880-4-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde
can: slcan: fix whitespace issues
Add and remove whitespace to make checkpatch happy.
Link: https://lore.kernel.org/all/20220704125954.1587880-4-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
ded5fa88 | 03-Jul-2022 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: slcan: slcan_init() convert printk(LEVEL ...) to pr_level()
Convert the last printk(LEVEL ...) to pr_level().
Link: https://lore.kernel.org/all/20220704125954.1587880-3-mkl@pengutronix.de Sign
can: slcan: slcan_init() convert printk(LEVEL ...) to pr_level()
Convert the last printk(LEVEL ...) to pr_level().
Link: https://lore.kernel.org/all/20220704125954.1587880-3-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|
71f3a4cc | 03-Jul-2022 |
Marc Kleine-Budde <mkl@pengutronix.de> |
can: slcan: convert comments to network style comments
Convert all comments to network subsystem style comments.
Link: https://lore.kernel.org/all/20220704125954.1587880-2-mkl@pengutronix.de Signed
can: slcan: convert comments to network style comments
Convert all comments to network subsystem style comments.
Link: https://lore.kernel.org/all/20220704125954.1587880-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
show more ...
|