diff options
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index b6631d7e2ddf..46da8b6f4368 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -1841,6 +1841,7 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
1841 | { | 1841 | { |
1842 | struct hci_ev_disconn_complete *ev = (void *) skb->data; | 1842 | struct hci_ev_disconn_complete *ev = (void *) skb->data; |
1843 | u8 reason = hci_to_mgmt_reason(ev->reason); | 1843 | u8 reason = hci_to_mgmt_reason(ev->reason); |
1844 | struct hci_conn_params *params; | ||
1844 | struct hci_conn *conn; | 1845 | struct hci_conn *conn; |
1845 | bool mgmt_connected; | 1846 | bool mgmt_connected; |
1846 | u8 type; | 1847 | u8 type; |
@@ -1868,6 +1869,23 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
1868 | if (conn->type == ACL_LINK && conn->flush_key) | 1869 | if (conn->type == ACL_LINK && conn->flush_key) |
1869 | hci_remove_link_key(hdev, &conn->dst); | 1870 | hci_remove_link_key(hdev, &conn->dst); |
1870 | 1871 | ||
1872 | params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type); | ||
1873 | if (params) { | ||
1874 | switch (params->auto_connect) { | ||
1875 | case HCI_AUTO_CONN_LINK_LOSS: | ||
1876 | if (ev->reason != HCI_ERROR_CONNECTION_TIMEOUT) | ||
1877 | break; | ||
1878 | /* Fall through */ | ||
1879 | |||
1880 | case HCI_AUTO_CONN_ALWAYS: | ||
1881 | hci_pend_le_conn_add(hdev, &conn->dst, conn->dst_type); | ||
1882 | break; | ||
1883 | |||
1884 | default: | ||
1885 | break; | ||
1886 | } | ||
1887 | } | ||
1888 | |||
1871 | type = conn->type; | 1889 | type = conn->type; |
1872 | 1890 | ||
1873 | hci_proto_disconn_cfm(conn, ev->reason); | 1891 | hci_proto_disconn_cfm(conn, ev->reason); |