Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[Bluetooth] Store remote modem status for RFCOMM TTY

When switching a RFCOMM socket to a TTY, the remote modem status might
be needed later. Currently it is lost since the original configuration
is done via the socket interface. So store the modem status and reply
it when the socket has been converted to a TTY.

Signed-off-by: Denis Kenzior <denis.kenzior@trolltech.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

+8
+1
include/net/bluetooth/rfcomm.h
··· 180 180 u8 addr; 181 181 u8 priority; 182 182 u8 v24_sig; 183 + u8 remote_v24_sig; 183 184 u8 mscex; 184 185 u8 out; 185 186
+4
net/bluetooth/rfcomm/core.c
··· 1463 1463 clear_bit(RFCOMM_TX_THROTTLED, &d->flags); 1464 1464 1465 1465 rfcomm_dlc_lock(d); 1466 + 1467 + d->remote_v24_sig = msc->v24_sig; 1468 + 1466 1469 if (d->modem_status) 1467 1470 d->modem_status(d, msc->v24_sig); 1471 + 1468 1472 rfcomm_dlc_unlock(d); 1469 1473 1470 1474 rfcomm_send_msc(s, 0, dlci, msc->v24_sig);
+3
net/bluetooth/rfcomm/tty.c
··· 271 271 272 272 dlc->owner = dev; 273 273 dev->dlc = dlc; 274 + 275 + rfcomm_dev_modem_status(dlc, dlc->remote_v24_sig); 276 + 274 277 rfcomm_dlc_unlock(dlc); 275 278 276 279 /* It's safe to call __module_get() here because socket already