Bluetooth : fix build error
[platform/kernel/linux-starfive.git] / net / bluetooth / hci_event.c
index c347007..d219042 100644 (file)
@@ -1977,6 +1977,31 @@ static void hci_vendor_specific_evt(struct hci_dev *hdev, struct sk_buff *skb)
                break;
        }
 }
+
+static void hci_le_data_length_changed_complete_evt(struct hci_dev *hdev,
+               struct sk_buff *skb)
+{
+       struct hci_ev_le_data_len_change *ev = (void *)skb->data;
+       struct hci_conn *conn;
+
+       BT_DBG("%s status", hdev->name);
+
+       hci_dev_lock(hdev);
+
+       conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
+       if (conn) {
+               conn->tx_len = le16_to_cpu(ev->tx_len);
+               conn->tx_time = le16_to_cpu(ev->tx_time);
+               conn->rx_len = le16_to_cpu(ev->rx_len);
+               conn->rx_time = le16_to_cpu(ev->rx_time);
+
+               mgmt_le_data_length_change_complete(hdev, &conn->dst,
+                                           conn->tx_len, conn->tx_time,
+                                           conn->rx_len, conn->rx_time);
+       }
+
+       hci_dev_unlock(hdev);
+}
 #endif
 
 static void hci_cc_read_rssi(struct hci_dev *hdev, struct sk_buff *skb)
@@ -2258,7 +2283,7 @@ static void hci_check_pending_name(struct hci_dev *hdev, struct hci_conn *conn,
        if (conn &&
            (conn->state == BT_CONFIG || conn->state == BT_CONNECTED)) {
                if (!test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
-                       mgmt_device_connected(hdev, conn, 0, name, name_len);
+                       mgmt_device_connected(hdev, conn, name, name_len);
                else
                        mgmt_device_name_update(hdev, bdaddr, name, name_len);
        }
@@ -3144,7 +3169,7 @@ static void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
        hci_conn_del(conn);
 
 #ifdef TIZEN_BT
-       if (type == ACL_LINK && !hci_conn_num(hdev, ACL_LINK)) {
+       if (conn->type == ACL_LINK && !hci_conn_num(hdev, ACL_LINK)) {
                int iscan;
                int pscan;
 
@@ -6406,6 +6431,11 @@ static void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb)
        case HCI_EV_LE_EXT_ADV_SET_TERM:
                hci_le_ext_adv_term_evt(hdev, skb);
                break;
+#ifdef TIZEN_BT
+       case HCI_EV_LE_DATA_LEN_CHANGE:
+               hci_le_data_length_changed_complete_evt(hdev, skb);
+               break;
+#endif
 
        default:
                break;