aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-01-10 05:07:22 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2014-02-13 02:51:32 -0500
commite98d2ce293a941d41b5c8435975ff25a1b858bf9 (patch)
tree19b109be357a464a5be7241cec423ab76bc781fa
parent40c59fcbcdc25d5b1aafef23b94167c2376b0dce (diff)
Bluetooth: Add flags and setting for Secure Connections support
The MGMT_SETTING_SECURE_CONN setting is used to track the support and status for Secure Connections from the management interface. For HCI based tracking HCI_SC_ENABLED flag is used. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--include/net/bluetooth/hci.h1
-rw-r--r--include/net/bluetooth/mgmt.h1
-rw-r--r--net/bluetooth/mgmt.c7
3 files changed, 9 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 8d888bc432c6..0253276e88e4 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -122,6 +122,7 @@ enum {
122 122
123 HCI_LE_SCAN, 123 HCI_LE_SCAN,
124 HCI_SSP_ENABLED, 124 HCI_SSP_ENABLED,
125 HCI_SC_ENABLED,
125 HCI_HS_ENABLED, 126 HCI_HS_ENABLED,
126 HCI_LE_ENABLED, 127 HCI_LE_ENABLED,
127 HCI_ADVERTISING, 128 HCI_ADVERTISING,
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 518c5c84e39a..4ec17dec62e0 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -94,6 +94,7 @@ struct mgmt_rp_read_index_list {
94#define MGMT_SETTING_HS 0x00000100 94#define MGMT_SETTING_HS 0x00000100
95#define MGMT_SETTING_LE 0x00000200 95#define MGMT_SETTING_LE 0x00000200
96#define MGMT_SETTING_ADVERTISING 0x00000400 96#define MGMT_SETTING_ADVERTISING 0x00000400
97#define MGMT_SETTING_SECURE_CONN 0x00000800
97 98
98#define MGMT_OP_READ_INFO 0x0004 99#define MGMT_OP_READ_INFO 0x0004
99#define MGMT_READ_INFO_SIZE 0 100#define MGMT_READ_INFO_SIZE 0
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index a03ca3ca91bf..b00fa0253cba 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -79,6 +79,7 @@ static const u16 mgmt_commands[] = {
79 MGMT_OP_SET_BREDR, 79 MGMT_OP_SET_BREDR,
80 MGMT_OP_SET_STATIC_ADDRESS, 80 MGMT_OP_SET_STATIC_ADDRESS,
81 MGMT_OP_SET_SCAN_PARAMS, 81 MGMT_OP_SET_SCAN_PARAMS,
82 MGMT_OP_SET_SECURE_CONN,
82}; 83};
83 84
84static const u16 mgmt_events[] = { 85static const u16 mgmt_events[] = {
@@ -376,6 +377,9 @@ static u32 get_supported_settings(struct hci_dev *hdev)
376 settings |= MGMT_SETTING_SSP; 377 settings |= MGMT_SETTING_SSP;
377 settings |= MGMT_SETTING_HS; 378 settings |= MGMT_SETTING_HS;
378 } 379 }
380
381 if (lmp_sc_capable(hdev))
382 settings |= MGMT_SETTING_SECURE_CONN;
379 } 383 }
380 384
381 if (lmp_le_capable(hdev)) { 385 if (lmp_le_capable(hdev)) {
@@ -423,6 +427,9 @@ static u32 get_current_settings(struct hci_dev *hdev)
423 if (test_bit(HCI_ADVERTISING, &hdev->dev_flags)) 427 if (test_bit(HCI_ADVERTISING, &hdev->dev_flags))
424 settings |= MGMT_SETTING_ADVERTISING; 428 settings |= MGMT_SETTING_ADVERTISING;
425 429
430 if (test_bit(HCI_SC_ENABLED, &hdev->dev_flags))
431 settings |= MGMT_SETTING_SECURE_CONN;
432
426 return settings; 433 return settings;
427} 434}
428 435