summaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2010-12-30 00:38:22 +0200
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-08 01:40:05 -0200
commit72a734ec1aca8cd2ef3fc85428c11bde662e149e (patch)
tree7491e7e980f74b3806955ad8ae061c8ac190de79 /include/net/bluetooth
parent9fbcbb455dd01abfad4f314b618ac51d566114cb (diff)
downloadlinux-72a734ec1aca8cd2ef3fc85428c11bde662e149e.tar.bz2
Bluetooth: Unify mode related management messages to a single struct
The powered, connectable and discoverable messages all have the same format. By using a single struct for all of them a lot of code can be simplified and reused. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/mgmt.h39
1 files changed, 4 insertions, 35 deletions
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 008acf54147a..f61fd6779ee5 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -59,35 +59,16 @@ struct mgmt_rp_read_info {
__u16 hci_rev;
} __packed;
-#define MGMT_OP_SET_POWERED 0x0005
-struct mgmt_cp_set_powered {
+struct mgmt_mode {
__le16 index;
- __u8 powered;
-} __packed;
-struct mgmt_rp_set_powered {
- __le16 index;
- __u8 powered;
+ __u8 val;
} __packed;
+#define MGMT_OP_SET_POWERED 0x0005
+
#define MGMT_OP_SET_DISCOVERABLE 0x0006
-struct mgmt_cp_set_discoverable {
- __le16 index;
- __u8 discoverable;
-} __packed;
-struct mgmt_rp_set_discoverable {
- __le16 index;
- __u8 discoverable;
-} __packed;
#define MGMT_OP_SET_CONNECTABLE 0x0007
-struct mgmt_cp_set_connectable {
- __le16 index;
- __u8 connectable;
-} __packed;
-struct mgmt_rp_set_connectable {
- __le16 index;
- __u8 connectable;
-} __packed;
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
@@ -118,19 +99,7 @@ struct mgmt_ev_index_removed {
} __packed;
#define MGMT_EV_POWERED 0x0006
-struct mgmt_ev_powered {
- __le16 index;
- __u8 powered;
-} __packed;
#define MGMT_EV_DISCOVERABLE 0x0007
-struct mgmt_ev_discoverable {
- __le16 index;
- __u8 discoverable;
-} __packed;
#define MGMT_EV_CONNECTABLE 0x0008
-struct mgmt_ev_connectable {
- __le16 index;
- __u8 connectable;
-} __packed;