diff options
author | Sudha Bheemanna <b.sudha@samsung.com> | 2016-09-16 15:37:22 +0530 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-14 13:53:27 +0900 |
commit | d4e62d53870f259cce1868920432576ee749ab51 (patch) | |
tree | 12c605a5bf060381902e1b41d89cd8e416c936b4 /net/bluetooth/hci_event.c | |
parent | 00ee9494f355d01ed48f22464ef9ce563a176422 (diff) |
Bluetooth: Set le data length command and event
Sets the data length for the le data packet with in the
advised limits. MGMT command and event are added to handle
the setting of data length.
Change-Id: I3dbcbba83098e17f0e6da209753f8924ffb67678
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index e72f98150d02..f49d81e5ba95 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -1567,6 +1567,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) @@ -5386,6 +5411,12 @@ static void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb) hci_le_direct_adv_report_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; } |