summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorDaniel Starke <daniel.starke@siemens.com>2022-08-31 09:38:00 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-22 16:05:00 +0200
commitc22d054f1ed6b3e990436c2dde7d3b7d6a170cff (patch)
treec3354072399d947f6d3102cdae022849ebc6660c /drivers/tty
parentc07da737af4dd9a29508ae2863fa2afdec130088 (diff)
downloadlinux-c22d054f1ed6b3e990436c2dde7d3b7d6a170cff.tar.bz2
tty: n_gsm: add debug bit for user payload
A debug bit to output a complete transmission dump exists. Sometimes only the user frames are relevant. Add an additional bit which limits the transmission dump output to user data frames if set. Signed-off-by: Daniel Starke <daniel.starke@siemens.com> Link: https://lore.kernel.org/r/20220831073800.7459-6-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/n_gsm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index e7ba15522215..5e516f5cac5a 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -69,6 +69,7 @@ module_param(debug, int, 0600);
#define DBG_DATA BIT(2) /* Data transmission details. */
#define DBG_ERRORS BIT(3) /* Details for fail conditions. */
#define DBG_TTY BIT(4) /* Transmission statistics for DLCI TTYs. */
+#define DBG_PAYLOAD BIT(5) /* Limits DBG_DUMP to payload frames. */
/* Defaults: these are from the specification */
@@ -598,6 +599,10 @@ static void gsm_print_packet(const char *hdr, int addr, int cr,
{
if (!(debug & DBG_DUMP))
return;
+ /* Only show user payload frames if debug & DBG_PAYLOAD */
+ if (!(debug & DBG_PAYLOAD) && addr != 0)
+ if ((control & ~PF) == UI || (control & ~PF) == UIH)
+ return;
pr_info("%s %d) %c: ", hdr, addr, "RC"[cr]);