tty: n_gsm: Fix control dlci ADM mode processing
authorIvaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Sat, 28 Dec 2024 15:01:00 +0000 (17:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Jan 2025 10:50:07 +0000 (11:50 +0100)
commit4a495b97b273fee77a8d77c579ebdd0d0d77f87c
treec14c37b8e0f85d82a602264ea05163a0e61ce2f7
parente2e4025bc5461258a48cb331107c5b55b3c787d3
tty: n_gsm: Fix control dlci ADM mode processing

Currently, code retries n2 times to open control dlci in ABM mode before
switching to ADM mode, but only if DM has been received. This contradicts
to the comment that dlci is switched to control mode unconditionally if
DLCI_OPENING retries time out. Also, it does not make sense to continue
trying once DM has received.

Change the logic to switch to ADM mode upon DM received. That way control
channel state will change to DLCI_OPEN way faster. Fix the misleading
comment while at it.

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20241228150100.100354-3-ivo.g.dimitrov.75@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_gsm.c