mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 10:13:57 +08:00
Bluetooth: Directly close dlc for not yet started RFCOMM session
If the RFCOMM session has not yet been started (ie., session is still in BT_BOUND state) when a dlc is closed, directly close and unlink the dlc rather than sending a DISC frame that is never sent. This allows the dlci to be immediately reused rather than waiting for a 20 second timeout. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Tested-By: Alexander Holler <holler@ahsoftware.de> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
f622357a5e
commit
c4fd318d6e
@ -468,13 +468,19 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
|
||||
|
||||
switch (d->state) {
|
||||
case BT_CONNECT:
|
||||
case BT_CONFIG:
|
||||
/* Fall through */
|
||||
|
||||
case BT_CONNECTED:
|
||||
__rfcomm_dlc_disconn(d);
|
||||
break;
|
||||
|
||||
case BT_CONFIG:
|
||||
if (s->state != BT_BOUND) {
|
||||
__rfcomm_dlc_disconn(d);
|
||||
break;
|
||||
}
|
||||
/* if closing a dlc in a session that hasn't been started,
|
||||
* just close and unlink the dlc
|
||||
*/
|
||||
|
||||
default:
|
||||
rfcomm_dlc_clear_timer(d);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user