Commit | Line | Data |
---|---|---|
c02178d2 JH |
1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | |
3 | ||
4 | Copyright (C) 2010 Nokia Corporation | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License version 2 as | |
8 | published by the Free Software Foundation; | |
9 | ||
10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | |
13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | |
14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | |
15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
18 | ||
19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | |
20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | |
21 | SOFTWARE IS DISCLAIMED. | |
22 | */ | |
23 | ||
24 | struct mgmt_hdr { | |
25 | __le16 opcode; | |
26 | __le16 len; | |
27 | } __packed; | |
28 | #define MGMT_HDR_SIZE 4 | |
29 | ||
02d98129 JH |
30 | #define MGMT_OP_READ_VERSION 0x0001 |
31 | struct mgmt_rp_read_version { | |
32 | __u8 version; | |
33 | __le16 revision; | |
34 | } __packed; | |
35 | ||
faba42eb JH |
36 | #define MGMT_OP_READ_INDEX_LIST 0x0003 |
37 | struct mgmt_rp_read_index_list { | |
38 | __le16 num_controllers; | |
39 | __le16 index[0]; | |
40 | } __packed; | |
41 | ||
f7b64e69 JH |
42 | #define MGMT_OP_READ_INFO 0x0004 |
43 | struct mgmt_cp_read_info { | |
44 | __le16 index; | |
45 | } __packed; | |
46 | struct mgmt_rp_read_info { | |
47 | __le16 index; | |
48 | __u8 type; | |
49 | __u8 powered; | |
9fbcbb45 | 50 | __u8 connectable; |
f7b64e69 JH |
51 | __u8 discoverable; |
52 | __u8 pairable; | |
53 | __u8 sec_mode; | |
54 | bdaddr_t bdaddr; | |
55 | __u8 dev_class[3]; | |
56 | __u8 features[8]; | |
57 | __u16 manufacturer; | |
58 | __u8 hci_ver; | |
59 | __u16 hci_rev; | |
60 | } __packed; | |
61 | ||
eec8d2bc JH |
62 | #define MGMT_OP_SET_POWERED 0x0005 |
63 | struct mgmt_cp_set_powered { | |
64 | __le16 index; | |
65 | __u8 powered; | |
66 | } __packed; | |
67 | struct mgmt_rp_set_powered { | |
68 | __le16 index; | |
69 | __u8 powered; | |
70 | } __packed; | |
71 | ||
73f22f62 JH |
72 | #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 | ||
9fbcbb45 JH |
82 | #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 | ||
c02178d2 JH |
92 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
93 | struct mgmt_ev_cmd_complete { | |
94 | __le16 opcode; | |
95 | __u8 data[0]; | |
96 | } __packed; | |
97 | ||
98 | #define MGMT_EV_CMD_STATUS 0x0002 | |
99 | struct mgmt_ev_cmd_status { | |
100 | __u8 status; | |
101 | __le16 opcode; | |
102 | } __packed; | |
103 | ||
104 | #define MGMT_EV_CONTROLLER_ERROR 0x0003 | |
105 | struct mgmt_ev_controller_error { | |
106 | __le16 index; | |
107 | __u8 error_code; | |
108 | } __packed; | |
c71e97bf JH |
109 | |
110 | #define MGMT_EV_INDEX_ADDED 0x0004 | |
111 | struct mgmt_ev_index_added { | |
112 | __le16 index; | |
113 | } __packed; | |
114 | ||
115 | #define MGMT_EV_INDEX_REMOVED 0x0005 | |
116 | struct mgmt_ev_index_removed { | |
117 | __le16 index; | |
118 | } __packed; | |
5add6af8 JH |
119 | |
120 | #define MGMT_EV_POWERED 0x0006 | |
121 | struct mgmt_ev_powered { | |
122 | __le16 index; | |
123 | __u8 powered; | |
124 | } __packed; | |
73f22f62 JH |
125 | |
126 | #define MGMT_EV_DISCOVERABLE 0x0007 | |
127 | struct mgmt_ev_discoverable { | |
128 | __le16 index; | |
129 | __u8 discoverable; | |
130 | } __packed; | |
9fbcbb45 JH |
131 | |
132 | #define MGMT_EV_CONNECTABLE 0x0008 | |
133 | struct mgmt_ev_connectable { | |
134 | __le16 index; | |
135 | __u8 connectable; | |
136 | } __packed; |