diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_event.c | 18 | ||||
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 1 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 1 | ||||
-rw-r--r-- | net/bluetooth/sco.c | 13 |
4 files changed, 24 insertions, 9 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index f13ddbf858ba..77930aa522e3 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -477,14 +477,16 @@ static void hci_setup_event_mask(struct hci_dev *hdev) | |||
477 | * command otherwise */ | 477 | * command otherwise */ |
478 | u8 events[8] = { 0xff, 0xff, 0xfb, 0xff, 0x00, 0x00, 0x00, 0x00 }; | 478 | u8 events[8] = { 0xff, 0xff, 0xfb, 0xff, 0x00, 0x00, 0x00, 0x00 }; |
479 | 479 | ||
480 | /* Events for 1.2 and newer controllers */ | 480 | /* CSR 1.1 dongles does not accept any bitfield so don't try to set |
481 | if (hdev->lmp_ver > 1) { | 481 | * any event mask for pre 1.2 devices */ |
482 | events[4] |= 0x01; /* Flow Specification Complete */ | 482 | if (hdev->lmp_ver <= 1) |
483 | events[4] |= 0x02; /* Inquiry Result with RSSI */ | 483 | return; |
484 | events[4] |= 0x04; /* Read Remote Extended Features Complete */ | 484 | |
485 | events[5] |= 0x08; /* Synchronous Connection Complete */ | 485 | events[4] |= 0x01; /* Flow Specification Complete */ |
486 | events[5] |= 0x10; /* Synchronous Connection Changed */ | 486 | events[4] |= 0x02; /* Inquiry Result with RSSI */ |
487 | } | 487 | events[4] |= 0x04; /* Read Remote Extended Features Complete */ |
488 | events[5] |= 0x08; /* Synchronous Connection Complete */ | ||
489 | events[5] |= 0x10; /* Synchronous Connection Changed */ | ||
488 | 490 | ||
489 | if (hdev->features[3] & LMP_RSSI_INQ) | 491 | if (hdev->features[3] & LMP_RSSI_INQ) |
490 | events[4] |= 0x04; /* Inquiry Result with RSSI */ | 492 | events[4] |= 0x04; /* Inquiry Result with RSSI */ |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 18dc9888d8c2..8248303f44e8 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -413,6 +413,7 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us | |||
413 | break; | 413 | break; |
414 | } | 414 | } |
415 | 415 | ||
416 | memset(&cinfo, 0, sizeof(cinfo)); | ||
416 | cinfo.hci_handle = chan->conn->hcon->handle; | 417 | cinfo.hci_handle = chan->conn->hcon->handle; |
417 | memcpy(cinfo.dev_class, chan->conn->hcon->dev_class, 3); | 418 | memcpy(cinfo.dev_class, chan->conn->hcon->dev_class, 3); |
418 | 419 | ||
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 386cfaffd4b7..1b10727ce523 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -788,6 +788,7 @@ static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __u | |||
788 | 788 | ||
789 | l2cap_sk = rfcomm_pi(sk)->dlc->session->sock->sk; | 789 | l2cap_sk = rfcomm_pi(sk)->dlc->session->sock->sk; |
790 | 790 | ||
791 | memset(&cinfo, 0, sizeof(cinfo)); | ||
791 | cinfo.hci_handle = conn->hcon->handle; | 792 | cinfo.hci_handle = conn->hcon->handle; |
792 | memcpy(cinfo.dev_class, conn->hcon->dev_class, 3); | 793 | memcpy(cinfo.dev_class, conn->hcon->dev_class, 3); |
793 | 794 | ||
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 42fdffd1d76c..cb4fb7837e5c 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -369,6 +369,15 @@ static void __sco_sock_close(struct sock *sk) | |||
369 | 369 | ||
370 | case BT_CONNECTED: | 370 | case BT_CONNECTED: |
371 | case BT_CONFIG: | 371 | case BT_CONFIG: |
372 | if (sco_pi(sk)->conn) { | ||
373 | sk->sk_state = BT_DISCONN; | ||
374 | sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT); | ||
375 | hci_conn_put(sco_pi(sk)->conn->hcon); | ||
376 | sco_pi(sk)->conn->hcon = NULL; | ||
377 | } else | ||
378 | sco_chan_del(sk, ECONNRESET); | ||
379 | break; | ||
380 | |||
372 | case BT_CONNECT: | 381 | case BT_CONNECT: |
373 | case BT_DISCONN: | 382 | case BT_DISCONN: |
374 | sco_chan_del(sk, ECONNRESET); | 383 | sco_chan_del(sk, ECONNRESET); |
@@ -819,7 +828,9 @@ static void sco_chan_del(struct sock *sk, int err) | |||
819 | conn->sk = NULL; | 828 | conn->sk = NULL; |
820 | sco_pi(sk)->conn = NULL; | 829 | sco_pi(sk)->conn = NULL; |
821 | sco_conn_unlock(conn); | 830 | sco_conn_unlock(conn); |
822 | hci_conn_put(conn->hcon); | 831 | |
832 | if (conn->hcon) | ||
833 | hci_conn_put(conn->hcon); | ||
823 | } | 834 | } |
824 | 835 | ||
825 | sk->sk_state = BT_CLOSED; | 836 | sk->sk_state = BT_CLOSED; |