Release 4.11 net/bluetooth/hci_event.c
/*
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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 36 | 33.03% | 3 | 25.00% |
Johan Hedberg | 24 | 22.02% | 2 | 16.67% |
Jakub Pawlowski | 17 | 15.60% | 1 | 8.33% |
Andre Guedes | 15 | 13.76% | 2 | 16.67% |
Maksim Krasnyanskiy | 14 | 12.84% | 1 | 8.33% |
Oliver Neukum | 1 | 0.92% | 1 | 8.33% |
Peter Zijlstra | 1 | 0.92% | 1 | 8.33% |
Andrei Emeltchenko | 1 | 0.92% | 1 | 8.33% |
Total | 109 | 100.00% | 12 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Andre Guedes | 49 | 92.45% | 2 | 50.00% |
Marcel Holtmann | 3 | 5.66% | 1 | 25.00% |
Andrei Emeltchenko | 1 | 1.89% | 1 | 25.00% |
Total | 53 | 100.00% | 4 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 53 | 91.38% | 3 | 60.00% |
Andre Guedes | 4 | 6.90% | 1 | 20.00% |
Andrei Emeltchenko | 1 | 1.72% | 1 | 20.00% |
Total | 58 | 100.00% | 5 | 100.00% |
static void hci_cc_remote_name_req_cancel(struct hci_dev *hdev,
struct sk_buff *skb)
{
BT_DBG("%s", hdev->name);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 16 | 64.00% | 1 | 50.00% |
Maksim Krasnyanskiy | 9 | 36.00% | 1 | 50.00% |
Total | 25 | 100.00% | 2 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Maksim Krasnyanskiy | 63 | 70.00% | 2 | 33.33% |
Marcel Holtmann | 22 | 24.44% | 2 | 33.33% |
Johan Hedberg | 4 | 4.44% | 1 | 16.67% |
Andrei Emeltchenko | 1 | 1.11% | 1 | 16.67% |
Total | 90 | 100.00% | 6 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 92 | 98.92% | 1 | 50.00% |
Andrei Emeltchenko | 1 | 1.08% | 1 | 50.00% |
Total | 93 | 100.00% | 2 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 106 | 94.64% | 2 | 40.00% |
Harvey Harrison | 4 | 3.57% | 1 | 20.00% |
Maksim Krasnyanskiy | 1 | 0.89% | 1 | 20.00% |
Andrei Emeltchenko | 1 | 0.89% | 1 | 20.00% |
Total | 112 | 100.00% | 5 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 59 | 98.33% | 1 | 50.00% |
Andrei Emeltchenko | 1 | 1.67% | 1 | 50.00% |
Total | 60 | 100.00% | 2 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 73 | 98.65% | 2 | 66.67% |
Andrei Emeltchenko | 1 | 1.35% | 1 | 33.33% |
Total | 74 | 100.00% | 3 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 64 | 44.14% | 7 | 43.75% |
Johan Hedberg | 39 | 26.90% | 4 | 25.00% |
Maksim Krasnyanskiy | 26 | 17.93% | 1 | 6.25% |
Gustavo Fernando Padovan | 10 | 6.90% | 1 | 6.25% |
Andre Guedes | 5 | 3.45% | 2 | 12.50% |
Andrei Emeltchenko | 1 | 0.69% | 1 | 6.25% |
Total | 145 | 100.00% | 16 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 93 | 100.00% | 1 | 100.00% |
Total | 93 | 100.00% | 1 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 74 | 100.00% | 1 | 100.00% |
Total | 74 | 100.00% | 1 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 43 | 40.95% | 2 | 28.57% |
Johan Hedberg | 42 | 40.00% | 3 | 42.86% |
Maksim Krasnyanskiy | 19 | 18.10% | 1 | 14.29% |
Andrei Emeltchenko | 1 | 0.95% | 1 | 14.29% |
Total | 105 | 100.00% | 7 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 51 | 65.38% | 3 | 42.86% |
Maksim Krasnyanskiy | 19 | 24.36% | 1 | 14.29% |
Johan Hedberg | 7 | 8.97% | 2 | 28.57% |
Andrei Emeltchenko | 1 | 1.28% | 1 | 14.29% |
Total | 78 | 100.00% | 7 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Maksim Krasnyanskiy | 61 | 46.21% | 1 | 16.67% |
Marcel Holtmann | 47 | 35.61% | 2 | 33.33% |
Johan Hedberg | 13 | 9.85% | 1 | 16.67% |
Jaganath Kanakkassery | 10 | 7.58% | 1 | 16.67% |
Andrei Emeltchenko | 1 | 0.76% | 1 | 16.67% |
Total | 132 | 100.00% | 6 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 60 | 57.69% | 2 | 50.00% |
Maksim Krasnyanskiy | 43 | 41.35% | 1 | 25.00% |
Andrei Emeltchenko | 1 | 0.96% | 1 | 25.00% |
Total | 104 | 100.00% | 4 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Maksim Krasnyanskiy | 83 | 53.55% | 1 | 10.00% |
Johan Hedberg | 44 | 28.39% | 6 | 60.00% |
Marcel Holtmann | 27 | 17.42% | 2 | 20.00% |
Andrei Emeltchenko | 1 | 0.65% | 1 | 10.00% |
Total | 155 | 100.00% | 10 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 91 | 98.91% | 4 | 80.00% |
Andrei Emeltchenko | 1 | 1.09% | 1 | 20.00% |
Total | 92 | 100.00% | 5 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 104 | 99.05% | 5 | 83.33% |
Andrei Emeltchenko | 1 | 0.95% | 1 | 16.67% |
Total | 105 | 100.00% | 6 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 100 | 98.04% | 3 | 75.00% |
Andrei Emeltchenko | 2 | 1.96% | 1 | 25.00% |
Total | 102 | 100.00% | 4 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 77 | 66.38% | 3 | 50.00% |
Maksim Krasnyanskiy | 36 | 31.03% | 1 | 16.67% |
Andrei Emeltchenko | 2 | 1.72% | 1 | 16.67% |
Harvey Harrison | 1 | 0.86% | 1 | 16.67% |
Total | 116 | 100.00% | 6 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 70 | 100.00% | 1 | 100.00% |
Total | 70 | 100.00% | 1 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Johan Hedberg | 79 | 49.69% | 4 | 40.00% |
Marcel Holtmann | 69 | 43.40% | 4 | 40.00% |
Jaganath Kanakkassery | 10 | 6.29% | 1 | 10.00% |
Andrei Emeltchenko | 1 | 0.63% | 1 | 10.00% |
Total | 159 | 100.00% | 10 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 134 | 91.78% | 4 | 66.67% |
Jaganath Kanakkassery | 10 | 6.85% | 1 | 16.67% |
Johan Hedberg | 2 | 1.37% | 1 | 16.67% |
Total | 146 | 100.00% | 6 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 93 | 80.17% | 6 | 60.00% |
Johan Hedberg | 21 | 18.10% | 2 | 20.00% |
Maksim Krasnyanskiy | 1 | 0.86% | 1 | 10.00% |
Andrei Emeltchenko | 1 | 0.86% | 1 | 10.00% |
Total | 116 | 100.00% | 10 | 100.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
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 55 | 66.27% | 4 | 57.14% |
Johan Hedberg | 15 | 18.07% | 1 | 14.29% |
Maksim Krasnyanskiy | 12 | 14.46% | 1 | 14.29% |
Andrei Emeltchenko | 1 | 1.20% | 1 | 14.29% |
Total | 83 | 100.00% | 7 | 100.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);
if (hdev->features[0][5] & LMP_EDR_ESCO_2M)
hdev->esco_type |= (ESCO_2EV3);
if (hdev->features[0][5] & LMP_EDR_ESCO_3M)
hdev->esco_type |= (ESCO_3EV3);
if (hdev->features[0][5] & LMP_EDR_3S_ESCO)
hdev->esco_type |= (ESCO_2EV5 | ESCO_3EV5);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Marcel Holtmann | 167 | 55.30% | 3 | 42.86% |
Maksim Krasnyanskiy | 104 | 34.44% | 1 | 14.29% |
Johan Hedberg | 27 | 8.94% | 1 | 14.29% |
Andre Guedes | 3 | 0.99% | 1 | 14.29% |
Andrei Emeltchenko | 1 | 0.33% | 1 | 14.29% |
Total | 302 | 100.00% | 7 | 100.00% |
static void hci_cc_read_local_ext_features(struct hci_dev *hdev,
struct sk_buff *skb)
{
struct hci_rp_read_local_ext_features *rp