From: "wanquan.zhong" 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 'n' (disabled by default for user devices) - 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 --- drivers/net/wwan/Kconfig | 11 +++++++++++ drivers/net/wwan/t7xx/t7xx_port_proxy.c | 2 ++ 2 files changed, 13 insertions(+) mode change 100644 => 100755 drivers/net/wwan/Kconfig mode change 100644 => 100755 drivers/net/wwan/t7xx/t7xx_port_proxy.c diff --git a/drivers/net/wwan/Kconfig b/drivers/net/wwan/Kconfig old mode 100644 new mode 100755 index 410b0245114e..70edfd0c03bb --- 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 n + 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 old mode 100644 new mode 100755 index 4fc131f9632f..23b331780f07 --- 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