cregit-Linux how code gets into the kernel

Release 4.8 net/bluetooth/hci_event.c

Directory: net/bluetooth
/*
   BlueZ - Bluetooth protocol stack for Linux
   Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.

   Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 2 as
   published by the Free Software Foundation;

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
   SOFTWARE IS DISCLAIMED.
*/

/* Bluetooth HCI event handling. */

#include <asm/unaligned.h>

#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/mgmt.h>

#include "hci_request.h"
#include "hci_debugfs.h"
#include "a2mp.h"
#include "amp.h"
#include "smp.h"


#define ZERO_KEY "\x00\x00\x00\x00\x00\x00\x00\x00" \
                 "\x00\x00\x00\x00\x00\x00\x00\x00"

/* Handle HCI Event packets */


static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); BT_DBG("%s status 0x%2.2x", hdev->name, status); if (status) return; clear_bit(HCI_INQUIRY, &hdev->flags); smp_mb__after_atomic(); /* wake_up_bit advises about this barrier */ wake_up_bit(&hdev->flags, HCI_INQUIRY); hci_dev_lock(hdev); /* Set discovery state to stopped if we're not doing LE active * scanning. */ if (!hci_dev_test_flag(hdev, HCI_LE_SCAN) || hdev->le_scan_type != LE_SCAN_ACTIVE) hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hci_dev_unlock(hdev); hci_conn_check_pending(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann3633.03%325.00%
johan hedbergjohan hedberg2422.02%216.67%
jakub pawlowskijakub pawlowski1715.60%18.33%
andre guedesandre guedes1513.76%216.67%
maksim krasnyanskiymaksim krasnyanskiy1412.84%18.33%
peter zijlstrapeter zijlstra10.92%18.33%
andrei emeltchenkoandrei emeltchenko10.92%18.33%
oliver neukumoliver neukum10.92%18.33%
Total109100.00%12100.00%


static void hci_cc_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); BT_DBG("%s status 0x%2.2x", hdev->name, status); if (status) return; hci_dev_set_flag(hdev, HCI_PERIODIC_INQ); }

Contributors

PersonTokensPropCommitsCommitProp
andre guedesandre guedes4992.45%250.00%
marcel holtmannmarcel holtmann35.66%125.00%
andrei emeltchenkoandrei emeltchenko11.89%125.00%
Total53100.00%4100.00%


static void hci_cc_exit_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); BT_DBG("%s status 0x%2.2x", hdev->name, status); if (status) return; hci_dev_clear_flag(hdev, HCI_PERIODIC_INQ); hci_conn_check_pending(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann5391.38%360.00%
andre guedesandre guedes46.90%120.00%
andrei emeltchenkoandrei emeltchenko11.72%120.00%
Total58100.00%5100.00%


static void hci_cc_remote_name_req_cancel(struct hci_dev *hdev, struct sk_buff *skb) { BT_DBG("%s", hdev->name); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann1664.00%150.00%
maksim krasnyanskiymaksim krasnyanskiy936.00%150.00%
Total25100.00%2100.00%


static void hci_cc_role_discovery(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_role_discovery *rp = (void *) skb->data; struct hci_conn *conn; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; hci_dev_lock(hdev); conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); if (conn) conn->role = rp->role; hci_dev_unlock(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
maksim krasnyanskiymaksim krasnyanskiy6370.00%233.33%
marcel holtmannmarcel holtmann2224.44%233.33%
johan hedbergjohan hedberg44.44%116.67%
andrei emeltchenkoandrei emeltchenko11.11%116.67%
Total90100.00%6100.00%


static void hci_cc_read_link_policy(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_link_policy *rp = (void *) skb->data; struct hci_conn *conn; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; hci_dev_lock(hdev); conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); if (conn) conn->link_policy = __le16_to_cpu(rp->policy); hci_dev_unlock(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann9298.92%150.00%
andrei emeltchenkoandrei emeltchenko11.08%150.00%
Total93100.00%2100.00%


static void hci_cc_write_link_policy(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_write_link_policy *rp = (void *) skb->data; struct hci_conn *conn; void *sent; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LINK_POLICY); if (!sent) return; hci_dev_lock(hdev); conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); if (conn) conn->link_policy = get_unaligned_le16(sent + 2); hci_dev_unlock(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann10694.64%240.00%
harvey harrisonharvey harrison43.57%120.00%
maksim krasnyanskiymaksim krasnyanskiy10.89%120.00%
andrei emeltchenkoandrei emeltchenko10.89%120.00%
Total112100.00%5100.00%


static void hci_cc_read_def_link_policy(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_def_link_policy *rp = (void *) skb->data; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; hdev->link_policy = __le16_to_cpu(rp->policy); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann5998.33%150.00%
andrei emeltchenkoandrei emeltchenko11.67%150.00%
Total60100.00%2100.00%


static void hci_cc_write_def_link_policy(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); void *sent; BT_DBG("%s status 0x%2.2x", hdev->name, status); if (status) return; sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_DEF_LINK_POLICY); if (!sent) return; hdev->link_policy = get_unaligned_le16(sent); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann7398.65%266.67%
andrei emeltchenkoandrei emeltchenko11.35%133.33%
Total74100.00%3100.00%


static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); BT_DBG("%s status 0x%2.2x", hdev->name, status); clear_bit(HCI_RESET, &hdev->flags); if (status) return; /* Reset all non-persistent flags */ hci_dev_clear_volatile_flags(hdev); hci_discovery_set_state(hdev, DISCOVERY_STOPPED); hdev->inq_tx_power = HCI_TX_POWER_INVALID; hdev->adv_tx_power = HCI_TX_POWER_INVALID; memset(hdev->adv_data, 0, sizeof(hdev->adv_data)); hdev->adv_data_len = 0; memset(hdev->scan_rsp_data, 0, sizeof(hdev->scan_rsp_data)); hdev->scan_rsp_data_len = 0; hdev->le_scan_type = LE_SCAN_PASSIVE; hdev->ssp_debug_mode = 0; hci_bdaddr_list_clear(&hdev->le_white_list); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann6444.14%743.75%
johan hedbergjohan hedberg3926.90%425.00%
maksim krasnyanskiymaksim krasnyanskiy2617.93%16.25%
gustavo f. padovangustavo f. padovan106.90%16.25%
andre guedesandre guedes53.45%212.50%
andrei emeltchenkoandrei emeltchenko10.69%16.25%
Total145100.00%16100.00%


static void hci_cc_read_stored_link_key(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_stored_link_key *rp = (void *)skb->data; struct hci_cp_read_stored_link_key *sent; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); sent = hci_sent_cmd_data(hdev, HCI_OP_READ_STORED_LINK_KEY); if (!sent) return; if (!rp->status && sent->read_all == 0x01) { hdev->stored_max_keys = rp->max_keys; hdev->stored_num_keys = rp->num_keys; } }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann93100.00%1100.00%
Total93100.00%1100.00%


static void hci_cc_delete_stored_link_key(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_delete_stored_link_key *rp = (void *)skb->data; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; if (rp->num_keys <= hdev->stored_num_keys) hdev->stored_num_keys -= rp->num_keys; else hdev->stored_num_keys = 0; }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann74100.00%1100.00%
Total74100.00%1100.00%


static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); void *sent; BT_DBG("%s status 0x%2.2x", hdev->name, status); sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_LOCAL_NAME); if (!sent) return; hci_dev_lock(hdev); if (hci_dev_test_flag(hdev, HCI_MGMT)) mgmt_set_local_name_complete(hdev, sent, status); else if (!status) memcpy(hdev->dev_name, sent, HCI_MAX_NAME_LENGTH); hci_dev_unlock(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann4340.95%228.57%
johan hedbergjohan hedberg4240.00%342.86%
maksim krasnyanskiymaksim krasnyanskiy1918.10%114.29%
andrei emeltchenkoandrei emeltchenko10.95%114.29%
Total105100.00%7100.00%


static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_local_name *rp = (void *) skb->data; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; if (hci_dev_test_flag(hdev, HCI_SETUP) || hci_dev_test_flag(hdev, HCI_CONFIG)) memcpy(hdev->dev_name, rp->name, HCI_MAX_NAME_LENGTH); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann5165.38%342.86%
maksim krasnyanskiymaksim krasnyanskiy1924.36%114.29%
johan hedbergjohan hedberg78.97%228.57%
andrei emeltchenkoandrei emeltchenko11.28%114.29%
Total78100.00%7100.00%


static void hci_cc_write_auth_enable(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); void *sent; BT_DBG("%s status 0x%2.2x", hdev->name, status); sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_AUTH_ENABLE); if (!sent) return; hci_dev_lock(hdev); if (!status) { __u8 param = *((__u8 *) sent); if (param == AUTH_ENABLED) set_bit(HCI_AUTH, &hdev->flags); else clear_bit(HCI_AUTH, &hdev->flags); } if (hci_dev_test_flag(hdev, HCI_MGMT)) mgmt_auth_enable_complete(hdev, status); hci_dev_unlock(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
maksim krasnyanskiymaksim krasnyanskiy6146.21%116.67%
marcel holtmannmarcel holtmann4735.61%233.33%
johan hedbergjohan hedberg139.85%116.67%
jaganath kanakkasseryjaganath kanakkassery107.58%116.67%
andrei emeltchenkoandrei emeltchenko10.76%116.67%
Total132100.00%6100.00%


static void hci_cc_write_encrypt_mode(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); __u8 param; void *sent; BT_DBG("%s status 0x%2.2x", hdev->name, status); if (status) return; sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_ENCRYPT_MODE); if (!sent) return; param = *((__u8 *) sent); if (param) set_bit(HCI_ENCRYPT, &hdev->flags); else clear_bit(HCI_ENCRYPT, &hdev->flags); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann6057.69%250.00%
maksim krasnyanskiymaksim krasnyanskiy4341.35%125.00%
andrei emeltchenkoandrei emeltchenko10.96%125.00%
Total104100.00%4100.00%


static void hci_cc_write_scan_enable(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); __u8 param; void *sent; BT_DBG("%s status 0x%2.2x", hdev->name, status); sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SCAN_ENABLE); if (!sent) return; param = *((__u8 *) sent); hci_dev_lock(hdev); if (status) { hdev->discov_timeout = 0; goto done; } if (param & SCAN_INQUIRY) set_bit(HCI_ISCAN, &hdev->flags); else clear_bit(HCI_ISCAN, &hdev->flags); if (param & SCAN_PAGE) set_bit(HCI_PSCAN, &hdev->flags); else clear_bit(HCI_PSCAN, &hdev->flags); done: hci_dev_unlock(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
maksim krasnyanskiymaksim krasnyanskiy8353.55%110.00%
johan hedbergjohan hedberg4428.39%660.00%
marcel holtmannmarcel holtmann2717.42%220.00%
andrei emeltchenkoandrei emeltchenko10.65%110.00%
Total155100.00%10100.00%


static void hci_cc_read_class_of_dev(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_class_of_dev *rp = (void *) skb->data; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; memcpy(hdev->dev_class, rp->dev_class, 3); BT_DBG("%s class 0x%.2x%.2x%.2x", hdev->name, hdev->dev_class[2], hdev->dev_class[1], hdev->dev_class[0]); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann9198.91%480.00%
andrei emeltchenkoandrei emeltchenko11.09%120.00%
Total92100.00%5100.00%


static void hci_cc_write_class_of_dev(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); void *sent; BT_DBG("%s status 0x%2.2x", hdev->name, status); sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_CLASS_OF_DEV); if (!sent) return; hci_dev_lock(hdev); if (status == 0) memcpy(hdev->dev_class, sent, 3); if (hci_dev_test_flag(hdev, HCI_MGMT)) mgmt_set_class_of_dev_complete(hdev, sent, status); hci_dev_unlock(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann10499.05%583.33%
andrei emeltchenkoandrei emeltchenko10.95%116.67%
Total105100.00%6100.00%


static void hci_cc_read_voice_setting(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_voice_setting *rp = (void *) skb->data; __u16 setting; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; setting = __le16_to_cpu(rp->voice_setting); if (hdev->voice_setting == setting) return; hdev->voice_setting = setting; BT_DBG("%s voice setting 0x%4.4x", hdev->name, setting); if (hdev->notify) hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann10098.04%375.00%
andrei emeltchenkoandrei emeltchenko21.96%125.00%
Total102100.00%4100.00%


static void hci_cc_write_voice_setting(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); __u16 setting; void *sent; BT_DBG("%s status 0x%2.2x", hdev->name, status); if (status) return; sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_VOICE_SETTING); if (!sent) return; setting = get_unaligned_le16(sent); if (hdev->voice_setting == setting) return; hdev->voice_setting = setting; BT_DBG("%s voice setting 0x%4.4x", hdev->name, setting); if (hdev->notify) hdev->notify(hdev, HCI_NOTIFY_VOICE_SETTING); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann7766.38%350.00%
maksim krasnyanskiymaksim krasnyanskiy3631.03%116.67%
andrei emeltchenkoandrei emeltchenko21.72%116.67%
harvey harrisonharvey harrison10.86%116.67%
Total116100.00%6100.00%


static void hci_cc_read_num_supported_iac(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_num_supported_iac *rp = (void *) skb->data; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; hdev->num_iac = rp->num_iac; BT_DBG("%s num iac %d", hdev->name, hdev->num_iac); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann70100.00%1100.00%
Total70100.00%1100.00%


static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb) { __u8 status = *((__u8 *) skb->data); struct hci_cp_write_ssp_mode *sent; BT_DBG("%s status 0x%2.2x", hdev->name, status); sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SSP_MODE); if (!sent) return; hci_dev_lock(hdev); if (!status) { if (sent->mode) hdev->features[1][0] |= LMP_HOST_SSP; else hdev->features[1][0] &= ~LMP_HOST_SSP; } if (hci_dev_test_flag(hdev, HCI_MGMT)) mgmt_ssp_enable_complete(hdev, sent->mode, status); else if (!status) { if (sent->mode) hci_dev_set_flag(hdev, HCI_SSP_ENABLED); else hci_dev_clear_flag(hdev, HCI_SSP_ENABLED); } hci_dev_unlock(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
johan hedbergjohan hedberg7949.69%440.00%
marcel holtmannmarcel holtmann6943.40%440.00%
jaganath kanakkasseryjaganath kanakkassery106.29%110.00%
andrei emeltchenkoandrei emeltchenko10.63%110.00%
Total159100.00%10100.00%


static void hci_cc_write_sc_support(struct hci_dev *hdev, struct sk_buff *skb) { u8 status = *((u8 *) skb->data); struct hci_cp_write_sc_support *sent; BT_DBG("%s status 0x%2.2x", hdev->name, status); sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SC_SUPPORT); if (!sent) return; hci_dev_lock(hdev); if (!status) { if (sent->support) hdev->features[1][0] |= LMP_HOST_SC; else hdev->features[1][0] &= ~LMP_HOST_SC; } if (!hci_dev_test_flag(hdev, HCI_MGMT) && !status) { if (sent->support) hci_dev_set_flag(hdev, HCI_SC_ENABLED); else hci_dev_clear_flag(hdev, HCI_SC_ENABLED); } hci_dev_unlock(hdev); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann13491.78%466.67%
jaganath kanakkasseryjaganath kanakkassery106.85%116.67%
johan hedbergjohan hedberg21.37%116.67%
Total146100.00%6100.00%


static void hci_cc_read_local_version(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_local_version *rp = (void *) skb->data; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; if (hci_dev_test_flag(hdev, HCI_SETUP) || hci_dev_test_flag(hdev, HCI_CONFIG)) { hdev->hci_ver = rp->hci_ver; hdev->hci_rev = __le16_to_cpu(rp->hci_rev); hdev->lmp_ver = rp->lmp_ver; hdev->manufacturer = __le16_to_cpu(rp->manufacturer); hdev->lmp_subver = __le16_to_cpu(rp->lmp_subver); } }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann9380.17%660.00%
johan hedbergjohan hedberg2118.10%220.00%
maksim krasnyanskiymaksim krasnyanskiy10.86%110.00%
andrei emeltchenkoandrei emeltchenko10.86%110.00%
Total116100.00%10100.00%


static void hci_cc_read_local_commands(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_local_commands *rp = (void *) skb->data; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; if (hci_dev_test_flag(hdev, HCI_SETUP) || hci_dev_test_flag(hdev, HCI_CONFIG)) memcpy(hdev->commands, rp->commands, sizeof(hdev->commands)); }

Contributors

PersonTokensPropCommitsCommitProp
marcel holtmannmarcel holtmann5566.27%457.14%
johan hedbergjohan hedberg1518.07%114.29%
maksim krasnyanskiymaksim krasnyanskiy1214.46%114.29%
andrei emeltchenkoandrei emeltchenko11.20%114.29%
Total83100.00%7100.00%


static void hci_cc_read_local_features(struct hci_dev *hdev, struct sk_buff *skb) { struct hci_rp_read_local_features *rp = (void *) skb->data; BT_DBG("%s status 0x%2.2x", hdev->name, rp->status); if (rp->status) return; memcpy(hdev->features, rp->features, 8); /* Adjust default settings according to features * supported by device. */ if (hdev->features[0][0] & LMP_3SLOT) hdev->pkt_type |= (HCI_DM3 | HCI_DH3); if (hdev->features[0][0] & LMP_5SLOT) hdev->pkt_type |= (HCI_DM5 | HCI_DH5); if (hdev->features[0][1] & LMP_HV2) { hdev->pkt_type |= (HCI_HV2); hdev->esco_type |= (ESCO_HV2); } if (hdev->features[0][1] & LMP_HV3) { hdev->pkt_type |= (HCI_HV3); hdev->esco_type |= (ESCO_HV3); } if (lmp_esco_capable(hdev)) hdev->esco_type |= (ESCO_EV3); if (hdev->features[0][4] & LMP_EV4) hdev->esco_type |= (ESCO_EV4); if (hdev->features[0][4] & LMP_EV5) hdev->esco_type |= (ESCO_EV5)