public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: Stefan x Nilsson <stefan.x.nilsson@axis.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	<netdev@vger.kernel.org>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <kernel@axis.com>
Subject: Re: [PATCH net-next] qmi_wwan: Add rawip module param
Date: Tue, 12 Sep 2023 09:22:20 +0200	[thread overview]
Message-ID: <87a5tramab.fsf@miraculix.mork.no> (raw)
In-Reply-To: <20230912-qmiraw-v1-1-21bc812fa0cf@axis.com> (Stefan x. Nilsson's message of "Tue, 12 Sep 2023 09:04:13 +0200")

Stefan x Nilsson <stefan.x.nilsson@axis.com> writes:

> Certain QMI modems will start communicating in rawip mode after
> bootup, and will not work properly if communication starts off in
> ethernet mode. So add a module parameter, rawip_as_default, that
> can be used to load the qmi driver in rawip mode.
>
> The advantage compared to changing rawip at a later point using
> sysfs is that the os will not detect the device and start talking
> to it while the driver is still in incorrect mode.
>
> Signed-off-by: Stefan x Nilsson <stefan.x.nilsson@axis.com>
> ---
>  drivers/net/usb/qmi_wwan.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
> index 344af3c5c836..968c60ececf8 100644
> --- a/drivers/net/usb/qmi_wwan.c
> +++ b/drivers/net/usb/qmi_wwan.c
> @@ -46,6 +46,10 @@
>   * commands on a serial interface
>   */
>  
> +/* Module parameters */
> +static bool rawip_as_default;
> +module_param(rawip_as_default, bool, 0644);
> +
>  /* driver specific data */
>  struct qmi_wwan_state {
>  	struct usb_driver *subdriver;
> @@ -843,6 +847,13 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
>  	}
>  	dev->net->netdev_ops = &qmi_wwan_netdev_ops;
>  	dev->net->sysfs_groups[0] = &qmi_wwan_sysfs_attr_group;
> +
> +	/* Set the driver into rawip mode if requested by module param */
> +	if (rawip_as_default) {
> +		info->flags |= QMI_WWAN_FLAG_RAWIP;
> +		qmi_wwan_netdev_setup(dev->net);
> +	}
> +
>  err:
>  	return status;
>  }
>

NAK

There is no reason to start communicating with the device before
changing the framing, using the existing sysfs interface.

This seems to be a workaround for some userspace bug.  I don't think we
yet another userspace knob for that.  And certainly not one that applies
to every device.



Bjørn

  reply	other threads:[~2023-09-12  7:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12  7:04 [PATCH net-next] qmi_wwan: Add rawip module param Stefan x Nilsson
2023-09-12  7:22 ` Bjørn Mork [this message]
2023-09-12  7:44   ` Stefan x Nilsson
2023-09-12  9:45     ` Bjørn Mork

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=87a5tramab.fsf@miraculix.mork.no \
    --to=bjorn@mork.no \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel@axis.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stefan.x.nilsson@axis.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