diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2010-12-29 17:38:22 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-07 22:40:05 -0500 |
commit | 72a734ec1aca8cd2ef3fc85428c11bde662e149e (patch) | |
tree | 7491e7e980f74b3806955ad8ae061c8ac190de79 /include | |
parent | 9fbcbb455dd01abfad4f314b618ac51d566114cb (diff) |
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')
-rw-r--r-- | include/net/bluetooth/mgmt.h | 39 |
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 { | |||
59 | __u16 hci_rev; | 59 | __u16 hci_rev; |
60 | } __packed; | 60 | } __packed; |
61 | 61 | ||
62 | #define MGMT_OP_SET_POWERED 0x0005 | 62 | struct mgmt_mode { |
63 | struct mgmt_cp_set_powered { | ||
64 | __le16 index; | 63 | __le16 index; |
65 | __u8 powered; | 64 | __u8 val; |
66 | } __packed; | ||
67 | struct mgmt_rp_set_powered { | ||
68 | __le16 index; | ||
69 | __u8 powered; | ||
70 | } __packed; | 65 | } __packed; |
71 | 66 | ||
67 | #define MGMT_OP_SET_POWERED 0x0005 | ||
68 | |||
72 | #define MGMT_OP_SET_DISCOVERABLE 0x0006 | 69 | #define MGMT_OP_SET_DISCOVERABLE 0x0006 |
73 | struct mgmt_cp_set_discoverable { | ||
74 | __le16 index; | ||
75 | __u8 discoverable; | ||
76 | } __packed; | ||
77 | struct mgmt_rp_set_discoverable { | ||
78 | __le16 index; | ||
79 | __u8 discoverable; | ||
80 | } __packed; | ||
81 | 70 | ||
82 | #define MGMT_OP_SET_CONNECTABLE 0x0007 | 71 | #define MGMT_OP_SET_CONNECTABLE 0x0007 |
83 | struct mgmt_cp_set_connectable { | ||
84 | __le16 index; | ||
85 | __u8 connectable; | ||
86 | } __packed; | ||
87 | struct mgmt_rp_set_connectable { | ||
88 | __le16 index; | ||
89 | __u8 connectable; | ||
90 | } __packed; | ||
91 | 72 | ||
92 | #define MGMT_EV_CMD_COMPLETE 0x0001 | 73 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
93 | struct mgmt_ev_cmd_complete { | 74 | struct mgmt_ev_cmd_complete { |
@@ -118,19 +99,7 @@ struct mgmt_ev_index_removed { | |||
118 | } __packed; | 99 | } __packed; |
119 | 100 | ||
120 | #define MGMT_EV_POWERED 0x0006 | 101 | #define MGMT_EV_POWERED 0x0006 |
121 | struct mgmt_ev_powered { | ||
122 | __le16 index; | ||
123 | __u8 powered; | ||
124 | } __packed; | ||
125 | 102 | ||
126 | #define MGMT_EV_DISCOVERABLE 0x0007 | 103 | #define MGMT_EV_DISCOVERABLE 0x0007 |
127 | struct mgmt_ev_discoverable { | ||
128 | __le16 index; | ||
129 | __u8 discoverable; | ||
130 | } __packed; | ||
131 | 104 | ||
132 | #define MGMT_EV_CONNECTABLE 0x0008 | 105 | #define MGMT_EV_CONNECTABLE 0x0008 |
133 | struct mgmt_ev_connectable { | ||
134 | __le16 index; | ||
135 | __u8 connectable; | ||
136 | } __packed; | ||