aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-11-07 19:23:00 -0500
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2012-11-18 20:03:01 -0500
commit3f0f524bafcd2025c12e215f13207c7be0a13bf9 (patch)
tree0938ee73420e34e3753f344d3a3e8927db57f672 /include
parentbbaf444a89dd7dd7effd8ed2f4e4ec64da3cc1da (diff)
Bluetooth: Add support for setting LE advertising data
This patch adds support for setting basing LE advertising data. The three elements supported for now are the advertising flags, the TX power and the friendly name. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/hci.h15
-rw-r--r--include/net/bluetooth/hci_core.h4
2 files changed, 19 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 344fea0a7244..7306078e547c 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -338,6 +338,13 @@ enum {
338#define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ 338#define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */
339#define EIR_DEVICE_ID 0x10 /* device ID */ 339#define EIR_DEVICE_ID 0x10 /* device ID */
340 340
341/* Low Energy Advertising Flags */
342#define LE_AD_LIMITED 0x01 /* Limited Discoverable */
343#define LE_AD_GENERAL 0x02 /* General Discoverable */
344#define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */
345#define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */
346#define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */
347
341/* ----- HCI Commands ---- */ 348/* ----- HCI Commands ---- */
342#define HCI_OP_NOP 0x0000 349#define HCI_OP_NOP 0x0000
343 350
@@ -942,6 +949,14 @@ struct hci_rp_le_read_adv_tx_power {
942 __s8 tx_power; 949 __s8 tx_power;
943} __packed; 950} __packed;
944 951
952#define HCI_MAX_AD_LENGTH 31
953
954#define HCI_OP_LE_SET_ADV_DATA 0x2008
955struct hci_cp_le_set_adv_data {
956 __u8 length;
957 __u8 data[HCI_MAX_AD_LENGTH];
958} __packed;
959
945#define HCI_OP_LE_SET_SCAN_PARAM 0x200b 960#define HCI_OP_LE_SET_SCAN_PARAM 0x200b
946struct hci_cp_le_set_scan_param { 961struct hci_cp_le_set_scan_param {
947 __u8 type; 962 __u8 type;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index ce6dbeb6dfb6..ef5b85dac3f7 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -279,6 +279,8 @@ struct hci_dev {
279 struct le_scan_params le_scan_params; 279 struct le_scan_params le_scan_params;
280 280
281 __s8 adv_tx_power; 281 __s8 adv_tx_power;
282 __u8 adv_data[HCI_MAX_AD_LENGTH];
283 __u8 adv_data_len;
282 284
283 int (*open)(struct hci_dev *hdev); 285 int (*open)(struct hci_dev *hdev);
284 int (*close)(struct hci_dev *hdev); 286 int (*close)(struct hci_dev *hdev);
@@ -734,6 +736,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash,
734 u8 *randomizer); 736 u8 *randomizer);
735int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); 737int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
736 738
739int hci_update_ad(struct hci_dev *hdev);
740
737void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 741void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
738 742
739int hci_recv_frame(struct sk_buff *skb); 743int hci_recv_frame(struct sk_buff *skb);