aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2014-05-14 07:43:03 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-05-16 00:48:06 -0400
commitdd9838087b8c2b45c7976e46290749732d7af9d5 (patch)
tree0c2a6fbbed4ca96a7da57414b36fa191242abcfa /include/net
parent31ad169148df2252a774c73c504aff43bfa4b656 (diff)
Bluetooth: Add support to get connection information
This patch adds support for Get Connection Information mgmt command which can be used to query for information about connection, i.e. RSSI and local TX power level. In general values cached in hci_conn are returned as long as they are considered valid, i.e. do not exceed age limit set in hdev. This limit is calculated as random value between min/max values to avoid client trying to guess when to poll for updated information. Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/hci_core.h2
-rw-r--r--include/net/bluetooth/mgmt.h12
2 files changed, 14 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 4623f45c8892..cbbab6327621 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -384,6 +384,8 @@ struct hci_conn {
384 __s8 tx_power; 384 __s8 tx_power;
385 unsigned long flags; 385 unsigned long flags;
386 386
387 unsigned long conn_info_timestamp;
388
387 __u8 remote_cap; 389 __u8 remote_cap;
388 __u8 remote_auth; 390 __u8 remote_auth;
389 __u8 remote_id; 391 __u8 remote_id;
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index d4b571c2f9fd..226ae03cafe7 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -409,6 +409,18 @@ struct mgmt_cp_load_irks {
409} __packed; 409} __packed;
410#define MGMT_LOAD_IRKS_SIZE 2 410#define MGMT_LOAD_IRKS_SIZE 2
411 411
412#define MGMT_OP_GET_CONN_INFO 0x0031
413struct mgmt_cp_get_conn_info {
414 struct mgmt_addr_info addr;
415} __packed;
416#define MGMT_GET_CONN_INFO_SIZE MGMT_ADDR_INFO_SIZE
417struct mgmt_rp_get_conn_info {
418 struct mgmt_addr_info addr;
419 __s8 rssi;
420 __s8 tx_power;
421 __s8 max_tx_power;
422} __packed;
423
412#define MGMT_EV_CMD_COMPLETE 0x0001 424#define MGMT_EV_CMD_COMPLETE 0x0001
413struct mgmt_ev_cmd_complete { 425struct mgmt_ev_cmd_complete {
414 __le16 opcode; 426 __le16 opcode;