Linux CAN drivers development
 help / color / mirror / Atom feed
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: linux-can@vger.kernel.org, Marc Kleine-Budde <mkl@pengutronix.de>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	michael@amarulasolutions.com,
	Amarula patchwork <linux-amarula@amarulasolutions.com>,
	Jeroen Hofstee <jhofstee@victronenergy.com>,
	Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	Alexandru Tachici <alexandru.tachici@analog.com>,
	Andrew Lunn <andrew@lunn.ch>, Arnd Bergmann <arnd@arndb.de>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Guangbin Huang <huangguangbin2@huawei.com>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Hao Chen <chenhao288@hisilicon.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Ido Schimmel <idosch@nvidia.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Leon Romanovsky <leon@kernel.org>,
	Oleksij Rempel <linux@rempel-privat.de>,
	Paolo Abeni <pabeni@redhat.com>,
	Sean Anderson <sean.anderson@seco.com>, Tom Rix <trix@redhat.com>,
	Yufeng Mo <moyufeng@huawei.com>,
	netdev@vger.kernel.org
Subject: [RFC PATCH v3 7/9] ethtool: add support to get/set CAN bit time register
Date: Tue, 26 Jul 2022 23:02:15 +0200	[thread overview]
Message-ID: <20220726210217.3368497-8-dario.binacchi@amarulasolutions.com> (raw)
In-Reply-To: <20220726210217.3368497-1-dario.binacchi@amarulasolutions.com>

Add ethtool support to get/set tunable values from/to the CAN bit time
register (btr).

CC: Marc Kleine-Budde <mkl@pengutronix.de>
CC: linux-can@vger.kernel.org
Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

(no changes since v1)

 include/uapi/linux/ethtool.h | 1 +
 net/ethtool/common.c         | 1 +
 net/ethtool/ioctl.c          | 1 +
 3 files changed, 3 insertions(+)

diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index e0f0ee9bc89e..a2d24f689124 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -232,6 +232,7 @@ enum tunable_id {
 	ETHTOOL_TX_COPYBREAK,
 	ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */
 	ETHTOOL_TX_COPYBREAK_BUF_SIZE,
+	ETHTOOL_CAN_BTR,
 	/*
 	 * Add your fresh new tunable attribute above and remember to update
 	 * tunable_strings[] in net/ethtool/common.c
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 566adf85e658..78f23b898243 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -90,6 +90,7 @@ tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
 	[ETHTOOL_TX_COPYBREAK]	= "tx-copybreak",
 	[ETHTOOL_PFC_PREVENTION_TOUT] = "pfc-prevention-tout",
 	[ETHTOOL_TX_COPYBREAK_BUF_SIZE] = "tx-copybreak-buf-size",
+	[ETHTOOL_CAN_BTR] = "can-btr",
 };
 
 const char
diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 326e14ee05db..17b69d6fcab4 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -2403,6 +2403,7 @@ static int ethtool_get_module_eeprom(struct net_device *dev,
 static int ethtool_tunable_valid(const struct ethtool_tunable *tuna)
 {
 	switch (tuna->id) {
+	case ETHTOOL_CAN_BTR:
 	case ETHTOOL_RX_COPYBREAK:
 	case ETHTOOL_TX_COPYBREAK:
 	case ETHTOOL_TX_COPYBREAK_BUF_SIZE:
-- 
2.32.0


  parent reply	other threads:[~2022-07-26 21:04 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 21:02 [RFC PATCH v3 0/9] can: slcan: extend supported features (step 2) Dario Binacchi
2022-07-26 21:02 ` [RFC PATCH v3 1/9] can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded names Dario Binacchi
2022-07-26 21:02 ` [RFC PATCH v3 2/9] can: slcan: remove useless header inclusions Dario Binacchi
2022-07-26 21:02 ` [RFC PATCH v3 3/9] can: slcan: remove legacy infrastructure Dario Binacchi
2022-07-27 17:09   ` Max Staudt
2022-07-26 21:02 ` [RFC PATCH v3 4/9] can: slcan: change every `slc' occurrence in `slcan' Dario Binacchi
2022-07-26 21:02 ` [RFC PATCH v3 5/9] can: slcan: use the generic can_change_mtu() Dario Binacchi
2022-07-26 21:02 ` [RFC PATCH v3 6/9] can: slcan: add support for listen-only mode Dario Binacchi
2022-07-26 21:02 ` Dario Binacchi [this message]
2022-07-26 21:02 ` [RFC PATCH v3 8/9] can: slcan: add support to set bit time register (btr) Dario Binacchi
2022-07-27 11:30   ` Marc Kleine-Budde
2022-07-27 15:55     ` Dario Binacchi
2022-07-27 17:21       ` Marc Kleine-Budde
2022-07-27 17:28         ` Dario Binacchi
2022-07-27 17:33           ` Max Staudt
2022-07-27 18:23             ` Dario Binacchi
2022-07-27 17:28     ` Max Staudt
2022-07-27 18:24       ` Marc Kleine-Budde
2022-07-27 20:12         ` Oliver Hartkopp
2022-07-28  6:56           ` Marc Kleine-Budde
2022-07-28  7:36         ` Dario Binacchi
2022-07-28  9:02           ` Marc Kleine-Budde
2022-07-28 10:23             ` Dario Binacchi
2022-07-28 10:50               ` Marc Kleine-Budde
2022-07-28 10:57                 ` Max Staudt
2022-07-29  6:52                   ` Dario Binacchi
2022-07-29  7:33                     ` Marc Kleine-Budde
2022-07-31 15:54                       ` Dario Binacchi
2022-07-31 18:58                         ` Marc Kleine-Budde
2022-07-26 21:02 ` [RFC PATCH v3 9/9] MAINTAINERS: Add maintainer for the slcan driver Dario Binacchi
2022-07-27 18:31 ` [RFC PATCH v3 0/9] can: slcan: extend supported features (step 2) Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220726210217.3368497-8-dario.binacchi@amarulasolutions.com \
    --to=dario.binacchi@amarulasolutions.com \
    --cc=alexandru.tachici@analog.com \
    --cc=andrew@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=chenhao288@hisilicon.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gustavoars@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=huangguangbin2@huawei.com \
    --cc=idosch@nvidia.com \
    --cc=jhofstee@victronenergy.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rempel-privat.de \
    --cc=michael@amarulasolutions.com \
    --cc=mkl@pengutronix.de \
    --cc=moyufeng@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sean.anderson@seco.com \
    --cc=socketcan@hartkopp.net \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox