mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: linux-kernel@vger.kernel.org, michael@amarulasolutions.com,
	Amarula patchwork <linux-amarula@amarulasolutions.com>,
	Jeroen Hofstee <jhofstee@victronenergy.com>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Wolfgang Grandegger <wg@grandegger.com>,
	linux-can@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 0/6] can: slcan: extend supported features (step 2)
Date: Mon, 25 Jul 2022 15:25:14 +0200	[thread overview]
Message-ID: <20220725132514.h3iva4xi4sdncus6@pengutronix.de> (raw)
In-Reply-To: <20220725065419.3005015-1-dario.binacchi@amarulasolutions.com>

[-- Attachment #1: Type: text/plain, Size: 1890 bytes --]

On 25.07.2022 08:54:13, Dario Binacchi wrote:
> With this series I try to finish the task, started with the series [1],
> of completely removing the dependency of the slcan driver from the
> userspace slcand/slcan_attach applications.
> 
> The series, however, still lacks a patch for sending the bitrate setting
> command to the adapter:
> 
> slcan_attach -b <btr> <dev>
> 
> Without at least this patch the task cannot be considered truly completed.
> 
> The idea I got is that this can only happen through the ethtool API.
> Among the various operations made available by this interface I would
> have used the set_regs (but only the get_regs has been developed), or,
> the set_eeprom, even if the setting would not be stored in an eeprom.
> IMHO it would take a set_regs operation with a `struct ethtool_wregs'
> parameter similar to `struct ethtool_eeprom' without the magic field:

This doesn't feel right.

> struct ethtool_wregs {
> 	__u32	cmd;
> 	__u32	offset;
> 	__u32	len;
> 	__u8	data[0];
> };
> 
> But I am not the expert and if there was an alternative solution already
> usable, it would be welcome.

Have a look at the get/set_tunable() callback:

| https://elixir.bootlin.com/linux/latest/source/include/linux/ethtool.h#L575

You probably have to add a new tunable. Here you'll find the people and
commits that changed the tunable:

| https://github.com/torvalds/linux/blame/master/include/uapi/linux/ethtool.h#L229

It's usually worth including them in an RFC patch series where you add a
new tunable and make use of it in the slcan driver.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2022-07-25 13:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25  6:54 Dario Binacchi
2022-07-25  6:54 ` [PATCH v2 1/6] can: slcan: remove useless header inclusions Dario Binacchi
2022-07-25  6:54 ` [PATCH v2 2/6] can: slcan: remove legacy infrastructure Dario Binacchi
2022-07-25 12:38   ` Marc Kleine-Budde
2022-07-26 10:11     ` Dario Binacchi
2022-07-26 11:58       ` Marc Kleine-Budde
2022-07-26 12:11         ` Dario Binacchi
2022-07-25  6:54 ` [PATCH v2 3/6] can: slcan: change every `slc' occurrence in `slcan' Dario Binacchi
2022-07-25  6:54 ` [PATCH v2 4/6] can: slcan: use the generic can_change_mtu() Dario Binacchi
2022-07-25  6:54 ` [PATCH v2 5/6] can: slcan: add support for listen-only mode Dario Binacchi
2022-07-25  6:54 ` [PATCH v2 6/6] MAINTAINERS: Add maintainer for the slcan driver Dario Binacchi
2022-07-25 12:41   ` Marc Kleine-Budde
2022-07-25 13:25 ` Marc Kleine-Budde [this message]
2022-07-26 12:14   ` [PATCH v2 0/6] can: slcan: extend supported features (step 2) Dario Binacchi

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=20220725132514.h3iva4xi4sdncus6@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhofstee@victronenergy.com \
    --cc=kuba@kernel.org \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@amarulasolutions.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=socketcan@hartkopp.net \
    --cc=wg@grandegger.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

all inboxes | Powered by JetHome®