Commit 8b6b3da7 authored by Marcel Holtmann's avatar Marcel Holtmann

[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: default avatarDenis Kenzior <denis.kenzior@trolltech.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent ca37bdd5
...@@ -180,6 +180,7 @@ struct rfcomm_dlc { ...@@ -180,6 +180,7 @@ struct rfcomm_dlc {
u8 addr; u8 addr;
u8 priority; u8 priority;
u8 v24_sig; u8 v24_sig;
u8 remote_v24_sig;
u8 mscex; u8 mscex;
u8 out; u8 out;
......
...@@ -1463,8 +1463,12 @@ static int rfcomm_recv_msc(struct rfcomm_session *s, int cr, struct sk_buff *skb ...@@ -1463,8 +1463,12 @@ static int rfcomm_recv_msc(struct rfcomm_session *s, int cr, struct sk_buff *skb
clear_bit(RFCOMM_TX_THROTTLED, &d->flags); clear_bit(RFCOMM_TX_THROTTLED, &d->flags);
rfcomm_dlc_lock(d); rfcomm_dlc_lock(d);
d->remote_v24_sig = msc->v24_sig;
if (d->modem_status) if (d->modem_status)
d->modem_status(d, msc->v24_sig); d->modem_status(d, msc->v24_sig);
rfcomm_dlc_unlock(d); rfcomm_dlc_unlock(d);
rfcomm_send_msc(s, 0, dlci, msc->v24_sig); rfcomm_send_msc(s, 0, dlci, msc->v24_sig);
......
...@@ -271,6 +271,9 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc) ...@@ -271,6 +271,9 @@ static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
dlc->owner = dev; dlc->owner = dev;
dev->dlc = dlc; dev->dlc = dlc;
rfcomm_dev_modem_status(dlc, dlc->remote_v24_sig);
rfcomm_dlc_unlock(dlc); rfcomm_dlc_unlock(dlc);
/* It's safe to call __module_get() here because socket already /* It's safe to call __module_get() here because socket already
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment