hci_event.c (dfe6d5c3ec23c5b999261d989059aa35403d791d) hci_event.c (26afbd826ee326e63a334c37fd45e82e50a615ec)
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as

--- 3761 unchanged lines hidden (view full) ---

3770 } else {
3771 if (!hci_dev_test_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE))
3772 schedule_delayed_work(&hdev->ncmd_timer,
3773 HCI_NCMD_TIMEOUT);
3774 }
3775 }
3776}
3777
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as

--- 3761 unchanged lines hidden (view full) ---

3770 } else {
3771 if (!hci_dev_test_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE))
3772 schedule_delayed_work(&hdev->ncmd_timer,
3773 HCI_NCMD_TIMEOUT);
3774 }
3775 }
3776}
3777
3778static u8 hci_cc_le_read_buffer_size_v2(struct hci_dev *hdev, void *data,
3779 struct sk_buff *skb)
3780{
3781 struct hci_rp_le_read_buffer_size_v2 *rp = data;
3782
3783 bt_dev_dbg(hdev, "status 0x%2.2x", rp->status);
3784
3785 if (rp->status)
3786 return rp->status;
3787
3788 hdev->le_mtu = __le16_to_cpu(rp->acl_mtu);
3789 hdev->le_pkts = rp->acl_max_pkt;
3790 hdev->iso_mtu = __le16_to_cpu(rp->iso_mtu);
3791 hdev->iso_pkts = rp->iso_max_pkt;
3792
3793 hdev->le_cnt = hdev->le_pkts;
3794 hdev->iso_cnt = hdev->iso_pkts;
3795
3796 BT_DBG("%s acl mtu %d:%d iso mtu %d:%d", hdev->name, hdev->acl_mtu,
3797 hdev->acl_pkts, hdev->iso_mtu, hdev->iso_pkts);
3798
3799 return rp->status;
3800}
3801
3802static u8 hci_cc_le_set_cig_params(struct hci_dev *hdev, void *data,
3803 struct sk_buff *skb)
3804{
3805 struct hci_rp_le_set_cig_params *rp = data;
3806 struct hci_conn *conn;
3807 int i = 0;
3808
3809 bt_dev_dbg(hdev, "status 0x%2.2x", rp->status);
3810
3811 hci_dev_lock(hdev);
3812
3813 if (rp->status) {
3814 while ((conn = hci_conn_hash_lookup_cig(hdev, rp->cig_id))) {
3815 conn->state = BT_CLOSED;
3816 hci_connect_cfm(conn, rp->status);
3817 hci_conn_del(conn);
3818 }
3819 goto unlock;
3820 }
3821
3822 rcu_read_lock();
3823
3824 list_for_each_entry_rcu(conn, &hdev->conn_hash.list, list) {
3825 if (conn->type != ISO_LINK || conn->iso_qos.cig != rp->cig_id ||
3826 conn->state == BT_CONNECTED)
3827 continue;
3828
3829 conn->handle = __le16_to_cpu(rp->handle[i++]);
3830
3831 bt_dev_dbg(hdev, "%p handle 0x%4.4x link %p", conn,
3832 conn->handle, conn->link);
3833
3834 /* Create CIS if LE is already connected */
3835 if (conn->link && conn->link->state == BT_CONNECTED)
3836 hci_le_create_cis(conn->link);
3837
3838 if (i == rp->num_handles)
3839 break;
3840 }
3841
3842 rcu_read_unlock();
3843
3844unlock:
3845 hci_dev_unlock(hdev);
3846
3847 return rp->status;
3848}
3849
3850static u8 hci_cc_le_setup_iso_path(struct hci_dev *hdev, void *data,
3851 struct sk_buff *skb)
3852{
3853 struct hci_rp_le_setup_iso_path *rp = data;
3854 struct hci_cp_le_setup_iso_path *cp;
3855 struct hci_conn *conn;
3856
3857 bt_dev_dbg(hdev, "status 0x%2.2x", rp->status);
3858
3859 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SETUP_ISO_PATH);
3860 if (!cp)
3861 return rp->status;
3862
3863 hci_dev_lock(hdev);
3864
3865 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle));
3866 if (!conn)
3867 goto unlock;
3868
3869 if (rp->status) {
3870 hci_connect_cfm(conn, rp->status);
3871 hci_conn_del(conn);
3872 goto unlock;
3873 }
3874
3875 switch (cp->direction) {
3876 /* Input (Host to Controller) */
3877 case 0x00:
3878 /* Only confirm connection if output only */
3879 if (conn->iso_qos.out.sdu && !conn->iso_qos.in.sdu)
3880 hci_connect_cfm(conn, rp->status);
3881 break;
3882 /* Output (Controller to Host) */
3883 case 0x01:
3884 /* Confirm connection since conn->iso_qos is always configured
3885 * last.
3886 */
3887 hci_connect_cfm(conn, rp->status);
3888 break;
3889 }
3890
3891unlock:
3892 hci_dev_unlock(hdev);
3893 return rp->status;
3894}
3895
3778#define HCI_CC_VL(_op, _func, _min, _max) \
3779{ \
3780 .op = _op, \
3781 .func = _func, \
3782 .min_len = _min, \
3783 .max_len = _max, \
3784}
3785

--- 159 unchanged lines hidden (view full) ---

3945 HCI_CC_STATUS(HCI_OP_LE_SET_EXT_ADV_ENABLE,
3946 hci_cc_le_set_ext_adv_enable),
3947 HCI_CC_STATUS(HCI_OP_LE_SET_ADV_SET_RAND_ADDR,
3948 hci_cc_le_set_adv_set_random_addr),
3949 HCI_CC_STATUS(HCI_OP_LE_REMOVE_ADV_SET, hci_cc_le_remove_adv_set),
3950 HCI_CC_STATUS(HCI_OP_LE_CLEAR_ADV_SETS, hci_cc_le_clear_adv_sets),
3951 HCI_CC(HCI_OP_LE_READ_TRANSMIT_POWER, hci_cc_le_read_transmit_power,
3952 sizeof(struct hci_rp_le_read_transmit_power)),
3896#define HCI_CC_VL(_op, _func, _min, _max) \
3897{ \
3898 .op = _op, \
3899 .func = _func, \
3900 .min_len = _min, \
3901 .max_len = _max, \
3902}
3903

--- 159 unchanged lines hidden (view full) ---

4063 HCI_CC_STATUS(HCI_OP_LE_SET_EXT_ADV_ENABLE,
4064 hci_cc_le_set_ext_adv_enable),
4065 HCI_CC_STATUS(HCI_OP_LE_SET_ADV_SET_RAND_ADDR,
4066 hci_cc_le_set_adv_set_random_addr),
4067 HCI_CC_STATUS(HCI_OP_LE_REMOVE_ADV_SET, hci_cc_le_remove_adv_set),
4068 HCI_CC_STATUS(HCI_OP_LE_CLEAR_ADV_SETS, hci_cc_le_clear_adv_sets),
4069 HCI_CC(HCI_OP_LE_READ_TRANSMIT_POWER, hci_cc_le_read_transmit_power,
4070 sizeof(struct hci_rp_le_read_transmit_power)),
3953 HCI_CC_STATUS(HCI_OP_LE_SET_PRIVACY_MODE, hci_cc_le_set_privacy_mode)
4071 HCI_CC_STATUS(HCI_OP_LE_SET_PRIVACY_MODE, hci_cc_le_set_privacy_mode),
4072 HCI_CC(HCI_OP_LE_READ_BUFFER_SIZE_V2, hci_cc_le_read_buffer_size_v2,
4073 sizeof(struct hci_rp_le_read_buffer_size_v2)),
4074 HCI_CC_VL(HCI_OP_LE_SET_CIG_PARAMS, hci_cc_le_set_cig_params,
4075 sizeof(struct hci_rp_le_set_cig_params), HCI_MAX_EVENT_SIZE),
4076 HCI_CC(HCI_OP_LE_SETUP_ISO_PATH, hci_cc_le_setup_iso_path,
4077 sizeof(struct hci_rp_le_setup_iso_path)),
3954};
3955
3956static u8 hci_cc_func(struct hci_dev *hdev, const struct hci_cc *cc,
3957 struct sk_buff *skb)
3958{
3959 void *data;
3960
3961 if (skb->len < cc->min_len) {

--- 46 unchanged lines hidden (view full) ---

4008 "unexpected event for opcode 0x%4.4x", *opcode);
4009 return;
4010 }
4011
4012 if (atomic_read(&hdev->cmd_cnt) && !skb_queue_empty(&hdev->cmd_q))
4013 queue_work(hdev->workqueue, &hdev->cmd_work);
4014}
4015
4078};
4079
4080static u8 hci_cc_func(struct hci_dev *hdev, const struct hci_cc *cc,
4081 struct sk_buff *skb)
4082{
4083 void *data;
4084
4085 if (skb->len < cc->min_len) {

--- 46 unchanged lines hidden (view full) ---

4132 "unexpected event for opcode 0x%4.4x", *opcode);
4133 return;
4134 }
4135
4136 if (atomic_read(&hdev->cmd_cnt) && !skb_queue_empty(&hdev->cmd_q))
4137 queue_work(hdev->workqueue, &hdev->cmd_work);
4138}
4139
4140static void hci_cs_le_create_cis(struct hci_dev *hdev, u8 status)
4141{
4142 struct hci_cp_le_create_cis *cp;
4143 int i;
4144
4145 bt_dev_dbg(hdev, "status 0x%2.2x", status);
4146
4147 if (!status)
4148 return;
4149
4150 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_CREATE_CIS);
4151 if (!cp)
4152 return;
4153
4154 hci_dev_lock(hdev);
4155
4156 /* Remove connection if command failed */
4157 for (i = 0; cp->num_cis; cp->num_cis--, i++) {
4158 struct hci_conn *conn;
4159 u16 handle;
4160
4161 handle = __le16_to_cpu(cp->cis[i].cis_handle);
4162
4163 conn = hci_conn_hash_lookup_handle(hdev, handle);
4164 if (conn) {
4165 conn->state = BT_CLOSED;
4166 hci_connect_cfm(conn, status);
4167 hci_conn_del(conn);
4168 }
4169 }
4170
4171 hci_dev_unlock(hdev);
4172}
4173
4016#define HCI_CS(_op, _func) \
4017{ \
4018 .op = _op, \
4019 .func = _func, \
4020}
4021
4022static const struct hci_cs {
4023 u16 op;

--- 13 unchanged lines hidden (view full) ---

4037 HCI_CS(HCI_OP_ENHANCED_SETUP_SYNC_CONN,
4038 hci_cs_enhanced_setup_sync_conn),
4039 HCI_CS(HCI_OP_SNIFF_MODE, hci_cs_sniff_mode),
4040 HCI_CS(HCI_OP_EXIT_SNIFF_MODE, hci_cs_exit_sniff_mode),
4041 HCI_CS(HCI_OP_SWITCH_ROLE, hci_cs_switch_role),
4042 HCI_CS(HCI_OP_LE_CREATE_CONN, hci_cs_le_create_conn),
4043 HCI_CS(HCI_OP_LE_READ_REMOTE_FEATURES, hci_cs_le_read_remote_features),
4044 HCI_CS(HCI_OP_LE_START_ENC, hci_cs_le_start_enc),
4174#define HCI_CS(_op, _func) \
4175{ \
4176 .op = _op, \
4177 .func = _func, \
4178}
4179
4180static const struct hci_cs {
4181 u16 op;

--- 13 unchanged lines hidden (view full) ---

4195 HCI_CS(HCI_OP_ENHANCED_SETUP_SYNC_CONN,
4196 hci_cs_enhanced_setup_sync_conn),
4197 HCI_CS(HCI_OP_SNIFF_MODE, hci_cs_sniff_mode),
4198 HCI_CS(HCI_OP_EXIT_SNIFF_MODE, hci_cs_exit_sniff_mode),
4199 HCI_CS(HCI_OP_SWITCH_ROLE, hci_cs_switch_role),
4200 HCI_CS(HCI_OP_LE_CREATE_CONN, hci_cs_le_create_conn),
4201 HCI_CS(HCI_OP_LE_READ_REMOTE_FEATURES, hci_cs_le_read_remote_features),
4202 HCI_CS(HCI_OP_LE_START_ENC, hci_cs_le_start_enc),
4045 HCI_CS(HCI_OP_LE_EXT_CREATE_CONN, hci_cs_le_ext_create_conn)
4203 HCI_CS(HCI_OP_LE_EXT_CREATE_CONN, hci_cs_le_ext_create_conn),
4204 HCI_CS(HCI_OP_LE_CREATE_CIS, hci_cs_le_create_cis),
4046};
4047
4048static void hci_cmd_status_evt(struct hci_dev *hdev, void *data,
4049 struct sk_buff *skb, u16 *opcode, u8 *status,
4050 hci_req_complete_t *req_complete,
4051 hci_req_complete_skb_t *req_complete_skb)
4052{
4053 struct hci_ev_cmd_status *ev = data;

--- 119 unchanged lines hidden (view full) ---

4173 break;
4174
4175 case SCO_LINK:
4176 hdev->sco_cnt += count;
4177 if (hdev->sco_cnt > hdev->sco_pkts)
4178 hdev->sco_cnt = hdev->sco_pkts;
4179 break;
4180
4205};
4206
4207static void hci_cmd_status_evt(struct hci_dev *hdev, void *data,
4208 struct sk_buff *skb, u16 *opcode, u8 *status,
4209 hci_req_complete_t *req_complete,
4210 hci_req_complete_skb_t *req_complete_skb)
4211{
4212 struct hci_ev_cmd_status *ev = data;

--- 119 unchanged lines hidden (view full) ---

4332 break;
4333
4334 case SCO_LINK:
4335 hdev->sco_cnt += count;
4336 if (hdev->sco_cnt > hdev->sco_pkts)
4337 hdev->sco_cnt = hdev->sco_pkts;
4338 break;
4339
4340 case ISO_LINK:
4341 if (hdev->iso_pkts) {
4342 hdev->iso_cnt += count;
4343 if (hdev->iso_cnt > hdev->iso_pkts)
4344 hdev->iso_cnt = hdev->iso_pkts;
4345 } else if (hdev->le_pkts) {
4346 hdev->le_cnt += count;
4347 if (hdev->le_cnt > hdev->le_pkts)
4348 hdev->le_cnt = hdev->le_pkts;
4349 } else {
4350 hdev->acl_cnt += count;
4351 if (hdev->acl_cnt > hdev->acl_pkts)
4352 hdev->acl_cnt = hdev->acl_pkts;
4353 }
4354 break;
4355
4181 default:
4182 bt_dev_err(hdev, "unknown type %d conn %p",
4183 conn->type, conn);
4184 break;
4185 }
4186 }
4187
4188 queue_work(hdev->workqueue, &hdev->tx_work);

--- 2286 unchanged lines hidden (view full) ---

6475
6476 conn->le_tx_phy = ev->tx_phy;
6477 conn->le_rx_phy = ev->rx_phy;
6478
6479unlock:
6480 hci_dev_unlock(hdev);
6481}
6482
4356 default:
4357 bt_dev_err(hdev, "unknown type %d conn %p",
4358 conn->type, conn);
4359 break;
4360 }
4361 }
4362
4363 queue_work(hdev->workqueue, &hdev->tx_work);

--- 2286 unchanged lines hidden (view full) ---

6650
6651 conn->le_tx_phy = ev->tx_phy;
6652 conn->le_rx_phy = ev->rx_phy;
6653
6654unlock:
6655 hci_dev_unlock(hdev);
6656}
6657
6658static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data,
6659 struct sk_buff *skb)
6660{
6661 struct hci_evt_le_cis_established *ev = data;
6662 struct hci_conn *conn;
6663 u16 handle = __le16_to_cpu(ev->handle);
6664
6665 bt_dev_dbg(hdev, "status 0x%2.2x", ev->status);
6666
6667 hci_dev_lock(hdev);
6668
6669 conn = hci_conn_hash_lookup_handle(hdev, handle);
6670 if (!conn) {
6671 bt_dev_err(hdev,
6672 "Unable to find connection with handle 0x%4.4x",
6673 handle);
6674 goto unlock;
6675 }
6676
6677 if (conn->role == HCI_ROLE_SLAVE) {
6678 __le32 interval;
6679
6680 memset(&interval, 0, sizeof(interval));
6681
6682 memcpy(&interval, ev->c_latency, sizeof(ev->c_latency));
6683 conn->iso_qos.in.interval = le32_to_cpu(interval);
6684 memcpy(&interval, ev->p_latency, sizeof(ev->p_latency));
6685 conn->iso_qos.out.interval = le32_to_cpu(interval);
6686 conn->iso_qos.in.latency = le16_to_cpu(ev->interval);
6687 conn->iso_qos.out.latency = le16_to_cpu(ev->interval);
6688 conn->iso_qos.in.sdu = le16_to_cpu(ev->c_mtu);
6689 conn->iso_qos.out.sdu = le16_to_cpu(ev->p_mtu);
6690 conn->iso_qos.in.phy = ev->c_phy;
6691 conn->iso_qos.out.phy = ev->p_phy;
6692 }
6693
6694 if (!ev->status) {
6695 conn->state = BT_CONNECTED;
6696 hci_debugfs_create_conn(conn);
6697 hci_conn_add_sysfs(conn);
6698 hci_iso_setup_path(conn);
6699 goto unlock;
6700 }
6701
6702 hci_connect_cfm(conn, ev->status);
6703 hci_conn_del(conn);
6704
6705unlock:
6706 hci_dev_unlock(hdev);
6707}
6708
6709static void hci_le_reject_cis(struct hci_dev *hdev, __le16 handle)
6710{
6711 struct hci_cp_le_reject_cis cp;
6712
6713 memset(&cp, 0, sizeof(cp));
6714 cp.handle = handle;
6715 cp.reason = HCI_ERROR_REJ_BAD_ADDR;
6716 hci_send_cmd(hdev, HCI_OP_LE_REJECT_CIS, sizeof(cp), &cp);
6717}
6718
6719static void hci_le_accept_cis(struct hci_dev *hdev, __le16 handle)
6720{
6721 struct hci_cp_le_accept_cis cp;
6722
6723 memset(&cp, 0, sizeof(cp));
6724 cp.handle = handle;
6725 hci_send_cmd(hdev, HCI_OP_LE_ACCEPT_CIS, sizeof(cp), &cp);
6726}
6727
6728static void hci_le_cis_req_evt(struct hci_dev *hdev, void *data,
6729 struct sk_buff *skb)
6730{
6731 struct hci_evt_le_cis_req *ev = data;
6732 u16 acl_handle, cis_handle;
6733 struct hci_conn *acl, *cis;
6734 int mask;
6735 __u8 flags = 0;
6736
6737 acl_handle = __le16_to_cpu(ev->acl_handle);
6738 cis_handle = __le16_to_cpu(ev->cis_handle);
6739
6740 bt_dev_dbg(hdev, "acl 0x%4.4x handle 0x%4.4x cig 0x%2.2x cis 0x%2.2x",
6741 acl_handle, cis_handle, ev->cig_id, ev->cis_id);
6742
6743 hci_dev_lock(hdev);
6744
6745 acl = hci_conn_hash_lookup_handle(hdev, acl_handle);
6746 if (!acl)
6747 goto unlock;
6748
6749 mask = hci_proto_connect_ind(hdev, &acl->dst, ISO_LINK, &flags);
6750 if (!(mask & HCI_LM_ACCEPT)) {
6751 hci_le_reject_cis(hdev, ev->cis_handle);
6752 goto unlock;
6753 }
6754
6755 cis = hci_conn_hash_lookup_handle(hdev, cis_handle);
6756 if (!cis) {
6757 cis = hci_conn_add(hdev, ISO_LINK, &acl->dst, HCI_ROLE_SLAVE);
6758 if (!cis) {
6759 hci_le_reject_cis(hdev, ev->cis_handle);
6760 goto unlock;
6761 }
6762 cis->handle = cis_handle;
6763 }
6764
6765 cis->iso_qos.cig = ev->cig_id;
6766 cis->iso_qos.cis = ev->cis_id;
6767
6768 if (!(flags & HCI_PROTO_DEFER)) {
6769 hci_le_accept_cis(hdev, ev->cis_handle);
6770 } else {
6771 cis->state = BT_CONNECT2;
6772 hci_connect_cfm(cis, 0);
6773 }
6774
6775unlock:
6776 hci_dev_unlock(hdev);
6777}
6778
6483#define HCI_LE_EV_VL(_op, _func, _min_len, _max_len) \
6484[_op] = { \
6485 .func = _func, \
6486 .min_len = _min_len, \
6487 .max_len = _max_len, \
6488}
6489
6490#define HCI_LE_EV(_op, _func, _len) \

--- 47 unchanged lines hidden (view full) ---

6538 sizeof(struct hci_ev_le_phy_update_complete)),
6539 /* [0x0d = HCI_EV_LE_EXT_ADV_REPORT] */
6540 HCI_LE_EV_VL(HCI_EV_LE_EXT_ADV_REPORT, hci_le_ext_adv_report_evt,
6541 sizeof(struct hci_ev_le_ext_adv_report),
6542 HCI_MAX_EVENT_SIZE),
6543 /* [0x12 = HCI_EV_LE_EXT_ADV_SET_TERM] */
6544 HCI_LE_EV(HCI_EV_LE_EXT_ADV_SET_TERM, hci_le_ext_adv_term_evt,
6545 sizeof(struct hci_evt_le_ext_adv_set_term)),
6779#define HCI_LE_EV_VL(_op, _func, _min_len, _max_len) \
6780[_op] = { \
6781 .func = _func, \
6782 .min_len = _min_len, \
6783 .max_len = _max_len, \
6784}
6785
6786#define HCI_LE_EV(_op, _func, _len) \

--- 47 unchanged lines hidden (view full) ---

6834 sizeof(struct hci_ev_le_phy_update_complete)),
6835 /* [0x0d = HCI_EV_LE_EXT_ADV_REPORT] */
6836 HCI_LE_EV_VL(HCI_EV_LE_EXT_ADV_REPORT, hci_le_ext_adv_report_evt,
6837 sizeof(struct hci_ev_le_ext_adv_report),
6838 HCI_MAX_EVENT_SIZE),
6839 /* [0x12 = HCI_EV_LE_EXT_ADV_SET_TERM] */
6840 HCI_LE_EV(HCI_EV_LE_EXT_ADV_SET_TERM, hci_le_ext_adv_term_evt,
6841 sizeof(struct hci_evt_le_ext_adv_set_term)),
6842 /* [0x19 = HCI_EVT_LE_CIS_ESTABLISHED] */
6843 HCI_LE_EV(HCI_EVT_LE_CIS_ESTABLISHED, hci_le_cis_estabilished_evt,
6844 sizeof(struct hci_evt_le_cis_established)),
6845 /* [0x1a = HCI_EVT_LE_CIS_REQ] */
6846 HCI_LE_EV(HCI_EVT_LE_CIS_REQ, hci_le_cis_req_evt,
6847 sizeof(struct hci_evt_le_cis_req)),
6546};
6547
6548static void hci_le_meta_evt(struct hci_dev *hdev, void *data,
6549 struct sk_buff *skb, u16 *opcode, u8 *status,
6550 hci_req_complete_t *req_complete,
6551 hci_req_complete_skb_t *req_complete_skb)
6552{
6553 struct hci_ev_le_meta *ev = data;

--- 22 unchanged lines hidden (view full) ---

6576
6577 /* Just warn if the length is over max_len size it still be
6578 * possible to partially parse the event so leave to callback to
6579 * decide if that is acceptable.
6580 */
6581 if (skb->len > subev->max_len)
6582 bt_dev_warn(hdev, "unexpected subevent 0x%2.2x length: %u > %u",
6583 ev->subevent, skb->len, subev->max_len);
6848};
6849
6850static void hci_le_meta_evt(struct hci_dev *hdev, void *data,
6851 struct sk_buff *skb, u16 *opcode, u8 *status,
6852 hci_req_complete_t *req_complete,
6853 hci_req_complete_skb_t *req_complete_skb)
6854{
6855 struct hci_ev_le_meta *ev = data;

--- 22 unchanged lines hidden (view full) ---

6878
6879 /* Just warn if the length is over max_len size it still be
6880 * possible to partially parse the event so leave to callback to
6881 * decide if that is acceptable.
6882 */
6883 if (skb->len > subev->max_len)
6884 bt_dev_warn(hdev, "unexpected subevent 0x%2.2x length: %u > %u",
6885 ev->subevent, skb->len, subev->max_len);
6584
6585 data = hci_le_ev_skb_pull(hdev, skb, ev->subevent, subev->min_len);
6586 if (!data)
6587 return;
6588
6589 subev->func(hdev, data, skb);
6590}
6591
6592static bool hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode,

--- 399 unchanged lines hidden ---
6886 data = hci_le_ev_skb_pull(hdev, skb, ev->subevent, subev->min_len);
6887 if (!data)
6888 return;
6889
6890 subev->func(hdev, data, skb);
6891}
6892
6893static bool hci_get_cmd_complete(struct hci_dev *hdev, u16 opcode,

--- 399 unchanged lines hidden ---