aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-06-23 05:40:05 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:44 -0400
commit1855d92dce0dc0ed81a78eacae710529600513f4 (patch)
tree866f116a0ccb42e2ca5ffe09d4a925b747d8a648 /net/bluetooth/hci_event.c
parente04fde60efabe27afdbe041e3e5a09ec752ec9d2 (diff)
Bluetooth: Track LE connection parameter update event
When the LE controller changes its connection parameters, it will send a connection parameter update event. Make sure that the new set of parameters are stored in hci_conn struct and thus will properly update the previous values retrieved from the connection complete event. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 3d4741d789d3..e239435312dc 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4070,6 +4070,29 @@ unlock:
4070 hci_dev_unlock(hdev); 4070 hci_dev_unlock(hdev);
4071} 4071}
4072 4072
4073static void hci_le_conn_update_complete_evt(struct hci_dev *hdev,
4074 struct sk_buff *skb)
4075{
4076 struct hci_ev_le_conn_update_complete *ev = (void *) skb->data;
4077 struct hci_conn *conn;
4078
4079 BT_DBG("%s status 0x%2.2x", hdev->name, ev->status);
4080
4081 if (ev->status)
4082 return;
4083
4084 hci_dev_lock(hdev);
4085
4086 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
4087 if (conn) {
4088 conn->le_conn_interval = le16_to_cpu(ev->interval);
4089 conn->le_conn_latency = le16_to_cpu(ev->latency);
4090 conn->le_supv_timeout = le16_to_cpu(ev->supervision_timeout);
4091 }
4092
4093 hci_dev_unlock(hdev);
4094}
4095
4073/* This function requires the caller holds hdev->lock */ 4096/* This function requires the caller holds hdev->lock */
4074static void check_pending_le_conn(struct hci_dev *hdev, bdaddr_t *addr, 4097static void check_pending_le_conn(struct hci_dev *hdev, bdaddr_t *addr,
4075 u8 addr_type) 4098 u8 addr_type)
@@ -4269,6 +4292,10 @@ static void hci_le_meta_evt(struct hci_dev *hdev, struct sk_buff *skb)
4269 hci_le_conn_complete_evt(hdev, skb); 4292 hci_le_conn_complete_evt(hdev, skb);
4270 break; 4293 break;
4271 4294
4295 case HCI_EV_LE_CONN_UPDATE_COMPLETE:
4296 hci_le_conn_update_complete_evt(hdev, skb);
4297 break;
4298
4272 case HCI_EV_LE_ADVERTISING_REPORT: 4299 case HCI_EV_LE_ADVERTISING_REPORT:
4273 hci_le_adv_report_evt(hdev, skb); 4300 hci_le_adv_report_evt(hdev, skb);
4274 break; 4301 break;