162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ci
362306a36Sopenharmony_ci.. Copyright (C) 2020-21 Intel Corporation
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci.. _t7xx_driver_doc:
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci============================================
862306a36Sopenharmony_cit7xx driver for MTK PCIe based T700 5G modem
962306a36Sopenharmony_ci============================================
1062306a36Sopenharmony_ciThe t7xx driver is a WWAN PCIe host driver developed for linux or Chrome OS platforms
1162306a36Sopenharmony_cifor data exchange over PCIe interface between Host platform & MediaTek's T700 5G modem.
1262306a36Sopenharmony_ciThe driver exposes an interface conforming to the MBIM protocol [1]. Any front end
1362306a36Sopenharmony_ciapplication (e.g. Modem Manager) could easily manage the MBIM interface to enable
1462306a36Sopenharmony_cidata communication towards WWAN. The driver also provides an interface to interact
1562306a36Sopenharmony_ciwith the MediaTek's modem via AT commands.
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ciBasic usage
1862306a36Sopenharmony_ci===========
1962306a36Sopenharmony_ciMBIM & AT functions are inactive when unmanaged. The t7xx driver provides
2062306a36Sopenharmony_ciWWAN port userspace interfaces representing MBIM & AT control channels and does
2162306a36Sopenharmony_cinot play any role in managing their functionality. It is the job of a userspace
2262306a36Sopenharmony_ciapplication to detect port enumeration and enable MBIM & AT functionalities.
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ciExamples of few such userspace applications are:
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci- mbimcli (included with the libmbim [2] library), and
2762306a36Sopenharmony_ci- Modem Manager [3]
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ciManagement Applications to carry out below required actions for establishing
3062306a36Sopenharmony_ciMBIM IP session:
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci- open the MBIM control channel
3362306a36Sopenharmony_ci- configure network connection settings
3462306a36Sopenharmony_ci- connect to network
3562306a36Sopenharmony_ci- configure IP network interface
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ciManagement Applications to carry out below required actions for send an AT
3862306a36Sopenharmony_cicommand and receive response:
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci- open the AT control channel using a UART tool or a special user tool
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ciManagement application development
4362306a36Sopenharmony_ci==================================
4462306a36Sopenharmony_ciThe driver and userspace interfaces are described below. The MBIM protocol is
4562306a36Sopenharmony_cidescribed in [1] Mobile Broadband Interface Model v1.0 Errata-1.
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ciMBIM control channel userspace ABI
4862306a36Sopenharmony_ci----------------------------------
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci/dev/wwan0mbim0 character device
5162306a36Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5262306a36Sopenharmony_ciThe driver exposes an MBIM interface to the MBIM function by implementing
5362306a36Sopenharmony_ciMBIM WWAN Port. The userspace end of the control channel pipe is a
5462306a36Sopenharmony_ci/dev/wwan0mbim0 character device. Application shall use this interface for
5562306a36Sopenharmony_ciMBIM protocol communication.
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ciFragmentation
5862306a36Sopenharmony_ci~~~~~~~~~~~~~
5962306a36Sopenharmony_ciThe userspace application is responsible for all control message fragmentation
6062306a36Sopenharmony_ciand defragmentation as per MBIM specification.
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci/dev/wwan0mbim0 write()
6362306a36Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~~
6462306a36Sopenharmony_ciThe MBIM control messages from the management application must not exceed the
6562306a36Sopenharmony_cinegotiated control message size.
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci/dev/wwan0mbim0 read()
6862306a36Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~
6962306a36Sopenharmony_ciThe management application must accept control messages of up the negotiated
7062306a36Sopenharmony_cicontrol message size.
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ciMBIM data channel userspace ABI
7362306a36Sopenharmony_ci-------------------------------
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ciwwan0-X network device
7662306a36Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~
7762306a36Sopenharmony_ciThe t7xx driver exposes IP link interface "wwan0-X" of type "wwan" for IP
7862306a36Sopenharmony_citraffic. Iproute network utility is used for creating "wwan0-X" network
7962306a36Sopenharmony_ciinterface and for associating it with MBIM IP session.
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ciThe userspace management application is responsible for creating new IP link
8262306a36Sopenharmony_ciprior to establishing MBIM IP session where the SessionId is greater than 0.
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ciFor example, creating new IP link for a MBIM IP session with SessionId 1:
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_ci  ip link add dev wwan0-1 parentdev wwan0 type wwan linkid 1
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ciThe driver will automatically map the "wwan0-1" network device to MBIM IP
8962306a36Sopenharmony_cisession 1.
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ciAT port userspace ABI
9262306a36Sopenharmony_ci----------------------------------
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci/dev/wwan0at0 character device
9562306a36Sopenharmony_ci~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9662306a36Sopenharmony_ciThe driver exposes an AT port by implementing AT WWAN Port.
9762306a36Sopenharmony_ciThe userspace end of the control port is a /dev/wwan0at0 character
9862306a36Sopenharmony_cidevice. Application shall use this interface to issue AT commands.
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ciThe MediaTek's T700 modem supports the 3GPP TS 27.007 [4] specification.
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ciReferences
10362306a36Sopenharmony_ci==========
10462306a36Sopenharmony_ci[1] *MBIM (Mobile Broadband Interface Model) Errata-1*
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci- https://www.usb.org/document-library/
10762306a36Sopenharmony_ci
10862306a36Sopenharmony_ci[2] *libmbim "a glib-based library for talking to WWAN modems and devices which
10962306a36Sopenharmony_cispeak the Mobile Interface Broadband Model (MBIM) protocol"*
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci- http://www.freedesktop.org/wiki/Software/libmbim/
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci[3] *Modem Manager "a DBus-activated daemon which controls mobile broadband
11462306a36Sopenharmony_ci(2G/3G/4G/5G) devices and connections"*
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci- http://www.freedesktop.org/wiki/Software/ModemManager/
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci[4] *Specification # 27.007 - 3GPP*
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci- https://www.3gpp.org/DynaReport/27007.htm
121