54e753ba7e54a3c598054b99741deeca40a7954d
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / include / net / bluetooth / mgmt_tizen.h
1 /*
2    BlueZ - Bluetooth protocol stack for Linux
3
4    Copyright (C) 2010  Nokia Corporation
5    Copyright (C) 2011-2012  Intel Corporation
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License version 2 as
9    published by the Free Software Foundation;
10
11    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
12    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
14    IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
15    CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
16    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19
20    ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21    COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
22    SOFTWARE IS DISCLAIMED.
23 */
24
25 #ifdef CONFIG_TIZEN_WIP
26
27 #define TIZEN_OP_CODE_BASE      0xff00
28 #define TIZEN_EV_BASE           0xff00
29
30 #define MGMT_OP_SET_ADVERTISING_PARAMS          (TIZEN_OP_CODE_BASE + 0x01)
31 struct mgmt_cp_set_advertising_params {
32         __le16  interval_min;
33         __le16  interval_max;
34         __u8 filter_policy;
35         __u8 type;
36 } __packed;
37 #define MGMT_SET_ADVERTISING_PARAMS_SIZE        6
38
39 #define MGMT_OP_SET_ADVERTISING_DATA            (TIZEN_OP_CODE_BASE + 0x02)
40 struct mgmt_cp_set_advertising_data {
41         __u8    data[HCI_MAX_AD_LENGTH];
42 } __packed;
43 #define MGMT_SET_ADVERTISING_DATA_SIZE          HCI_MAX_AD_LENGTH
44 #define MGMT_SET_ADV_MIN_APP_DATA_SIZE          1
45
46 #define MGMT_OP_SET_SCAN_RSP_DATA               (TIZEN_OP_CODE_BASE + 0x03)
47 struct mgmt_cp_set_scan_rsp_data {
48         __u8    data[HCI_MAX_AD_LENGTH];
49 } __packed;
50 #define MGMT_SET_SCAN_RSP_DATA_SIZE             HCI_MAX_AD_LENGTH
51 #define MGMT_SET_SCAN_RSP_MIN_APP_DATA_SIZE     1
52
53 #define MGMT_OP_ADD_DEV_WHITE_LIST              (TIZEN_OP_CODE_BASE + 0x04)
54 struct mgmt_cp_add_dev_white_list {
55         __u8    bdaddr_type;
56         bdaddr_t bdaddr;
57 } __packed;
58 #define MGMT_ADD_DEV_WHITE_LIST_SIZE            7
59
60 #define MGMT_OP_REMOVE_DEV_FROM_WHITE_LIST      (TIZEN_OP_CODE_BASE + 0x05)
61 struct mgmt_cp_remove_dev_from_white_list {
62         __u8    bdaddr_type;
63         bdaddr_t bdaddr;
64 } __packed;
65 #define MGMT_REMOVE_DEV_FROM_WHITE_LIST_SIZE    7
66
67 #define MGMT_OP_CLEAR_DEV_WHITE_LIST            (TIZEN_OP_CODE_BASE + 0x06)
68 #define MGMT_OP_CLEAR_DEV_WHITE_LIST_SIZE       0
69
70 /* BEGIN TIZEN_Bluetooth :: RSSI monitoring   */
71 #define MGMT_OP_SET_RSSI_ENABLE                 (TIZEN_OP_CODE_BASE + 0x07)
72 #define MGMT_SET_RSSI_ENABLE_SIZE               10
73
74 struct mgmt_cp_set_enable_rssi {
75         __s8    low_th;
76         __s8    in_range_th;
77         __s8    high_th;
78         bdaddr_t bdaddr;
79         __s8    link_type;
80 } __packed;
81
82 struct mgmt_cc_rsp_enable_rssi {
83         __u8     status;
84         __u8     le_ext_opcode;
85         bdaddr_t bt_address;
86         __s8    link_type;
87 } __packed;
88
89 #define MGMT_OP_GET_RAW_RSSI                    (TIZEN_OP_CODE_BASE + 0x08)
90 #define MGMT_GET_RAW_RSSI_SIZE                  7
91
92 struct mgmt_cp_get_raw_rssi {
93         bdaddr_t bt_address;
94         __u8     link_type;
95 } __packed;
96
97 #define MGMT_OP_SET_RSSI_DISABLE                (TIZEN_OP_CODE_BASE + 0x09)
98 #define MGMT_SET_RSSI_DISABLE_SIZE              7
99 struct mgmt_cp_disable_rssi {
100         bdaddr_t   bdaddr;
101         __u8     link_type;
102 } __packed;
103 struct mgmt_cc_rp_disable_rssi {
104         __u8 status;
105         __u8 le_ext_opcode;
106         bdaddr_t bt_address;
107         __s8    link_type;
108 } __packed;
109 /* END TIZEN_Bluetooth :: RSSI monitoring */
110
111 #define MGMT_OP_START_LE_DISCOVERY              (TIZEN_OP_CODE_BASE + 0x0a)
112 struct mgmt_cp_start_le_discovery {
113             __u8 type;
114 } __packed;
115 #define MGMT_START_LE_DISCOVERY_SIZE            1
116
117 #define MGMT_OP_STOP_LE_DISCOVERY               (TIZEN_OP_CODE_BASE + 0x0b)
118 struct mgmt_cp_stop_le_discovery {
119             __u8 type;
120 } __packed;
121 #define MGMT_STOP_LE_DISCOVERY_SIZE             1
122
123 /* BEGIN TIZEN_Bluetooth :: LE auto connection */
124 #define MGMT_OP_DISABLE_LE_AUTO_CONNECT         (TIZEN_OP_CODE_BASE + 0x0c)
125 #define MGMT_DISABLE_LE_AUTO_CONNECT_SIZE       0
126 /* END TIZEN_Bluetooth */
127
128 #define MGMT_LE_CONN_UPDATE_SIZE                14
129 #define MGMT_OP_LE_CONN_UPDATE                  (TIZEN_OP_CODE_BASE + 0x0d)
130 struct mgmt_cp_le_conn_update {
131         __le16  conn_interval_min;
132         __le16  conn_interval_max;
133         __le16  conn_latency;
134         __le16  supervision_timeout;
135         bdaddr_t bdaddr;
136 } __packed;
137
138 #define MGMT_OP_SET_MANUFACTURER_DATA           (TIZEN_OP_CODE_BASE + 0x0e)
139 #define MGMT_SET_MANUFACTURER_DATA_SIZE         100
140 struct mgmt_cp_set_manufacturer_data {
141         __u8 data[MGMT_SET_MANUFACTURER_DATA_SIZE];
142 } __packed;
143
144 #define MGMT_OP_LE_SET_SCAN_PARAMS              (TIZEN_OP_CODE_BASE + 0x0f)
145 struct mgmt_cp_le_set_scan_params {
146         __u8    type;   /* le scan type */
147         __le16  interval;
148         __le16  window;
149 } __packed;
150 #define MGMT_LE_SET_SCAN_PARAMS_SIZE            5
151
152 #define MGMT_SCO_ROLE_HANDSFREE                 0x00
153 #define MGMT_SCO_ROLE_AUDIO_GATEWAY             0x01
154 #define MGMT_OP_SET_VOICE_SETTING               (TIZEN_OP_CODE_BASE + 0x10)
155 struct mgmt_cp_set_voice_setting {
156         bdaddr_t bdaddr;
157         uint8_t  sco_role;
158         uint16_t voice_setting;
159 } __packed;
160 #define MGMT_SET_VOICE_SETTING_SIZE     9
161
162 #define MGMT_OP_GET_ADV_TX_POWER                (TIZEN_OP_CODE_BASE + 0x11)
163 #define MGMT_GET_ADV_TX_POWER_SIZE                      0
164 struct mgmt_rp_get_adv_tx_power {
165         __s8 adv_tx_power;
166 } __packed;
167
168
169 /* BEGIN TIZEN_Bluetooth :: name update changes */
170 #define MGMT_EV_DEVICE_NAME_UPDATE              (TIZEN_EV_BASE + 0x01)
171 struct mgmt_ev_device_name_update {
172         struct mgmt_addr_info addr;
173         __le16  eir_len;
174         __u8    eir[0];
175 } __packed;
176 /* END TIZEN_Bluetooth :: name update changes */
177
178 /* BEGIN TIZEN_Bluetooth :: Add handling of hardware error event   */
179 #define MGMT_EV_HARDWARE_ERROR                  (TIZEN_EV_BASE + 0x02)
180 struct mgmt_ev_hardware_error {
181         __u8    error_code;
182 } __packed;
183 /* END TIZEN_Bluetooth */
184
185 /* BEGIN TIZEN_Bluetooth :: HCI TX Timeout Error   */
186 #define MGMT_EV_TX_TIMEOUT_ERROR                (TIZEN_EV_BASE + 0x03)
187 /* END TIZEN_Bluetooth */
188
189 /* BEGIN TIZEN_Bluetooth :: Add handling of RSSI Events   */
190 #define MGMT_EV_RSSI_ALERT                      (TIZEN_EV_BASE + 0x04)
191 struct mgmt_ev_vendor_specific_rssi_alert {
192         bdaddr_t bdaddr;
193         __s8     link_type;
194         __s8     alert_type;
195         __s8     rssi_dbm;
196 } __packed;
197
198 #define MGMT_EV_RAW_RSSI                        (TIZEN_EV_BASE + 0x05)
199 struct mgmt_cc_rp_get_raw_rssi {
200         __u8     status;
201         __s8     rssi_dbm;
202         __u8     link_type;
203         bdaddr_t bt_address;
204 } __packed;
205
206 #define MGMT_EV_RSSI_ENABLED                    (TIZEN_EV_BASE + 0x06)
207
208 #define MGMT_EV_RSSI_DISABLED                   (TIZEN_EV_BASE + 0x07)
209 /* END TIZEN_Bluetooth :: Handling of RSSI Events */
210
211 /* BEGIN TIZEN_Bluetooth :: Add LE connection update Events   */
212 #define MGMT_EV_CONN_UPDATED                    (TIZEN_EV_BASE + 0x08)
213 struct mgmt_ev_conn_updated {
214         struct  mgmt_addr_info addr;
215         __le16  conn_interval;
216         __le16  conn_latency;
217         __le16  supervision_timeout;
218 } __packed;
219
220 #define MGMT_EV_CONN_UPDATE_FAILED              (TIZEN_EV_BASE + 0x09)
221 struct mgmt_ev_conn_update_failed {
222         struct  mgmt_addr_info addr;
223         __u8    status;
224 } __packed;
225 /* END TIZEN_Bluetooth :: Add LE connection update Events */
226
227 #define MGMT_EV_LE_DEVICE_FOUND                 (TIZEN_EV_BASE + 0x0a)
228 struct mgmt_ev_le_device_found {
229         struct mgmt_addr_info addr;
230         __s8    rssi;
231         __le32  flags;
232         __s8    adv_type;
233         __le16  eir_len;
234         __u8    eir[0];
235 } __packed;
236
237 #define MGMT_EV_MULTI_ADV_STATE_CHANGED                 (TIZEN_EV_BASE + 0x0b)
238 struct mgmt_ev_vendor_specific_multi_adv_state_changed {
239         __u8    adv_instance;
240         __u8    state_change_reason;
241         __le16  connection_handle;
242 } __packed;
243
244 #endif   /* CONFIG_TIZEN_WIP */