aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2010-12-29 09:00:25 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-07 22:40:04 -0500
commit73f22f62388795c0f6b4f3f97bda7a64f9681aac (patch)
tree5e85471cd9411a9f21cd2f7bb722be196a23f7c7 /include/net
parenteec8d2bcc841ae44edcde9660ff21144a2016053 (diff)
Bluetooth: Add support for set_discoverable management command
This patch adds a set_discoverable command to the management interface as well as the corresponding event. The command is used to control the discoverable state of adapters. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/hci_core.h1
-rw-r--r--include/net/bluetooth/mgmt.h16
2 files changed, 17 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 2d046e07a586..ee5ec4f17a15 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -675,6 +675,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len);
675int mgmt_index_added(u16 index); 675int mgmt_index_added(u16 index);
676int mgmt_index_removed(u16 index); 676int mgmt_index_removed(u16 index);
677int mgmt_powered(u16 index, u8 powered); 677int mgmt_powered(u16 index, u8 powered);
678int mgmt_discoverable(u16 index, u8 discoverable);
678 679
679/* HCI info for socket */ 680/* HCI info for socket */
680#define hci_pi(sk) ((struct hci_pinfo *) sk) 681#define hci_pi(sk) ((struct hci_pinfo *) sk)
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 81ef78918b66..434dbcf28b6e 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -68,6 +68,16 @@ struct mgmt_rp_set_powered {
68 __u8 powered; 68 __u8 powered;
69} __packed; 69} __packed;
70 70
71#define MGMT_OP_SET_DISCOVERABLE 0x0006
72struct mgmt_cp_set_discoverable {
73 __le16 index;
74 __u8 discoverable;
75} __packed;
76struct mgmt_rp_set_discoverable {
77 __le16 index;
78 __u8 discoverable;
79} __packed;
80
71#define MGMT_EV_CMD_COMPLETE 0x0001 81#define MGMT_EV_CMD_COMPLETE 0x0001
72struct mgmt_ev_cmd_complete { 82struct mgmt_ev_cmd_complete {
73 __le16 opcode; 83 __le16 opcode;
@@ -101,3 +111,9 @@ struct mgmt_ev_powered {
101 __le16 index; 111 __le16 index;
102 __u8 powered; 112 __u8 powered;
103} __packed; 113} __packed;
114
115#define MGMT_EV_DISCOVERABLE 0x0007
116struct mgmt_ev_discoverable {
117 __le16 index;
118 __u8 discoverable;
119} __packed;