Skip to content

Commit

Permalink
net: Add a WWAN subsystem
Browse files Browse the repository at this point in the history
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 them as character devices, and
user daemons such as ModemManager learnt to use them.

This initial version adds the concept of WWAN port, which is a logical
pipe to a modem control protocol. The protocols are rawly exposed to
user via character device, allowing straigthforward support in existing
tools (ModemManager, ofono...). The WWAN core takes care of the generic
part, including character device management, and relies on port driver
operations to receive/submit protocol data.

Since the different devices exposing protocols for a same WWAN hardware
do not necessarily know about each others (e.g. two different USB
interfaces, PCI/MHI channel devices...) and can be created/removed in
different orders, the WWAN core ensures that all WAN ports contributing
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Loic Poulain authored and David S. Miller committed Apr 16, 2021
1 parent 4ad29b1 commit 9a44c1c
Show file tree
Hide file tree
Showing 6 changed files with 696 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ source "drivers/net/wan/Kconfig"

source "drivers/net/ieee802154/Kconfig"

source "drivers/net/wwan/Kconfig"

config XEN_NETDEV_FRONTEND
tristate "Xen network device frontend driver"
depends on XEN
Expand Down
1 change: 1 addition & 0 deletions drivers/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ obj-$(CONFIG_SUNGEM_PHY) += sungem_phy.o
obj-$(CONFIG_WAN) += wan/
obj-$(CONFIG_WLAN) += wireless/
obj-$(CONFIG_IEEE802154) += ieee802154/
obj-$(CONFIG_WWAN) += wwan/

obj-$(CONFIG_VMXNET3) += vmxnet3/
obj-$(CONFIG_XEN_NETDEV_FRONTEND) += xen-netfront.o
Expand Down
23 changes: 23 additions & 0 deletions drivers/net/wwan/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# Wireless WAN device configuration
#

menuconfig WWAN
bool "Wireless WAN"
help
This section contains Wireless WAN configuration for WWAN framework
and drivers.

if WWAN

config WWAN_CORE
tristate "WWAN Driver Core"
help
Say Y here if you want to use the WWAN driver core. This driver
provides a common framework for WWAN drivers.

To compile this driver as a module, choose M here: the module will be
called wwan.

endif # WWAN
7 changes: 7 additions & 0 deletions drivers/net/wwan/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
#
# Makefile for the Linux WWAN device drivers.
#

obj-$(CONFIG_WWAN_CORE) += wwan.o
wwan-objs += wwan_core.o
Loading

0 comments on commit 9a44c1c

Please sign in to comment.