diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2011-04-26 04:22:15 -0400 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2011-04-26 04:22:59 -0400 |
| commit | 07f9479a40cc778bc1462ada11f95b01360ae4ff (patch) | |
| tree | 0676cf38df3844004bb3ebfd99dfa67a4a8998f5 /net/bluetooth | |
| parent | 9d5e6bdb3013acfb311ab407eeca0b6a6a3dedbf (diff) | |
| parent | cd2e49e90f1cae7726c9a2c54488d881d7f1cd1c (diff) | |
Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be
applied for files that didn't exist on the old branch.
Diffstat (limited to 'net/bluetooth')
| -rw-r--r-- | net/bluetooth/hci_core.c | 12 | ||||
| -rw-r--r-- | net/bluetooth/hci_event.c | 4 | ||||
| -rw-r--r-- | net/bluetooth/l2cap_core.c | 4 | ||||
| -rw-r--r-- | net/bluetooth/l2cap_sock.c | 7 | ||||
| -rw-r--r-- | net/bluetooth/mgmt.c | 2 |
5 files changed, 21 insertions, 8 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index b372fb8bcdcf..c83f618282f7 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
| @@ -186,6 +186,7 @@ static void hci_reset_req(struct hci_dev *hdev, unsigned long opt) | |||
| 186 | BT_DBG("%s %ld", hdev->name, opt); | 186 | BT_DBG("%s %ld", hdev->name, opt); |
| 187 | 187 | ||
| 188 | /* Reset device */ | 188 | /* Reset device */ |
| 189 | set_bit(HCI_RESET, &hdev->flags); | ||
| 189 | hci_send_cmd(hdev, HCI_OP_RESET, 0, NULL); | 190 | hci_send_cmd(hdev, HCI_OP_RESET, 0, NULL); |
| 190 | } | 191 | } |
| 191 | 192 | ||
| @@ -213,8 +214,10 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt) | |||
| 213 | /* Mandatory initialization */ | 214 | /* Mandatory initialization */ |
| 214 | 215 | ||
| 215 | /* Reset */ | 216 | /* Reset */ |
| 216 | if (!test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks)) | 217 | if (!test_bit(HCI_QUIRK_NO_RESET, &hdev->quirks)) { |
| 218 | set_bit(HCI_RESET, &hdev->flags); | ||
| 217 | hci_send_cmd(hdev, HCI_OP_RESET, 0, NULL); | 219 | hci_send_cmd(hdev, HCI_OP_RESET, 0, NULL); |
| 220 | } | ||
| 218 | 221 | ||
| 219 | /* Read Local Supported Features */ | 222 | /* Read Local Supported Features */ |
| 220 | hci_send_cmd(hdev, HCI_OP_READ_LOCAL_FEATURES, 0, NULL); | 223 | hci_send_cmd(hdev, HCI_OP_READ_LOCAL_FEATURES, 0, NULL); |
| @@ -584,6 +587,9 @@ static int hci_dev_do_close(struct hci_dev *hdev) | |||
| 584 | hci_req_cancel(hdev, ENODEV); | 587 | hci_req_cancel(hdev, ENODEV); |
| 585 | hci_req_lock(hdev); | 588 | hci_req_lock(hdev); |
| 586 | 589 | ||
| 590 | /* Stop timer, it might be running */ | ||
| 591 | del_timer_sync(&hdev->cmd_timer); | ||
| 592 | |||
| 587 | if (!test_and_clear_bit(HCI_UP, &hdev->flags)) { | 593 | if (!test_and_clear_bit(HCI_UP, &hdev->flags)) { |
| 588 | hci_req_unlock(hdev); | 594 | hci_req_unlock(hdev); |
| 589 | return 0; | 595 | return 0; |
| @@ -623,7 +629,6 @@ static int hci_dev_do_close(struct hci_dev *hdev) | |||
| 623 | 629 | ||
| 624 | /* Drop last sent command */ | 630 | /* Drop last sent command */ |
| 625 | if (hdev->sent_cmd) { | 631 | if (hdev->sent_cmd) { |
| 626 | del_timer_sync(&hdev->cmd_timer); | ||
| 627 | kfree_skb(hdev->sent_cmd); | 632 | kfree_skb(hdev->sent_cmd); |
| 628 | hdev->sent_cmd = NULL; | 633 | hdev->sent_cmd = NULL; |
| 629 | } | 634 | } |
| @@ -1074,6 +1079,7 @@ static void hci_cmd_timer(unsigned long arg) | |||
| 1074 | 1079 | ||
| 1075 | BT_ERR("%s command tx timeout", hdev->name); | 1080 | BT_ERR("%s command tx timeout", hdev->name); |
| 1076 | atomic_set(&hdev->cmd_cnt, 1); | 1081 | atomic_set(&hdev->cmd_cnt, 1); |
| 1082 | clear_bit(HCI_RESET, &hdev->flags); | ||
| 1077 | tasklet_schedule(&hdev->cmd_task); | 1083 | tasklet_schedule(&hdev->cmd_task); |
| 1078 | } | 1084 | } |
| 1079 | 1085 | ||
| @@ -1877,7 +1883,7 @@ static void hci_tx_task(unsigned long arg) | |||
| 1877 | read_unlock(&hci_task_lock); | 1883 | read_unlock(&hci_task_lock); |
| 1878 | } | 1884 | } |
| 1879 | 1885 | ||
| 1880 | /* ----- HCI RX task (incoming data proccessing) ----- */ | 1886 | /* ----- HCI RX task (incoming data processing) ----- */ |
| 1881 | 1887 | ||
| 1882 | /* ACL data packet */ | 1888 | /* ACL data packet */ |
| 1883 | static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb) | 1889 | static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb) |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 3fbfa50c2bff..cebe7588469f 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
| @@ -183,6 +183,8 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb) | |||
| 183 | 183 | ||
| 184 | BT_DBG("%s status 0x%x", hdev->name, status); | 184 | BT_DBG("%s status 0x%x", hdev->name, status); |
| 185 | 185 | ||
| 186 | clear_bit(HCI_RESET, &hdev->flags); | ||
| 187 | |||
| 186 | hci_req_complete(hdev, HCI_OP_RESET, status); | 188 | hci_req_complete(hdev, HCI_OP_RESET, status); |
| 187 | } | 189 | } |
| 188 | 190 | ||
| @@ -1847,7 +1849,7 @@ static inline void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
| 1847 | if (ev->opcode != HCI_OP_NOP) | 1849 | if (ev->opcode != HCI_OP_NOP) |
| 1848 | del_timer(&hdev->cmd_timer); | 1850 | del_timer(&hdev->cmd_timer); |
| 1849 | 1851 | ||
| 1850 | if (ev->ncmd) { | 1852 | if (ev->ncmd && !test_bit(HCI_RESET, &hdev->flags)) { |
| 1851 | atomic_set(&hdev->cmd_cnt, 1); | 1853 | atomic_set(&hdev->cmd_cnt, 1); |
| 1852 | if (!skb_queue_empty(&hdev->cmd_q)) | 1854 | if (!skb_queue_empty(&hdev->cmd_q)) |
| 1853 | tasklet_schedule(&hdev->cmd_task); | 1855 | tasklet_schedule(&hdev->cmd_task); |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index c9f9cecca527..ca27f3a41536 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
| @@ -1116,7 +1116,9 @@ int l2cap_ertm_send(struct sock *sk) | |||
| 1116 | bt_cb(skb)->tx_seq = pi->next_tx_seq; | 1116 | bt_cb(skb)->tx_seq = pi->next_tx_seq; |
| 1117 | pi->next_tx_seq = (pi->next_tx_seq + 1) % 64; | 1117 | pi->next_tx_seq = (pi->next_tx_seq + 1) % 64; |
| 1118 | 1118 | ||
| 1119 | pi->unacked_frames++; | 1119 | if (bt_cb(skb)->retries == 1) |
| 1120 | pi->unacked_frames++; | ||
| 1121 | |||
| 1120 | pi->frames_sent++; | 1122 | pi->frames_sent++; |
| 1121 | 1123 | ||
| 1122 | if (skb_queue_is_last(TX_QUEUE(sk), skb)) | 1124 | if (skb_queue_is_last(TX_QUEUE(sk), skb)) |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index fc85e7ae33c7..299fe56a9668 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
| @@ -679,7 +679,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch | |||
| 679 | 679 | ||
| 680 | if (opt == BT_FLUSHABLE_OFF) { | 680 | if (opt == BT_FLUSHABLE_OFF) { |
| 681 | struct l2cap_conn *conn = l2cap_pi(sk)->conn; | 681 | struct l2cap_conn *conn = l2cap_pi(sk)->conn; |
| 682 | /* proceed futher only when we have l2cap_conn and | 682 | /* proceed further only when we have l2cap_conn and |
| 683 | No Flush support in the LM */ | 683 | No Flush support in the LM */ |
| 684 | if (!conn || !lmp_no_flush_capable(conn->hcon->hdev)) { | 684 | if (!conn || !lmp_no_flush_capable(conn->hcon->hdev)) { |
| 685 | err = -EINVAL; | 685 | err = -EINVAL; |
| @@ -923,8 +923,9 @@ void __l2cap_sock_close(struct sock *sk, int reason) | |||
| 923 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); | 923 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); |
| 924 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, | 924 | l2cap_send_cmd(conn, l2cap_pi(sk)->ident, |
| 925 | L2CAP_CONN_RSP, sizeof(rsp), &rsp); | 925 | L2CAP_CONN_RSP, sizeof(rsp), &rsp); |
| 926 | } else | 926 | } |
| 927 | l2cap_chan_del(sk, reason); | 927 | |
| 928 | l2cap_chan_del(sk, reason); | ||
| 928 | break; | 929 | break; |
| 929 | 930 | ||
| 930 | case BT_CONNECT: | 931 | case BT_CONNECT: |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 0054c74e27b7..4476d8e3c0f2 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
| @@ -1230,6 +1230,8 @@ static int user_confirm_reply(struct sock *sk, u16 index, unsigned char *data, | |||
| 1230 | if (!hdev) | 1230 | if (!hdev) |
| 1231 | return cmd_status(sk, index, mgmt_op, ENODEV); | 1231 | return cmd_status(sk, index, mgmt_op, ENODEV); |
| 1232 | 1232 | ||
| 1233 | hci_dev_lock_bh(hdev); | ||
| 1234 | |||
| 1233 | if (!test_bit(HCI_UP, &hdev->flags)) { | 1235 | if (!test_bit(HCI_UP, &hdev->flags)) { |
| 1234 | err = cmd_status(sk, index, mgmt_op, ENETDOWN); | 1236 | err = cmd_status(sk, index, mgmt_op, ENETDOWN); |
| 1235 | goto failed; | 1237 | goto failed; |
