[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFEp6-2cfVnpr9A6YOjLO-tpPTs-5jdifHOmHupc83KFZ=8UcQ@mail.gmail.com>
Date: Thu, 17 Apr 2025 22:41:12 +0200
From: Loic Poulain <loic.poulain@....qualcomm.com>
To: Sergey Ryazanov <ryazanov.s.a@...il.com>
Cc: Johannes Berg <johannes@...solutions.net>,
Andrew Lunn <andrew+netdev@...n.ch>,
Eric Dumazet <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, Slark Xiao <slark_xiao@....com>,
Muhammad Nuzaihan <zaihan@...ealasia.net>,
Qiang Yu <quic_qianyu@...cinc.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Johan Hovold <johan@...nel.org>
Subject: Re: [RFC PATCH 4/6] net: wwan: add NMEA port support
On Wed, Apr 9, 2025 at 1:31 AM Sergey Ryazanov <ryazanov.s.a@...il.com> wrote:
>
> Many WWAN modems come with embedded GNSS receiver inside and have a
> dedicated port to output geopositioning data. On the one hand, the
> GNSS receiver has little in common with WWAN modem and just shares a
> host interface and should be exported using the GNSS subsystem. On the
> other hand, GNSS receiver is not automatically activated and needs a
> generic WWAN control port (AT, MBIM, etc.) to be turned on. And a user
> space software needs extra information to find the control port.
>
> Introduce the new type of WWAN port - NMEA. When driver asks to register
> a NMEA port, the core allocates common parent WWAN device as usual, but
> exports the NMEA port via the GNSS subsystem and acts as a proxy between
> the device driver and the GNSS subsystem.
>
> From the WWAN device driver perspective, a NMEA port is registered as a
> regular WWAN port without any difference. And the driver interacts only
> with the WWAN core. From the user space perspective, the NMEA port is a
> GNSS device which parent can be used to enumerate and select the proper
> control port for the GNSS receiver management.
>
> CC: Slark Xiao <slark_xiao@....com>
> CC: Muhammad Nuzaihan <zaihan@...ealasia.net>
> CC: Qiang Yu <quic_qianyu@...cinc.com>
> CC: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> CC: Johan Hovold <johan@...nel.org>
> Suggested-by: Loic Poulain <loic.poulain@....qualcomm.com>
> Signed-off-by: Sergey Ryazanov <ryazanov.s.a@...il.com>
> ---
> drivers/net/wwan/Kconfig | 1 +
> drivers/net/wwan/wwan_core.c | 157 ++++++++++++++++++++++++++++++++++-
> include/linux/wwan.h | 2 +
> 3 files changed, 156 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wwan/Kconfig b/drivers/net/wwan/Kconfig
> index 410b0245114e..88df55d78d90 100644
> --- a/drivers/net/wwan/Kconfig
> +++ b/drivers/net/wwan/Kconfig
> @@ -7,6 +7,7 @@ menu "Wireless WAN"
>
> config WWAN
> tristate "WWAN Driver Core"
> + depends on GNSS || GNSS = n
> help
> Say Y here if you want to use the WWAN driver core. This driver
> provides a common framework for WWAN drivers.
> diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
> index 439a57bc2b9c..a30f0c89aa82 100644
[...]
> +static int wwan_port_register_gnss(struct wwan_port *port)
> +{
> + struct wwan_device *wwandev = to_wwan_dev(port->dev.parent);
> + struct gnss_device *gdev;
> + int err;
> +
> + gdev = gnss_allocate_device(&wwandev->dev);
> + if (!gdev) {
> + err = -ENOMEM;
> + goto error_destroy_port;
> + }
> +
> + /* NB: for now we support only NMEA WWAN port type, so hardcode
> + * the GNSS port type. If more GNSS WWAN port types will be added,
> + * then we should dynamically mapt WWAN port type to GNSS type.
typo: mapt
Powered by blists - more mailing lists