aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-01-13 14:56:52 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-07 22:40:06 -0500
commit1aff6f09491f454d4cd9f405c783fa5e9d3168a0 (patch)
tree3c51a386ada638e39bf6fa42dbc35413ede08ddd /include
parentd5859e22cd40b73164b3e5d8d5d796f96edcc6af (diff)
Bluetooth: Add class of device control to the management interface
This patch adds the possibility for user space to fully control the Class of Device value of local adapters. To control the service class bits each UUID that's added comes with a service class "hint" which acts as a mask of bits that the UUID needs to have enabled. The set_service_cache management command is used to make sure we queue up all UUID changes as user space initializes its drivers and then send a single HCI_Write_Class_of_Device command when initialization is complete. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/hci.h1
-rw-r--r--include/net/bluetooth/hci_core.h3
-rw-r--r--include/net/bluetooth/mgmt.h14
3 files changed, 18 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 99ac3516fe9d..9ce46cd00ba2 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -81,6 +81,7 @@ enum {
81 HCI_AUTO_OFF, 81 HCI_AUTO_OFF,
82 HCI_MGMT, 82 HCI_MGMT,
83 HCI_PAIRABLE, 83 HCI_PAIRABLE,
84 HCI_SERVICE_CACHE,
84}; 85};
85 86
86/* HCI ioctl defines */ 87/* HCI ioctl defines */
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 71a3fbf1e785..e62da084e01d 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -70,6 +70,7 @@ struct bdaddr_list {
70struct bt_uuid { 70struct bt_uuid {
71 struct list_head list; 71 struct list_head list;
72 u8 uuid[16]; 72 u8 uuid[16];
73 u8 svc_hint;
73}; 74};
74 75
75#define NUM_REASSEMBLY 4 76#define NUM_REASSEMBLY 4
@@ -86,6 +87,8 @@ struct hci_dev {
86 bdaddr_t bdaddr; 87 bdaddr_t bdaddr;
87 __u8 dev_name[248]; 88 __u8 dev_name[248];
88 __u8 dev_class[3]; 89 __u8 dev_class[3];
90 __u8 major_class;
91 __u8 minor_class;
89 __u8 features[8]; 92 __u8 features[8];
90 __u8 commands[64]; 93 __u8 commands[64];
91 __u8 ssp_mode; 94 __u8 ssp_mode;
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index c118ad3af332..b092c4c014eb 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -76,6 +76,7 @@ struct mgmt_mode {
76struct mgmt_cp_add_uuid { 76struct mgmt_cp_add_uuid {
77 __le16 index; 77 __le16 index;
78 __u8 uuid[16]; 78 __u8 uuid[16];
79 __u8 svc_hint;
79} __packed; 80} __packed;
80 81
81#define MGMT_OP_REMOVE_UUID 0x000A 82#define MGMT_OP_REMOVE_UUID 0x000A
@@ -84,6 +85,19 @@ struct mgmt_cp_remove_uuid {
84 __u8 uuid[16]; 85 __u8 uuid[16];
85} __packed; 86} __packed;
86 87
88#define MGMT_OP_SET_DEV_CLASS 0x000B
89struct mgmt_cp_set_dev_class {
90 __le16 index;
91 __u8 major;
92 __u8 minor;
93} __packed;
94
95#define MGMT_OP_SET_SERVICE_CACHE 0x000C
96struct mgmt_cp_set_service_cache {
97 __le16 index;
98 __u8 enable;
99} __packed;
100
87#define MGMT_EV_CMD_COMPLETE 0x0001 101#define MGMT_EV_CMD_COMPLETE 0x0001
88struct mgmt_ev_cmd_complete { 102struct mgmt_ev_cmd_complete {
89 __le16 opcode; 103 __le16 opcode;