Re: [PATCH] wwan: t7xx: Add CONFIG_WWAN_DEBUG_PORTS to control ADB debug port
From: Loic Poulain
Date: Fri Jan 09 2026 - 03:58:43 EST
On Thu, Jan 8, 2026 at 1:53 PM wanquan.zhong <zwq2226404116@xxxxxxx> wrote:
>
> From: "wanquan.zhong" <wanquan.zhong@xxxxxxxxxxx>
>
> 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@xxxxxxxxxxx>
> ---
> 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.
> +
So, ultimately, this port will depend on debugfs being enabled, so it
might be simpler to move the `port_conf/debug` attribute from sysfs
to debugfs? Additionally, the symbol config name is quite generic,
while its description is specific to ADB.
Regards,
Loic