OSDN Git Service

net: wwan: core: implement terminal ioctls for AT port
authorSergey Ryazanov <ryazanov.s.a@gmail.com>
Tue, 8 Jun 2021 04:02:40 +0000 (07:02 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jun 2021 21:33:43 +0000 (14:33 -0700)
commitc230035c2f2f6371739f29e56eeb2611172225c8
tree4dafa6a060e84a5b3568149af392cbeeddea5340
parente263c5b2e8912149b49d757511d85a16c5fb432f
net: wwan: core: implement terminal ioctls for AT port

It is not unreasonable to assume that users will use terminal emulation
software to communicate directly with a WWAN device over the AT port.
But terminal emulators  will refuse to work with a device that does not
support terminal IOCTLs (e.g. TCGETS, TCSETS, TIOCMSET, etc.). To make
it possible to interact with the WWAN AT port using a terminal emulator,
implement a minimal set of terminal IOCTLs.

The implementation is rather stub, no passed data are actually used to
control a port behaviour. An obtained configuration is kept inside the
port structure and returned back by a request. The latter is done to
fool a program that will test the configuration status by comparing the
readed back data from the device with earlier configured ones.

Tested with fresh versions of minicom and picocom terminal apps.

MBIM, QMI and other ports for binary protocols can hardly be considered
a terminal device, so terminal IOCTLs are only implemented for the AT
port.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wwan/wwan_core.c