Article View: linux.kernel.netdev
Article #3025[PATCH v10 2/6] net: wwan: t9xx: Add control plane transaction layer framework
From: Jack Wu via B4 Relay
Date: Wed, 14 Oct 2026 02:51
Date: Wed, 14 Oct 2026 02:51
175 lines
11208 bytes
11208 bytes
From: Jack Wu <jackbb_wu@compal.com>
Introduce 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, and
mtk_ctrl_init() and mtk_ctrl_exit() get their first callers
there, in pcie/mtk_trans_ctrl.c.
Signed-off-by: Jack Wu <jackbb_wu@compal.com>
---
drivers/net/wwan/t9xx/Makefile | 1 +
drivers/net/wwan/t9xx/mtk_ctrl_plane.c | 46 +++++++++++++++++++++++++++++
drivers/net/wwan/t9xx/mtk_ctrl_plane.h | 21 +++++++++++++
drivers/net/wwan/t9xx/mtk_dev.h | 3 ++
drivers/net/wwan/t9xx/pcie/mtk_pci.c | 1 +
drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h | 20 +++++++++++++
6 files changed, 92 insertions(+)
diff --git a/drivers/net/wwan/t9xx/Makefile b/drivers/net/wwan/t9xx/Makefile
index bd6063c85c2b..0a07507f1ddf 100644
--- a/drivers/net/wwan/t9xx/Makefile
+++ b/drivers/net/wwan/t9xx/Makefile
@@ -6,4 +6,5 @@ ccflags-y += -I$(src)
obj-$(CONFIG_MTK_T9XX) += mtk_t9xx.o
mtk_t9xx-y := \
+ mtk_ctrl_plane.o \
pcie/mtk_pci.o
diff --git a/drivers/net/wwan/t9xx/mtk_ctrl_plane.c b/drivers/net/wwan/t9xx/mtk_ctrl_plane.c
new file mode 100644
index 000000000000..81f6b3fbc0bd
--- /dev/null
+++ b/drivers/net/wwan/t9xx/mtk_ctrl_plane.c
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2022, MediaTek Inc.
+ * Copyright (c) 2022-2023, Intel Corporation.
+ */
+
+#include <linux/device.h>
+
+#include "mtk_ctrl_plane.h"
+
+/**
+ * mtk_ctrl_init() - Initialize the control plane block.
+ * @mdev: Pointer to the MTK modem device.
+ *
+ * Allocates and initializes the control plane block
+ * associated with @mdev. Runs once per bind; the allocation is
+ * devres managed and is released at unbind, not by
+ * mtk_ctrl_exit().
+ *
+ * Return: 0 on success, -ENOMEM on allocation failure.
+ */
+int mtk_ctrl_init(struct mtk_md_dev *mdev)
+{
+ struct mtk_ctrl_blk *ctrl_blk;
+
+ ctrl_blk = devm_kzalloc(mdev->dev, sizeof(*ctrl_blk), GFP_KERNEL);
+ if (!ctrl_blk)
+ return -ENOMEM;
+
+ ctrl_blk->mdev = mdev;
+ mdev->ctrl_blk = ctrl_blk;
+
+ return 0;
+}
+
+/**
+ * mtk_ctrl_exit() - Clean up the control plane block.
+ * @mdev: Pointer to the MTK modem device.
+ *
+ * Clears the control plane block pointer. The allocation
+ * itself is managed by devres and freed on driver detach.
+ */
+void mtk_ctrl_exit(struct mtk_md_dev *mdev)
+{
+ mdev->ctrl_blk = NULL;
+}
diff --git a/drivers/net/wwan/t9xx/mtk_ctrl_plane.h b/drivers/net/wwan/t9xx/mtk_ctrl_plane.h
new file mode 100644
index 000000000000..46f1ab9f0551
--- /dev/null
+++ b/drivers/net/wwan/t9xx/mtk_ctrl_plane.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-only
+ *
+ * Copyright (c) 2022, MediaTek Inc.
+ */
+
+#ifndef __MTK_CTRL_PLANE_H__
+#define __MTK_CTRL_PLANE_H__
+
+#include <linux/skbuff.h>
+
+#include "mtk_dev.h"
+
+struct mtk_ctrl_blk {
+ struct mtk_md_dev *mdev;
+ void *ctrl_hw_priv;
+};
+
+int mtk_ctrl_init(struct mtk_md_dev *mdev);
+void mtk_ctrl_exit(struct mtk_md_dev *mdev);
+
+#endif /* __MTK_CTRL_PLANE_H__ */
diff --git a/drivers/net/wwan/t9xx/mtk_dev.h b/drivers/net/wwan/t9xx/mtk_dev.h
index 329e5e6695df..84fcd980110b 100644
--- a/drivers/net/wwan/t9xx/mtk_dev.h
+++ b/drivers/net/wwan/t9xx/mtk_dev.h
@@ -31,12 +31,15 @@ enum mtk_dev_evt_d2h {
DEV_EVT_D2H_ASYNC_HS_NOTIFY_MD = BIT(6),
};
+struct mtk_ctrl_blk;
+
/* mtk_md_dev defines the structure of MTK modem device */
struct mtk_md_dev {
struct device *dev;
void *hw_priv;
u32 hw_ver;
char dev_str[MTK_DEV_STR_LEN];
+ struct mtk_ctrl_blk *ctrl_blk;
};
#endif /* __MTK_DEV_H__ */
diff --git a/drivers/net/wwan/t9xx/pcie/mtk_pci.c b/drivers/net/wwan/t9xx/pcie/mtk_pci.c
index a3bd1caf470b..9fa61f08174d 100644
--- a/drivers/net/wwan/t9xx/pcie/mtk_pci.c
+++ b/drivers/net/wwan/t9xx/pcie/mtk_pci.c
@@ -13,6 +13,7 @@
#include <linux/module.h>
#include "mtk_dev.h"
+#include "mtk_trans_ctrl.h"
#include "mtk_pci.h"
#include "mtk_pci_reg.h"
diff --git a/drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h b/drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h
new file mode 100644
index 000000000000..50b1c366a4c8
--- /dev/null
+++ b/drivers/net/wwan/t9xx/pcie/mtk_trans_ctrl.h
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-only
+ *
+ * Copyright (c) 2022, MediaTek Inc.
+ */
+
+#ifndef __MTK_TRANS_CTRL_H__
+#define __MTK_TRANS_CTRL_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
--
2.34.1
Technical Details
Message-ID:
<20261014-t9xx_driver_v1-v10-2-4d0dde3613f5@compal.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345977-linux-kernel-netdev=dewy.ruReferences:
<20261014-t9xx_driver_v1-v10-0-4d0dde3613f5@compal.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345977-linux-kernel-netdev=dewy.ru From: devnull+jackbb_wu.compal.com@kernel.org (Jack Wu via B4 Relay) Newsgroups: linux.kernel.netdev Subject: [PATCH v10 2/6] net: wwan: t9xx: Add control plane transaction layer framework Date: Wed, 14 Oct 2026 10:51:00 +0800 Organization: Usenet Network Message-ID: <20261014-t9xx_driver_v1-v10-2-4d0dde3613f5@compal.com> References: <20261014-t9xx_driver_v1-v10-0-4d0dde3613f5@compal.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="2202796"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Me2qs2hKObXV6X7oxwdy4Kd/drk= sha256:C/soJwiuvmPfwJUM9iwbvOuW7gemsiUaYpSvSuWs5xQ= sha1:co9ND6Ir+Xh86Pq/1+dmDNU+XaY= sha256:eDhaTeovfFXhl11b3eF28w6zRRUgyCNuwrCSkNEyP4M= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id AC23410FFB7; Wed, 14 Oct 2026 05:53:05 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.34 X-Spam-Status: No, score=-1.34 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8sjMskvvEkVh; Wed, 14 Oct 2026 05:53:03 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-345977-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id A76B810FFB1; Wed, 14 Oct 2026 05:52:48 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 2B57C2C06E; Wed, 14 Oct 2026 02:52:46 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96DD739768C; Wed, 14 Oct 2026 02:52:45 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eCPJbxCu" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7034A3019D9; Wed, 14 Oct 2026 02:52:45 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791946365; cv=none; b=soUQ8rDQFv4hxu93iXVphy8XGKY33nGbPhPsg7kRSpBxAdA4Pbz2baFl476wZk/CFoUiUIW0qVZsjuwUOYQHe/tdHleu6RXZxil94VvITDgy79LKo0Vj8m66ponnGvkdFA5gRs2Rg9hdI8jgb/kkw+LGbzEodC6uLY9NJ+KktHE= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791946365; c=relaxed/simple; bh=6QAs/AWFg+oBZWeRI/xjXG7Fb0aOe9h+Fc+Luoc3Buo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EA5UXPntdNhjvncxVpgm3xkydg+85o0juDVx09p8NBOYV8SVmAXtkKRxo7VkyACfL+gbdRfv+vjRxaqNfE+9GvYNK9Bf42m7PxFsDlW9RjJvFkyWG8K6R69wV8DtwxFm8lxVuZZE7vswZ7yyTenO+GpabMj3uDuPhZdcnbnkV1M= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eCPJbxCu; arc=none smtp.client-ip=10.30.226.201 X-Received: by smtp.kernel.org (Postfix) with ESMTPS id 2D3F3C2BCFD; Wed, 14 Oct 2026 02:52:45 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1791946365; bh=6QAs/AWFg+oBZWeRI/xjXG7Fb0aOe9h+Fc+Luoc3Buo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=eCPJbxCuNea0z4pF0nB2hK/Mg/QZpcF7OYLr7NVfTbew7cMV7P8a2HzSAe/8xtXhL tzUJ240YkwpfN144bGvFKFJm7mIOlx3UeNSvQWFUeOFCKtu9qkU7JPR1S5g8Fp7HY/ rRchVdFpO/+55ene0uHn0U30dlpAU3jQSiBE3bQtzA4PUd4NN6OhevUO+k1zg+at7W PcZfGDjnlJ9/AdsUPpNAg0RCRzn9Pd/jSMl1YIFqL7JJKlxe976C26i9YereMouken 5fafPKiYxYsHzJ9SYUf3HvHEnj6Zeh4QD+N6h2odKc9KdB8uK5V7ee2vMmXRPmW7BX Q8bNF8ke1If7w== X-Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B4B8CC6B20; Wed, 14 Oct 2026 02:52:45 +0000 (UTC) X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-In-Reply-To: <20261014-t9xx_driver_v1-v10-0-4d0dde3613f5@compal.com> X-Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-doc@vger.kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1791946362; l=5009; i=jackbb_wu@compal.com; s=20260526; h=from:subject:message-id; bh=Lzrnn7C9a9Y9E/a8QXchnvLpm0gvt2cHKib9+c/G3dM=; b=ZkxvWXrNy9RHFPhO09nFO9Eeq/r66bg+SilozXTSbFiTj2uS9wd0ew4B1K0VPiZhBpOWlQxSa OY0JXQYU8glAeHWLlBsn71LRGeUhpU8TI1/ot2E/E6Pvw8NB+9lLNnC X-Developer-Key: i=jackbb_wu@compal.com; a=ed25519; pk=VH1prTWixNl8OEUPPSfII3p46MzJpQN8J3+ecE1tZXg= X-Endpoint-Received: by B4 Relay for jackbb_wu@compal.com/20260526 with auth_id=793 X-Original-From: Jack Wu <jackbb_wu@compal.com> X-Reply-To: jackbb_wu@compal.com