aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-05-04 18:36:13 -0400
committerMarcel Holtmann <marcel@holtmann.org>2007-05-04 18:36:13 -0400
commit9cf5b0ea3a7f1432c61029f7aaf4b8b338628884 (patch)
treedf659b3fe371301a6dba33782451655a09e9c25b /net/bluetooth
parent77f2a45fa1ba33147fd6cc8ae546188504a822cd (diff)
[Bluetooth] Disconnect L2CAP connection after last RFCOMM DLC
The RFCOMM specification says that the device closing the last DLC on a particular session is responsible for closing the multiplexer by closing the corresponding L2CAP channel. Signed-off-by: Ville Tervo <ville.tervo@nokia.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/rfcomm/core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 71a72fcb2b54..52e04df323ea 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -1058,6 +1058,12 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci)
1058 case BT_DISCONN: 1058 case BT_DISCONN:
1059 d->state = BT_CLOSED; 1059 d->state = BT_CLOSED;
1060 __rfcomm_dlc_close(d, 0); 1060 __rfcomm_dlc_close(d, 0);
1061
1062 if (list_empty(&s->dlcs)) {
1063 s->state = BT_DISCONN;
1064 rfcomm_send_disc(s, 0);
1065 }
1066
1061 break; 1067 break;
1062 } 1068 }
1063 } else { 1069 } else {
@@ -1067,6 +1073,10 @@ static int rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci)
1067 s->state = BT_CONNECTED; 1073 s->state = BT_CONNECTED;
1068 rfcomm_process_connect(s); 1074 rfcomm_process_connect(s);
1069 break; 1075 break;
1076
1077 case BT_DISCONN:
1078 rfcomm_session_put(s);
1079 break;
1070 } 1080 }
1071 } 1081 }
1072 return 0; 1082 return 0;