All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Loic Poulain <loic.poulain@linaro.org>
Cc: kuba@kernel.org, davem@davemloft.net,
	linux-arm-msm@vger.kernel.org, aleksander@aleksander.es,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	bjorn.andersson@linaro.org, manivannan.sadhasivam@linaro.org
Subject: Re: [PATCH net-next v8 1/2] net: Add a WWAN subsystem
Date: Fri, 2 Apr 2021 16:02:52 +0200	[thread overview]
Message-ID: <YGckDNXbeRoOBQPW@kroah.com> (raw)
In-Reply-To: <1617372397-13988-1-git-send-email-loic.poulain@linaro.org>

On Fri, Apr 02, 2021 at 04:06:36PM +0200, Loic Poulain wrote:
> This change introduces initial support for a WWAN framework. Given the
> complexity and heterogeneity of existing WWAN hardwares and interfaces,
> there is no strict definition of what a WWAN device is and how it should
> be represented. It's often a collection of multiple devices that perform
> the global WWAN feature (netdev, tty, chardev, etc).
> 
> One usual way to expose modem controls and configuration is via high
> level protocols such as the well known AT command protocol, MBIM or
> QMI. The USB modems started to expose that as character devices, and
> user daemons such as ModemManager learnt how to deal with them. This
> initial version adds the concept of WWAN port, which can be created
> by any driver to expose one of these protocols. The WWAN core takes
> care of the generic part, including character device management, and
> rely on port operations to received and submit protocol data.
> 
> Since the different components/devices do no necesserarly know about
> each others, and can be created/removed in different orders, the
> WWAN core ensures that all WAN ports that contribute to the 'whole'
> WWAN feature are grouped under the same virtual WWAN device, relying
> on the provided parent device (e.g. mhi controller, USB device). It's
> a 'trick' I copied from Johannes's earlier WWAN subsystem proposal.
> 
> This initial version is purposely minimalist, it's essentially moving
> the generic part of the previously proposed mhi_wwan_ctrl driver inside
> a common WWAN framework, but the implementation is open and flexible
> enough to allow extension for further drivers.
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>

Always run checkpatch before sending stuff off :(

Anyway, one thing did stand out:

> --- /dev/null
> +++ b/include/linux/wwan.h
> @@ -0,0 +1,127 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/* Copyright (c) 2021, Linaro Ltd <loic.poulain@linaro.org> */
> +
> +#ifndef __WWAN_H
> +#define __WWAN_H
> +
> +#include <linux/device.h>
> +#include <linux/kernel.h>
> +#include <linux/skbuff.h>
> +
> +/**
> + * enum wwan_port_type - WWAN port types
> + * @WWAN_PORT_AT: AT commands
> + * @WWAN_PORT_MBIM: Mobile Broadband Interface Model control
> + * @WWAN_PORT_QMI: Qcom modem/MSM interface for modem control
> + * @WWAN_PORT_QCDM: Qcom Modem diagnostic interface
> + * @WWAN_PORT_FIREHOSE: XML based command protocol
> + * @WWAN_PORT_MAX
> + */
> +enum wwan_port_type {
> +	WWAN_PORT_AT,
> +	WWAN_PORT_MBIM,
> +	WWAN_PORT_QMI,
> +	WWAN_PORT_QCDM,
> +	WWAN_PORT_FIREHOSE,
> +	WWAN_PORT_MAX,
> +};
> +
> +/**
> + * struct wwan_port - The structure that defines a WWAN port
> + * @type: Port type
> + * @start_count: Port start counter
> + * @flags: Store port state and capabilities
> + * @ops: Pointer to WWAN port operations
> + * @ops_lock: Protect port ops
> + * @dev: Underlying device
> + * @rxq: Buffer inbound queue
> + * @waitqueue: The waitqueue for port fops (read/write/poll)
> + */
> +struct wwan_port {
> +	enum wwan_port_type type;
> +	unsigned int start_count;
> +	unsigned long flags;
> +	const struct wwan_port_ops *ops;
> +	struct mutex ops_lock;
> +	struct device dev;
> +	struct sk_buff_head rxq;
> +	wait_queue_head_t waitqueue;
> +};

No need to put the actual definition of struct wwan_port in this .h
file, keep it private in your .c file to keep wwan drivers from poking
around in it where they shouldn't be :)

thanks,

greg k-h

  reply	other threads:[~2021-04-02 14:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02 14:06 [PATCH net-next v8 1/2] net: Add a WWAN subsystem Loic Poulain
2021-04-02 14:02 ` Greg KH [this message]
2021-04-02 14:06 ` [PATCH net-next v8 2/2] net: Add Qcom WWAN control driver Loic Poulain
2021-04-02 14:05   ` Greg KH
2021-04-02 15:41     ` Loic Poulain
2021-04-02 15:43       ` Greg KH
2021-04-02 18:18         ` Loic Poulain
2021-04-02 16:29   ` kernel test robot
2021-04-02 16:29     ` kernel test robot
2021-04-02 18:03 ` [PATCH net-next v8 1/2] net: Add a WWAN subsystem kernel test robot
2021-04-02 18:03   ` kernel test robot
2021-04-02 18:03 ` [PATCH] net: fix err_cast.cocci warnings kernel test robot
2021-04-02 18:03   ` kernel test robot

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=YGckDNXbeRoOBQPW@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=aleksander@aleksander.es \
    --cc=bjorn.andersson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.