net: wwan: t9xx: Add MediaTek T9XX WWAN driver
Subsystems (5)
v5 cover net: wwan: t9xx: Add MediaTek T9XX WWAN driver
T9XX is the PCIe host device driver for MediaTek's t900 modem. The driver uses the WWAN framework infrastructure to create the following control ports and network interfaces for data transactions.
* /dev/wwan0at0 - Interface that supports AT commands.
* /dev/wwan0mbim0 - Interface conforming to the MBIM protocol.
* wwan0-X - Primary network interface for IP traffic.
The main blocks in the T9XX driver are:
* HW layer - Abstracts the hardware bus operations for the device, and provides generic interfaces for the transaction layer to get the device's information and control the device's behavior. It includes:
* PCIe - Implements probe, removal and interrupt handling.
* MHCCIF (Modem Host Cross-Core Interface) - Provides interrupt channels for bidirectional event notification such as handshake and port enumeration.
* Transaction layer - Implements data transactions for the control plane and the data plane. It includes:
* DPMAIF (Data Plane Modem AP Interface) - Controls the hardware that provides uplink and downlink queues for the data path. The data exchange takes place using circular buffers to share data buffer addresses and metadata to describe the packets.
* CLDMA (Cross Layer DMA) - Manages the hardware used by the port layer to send control messages to the device using MediaTek's CCCI (Cross-Core Communication Interface) protocol.
* TX Services - Dispatch packets from the port layer to the device.
* RX Services - Dispatch packets to the port layer when receiving packets from the device.
* Port layer - Provides control plane and data plane interfaces to userspace. It includes:
* Control Plane - Provides device node interfaces for controlling data transactions.
* Data Plane - Provides network link interfaces wwanX (0, 1, 2...) for IP data transactions.
* Core logic - Contains the core logic to keep the device working. It includes:
* FSM (Finite State Machine) - Monitors the state of the device, and notifies each module when the state changes.
The compilation of the T9XX driver is enabled by the CONFIG_MTK_T9XX and CONFIG_MTK_T9XX_PCI config option which depends on CONFIG_WWAN.
This v2 submission covers the control plane only (patches 1-6). The data plane will follow in a separate series once the control plane is accepted.
---
Changes in v5:
- Patch 1 (Add PCIe core):
- Remove LE32_TO_U32(cpu_to_le32()) no-op endianness
roundtrip, return hw_bits directly
- Use "%s" format string in pci_request_irq() to prevent
format string injection
- Return PCI_ERS_RESULT_DISCONNECT from AER error_detected,
driver does not support AER recovery
- Patch 2 (Add control plane transaction layer):
- Rewrite commit message to accurately describe skeleton
content
- Patch 3 (Add control DMA interface):
- Replace rmb() with dma_rmb() after HWO check in TX/RX
done paths for correct DMA descriptor ordering
- Add ring boundary check in TX done to prevent crossing
into submit territory
- Fix RX stall on reload failure: recycle old buffer with
skb_trim() + dma_map_single() instead of losing descriptor
- Convert devm_kcalloc to kcalloc for req_pool and
bd_dsc_pool, matching existing kfree in teardown
- Set bd_dsc->skb = NULL after dev_kfree_skb_any() in
reload error path to prevent use-after-free
- Use skb_headlen(skb) instead of skb->len for linear
segment size in txbuf_set non-BD path
- Use WRITE_ONCE() for wr_idx update in submit_tx
- Patch 4 (Add control port):
- Fix direct mtk_port_release() calls to use kref_put()
in mtk_port_free_or_backup and stale_list_grp_cleanup
- Add ida_free() before kfree(s_list) in stale list
cleanup to prevent IDA leak
- Remove double-free of skb in mtk_port_internal_recv()
drop_data path, caller owns the skb
- Add port_cnt bounds check against data_len in
mtk_port_status_update() to prevent OOB read
- Replace wait_event_interruptible_timeout with
wait_event_timeout in ch_enable/ch_disable to prevent
busy-spin on pending signals
- Patch 5 (Add FSM thread):
- Validate rtft data_len before passing to query_rtft
callback to prevent OOB access
- Zero-initialize HS3 skb data with memset() to prevent
heap infoleak
- Set hs_info->rt_data = NULL after dev_kfree_skb() in
SAP/MD ctrl msg handlers to prevent use-after-free
- Move wake_up_process() inside spinlock in evt_submit,
clear fsm_handler under lock in exit to fix race
- Replace kcalloc + radix_tree_gang_lookup with
radix_tree_for_each_slot() in mtk_port_disable()
- Add rt_data cleanup loop in FSM teardown path
- Patch 7 (Add maintainers entry):
- Add Robert Yu and Jeff Chang as maintainers
- Link to v4: https://patch.msgid.link/[email protected]
Changes in v4:
- Patch 1 (Add PCIe core):
- Add ACPI dependency to Kconfig (depends on PCI && ACPI)
and remove #ifdef CONFIG_ACPI / #else guards from
mtk_pci_fldr() and mtk_pci_pldr()
- Remove unnecessary parentheses in (mdev)->dev across
all dev_err/dev_warn calls
- Remove devm_kfree() calls from mtk_pci_probe() error
path and mtk_pci_remove(), devres handles cleanup
- Remove mtk_dev_alloc()/mtk_dev_free() wrappers, use
devm_kzalloc() directly in mtk_pci_probe()
- Convert ext_evt callbacks from devm_kzalloc/devm_kfree
to kzalloc/kfree for runtime-managed resources
- Patch 2 (Add control plane transaction layer):
- Remove mtk_dev_alloc()/mtk_dev_free() declarations and
implementations from mtk_dev.h and mtk_dev.c
- Remove empty module_init/module_exit stubs, defer to
Patch 4 where they have actual content
- Remove devm_kfree() and unused ctrl_blk variable in
mtk_ctrl_exit(), devres handles cleanup
- Patch 3 (Add control DMA interface):
- Remove inline keyword from mtk_cldma_clr_bd_dsc() in
.c file, let compiler decide inlining
- Replace dev_warn() with dev_warn_ratelimited() for SKB
alloc/map failure messages in data path
- Replace open-coded do/while polling loop with
read_poll_timeout() from <linux/iopoll.h> in
mtk_cldma_stop_queue()
- Remove ctrl_port_chl_mtu module_param, MODULE_PARM_DESC,
and mtk_ctrl_queue_info_update() with associated macros
- Remove unnecessary parentheses in (mdev)->dev across
mtk_cldma.c and mtk_trans_ctrl.c
- Convert CLDMA txq/rxq/cd from devm_kzalloc/devm_kfree
to kzalloc/kfree for runtime-managed resources
- Convert trb_srv/srv_que from devm_kzalloc/devm_kfree
to kzalloc/kfree for runtime-managed resources
- Remove devm_kfree() and unused variables from
mtk_cldma_exit() and mtk_trans_ctrl_exit(), devres
handles cleanup for device-lifetime resources
- Remove unnecessary NULL checks before kfree() for
bd_dsc_pool in txq_free/rxq_free
- Patch 4 (Add control port):
- Add module_init/module_exit with mtk_port_io_init/exit
content, moved from Patch 2
- Remove unnecessary parentheses in (mdev)->dev in
mtk_port.c
- Remove devm_kfree() from mtk_port_mngr_init() error
path and mtk_port_mngr_exit(), devres handles cleanup
- Simplify mtk_trans_ctrl_init() error path: replace goto
err_free_trans with direct return -ENOMEM
- Patch 5 (Add FSM thread):
- Remove unnecessary parentheses in (mdev)->dev across
mtk_fsm.c and mtk_ctrl_plane.c
- Convert FSM notifiers from devm_kzalloc/devm_kfree to
kzalloc/kfree for runtime-managed resources
- Convert CLDMA drv_info from devm_kzalloc/devm_kfree to
kzalloc/kfree for runtime-managed resources
- Remove devm_kfree() from mtk_fsm_init()/mtk_fsm_exit()
and mtk_ctrl_init()/mtk_ctrl_exit(), devres handles
cleanup for device-lifetime resources
- Link to v3: https://patch.msgid.link/[email protected]
Changes in v3:
- Address sashiko AI code review comments and fix sparse warnings
- Patch 1 (Add PCIe core):
- Move extern declaration of mtk_dev_cfg_0900 from mtk_pci.c to mtk_pci.h to fix sparse warning
- Remove mtk_pci_bar_exit(): pcim_iounmap_region() was called with bitmask instead of BAR index, and pcim_iomap_regions() is devres-managed so manual unmap is redundant [sashiko]
- Remove pci_disable_device() from probe error path and remove path: pcim_enable_device() registers devres cleanup, manual disable causes enable_cnt underflow [sashiko]
- Patch 3 (Add control DMA interface):
- Add #include "mtk_cldma.h" in mtk_cldma_drv_m9xx.c to fix sparse undeclared symbol warnings for mtk_cldma_regs_m9xx and cldma_drv_ops_m9xx
- Move extern declaration of mtk_ctrl_info_m9xx from mtk_trans_ctrl.c to mtk_trans_ctrl.h to fix sparse undeclared symbol warning
- Replace kcalloc + radix_tree_gang_lookup with radix_tree_for_each_slot() in mtk_ctrl_remove_radix_tree() to eliminate allocation in teardown path [sashiko]
- Add missing mtk_pci_dev_exit() call in mtk_pci_remove() to properly clean up FSM and trans_ctrl resources before device removal [sashiko]
- Patch 4 (Add control port):
- Replace kcalloc + radix_tree_gang_lookup with radix_tree_for_each_slot() and single-entry gang_lookup in mtk_port_tbl_destroy() to eliminate allocation failure in teardown path [sashiko]
- Add port = NULL after mtk_port_put_locked() in mtk_port_internal_open() error path to prevent returning un-refcounted pointer [sashiko]
- Restore skb_unlink + trb_complete for non-EAGAIN errors in mtk_ctrl_trb_handler() TX path to prevent infinite retry loop [sashiko]
- Patch 5 (Add FSM thread):
- Check mtk_pci_register_irq() return value in mtk_cldma_dev_init() and add err_destroy_wq error label to fix unreachable dead code [sashiko]
- Propagate specific error codes (ENOMEM/EIO/EINVAL) from mtk_cldma_dev_init() error paths instead of generic -EIO [sashiko]
- Free head SKB after detaching frag_list in mtk_cldma_rxq_free() scatter-gather mode to fix memory leak [sashiko]
- Patch 6 (Add AT & MBIM WWAN ports):
- Remove unused write_lock mutex from struct mtk_port and its mutex_init call [sashiko]
- Link to v2: https://patch.msgid.link/[email protected]
Changes in v2:
- Split series into control plane (this v2) and data plane (follow-up)
- Patch 1 (Add PCIe core):
- Rename BAR_NUM to MTK_PCI_BAR_NUM for driver prefix consistency
- Replace magic numbers in mtk_pci_setup_atr() with named defines
- Remove redundant ATR register comments, use blank line separators
- Add kernel-doc comments to all non-static functions
- Convert 4 MMIO wrapper functions to static inline in header [sashiko]
- Remove unnecessary unlikely() from IRQ validation paths
- Add irq_cnt == 0 and irq_id < 0 guards in mtk_pci_get_virq_id() [sashiko]
- Initialize hw_bits at declaration for consistency
- Merge same-type variable declarations into single lines
- Add #else/#endif comments for CONFIG_ACPI blocks
- Add newlines in mtk_pci_pldr() for readability
- Move return into default case in mtk_pci_dev_reset()
- Simplify mtk_mhccif_init() error path to use direct returns
- Change -EFAULT to -ENOLINK for PCIe link check failure
- Rename goto label "out" to "log_err" in mtk_pci_probe()
- Wrap long lines to stay within 80 columns
- Fix IRQ vector leak: add pci_free_irq_vectors() on error path [sashiko]
- Fix mtk_pci_remove() ordering: free IRQ before cancel_work_sync [sashiko]
- Fix mtk_pci_pldr() ACPI buffer leak: free first result before second call [sashiko]
- Replace msleep(500) with MTK_PLDR_POWER_OFF_DELAY_MS define
- Remove unused EXT_EVT_H2D_DRM_DISABLE_AP and related register define [sashiko]
- Increase MTK_IRQ_NAME_LEN from 20 to 32 to fix W=1 format-truncation warning [sashiko]
- Patch 2 (Add control plane transaction layer):
- Add kernel-doc comments to mtk_ctrl_init() and mtk_ctrl_exit()
- Change mtk_ctrl_exit() return type from int to void
- Set mdev->ctrl_blk to NULL after freeing in mtk_ctrl_exit() [sashiko]
- Change ctrl_blk from void* to typed struct mtk_ctrl_blk* [sashiko]
- Remove redundant "depends on MTK_T9XX" from MTK_T9XX_PCI Kconfig [sashiko]
- Use mtk_dev_free() instead of devm_kfree() in mtk_pci_probe() error path [sashiko]
- Patch 3 (Add control DMA interface):
- Add @ops kernel-doc parameter for mtk_ctrl_init()
- Rename 'err' to 'ret' consistently throughout the patch
- Reorder variable declarations to follow reverse Christmas tree style
- Change mtk_cldma_txq_free() return type from int to void
- Change mtk_cldma_rxq_free() return type from int to void
- Change mtk_cldma_exit() return type from int to void
- Remove unnecessary zero-initialization of ret in mtk_cldma_start_xfer()
- Remove unnecessary zero-initialization of ret in mtk_cldma_tx()
- Use direct return instead of goto out in mtk_cldma_submit_tx() error paths
- Move software state before HWO flag in mtk_cldma_submit_tx()
- Squash variable declarations in mtk_cldma_check_intr_status()
- Remove unlikely() from validation paths in mtk_cldma_check_ch_cfg()
- Clamp data_recv_len with min_t to prevent skb_over_panic in mtk_cldma_rx_skb_adjust() [sashiko]
- Use READ_ONCE() for HWO flag polling in mtk_cldma_check_rx_req() [sashiko]
- Fix mtk_cldma_rx_done_work() to always unmask interrupt on error path [sashiko]
- Add DMA address guard in mtk_cldma_txq_free() teardown loop [sashiko]
- Add IS_ERR() check for kthread_run() in mtk_ctrl_trb_srv_init() [sashiko]
- Fix queue_info memory leak on validation failure in mtk_pcie_hif_init() [sashiko]
- Handle non-EAGAIN errors in mtk_ctrl_trb_handler() TX path [sashiko]
- Fix 'err' typo to 'ret' in mtk_cldma_txbuf_set() error message
- Remove unused variable mdev in mtk_cldma_rx_check_again() [sashiko]
- Remove unused variables trans and ctrl_blk in mtk_cldma_txq_free() and mtk_cldma_rxq_free() [sashiko]
- Patch 4 (Add control port):
- Add @cfg kernel-doc parameter for mtk_ctrl_init()
- Update mtk_ctrl_init() return description to cover additional error codes
- Fix double list_del in mtk_port_stale_list_grp_cleanup() [sashiko]
- Fix direct mtk_port_trb_free() call to use kref_put() in mtk_port_ch_enable() error path [sashiko]
- Fix direct mtk_port_trb_free() call to use kref_put() in mtk_port_ch_disable() error path [sashiko]
- Add mtk_port_tbl_destroy() in mtk_port_mngr_init() error path to prevent port memory leak [sashiko]
- Change port_ops exit/reset/enable/disable callbacks from int to void
- Move -EIO dispatch comment to where the code was introduced
- Patch 5 (Add FSM thread):
- Add bounds check for rtft_entry in mtk_fsm_parse_hs2_msg() [sashiko]
- Add skb length validation before accessing ctrl_msg_header in mtk_fsm_sap_ctrl_msg_handler() [sashiko]
- Fix skb leak on CTRL_MSG_HS2 mismatch return in mtk_fsm_sap_ctrl_msg_handler() [sashiko]
- Add skb length validation before accessing ctrl_msg_header in mtk_fsm_md_ctrl_msg_handler() [sashiko]
- Replace devm_kzalloc/devm_kfree with kzalloc/kfree for FSM events [sashiko]
- Fix mtk_fsm_evt_submit() to return -ETIMEDOUT on blocking event timeout [sashiko]
- Change FSM kthread from TASK_INTERRUPTIBLE to TASK_UNINTERRUPTIBLE [sashiko]
- Remove unused variable hw_id in mtk_cldma_dev_exit() [sashiko]
- Patch 6 (Add AT & MBIM WWAN ports):
- Use imperative mode in commit message
- Remove unnecessary zero-initialization of ret in mtk_port_copy_data_from()
- Change copy_from_user() error code from -EFAULT to -EINVAL in mtk_port_copy_data_from()
- Return -EINVAL for zero-length write in mtk_port_common_write()
- Change mtk_port_wwan_exit/enable/disable() return type from int to void
- Fix packet_size to account for CCCI header reservation in mtk_port_common_write() [sashiko]
- Fix WWAN tx callbacks to consume skb and return 0 per wwan_port_ops contract [sashiko]
- Fix wwan_create_port() error path: clear ERR_PTR to NULL and call mtk_port_ch_disable() [sashiko]
- Patch 7 (Add maintainers entry): new patch
- Link to v1: https://patch.msgid.link/[email protected]
To: Loic Poulain <[email protected]>
To: Sergey Ryazanov <[email protected]>
To: Johannes Berg <[email protected]>
To: Andrew Lunn <[email protected]>
To: "David S. Miller" <[email protected]>
To: Eric Dumazet <[email protected]>
To: Jakub Kicinski <[email protected]>
To: Paolo Abeni <[email protected]>
To: Jack Wu <[email protected]>
To: Robert Yu <[email protected]>
To: Jeff Chang <[email protected]>
To: Wen-Zhi Huang <[email protected]>
To: Shi-Wei Yeh <[email protected]>
To: Minano Tseng <[email protected]>
To: Matthias Brugger <[email protected]>
To: AngeloGioacchino Del Regno <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
Jack Wu (7):
net: wwan: t9xx: Add PCIe core
net: wwan: t9xx: Add control plane transaction layer
net: wwan: t9xx: Add control DMA interface
net: wwan: t9xx: Add control port
net: wwan: t9xx: Add FSM thread
net: wwan: t9xx: Add AT & MBIM WWAN ports
net: wwan: t9xx: Add maintainers entry
MAINTAINERS | 11 + drivers/net/wwan/Kconfig | 17 + drivers/net/wwan/Makefile | 1 + drivers/net/wwan/t9xx/Makefile | 14 + drivers/net/wwan/t9xx/mtk_ctrl_plane.c | 108 ++ drivers/net/wwan/t9xx/mtk_ctrl_plane.h | 88 ++ drivers/net/wwan/t9xx/mtk_dev.c | 33 + drivers/net/wwan/t9xx/mtk_dev.h | 111 ++ drivers/net/wwan/t9xx/mtk_fsm.c | 965 +++++++++++++++ drivers/net/wwan/t9xx/mtk_fsm.h | 140 +++ drivers/net/wwan/t9xx/mtk_port.c | 964 +++++++++++++++ drivers/net/wwan/t9xx/mtk_port.h | 174 +++ drivers/net/wwan/t9xx/mtk_port_io.c | 573 +++++++++ drivers/net/wwan/t9xx/mtk_port_io.h | 41 + drivers/net/wwan/t9xx/mtk_utility.h | 33 + drivers/net/wwan/t9xx/pcie/Makefile | 15 + drivers/net/wwan/t9xx/pcie/mtk_cldma.c | 1441 +++++++++++++++++++++++ drivers/net/wwan/t9xx/pcie/mtk_cldma.h | 173 +++ drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.c | 369 ++++++ drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.h | 174 +++ drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.c | 178 +++ drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.h | 101 ++ drivers/net/wwan/t9xx/pcie/mtk_ctrl_cfg_m9xx.c | 55 + drivers/net/wwan/t9xx/pcie/mtk_pci.c | 1083 +++++++++++++++++ drivers/net/wwan/t9xx/pcie/mtk_pci.h | 234 ++++ drivers/net/wwan/t9xx/pcie/mtk_pci_drv_m9xx.c | 69 ++ drivers/net/wwan/t9xx/pcie/mtk_pci_reg.h | 71 ++ drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.c | 563 +++++++++ drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h | 107 ++ 29 files changed, 7906 insertions(+)
---
base-commit: eb3f4b7426cfd2b79d65b7d37155480b32259a11
change-id: 20260529-t9xx_driver_v1-1744f8af7739
Best regards,
Signature · 1 line
Jack Wu <[email protected]>
PATCH v5 1/7 net: wwan: t9xx: Add PCIe core
Registers the T900 device driver with the kernel. Set up all the fundamental configurations for the device: PCIe layer, Modem Host Cross Core Interface (MHCCIF), Reset Generation Unit (RGU), modem common control operations and build infrastructure.
* PCIe layer code implements driver probe and removal, MSI-X interrupt initialization and de-initialization, and the way of resetting the device.
* MHCCIF provides interrupt channels to communicate events such as handshake, PM and port enumeration.
* RGU provides interrupt channels to generate notifications from the device so that the T900 driver could get the device reset.
* Modem common control operations provide the basic read/write functions of the device's hardware registers, mask/unmask/get/clear functions of the device's interrupt registers and inquiry functions of the device's status.
--- drivers/net/wwan/Kconfig | 12 + drivers/net/wwan/Makefile | 1 + drivers/net/wwan/t9xx/Makefile | 10 + drivers/net/wwan/t9xx/mtk_dev.h | 108 +++ drivers/net/wwan/t9xx/pcie/mtk_pci.c | 1029 +++++++++++++++++++++++++ drivers/net/wwan/t9xx/pcie/mtk_pci.h | 234 ++++++ drivers/net/wwan/t9xx/pcie/mtk_pci_drv_m9xx.c | 69 ++ drivers/net/wwan/t9xx/pcie/mtk_pci_reg.h | 70 ++ 8 files changed, 1533 insertions(+)
drivers/net/wwan/Kconfig +12 -0
@@ -121,6 +121,18 @@ config MTK_T7XX If unsure, say N. +config MTK_T9XX + tristate "MediaTek PCIe 5G WWAN modem T9xx device" + depends on PCI && ACPI + select NET_DEVLINK + help + Enables MediaTek PCIe based 5G WWAN modem (T9xx series) device. + + To compile this driver as a module, choose M here: the module will be + called mtk_t9xx. + + If unsure, say N. + endif # WWAN endmenu
drivers/net/wwan/Makefile +1 -0
@@ -14,3 +14,4 @@ obj-$(CONFIG_QCOM_BAM_DMUX) += qcom_bam_dmux.o obj-$(CONFIG_RPMSG_WWAN_CTRL) += rpmsg_wwan_ctrl.o obj-$(CONFIG_IOSM) += iosm/ obj-$(CONFIG_MTK_T7XX) += t7xx/ +obj-$(CONFIG_MTK_T9XX) += t9xx/
drivers/net/wwan/t9xx/Makefile new file +10 -0
@@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0-only + +ccflags-y += -I$(src)/pcie +ccflags-y += -I$(src) + +obj-$(CONFIG_MTK_T9XX) += mtk_t9xx.o + +mtk_t9xx-y := \ + pcie/mtk_pci.o \ + pcie/mtk_pci_drv_m9xx.o
drivers/net/wwan/t9xx/mtk_dev.h new file +108 -0
108 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_pci.c new file +1029 -0
1,029 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_pci.h new file +234 -0
234 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_pci_drv_m9xx.c new file +69 -0
69 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_pci_reg.h new file +70 -0
70 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v5 2/7 net: wwan: t9xx: Add control plane transaction layer
In reply to Jack WuIntroduce the control plane and transaction layer framework for the T9XX WWAN driver. This patch adds the core data structures (mtk_ctrl_blk, mtk_ctrl_trans) and initialization entry points that subsequent patches build upon.
The control plane block (ctrl_blk) serves as the central context for managing the transaction layer, port layer, and FSM interactions. The actual DMA engine and TX/RX service implementations are added in subsequent patches.
--- drivers/net/wwan/Kconfig | 5 ++++ drivers/net/wwan/t9xx/Makefile | 5 ++-- drivers/net/wwan/t9xx/mtk_ctrl_plane.c | 45 +++++++++++++++++++++++++++++ drivers/net/wwan/t9xx/mtk_ctrl_plane.h | 22 ++++++++++++++ drivers/net/wwan/t9xx/mtk_dev.c | 11 +++++++ drivers/net/wwan/t9xx/mtk_dev.h | 2 ++ drivers/net/wwan/t9xx/pcie/Makefile | 10 +++++++ drivers/net/wwan/t9xx/pcie/mtk_pci.c | 1 + drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h | 21 ++++++++++++++ 9 files changed, 120 insertions(+), 2 deletions(-)
drivers/net/wwan/Kconfig +5 -0
@@ -124,6 +124,7 @@ config MTK_T7XX config MTK_T9XX tristate "MediaTek PCIe 5G WWAN modem T9xx device" depends on PCI && ACPI + select MTK_T9XX_PCI select NET_DEVLINK help Enables MediaTek PCIe based 5G WWAN modem (T9xx series) device.
@@ -133,6 +134,10 @@ config MTK_T9XX If unsure, say N. +config MTK_T9XX_PCI + tristate + depends on PCI + endif # WWAN endmenu
drivers/net/wwan/t9xx/Makefile +3 -2
@@ -4,7 +4,8 @@ ccflags-y += -I$(src)/pcie ccflags-y += -I$(src) obj-$(CONFIG_MTK_T9XX) += mtk_t9xx.o +obj-$(CONFIG_MTK_T9XX_PCI) += pcie/ mtk_t9xx-y := \ - pcie/mtk_pci.o \ - pcie/mtk_pci_drv_m9xx.o + mtk_dev.o \ + mtk_ctrl_plane.o
drivers/net/wwan/t9xx/mtk_ctrl_plane.c new file +45 -0
45 lines not on this page · raw message
drivers/net/wwan/t9xx/mtk_ctrl_plane.h new file +22 -0
@@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-only +* +* Copyright (c) 2022, MediaTek Inc. +*/ + +#ifndef __MTK_CTRL_PLANE_H__ +#define __MTK_CTRL_PLANE_H__ + +#include <linux/kref.h> +#include <linux/skbuff.h> + +#include "mtk_dev.h" + +struct mtk_ctrl_blk { +struct mtk_md_dev *mdev; +struct mtk_ctrl_trans *trans; +}; + +int mtk_ctrl_init (struct mtk_md_dev *mdev); +void mtk_ctrl_exit (struct mtk_md_dev *mdev); + +#endif /* __MTK_CTRL_PLANE_H__ */
drivers/net/wwan/t9xx/mtk_dev.c new file +11 -0
@@ -0,0 +1,11 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +* Copyright (c) 2022, MediaTek Inc. +*/ + +#include <linux/module.h> + +#include "mtk_dev.h" + +MODULE_DESCRIPTION ("MediaTek T9xx PCIe WWAN driver" ); +MODULE_LICENSE ("GPL" );
drivers/net/wwan/t9xx/mtk_dev.h +2 -0
@@ -36,6 +36,7 @@ enum mtk_dev_evt_d2h { };struct mtk_md_dev ; +struct mtk_ctrl_blk ;struct mtk_dev_ops {u32 (*get_dev_state)(struct mtk_md_dev *mdev);
@@ -57,6 +58,7 @@ struct mtk_md_dev {void *hw_priv;u32 hw_ver;char dev_str[MTK_DEV_STR_LEN ]; +struct mtk_ctrl_blk *ctrl_blk; };static inline u32 mtk_dev_get_dev_state (struct mtk_md_dev *mdev)
drivers/net/wwan/t9xx/pcie/Makefile new file +10 -0
@@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0-only + +ccflags-y += -I$(src) +ccflags-y += -I$(src)/.. + +obj-$(CONFIG_MTK_T9XX_PCI) += mtk_t9xx_pcie.o + +mtk_t9xx_pcie-y := \ + mtk_pci_drv_m9xx.o \ + mtk_pci.o
drivers/net/wwan/t9xx/pcie/mtk_pci.c +1 -0
@@ -14,6 +14,7 @@#include <linux/module.h> #include "mtk_dev.h" +#include "mtk_trans_ctrl.h" #include "mtk_pci.h" #include "mtk_pci_reg.h"
drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h new file +21 -0
@@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0-only +* +* Copyright (c) 2022, MediaTek Inc. +*/ + +#ifndef __MTK_TRANS_CTRL_H__ +#define __MTK_TRANS_CTRL_H__ + +#include <linux/kref.h> +#include <linux/list.h> +#include <linux/skbuff.h> +#include <linux/types.h> + +#include "mtk_dev.h" + +struct mtk_ctrl_trans { +struct mtk_ctrl_blk *ctrl_blk; +struct mtk_md_dev *mdev; +}; + +#endif
Signature · 1 line
2.34.1
PATCH v5 3/7 net: wwan: t9xx: Add control DMA interface
In reply to Jack WuCross Layer Direct Memory Access(CLDMA) is the hardware interface used by the control plane and designated to translate data between the host and the device. It supports 8 hardware queues for the device AP and modem respectively.
CLDMA driver uses General Purpose Descriptor (GPD) to describe transaction information that can be recognized by CLDMA hardware. Once CLDMA hardware transaction is started, it would fetch and parse GPD to transfer data correctly. To facilitate the CLDMA transaction, a GPD ring for each queue is used. Once the transaction is started, CLDMA hardware will traverse the GPD ring to transfer data between the host and the device until no GPD is available.
CLDMA TX flow:
Once a TX service receives the TX data from the port layer, it uses APIs exported by the CLDMA driver to configure GPD with the DMA address of TX data. After that, the service triggers CLDMA to fetch the first available GPD to transfer data.
CLDMA RX flow:
When there is RX data from the MD, CLDMA hardware asserts an interrupt to notify the host to fetch data and dispatch it to FSM (for handshake messages) or the port layer. After CLDMA opening is finished, All RX GPDs are fulfilled and ready to receive data from the device.
--- drivers/net/wwan/t9xx/mtk_ctrl_plane.c | 4 +- drivers/net/wwan/t9xx/mtk_ctrl_plane.h | 52 +- drivers/net/wwan/t9xx/pcie/Makefile | 7 +- drivers/net/wwan/t9xx/pcie/mtk_cldma.c | 1221 +++++++++++++++++++++++ drivers/net/wwan/t9xx/pcie/mtk_cldma.h | 170 ++++ drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.c | 369 +++++++ drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.h | 177 ++++ drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.c | 183 ++++ drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.h | 103 ++ drivers/net/wwan/t9xx/pcie/mtk_ctrl_cfg_m9xx.c | 24 + drivers/net/wwan/t9xx/pcie/mtk_pci.c | 39 + drivers/net/wwan/t9xx/pcie/mtk_pci_reg.h | 1 + drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.c | 541 ++++++++++ drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h | 86 ++ 14 files changed, 2973 insertions(+), 4 deletions(-)
drivers/net/wwan/t9xx/mtk_ctrl_plane.c +3 -1
@@ -11,13 +11,14 @@/** * mtk_ctrl_init() - Initialize the control plane block. * @mdev: Pointer to the MTK modem device. +* @ops: HIF operations for the control plane. * * Allocates and initializes the control plane block * associated with @mdev. * * Return: 0 on success, -ENOMEM on allocation failure. */ -int mtk_ctrl_init (struct mtk_md_dev *mdev) +int mtk_ctrl_init (struct mtk_md_dev *mdev,struct mtk_ctrl_hif_ops *ops) {struct mtk_ctrl_blk *ctrl_blk;
@@ -27,6 +28,7 @@ int mtk_ctrl_init(struct mtk_md_dev *mdev) ctrl_blk->mdev = mdev; mdev->ctrl_blk = ctrl_blk; + ctrl_blk->ops = ops;return 0 ; }
drivers/net/wwan/t9xx/mtk_ctrl_plane.h +50 -2
62 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/Makefile +6 -1
@@ -7,4 +7,9 @@ obj-$(CONFIG_MTK_T9XX_PCI) += mtk_t9xx_pcie.o mtk_t9xx_pcie-y := \ mtk_pci_drv_m9xx.o \ - mtk_pci.o + mtk_cldma_drv_m9xx.o \ + mtk_ctrl_cfg_m9xx.o \ + mtk_pci.o \ + mtk_trans_ctrl.o \ + mtk_cldma.o \ + mtk_cldma_drv.o
drivers/net/wwan/t9xx/pcie/mtk_cldma.c new file +1221 -0
1,221 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_cldma.h new file +170 -0
170 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.c new file +369 -0
369 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.h new file +177 -0
177 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.c new file +183 -0
183 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.h new file +103 -0
103 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_ctrl_cfg_m9xx.c new file +24 -0
@@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +* Copyright (c) 2022, MediaTek Inc. +*/ + +#include "mtk_cldma.h" +#include "mtk_trans_ctrl.h" + +#define TRB_SRV_NUM (1) + +static const int mtk_srv_cfg_m9xx[NR_CLDMA ][HW_QUE_NUM ] = { + {0 }, + {0 }, +}; + +static const struct queue_info mtk_queue_info_m9xx[] = { +}; + +struct mtk_ctrl_info mtk_ctrl_info_m9xx = { + .queue_info = (struct queue_info *)mtk_queue_info_m9xx, + .queue_info_num =ARRAY_SIZE (mtk_queue_info_m9xx), + .srv_cfg = (int **)mtk_srv_cfg_m9xx, + .trb_srv_num =TRB_SRV_NUM , +};
drivers/net/wwan/t9xx/pcie/mtk_pci.c +39 -0
@@ -877,6 +877,28 @@ static void mtk_pci_free_irq(struct mtk_md_dev *mdev)pci_free_irq_vectors (pdev); } +static int mtk_pci_dev_init (struct mtk_md_dev *mdev) +{ +int ret; + + ret =mtk_trans_ctrl_init (mdev); +if (ret) { +dev_err (mdev->dev,"Failed to initialize control plane: %d\n" , ret); +return ret; + } + +return 0 ; +} + +static void mtk_pci_dev_exit (struct mtk_md_dev *mdev) +{ +mtk_trans_ctrl_exit (mdev); +} + +static int mtk_pci_dev_start (struct mtk_md_dev *mdev) +{ +return 0 ; +}static const struct mtk_dev_ops pci_hw_ops = { .get_dev_state = mtk_pci_get_dev_state, .ack_dev_state = mtk_pci_ack_dev_state,
@@ -953,6 +975,12 @@ static int mtk_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)if (ret) goto free_mhccif; + ret =mtk_pci_dev_init (mdev); +if (ret) { +dev_err (mdev->dev,"Failed to init dev.\n" ); + goto free_irq; + } +pci_set_master (pdev);mtk_pci_unmask_irq (mdev, priv->mhccif_irq_id);
@@ -969,10 +997,20 @@ static int mtk_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto clear_master; } + ret =mtk_pci_dev_start (mdev); +if (ret) { +dev_err (mdev->dev,"Failed to start dev.\n" ); + goto free_saved_state; + } +return 0 ; +free_saved_state: +pci_load_and_free_saved_state (pdev, &priv->saved_state); clear_master:pci_clear_master (pdev); +mtk_pci_dev_exit (mdev); +free_irq:mtk_pci_free_irq (mdev); free_mhccif:mtk_mhccif_exit (mdev);
@@ -996,6 +1034,7 @@ static void mtk_pci_remove(struct pci_dev *pdev) }pci_clear_master (pdev); +mtk_pci_dev_exit (mdev);mtk_pci_free_irq (mdev);mtk_mhccif_exit (mdev);pci_load_and_free_saved_state (pdev, &priv->saved_state);
drivers/net/wwan/t9xx/pcie/mtk_pci_reg.h +1 -0
@@ -21,6 +21,7 @@#define REG_IMASK_HOST_MSIX_SET_GRP0_0 0x3000#define REG_IMASK_HOST_MSIX_CLR_GRP0_0 0x3080#define REG_IMASK_HOST_MSIX_GRP0_0 0x3100 +#define REG_DEV_INFRA_BASE 0x10001000/* mhccif registers */ #define MHCCIF_RC2EP_SW_BSY 0x4
drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.c new file +541 -0
541 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h +86 -0
44 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.34.1
Part of the diff is not shown here. View the raw message.
Jakub Kicinski
maintainerRe: [PATCH v5 3/7] net: wwan: t9xx: Add control DMA interface
Quoted 4 lines · On Thu, 23 Jul 2026 16:34:28 +0800 Jack Wu via B4 Relay wrote:
Cross Layer Direct Memory Access(CLDMA) is the hardware interface used by the control plane and designated to translate data between the host and the device. It supports 8 hardware queues for the device AP and modem respectively.
each commit has to build cleanly with W=1 C=1, please:
drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.c:34:22: warning: symbol 'mtk_cldma_regs_m9xx' was not declared. Should it be static? drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.c:167:22: warning: symbol 'cldma_drv_ops_m9xx' was not declared. Should it be static?
Signature · 1 line
pw-bot: cr
RE: [External Mail] Re: [PATCH v5 3/7] net: wwan: t9xx: Add control DMA interface
Hi Jakub,
Quoted 4 lines
each commit has to build cleanly with W=1 C=1, please:
drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.c:34:22: warning: symbol 'mtk_cldma_regs_m9xx' was not declared. Should it be static?drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.c:167:22: warning: symbol 'cldma_drv_ops_m9xx' was not declared. Should it be static?
Will fix in v6. The extern declarations for these two symbols were placed in Patch 5's mtk_cldma.h — will move them to Patch 3 where the symbols are first defined.
Thanks.
PATCH v5 4/7 net: wwan: t9xx: Add control port
In reply to Jack WuThe control port consists of port I/O and port manager. Port I/O provides a common operation as defined by "struct port_ops", and the operation is managed by the "port manager". It provides interfaces to internal users, the implemented internal interfaces are open, close, write and recv_register.
The port manager defines and implements port management interfaces and structures. It is responsible for port creation, destroying, and managing port states. It sends data from port I/O to CLDMA via TRB ( Transaction Request Block ), and dispatches received data from CLDMA to port I/O. The using port will be held in the "stale list" when the driver destroys it, and after creating it again, the user can continue to use it.
--- drivers/net/wwan/t9xx/Makefile | 4 +- drivers/net/wwan/t9xx/mtk_ctrl_plane.c | 19 +- drivers/net/wwan/t9xx/mtk_ctrl_plane.h | 20 +- drivers/net/wwan/t9xx/mtk_dev.c | 22 + drivers/net/wwan/t9xx/mtk_port.c | 875 +++++++++++++++++++++++++ drivers/net/wwan/t9xx/mtk_port.h | 159 +++++ drivers/net/wwan/t9xx/mtk_port_io.c | 238 +++++++ drivers/net/wwan/t9xx/mtk_port_io.h | 36 + drivers/net/wwan/t9xx/pcie/mtk_ctrl_cfg_m9xx.c | 25 +- drivers/net/wwan/t9xx/pcie/mtk_pci.c | 2 + drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.c | 22 +- drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h | 1 + 12 files changed, 1412 insertions(+), 11 deletions(-)
drivers/net/wwan/t9xx/Makefile +3 -1
@@ -8,4 +8,6 @@ obj-$(CONFIG_MTK_T9XX_PCI) += pcie/ mtk_t9xx-y := \ mtk_dev.o \ - mtk_ctrl_plane.o + mtk_ctrl_plane.o \ + mtk_port.o \ + mtk_port_io.o
drivers/net/wwan/t9xx/mtk_ctrl_plane.c +17 -2
@@ -7,20 +7,23 @@#include <linux/device.h> #include "mtk_ctrl_plane.h" +#include "mtk_port.h" /** * mtk_ctrl_init() - Initialize the control plane block. * @mdev: Pointer to the MTK modem device. * @ops: HIF operations for the control plane. +* @cfg: Control plane configuration. * * Allocates and initializes the control plane block * associated with @mdev. * -* Return: 0 on success, -ENOMEM on allocation failure. +* Return: 0 on success, negative error code on failure. */ -int mtk_ctrl_init (struct mtk_md_dev *mdev,struct mtk_ctrl_hif_ops *ops) +int mtk_ctrl_init (struct mtk_md_dev *mdev,struct mtk_ctrl_hif_ops *ops,struct mtk_ctrl_cfg *cfg) {struct mtk_ctrl_blk *ctrl_blk; +int err; ctrl_blk =devm_kzalloc (mdev->dev,sizeof (*ctrl_blk),GFP_KERNEL );if (!ctrl_blk)
@@ -29,8 +32,17 @@ int mtk_ctrl_init(struct mtk_md_dev *mdev, struct mtk_ctrl_hif_ops *ops) ctrl_blk->mdev = mdev; mdev->ctrl_blk = ctrl_blk; ctrl_blk->ops = ops; + ctrl_blk->cfg = cfg; + + err =mtk_port_mngr_init (ctrl_blk, cfg->port_layer_cfg->port_cfg, + cfg->port_layer_cfg->port_cnt); +if (err) + goto err_free_mem;return 0 ; + +err_free_mem: +return err; }EXPORT_SYMBOL (mtk_ctrl_init);
@@ -42,6 +54,9 @@ EXPORT_SYMBOL(mtk_ctrl_init);*/ void mtk_ctrl_exit (struct mtk_md_dev *mdev) { +struct mtk_ctrl_blk *ctrl_blk = mdev->ctrl_blk; + +mtk_port_mngr_exit (ctrl_blk); mdev->ctrl_blk =NULL ; }EXPORT_SYMBOL (mtk_ctrl_exit);
drivers/net/wwan/t9xx/mtk_ctrl_plane.h +18 -2
@@ -11,6 +11,17 @@#include "mtk_dev.h" +#define Q_MTU_2K (0x800) +#define Q_MTU_3_5K (0xE00) +#define Q_MTU_7K (0x1C00) +#define Q_MTU_32K (0x8000) +#define Q_MTU_63K (0xFC00) +#define Q_FRAG_2K (0x800) +#define Q_FRAG_3_5K (0xE00) +#define Q_FRAG_7K (0x1C00) +#define Q_FRAG_32K (0x8000) +#define Q_FRAG_63K (0xFC00) +enum mtk_trb_cmd_type {TRB_CMD_MIN ,TRB_CMD_ENABLE ,
@@ -54,17 +65,22 @@ struct mtk_ctrl_hif_ops { int (*send_cmd)(struct mtk_md_dev *mdev, int cmd, void *data); }; -struct mtk_ctrl_cfg ; +struct mtk_ctrl_cfg { +struct mtk_port_layer_cfg *port_layer_cfg; +}; +struct mtk_ctrl_trans ;struct mtk_ctrl_blk {struct mtk_md_dev *mdev; +struct mtk_port_mngr *port_mngr;struct mtk_ctrl_hif_ops *ops;void *ctrl_hw_priv;struct mtk_ctrl_cfg *cfg; }; -int mtk_ctrl_init (struct mtk_md_dev *mdev,struct mtk_ctrl_hif_ops *ops); +int mtk_ctrl_init (struct mtk_md_dev *mdev,struct mtk_ctrl_hif_ops *ops, +struct mtk_ctrl_cfg *cfg);void mtk_ctrl_exit (struct mtk_md_dev *mdev);#endif /* __MTK_CTRL_PLANE_H__ */
drivers/net/wwan/t9xx/mtk_dev.c +22 -0
@@ -6,6 +6,28 @@#include <linux/module.h> #include "mtk_dev.h" +#include "mtk_port.h" +#include "mtk_port_io.h" + +static int __init mtk_common_drv_init (void ) +{ +int ret; + + ret =mtk_port_io_init (); +if (ret) + goto err_init_devid; + +err_init_devid: +return ret; +} +module_init (mtk_common_drv_init); + +static void __exit mtk_common_drv_exit(void) +{ +mtk_port_io_exit (); +mtk_port_stale_list_grp_cleanup (); +} +module_exit (mtk_common_drv_exit);MODULE_DESCRIPTION ("MediaTek T9xx PCIe WWAN driver" );MODULE_LICENSE ("GPL" );
drivers/net/wwan/t9xx/mtk_port.c new file +875 -0
875 lines not on this page · raw message
drivers/net/wwan/t9xx/mtk_port.h new file +159 -0
159 lines not on this page · raw message
drivers/net/wwan/t9xx/mtk_port_io.c new file +238 -0
238 lines not on this page · raw message
drivers/net/wwan/t9xx/mtk_port_io.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0-only +* +* Copyright (c) 2022, MediaTek Inc. +*/ + +#ifndef __MTK_PORT_IO_H__ +#define __MTK_PORT_IO_H__ + +#include <linux/skbuff.h> + +#include "mtk_port.h" + +#define MTK_RX_BUF_SIZE (1024 * 1024) + +extern struct mutex port_mngr_grp_mtx; + +struct port_ops { +int (*init)(struct mtk_port *port); +void (*exit)(struct mtk_port *port); +void (*reset)(struct mtk_port *port); +void (*enable)(struct mtk_port *port); +void (*disable)(struct mtk_port *port); +int (*recv)(struct mtk_port *port,struct sk_buff *skb); +}; + +void *mtk_port_internal_open (struct mtk_md_dev *mdev,char *name,int flag); +int mtk_port_internal_close (void *i_port); +int mtk_port_internal_write (void *i_port,struct sk_buff *skb); +void mtk_port_internal_recv_register (void *i_port, +int (*cb)(void *priv,struct sk_buff *skb), +void *arg); + +int mtk_port_io_init (void ); +void mtk_port_io_exit (void ); + +#endif /* __MTK_PORT_IO_H__ */
drivers/net/wwan/t9xx/pcie/mtk_ctrl_cfg_m9xx.c +24 -1
@@ -4,6 +4,7 @@*/ #include "mtk_cldma.h" +#include "mtk_port.h" #include "mtk_trans_ctrl.h" #define TRB_SRV_NUM (1)
@@ -13,12 +14,34 @@ static const int mtk_srv_cfg_m9xx[NR_CLDMA][HW_QUE_NUM] = { {0}, }; +/* the number of RX GPDs should be at last two */ static const struct queue_info mtk_queue_info_m9xx[] = { + {CCCI_CONTROL_TX ,CCCI_CONTROL_RX ,CLDMA1 ,TXQ (0 ),RXQ (0 ), +Q_MTU_3_5K ,Q_MTU_3_5K ,TX_GPD_NUM ,RX_GPD_NUM ,Q_FRAG_3_5K ,Q_FRAG_3_5K ,0 }, + {CCCI_SAP_CONTROL_TX ,CCCI_SAP_CONTROL_RX ,CLDMA0 ,TXQ (0 ),RXQ (0 ), +Q_MTU_3_5K ,Q_MTU_3_5K ,TX_GPD_NUM ,RX_GPD_NUM ,Q_FRAG_3_5K ,Q_FRAG_3_5K ,0 }, +}; + +static const struct mtk_port_cfg port_cfg_m9xx[] = { + {CCCI_CONTROL_TX ,CCCI_CONTROL_RX ,PORT_TYPE_INTERNAL ,"MDCTRL" , +PORT_F_ALLOW_DROP }, + {CCCI_SAP_CONTROL_TX ,CCCI_SAP_CONTROL_RX ,PORT_TYPE_INTERNAL ,"SAPCTRL" , +PORT_F_ALLOW_DROP }, +}; + +static struct mtk_port_layer_cfg port_layer_cfg_m9xx = { + .port_cfg = (struct mtk_port_cfg *)port_cfg_m9xx, + .port_cnt =ARRAY_SIZE (port_cfg_m9xx), +}; + +static struct mtk_ctrl_cfg mtk_ctrl_cfg_m9xx = { + .port_layer_cfg = &port_layer_cfg_m9xx, };struct mtk_ctrl_info mtk_ctrl_info_m9xx = { + .ctrl_cfg = &mtk_ctrl_cfg_m9xx, + .srv_cfg = (int **)mtk_srv_cfg_m9xx, .queue_info = (struct queue_info *)mtk_queue_info_m9xx, .queue_info_num =ARRAY_SIZE (mtk_queue_info_m9xx), - .srv_cfg = (int **)mtk_srv_cfg_m9xx, .trb_srv_num =TRB_SRV_NUM , };
drivers/net/wwan/t9xx/pcie/mtk_pci.c +2 -0
@@ -17,6 +17,8 @@#include "mtk_trans_ctrl.h" #include "mtk_pci.h" #include "mtk_pci_reg.h" +#include "mtk_port.h" +#include "mtk_port_io.h" #define MTK_PCI_BAR_NUM 6#define MTK_PCI_TRANSPARENT_ATR_SIZE (0x3F)
drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.c +17 -5
@@ -16,12 +16,13 @@#include "mtk_ctrl_plane.h" #include "mtk_dev.h" #include "mtk_pci.h" +#include "mtk_port.h" #include "mtk_trans_ctrl.h" #define MTK_DFLT_PORT_NAME_LEN (20)static struct mtk_ctrl_info_desc mtk_ctrl_info_tbl[] = { - {2304 , &ctrl_info_name (m9xx)}, + {0x01CA , &ctrl_info_name (m9xx)}, {0 ,NULL }, };
@@ -131,6 +132,7 @@ static void mtk_ctrl_trb_handler(struct trb_srv *srv, struct trans_list *trans_lif (!skb)break ; trb = (struct trb *)skb->cb; +kref_get (&trb->kref);switch (trb->cmd) {case TRB_CMD_ENABLE :
@@ -150,8 +152,10 @@ static void mtk_ctrl_trb_handler(struct trb_srv *srv, struct trans_list *trans_l kick = true;break ; } -if (err == -EAGAIN ) +if (err == -EAGAIN ) { +kref_put (&trb->kref, mtk_port_trb_free);return ; + }skb_unlink (skb, skb_list); trb->status = err;
@@ -182,6 +186,8 @@ static void mtk_ctrl_trb_handler(struct trb_srv *srv, struct trans_list *trans_l kick = false; } +kref_put (&trb->kref, mtk_port_trb_free); + loop++; }while (loop <TRB_NUM_PER_ROUND ); }
@@ -492,6 +498,7 @@ static void mtk_trans_get_ctrl_info(struct mtk_ctrl_cfg *cfg,continue ; ctrl_info = ctrl_info_desc->ctrl_info; + cfg->port_layer_cfg = ctrl_info->ctrl_cfg->port_layer_cfg;memcpy (trans->srv_cfg, ctrl_info->srv_cfg,sizeof (int ) *NR_CLDMA *HW_QUE_NUM ); trans->queue_info = ctrl_info->queue_info;
@@ -504,6 +511,7 @@ int mtk_trans_ctrl_init(struct mtk_md_dev *mdev) {struct mtk_ctrl_trans *trans;struct mtk_ctrl_blk *ctrl_blk; +struct mtk_ctrl_cfg *cfg;int err; trans =devm_kzalloc (mdev->dev,sizeof (*trans),GFP_KERNEL );
@@ -512,15 +520,19 @@ int mtk_trans_ctrl_init(struct mtk_md_dev *mdev) trans->mdev = mdev; trans->queues_cnt =0 ; -mtk_trans_get_ctrl_info (NULL , trans, mdev->hw_ver); -if (!trans->queue_info || + cfg =devm_kzalloc (mdev->dev,sizeof (*cfg),GFP_KERNEL ); +if (!cfg) +return -ENOMEM ; + +mtk_trans_get_ctrl_info (cfg, trans, mdev->hw_ver); +if (!cfg->port_layer_cfg || !trans->queue_info || trans->trb_srv_num <=0 || trans->trb_srv_num >TRB_SRV_MAX_NUM || trans->queue_info_num <=0 ) {dev_err (mdev->dev,"Failed to get ctrl info!\n" ); goto err_free_cfg; } - err =mtk_ctrl_init (mdev, &pcie_ctrl_ops); + err =mtk_ctrl_init (mdev, &pcie_ctrl_ops, cfg);if (err) goto err_free_cfg;
drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h +1 -0
@@ -12,6 +12,7 @@#include <linux/types.h> #include "mtk_dev.h" +#include "mtk_port.h" #define TRB_SRV_MAX_NUM (1)#define HW_QUE_NUM (8)
Signature · 1 line
2.34.1
PATCH v5 5/7 net: wwan: t9xx: Add FSM thread
In reply to Jack WuThe FSM (Finite-state Machine) thread is responsible for synchronizing the actions of different modules. The asynchronous events from the device or the OS will trigger a state transition.
The FSM thread will append it to the event queue when an event arrives. It handles the events sequentially. After processing the event, the FSM thread notifies other modules before and after the state transition.
Seven FSM states are defined. They can transition from one state to another, self-transition in some states, and transition in some sub-states.
--- drivers/net/wwan/t9xx/Makefile | 3 +- drivers/net/wwan/t9xx/mtk_ctrl_plane.c | 46 ++ drivers/net/wwan/t9xx/mtk_ctrl_plane.h | 2 + drivers/net/wwan/t9xx/mtk_dev.h | 1 + drivers/net/wwan/t9xx/mtk_fsm.c | 965 ++++++++++++++++++++++++ drivers/net/wwan/t9xx/mtk_fsm.h | 140 ++++ drivers/net/wwan/t9xx/mtk_port.c | 63 ++ drivers/net/wwan/t9xx/mtk_port.h | 2 + drivers/net/wwan/t9xx/mtk_utility.h | 33 + drivers/net/wwan/t9xx/pcie/mtk_cldma.c | 222 +++++- drivers/net/wwan/t9xx/pcie/mtk_cldma.h | 3 + drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.h | 3 - drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.c | 7 +- drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.h | 2 - drivers/net/wwan/t9xx/pcie/mtk_pci.c | 16 +- drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.c | 10 + drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h | 1 - 17 files changed, 1503 insertions(+), 16 deletions(-)
drivers/net/wwan/t9xx/Makefile +2 -1
@@ -10,4 +10,5 @@ mtk_t9xx-y := \ mtk_dev.o \ mtk_ctrl_plane.o \ mtk_port.o \ - mtk_port_io.o + mtk_port_io.o \ + mtk_fsm.o
drivers/net/wwan/t9xx/mtk_ctrl_plane.c +46 -0
70 lines not on this page · raw message
drivers/net/wwan/t9xx/mtk_ctrl_plane.h +2 -0
@@ -10,6 +10,7 @@#include <linux/skbuff.h> #include "mtk_dev.h" +#include "mtk_fsm.h" #define Q_MTU_2K (0x800)#define Q_MTU_3_5K (0xE00)
@@ -62,6 +63,7 @@ struct mtk_ctrl_hif_ops {int (*init)(struct mtk_md_dev *mdev);int (*exit)(struct mtk_md_dev *mdev);int (*submit_skb)(struct mtk_md_dev *mdev,struct sk_buff *skb,bool force_send); +void (*fsm_indication)(struct mtk_md_dev *mdev,struct mtk_fsm_param *param);int (*send_cmd)(struct mtk_md_dev *mdev,int cmd,void *data); };
drivers/net/wwan/t9xx/mtk_dev.h +1 -0
@@ -59,6 +59,7 @@ struct mtk_md_dev {u32 hw_ver;char dev_str[MTK_DEV_STR_LEN ];struct mtk_ctrl_blk *ctrl_blk; +struct mtk_md_fsm *fsm; };static inline u32 mtk_dev_get_dev_state (struct mtk_md_dev *mdev)
drivers/net/wwan/t9xx/mtk_fsm.c new file +965 -0
965 lines not on this page · raw message
drivers/net/wwan/t9xx/mtk_fsm.h new file +140 -0
140 lines not on this page · raw message
drivers/net/wwan/t9xx/mtk_port.c +63 -0
69 lines not on this page · raw message
drivers/net/wwan/t9xx/mtk_port.h +2 -0
@@ -152,6 +152,8 @@ int mtk_port_send_data(struct mtk_port *port, void *data);int mtk_port_status_update (struct mtk_md_dev *mdev,void *data,u32 data_len);int mtk_port_ch_enable (struct mtk_port *port);int mtk_port_ch_disable (struct mtk_port *port); +void mtk_port_mngr_fsm_state_handler (struct mtk_fsm_param *fsm_param,void *arg); +void mtk_port_mngr_fsm_state_handler_late (struct mtk_fsm_param *fsm_param,void *arg);int mtk_port_mngr_init (struct mtk_ctrl_blk *ctrl_blk,struct mtk_port_cfg *port_cfg,int port_cnt);void mtk_port_mngr_exit (struct mtk_ctrl_blk *ctrl_blk); void mtk_port_trb_init(struct mtk_port *port, struct trb *trb, enum mtk_trb_cmd_type cmd,
drivers/net/wwan/t9xx/mtk_utility.h new file +33 -0
@@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0-only +* +* Copyright (c) 2022, MediaTek Inc. +*/ + +#ifndef __MTK_UTILITY_H__ +#define __MTK_UTILITY_H__ + +#include <linux/device.h> +#include "mtk_dev.h" + +#define MTK_UEVENT_INFO_LEN 128 + +/* MTK uevent */ +enum mtk_uevent_id { +MTK_UEVENT_UNDEF =0 , +MTK_UEVENT_FSM =1 , +MTK_UEVENT_MINIDUMP =2 , +MTK_UEVENT_LOWPOWER =3 , +MTK_UEVENT_MAX +}; + +static inline void mtk_uevent_notify (struct device *dev,enum mtk_uevent_id id,const char *info) +{ +char buf[MTK_UEVENT_INFO_LEN ]; +char *ext[2 ] = {NULL ,NULL }; + +snprintf (buf,MTK_UEVENT_INFO_LEN ,"%s:event_id=%d, info=%s" , + dev->kobj.name, id, info); + ext[0 ] = buf; +kobject_uevent_env (&dev->kobj,KOBJ_CHANGE , ext); +} +#endif /* __MTK_UTILITY_H__ */
drivers/net/wwan/t9xx/pcie/mtk_cldma.c +221 -1
251 lines not on this page · raw message
drivers/net/wwan/t9xx/pcie/mtk_cldma.h +3 -0
@@ -167,4 +167,7 @@ int mtk_cldma_check_ch_cfg(void *dev, struct queue_info *que);#define drv_ops_name (NAME ) cldma_drv_ops_##NAME#define cldma_regs_name (NAME ) mtk_cldma_regs_##NAME +extern struct cldma_drv_ops cldma_drv_ops_m9xx; +extern struct cldma_hw_regs mtk_cldma_regs_m9xx; +#endif
drivers/net/wwan/t9xx/pcie/mtk_cldma_drv.h +0 -3
@@ -11,7 +11,6 @@#define LINK_ERROR_VAL (0xFFFFFFFF)#define CLDMA0_HW_ID (0)#define CLDMA1_HW_ID (1) -#define CLDMA4_HW_ID (4)struct cldma_hw_regs {u8 cldma_rx_skb_pool_max_size;
@@ -36,7 +35,6 @@ struct cldma_hw_regs {u16 reg_cldma_l2rimsr0;u16 reg_cldma_l2rimsr1;u16 reg_cldma_int_mask; -u16 reg_cldma4_int_mask;u16 reg_cldma_slp_mem_ctl;u16 reg_cldma_busy_mask;u16 reg_cldma_ip_busy_to_pcie_mask;
@@ -58,7 +56,6 @@ struct cldma_hw_regs {u32 rq_err_int_bitmask;u32 cldma0_base_addr;u32 cldma1_base_addr; -u32 cldma4_base_addr;u32 rq_active_start_err_int_bitmask;u32 reg_cldma_ul_start_addrl_0;u32 reg_cldma_ul_start_addrh_0;
drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.c +1 -6
@@ -34,7 +34,6 @@struct cldma_hw_regs mtk_cldma_regs_m9xx = { .cldma0_base_addr =CLDMA0_BASE_ADDR , .cldma1_base_addr =CLDMA1_BASE_ADDR , - .cldma4_base_addr =CLDMA4_BASE_ADDR , .cldma_rx_skb_pool_max_size =CLDMA_RX_SKB_POOL_MAX_SIZE , .cldma_rx_skb_reload_threshold =CLDMA_RX_SKB_RELOAD_THRESHOLD , .tq_err_int_offset =TQ_ERR_INT_OFFSET ,
@@ -93,7 +92,6 @@ struct cldma_hw_regs mtk_cldma_regs_m9xx = { .reg_cldma_l3risar1 = REG_CLDMA_L3RISAR1, .reg_cldma_ip_busy = REG_CLDMA_IP_BUSY, .reg_cldma_int_mask = REG_CLDMA_INT_EAP_USIP_MASK, - .reg_cldma4_int_mask = REG_CLDMA_INT_WF_MASK, .reg_cldma_ip_busy_to_pcie_mask = REG_CLDMA_IP_BUSY_TO_PCIE_MASK, .reg_cldma_ip_busy_to_pcie_mask_set = REG_CLDMA_IP_BUSY_TO_PCIE_MASK_SET, .reg_cldma_ip_busy_to_pcie_mask_clr = REG_CLDMA_IP_BUSY_TO_PCIE_MASK_CLR,
@@ -135,10 +133,7 @@ static void mtk_cldma_drv_init_m9xx(struct cldma_drv_info *drv_info) ALLQ << 24);/* enable interrupt to PCIe */ -if (drv_info->hw_id ==CLDMA4_HW_ID ) -mtk_pci_write32 (mdev, base + hw_regs->reg_cldma4_int_mask,0 ); -else -mtk_pci_write32 (mdev, base + hw_regs->reg_cldma_int_mask,0 ); +mtk_pci_write32 (mdev, base + hw_regs->reg_cldma_int_mask,0 );/* disable illegal memory check */ mtk_pci_write32 (mdev, base + hw_regs->reg_cldma_ul_dummy_0,1 );
drivers/net/wwan/t9xx/pcie/mtk_cldma_drv_m9xx.h +0 -2
@@ -8,7 +8,6 @@#define CLDMA0_BASE_ADDR (0x1021C000)#define CLDMA1_BASE_ADDR (0x1021E000) -#define CLDMA4_BASE_ADDR (0x10224000)#define CLDMA_RX_SKB_POOL_MAX_SIZE (64)#define CLDMA_RX_SKB_RELOAD_THRESHOLD (16)
@@ -80,7 +79,6 @@#define REG_CLDMA_L2RIMSR1 (0x0800 + 0x00FC)#define REG_CLDMA_INT_EAP_USIP_MASK (0x0800 + 0x011C) -#define REG_CLDMA_INT_WF_MASK (0x0800 + 0x0120)#define REG_CLDMA_RQ1_GPD_DONE_CNT (0x0800 + 0x0174)#define REG_CLDMA_TQ1_GPD_DONE_CNT (0x0800 + 0x0184)
drivers/net/wwan/t9xx/pcie/mtk_pci.c +14 -2
@@ -883,22 +883,34 @@ static int mtk_pci_dev_init(struct mtk_md_dev *mdev) {int ret; - ret =mtk_trans_ctrl_init (mdev); + ret =mtk_fsm_init (mdev);if (ret) { -dev_err (mdev->dev,"Failed to initialize control plane: %d\n" , ret); +dev_err (mdev->dev,"Failed to initialize FSM: %d\n" , ret);return ret; } + ret =mtk_trans_ctrl_init (mdev); +if (ret) + goto free_fsm; +return 0 ; +free_fsm: +mtk_fsm_exit (mdev); +return ret; }static void mtk_pci_dev_exit (struct mtk_md_dev *mdev) { +mtk_fsm_evt_submit (mdev,FSM_EVT_DEV_RM ,0 ,NULL ,0 , +EVT_MODE_BLOCKING |EVT_MODE_TOHEAD );mtk_trans_ctrl_exit (mdev); +mtk_fsm_exit (mdev); }static int mtk_pci_dev_start (struct mtk_md_dev *mdev) { +mtk_fsm_evt_submit (mdev,FSM_EVT_DEV_ADD ,0 ,NULL ,0 ,0 ); +mtk_fsm_start (mdev);return 0 ; }static const struct mtk_dev_ops pci_hw_ops = {
drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.c +10 -0
@@ -455,6 +455,15 @@ static int mtk_pcie_hif_submit_skb(struct mtk_md_dev *mdev, struct sk_buff *skb,return 0 ; } +static void mtk_pcie_hif_fsm_indication (struct mtk_md_dev *mdev,struct mtk_fsm_param *param) +{ +struct mtk_ctrl_blk *ctrl_blk = mdev->ctrl_blk; +struct mtk_ctrl_trans *trans; + + trans = ctrl_blk->ctrl_hw_priv; +mtk_cldma_fsm_state_listener (param, trans); +} +static int mtk_pcie_hif_cmd_func (struct mtk_md_dev *mdev,int cmd,void *data) {struct mtk_ctrl_blk *ctrl_blk = mdev->ctrl_blk;
@@ -482,6 +491,7 @@ static struct mtk_ctrl_hif_ops pcie_ctrl_ops = { .init = mtk_pcie_hif_init, .exit = mtk_pcie_hif_exit, .submit_skb = mtk_pcie_hif_submit_skb, + .fsm_indication = mtk_pcie_hif_fsm_indication, .send_cmd = mtk_pcie_hif_cmd_func, };
drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h +0 -1
@@ -29,7 +29,6 @@enum mtk_hif_id {CLDMA0 ,CLDMA1 , -CLDMA4 ,NR_CLDMA };
Signature · 1 line
2.34.1
PATCH v5 6/7 net: wwan: t9xx: Add AT & MBIM WWAN ports
In reply to Jack WuAdd AT & MBIM ports to the port infrastructure.
The WWAN initialization method is responsible for creating the corresponding ports using the WWAN framework infrastructure. The implemented WWAN port operations are start, stop, tx, tx_blocking and tx_poll.
--- drivers/net/wwan/t9xx/mtk_port.c | 26 ++ drivers/net/wwan/t9xx/mtk_port.h | 13 + drivers/net/wwan/t9xx/mtk_port_io.c | 335 +++++++++++++++++++++++++ drivers/net/wwan/t9xx/mtk_port_io.h | 5 + drivers/net/wwan/t9xx/pcie/mtk_ctrl_cfg_m9xx.c | 8 + 5 files changed, 387 insertions(+)
drivers/net/wwan/t9xx/mtk_port.c +26 -0
@@ -819,6 +819,29 @@ int mtk_port_ch_disable(struct mtk_port *port)return ret; } +static int mtk_port_enable_by_type (struct mtk_port_mngr *port_mngr,int tbl_type) +{ +struct mtk_port **ports; +int ret, idx; + +if (tbl_type <0 || tbl_type >=PORT_TBL_MAX ) +return -EINVAL ; + + ports =kcalloc (port_mngr->port_cnt,sizeof (struct mtk_port *),GFP_KERNEL ); +if (!ports) +return -ENOMEM ; + + ret =radix_tree_gang_lookup (&port_mngr->port_tbl[tbl_type], + (void **)ports,0 , port_mngr->port_cnt); +for (idx =0 ; idx < ret; idx++) { +if (ports[idx]->enable) + ports_ops[ports[idx]->info.type]->enable (ports[idx]); + } + +kfree (ports); +return 0 ; +} +static void mtk_port_disable (struct mtk_port_mngr *port_mngr) {struct radix_tree_iter iter;
@@ -850,6 +873,9 @@ void mtk_port_mngr_fsm_state_handler(struct mtk_fsm_param *fsm_param, void *arg)case FSM_STATE_OFF :mtk_port_disable (port_mngr);break ; +case FSM_STATE_READY : +mtk_port_enable_by_type (port_mngr,PORT_TBL_MD ); +break ;default :break ; }
drivers/net/wwan/t9xx/mtk_port.h +13 -0
@@ -56,6 +56,10 @@ enum mtk_ccci_ch {/* to MD */ CCCI_CONTROL_RX =0x2000 ,CCCI_CONTROL_TX =0x2001 , +CCCI_UART2_RX =0x200A , +CCCI_UART2_TX =0x200C , +CCCI_MBIM_RX =0x20D0 , + CCCI_MBIM_TX = 0x20D1, }; enum mtk_port_flag {
@@ -73,6 +77,7 @@ enum mtk_port_tbl {enum mtk_port_type {PORT_TYPE_INTERNAL , +PORT_TYPE_WWAN ,PORT_TYPE_MAX };
@@ -81,6 +86,13 @@ struct mtk_internal_port {int (*recv_cb)(void *arg,struct sk_buff *skb); }; +struct mtk_wwan_port { +/* w_lock protects wwan_port when recv data and disable port at the same time */ +struct mutex w_lock; +int w_type; +void *w_port; +}; +struct mtk_port_cfg {enum mtk_ccci_ch tx_ch;enum mtk_ccci_ch rx_ch;
@@ -110,6 +122,7 @@ struct mtk_port {char dev_str[MTK_DEV_STR_LEN ];struct mtk_port_mngr *port_mngr;struct mtk_internal_port i_priv; +struct mtk_wwan_port w_priv; };struct mtk_port_mngr {
drivers/net/wwan/t9xx/mtk_port_io.c +335 -0
353 lines not on this page · raw message
drivers/net/wwan/t9xx/mtk_port_io.h +5 -0
@@ -23,6 +23,11 @@ struct port_ops {int (*recv)(struct mtk_port *port,struct sk_buff *skb); }; +union user_buf { +void __user *ubuf; +void *kbuf; +}; +void *mtk_port_internal_open (struct mtk_md_dev *mdev,char *name,int flag);int mtk_port_internal_close (void *i_port);int mtk_port_internal_write (void *i_port,struct sk_buff *skb);
drivers/net/wwan/t9xx/pcie/mtk_ctrl_cfg_m9xx.c +8 -0
@@ -16,6 +16,10 @@ static const int mtk_srv_cfg_m9xx[NR_CLDMA][HW_QUE_NUM] = {/* the number of RX GPDs should be at last two */ static const struct queue_info mtk_queue_info_m9xx[] = { + {CCCI_UART2_TX ,CCCI_UART2_RX ,CLDMA1 ,TXQ (5 ),RXQ (5 ), +Q_MTU_3_5K ,Q_MTU_3_5K ,TX_GPD_NUM ,RX_GPD_NUM ,Q_FRAG_3_5K ,Q_FRAG_3_5K ,0 }, + {CCCI_MBIM_TX ,CCCI_MBIM_RX ,CLDMA1 ,TXQ (2 ),RXQ (2 ), +Q_MTU_3_5K ,Q_MTU_3_5K ,TX_GPD_NUM ,RX_GPD_NUM ,Q_FRAG_3_5K ,Q_FRAG_3_5K ,0 }, {CCCI_CONTROL_TX ,CCCI_CONTROL_RX ,CLDMA1 ,TXQ (0 ),RXQ (0 ),Q_MTU_3_5K ,Q_MTU_3_5K ,TX_GPD_NUM ,RX_GPD_NUM ,Q_FRAG_3_5K ,Q_FRAG_3_5K ,0 }, {CCCI_SAP_CONTROL_TX ,CCCI_SAP_CONTROL_RX ,CLDMA0 ,TXQ (0 ),RXQ (0 ),
@@ -23,6 +27,10 @@ static const struct queue_info mtk_queue_info_m9xx[] = { };static const struct mtk_port_cfg port_cfg_m9xx[] = { + {CCCI_UART2_TX ,CCCI_UART2_RX ,PORT_TYPE_WWAN ,"AT" , +PORT_F_ALLOW_DROP }, + {CCCI_MBIM_TX ,CCCI_MBIM_RX ,PORT_TYPE_WWAN ,"MBIM" , +PORT_F_ALLOW_DROP }, {CCCI_CONTROL_TX ,CCCI_CONTROL_RX ,PORT_TYPE_INTERNAL ,"MDCTRL" ,PORT_F_ALLOW_DROP }, {CCCI_SAP_CONTROL_TX ,CCCI_SAP_CONTROL_RX ,PORT_TYPE_INTERNAL ,"SAPCTRL" ,
Signature · 1 line
2.34.1
PATCH v5 7/7 net: wwan: t9xx: Add maintainers entry
In reply to Jack WuAdd MAINTAINERS entry for the MediaTek T9XX 5G WWAN modem device driver.
--- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+)
MAINTAINERS +11 -0
@@ -16494,6 +16494,17 @@ L: [email protected] S: Supported F: drivers/net/wwan/t7xx/ +MEDIATEK T9XX 5G WWAN MODEM DRIVER +M: Jack Wu <[email protected]> +M: Robert Yu <[email protected]> +M: Jeff Chang <[email protected]> +R: Wen-Zhi Huang <[email protected]> +R: Shi-Wei Yeh <[email protected]> +R: Minano Tseng <[email protected]> +L: [email protected] +S: Supported +F: drivers/net/wwan/t9xx/ + MEDIATEK USB3 DRD IP DRIVER M: Chunfeng Yun <[email protected]> L: [email protected]
Signature · 1 line
2.34.1