public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wwan: t7xx: Add CONFIG_WWAN_DEBUG_PORTS to control ADB debug port
@ 2026-01-08 12:52 wanquan.zhong
  2026-01-08 23:00 ` Sergey Ryazanov
  2026-01-09  8:56 ` [PATCH] wwan: t7xx: Add CONFIG_WWAN_DEBUG_PORTS to control ADB debug port Loic Poulain
  0 siblings, 2 replies; 5+ messages in thread
From: wanquan.zhong @ 2026-01-08 12:52 UTC (permalink / raw)
  To: chandrashekar.devegowda, chiranjeevi.rapolu, haijun.liu,
	ricardo.martinez
  Cc: netdev, loic.poulain, ryazanov.s.a, johannes, davem,
	andrew+netdev, kuba, pabeni, linux-kernel, wanquan.zhong

From: "wanquan.zhong" <wanquan.zhong@fibocom.com>

Add a new Kconfig option CONFIG_WWAN_DEBUG_PORTS for WWAN devices,
to conditionally enable the ADB debug port functionality. This option:
- Depends on DEBUG_FS (aligning with existing debug-related WWAN configs)
- Defaults to 'y',If default to n, it may cause difficulties for t7xx
debugging
- Requires EXPERT to be visible (to avoid accidental enablement)

In t7xx_port_proxy.c, wrap the ADB port configuration struct with
CONFIG_WWAN_DEBUG_PORTS, so the port is only exposed when
the config is explicitly enabled (e.g. for lab debugging scenarios).

This aligns with security best practices of restricting debug interfaces
on production user devices, while retaining access for development.

Signed-off-by: wanquan.zhong <wanquan.zhong@fibocom.com>
---
 drivers/net/wwan/Kconfig                | 11 +++++++++++
 drivers/net/wwan/t7xx/t7xx_port_proxy.c |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/drivers/net/wwan/Kconfig b/drivers/net/wwan/Kconfig
index 410b0245114e..0ab8122efd76 100644
--- a/drivers/net/wwan/Kconfig
+++ b/drivers/net/wwan/Kconfig
@@ -27,6 +27,17 @@ config WWAN_DEBUGFS
 	  elements for each WWAN device in a directory that is corresponding to
 	  the device name: debugfs/wwan/wwanX.
 
+config WWAN_DEBUG_PORTS
+	bool "WWAN devices ADB debug port" if EXPERT
+	depends on DEBUG_FS
+	default y
+	help
+	  Enables ADB (Android Debug Bridge) debug port support for WWAN devices.
+
+	  If this option is selected, then the ADB debug port functionality in
+	  WWAN device drivers is enabled, allowing for Android Debug Bridge
+	  connections through WWAN modems that support this feature.
+
 config WWAN_HWSIM
 	tristate "Simulated WWAN device"
 	help
diff --git a/drivers/net/wwan/t7xx/t7xx_port_proxy.c b/drivers/net/wwan/t7xx/t7xx_port_proxy.c
index 4fc131f9632f..23b331780f07 100644
--- a/drivers/net/wwan/t7xx/t7xx_port_proxy.c
+++ b/drivers/net/wwan/t7xx/t7xx_port_proxy.c
@@ -102,6 +102,7 @@ static const struct t7xx_port_conf t7xx_port_conf[] = {
 		.ops = &ctl_port_ops,
 		.name = "t7xx_ap_ctrl",
 	}, {
+#ifdef CONFIG_WWAN_DEBUG_PORTS
 		.tx_ch = PORT_CH_AP_ADB_TX,
 		.rx_ch = PORT_CH_AP_ADB_RX,
 		.txq_index = Q_IDX_ADB,
@@ -112,6 +113,7 @@ static const struct t7xx_port_conf t7xx_port_conf[] = {
 		.port_type = WWAN_PORT_ADB,
 		.debug = true,
 	}, {
+#endif
 		.tx_ch = PORT_CH_MIPC_TX,
 		.rx_ch = PORT_CH_MIPC_RX,
 		.txq_index = Q_IDX_MBIM_MIPC,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-14 19:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 12:52 [PATCH] wwan: t7xx: Add CONFIG_WWAN_DEBUG_PORTS to control ADB debug port wanquan.zhong
2026-01-08 23:00 ` Sergey Ryazanov
2026-01-14 13:14   ` [PATCH] net: wwan: t7xx: Add CONFIG_WWAN_ADB_PORT for ADB port control wanquan.zhong
2026-01-14 19:03     ` Sergey Ryazanov
2026-01-09  8:56 ` [PATCH] wwan: t7xx: Add CONFIG_WWAN_DEBUG_PORTS to control ADB debug port Loic Poulain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox