blob: 2995e2e63512f00bc19d0cf0c52836266f965807 [file] [log] [blame]
Ron Shaffer04fafe42010-05-28 11:53:45 -04001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 BlueZ - Bluetooth protocol stack for Linux
Ron Shaffer2d0a0342010-05-28 11:53:46 -04003 Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
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
Ron Shaffer04fafe42010-05-28 11:53:45 -040015 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19
Ron Shaffer04fafe42010-05-28 11:53:45 -040020 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
21 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 SOFTWARE IS DISCLAIMED.
23*/
24
25#ifndef __HCI_CORE_H
26#define __HCI_CORE_H
27
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#include <net/bluetooth/hci.h>
29
30/* HCI upper protocols */
31#define HCI_PROTO_L2CAP 0
32#define HCI_PROTO_SCO 1
33
Linus Torvalds1da177e2005-04-16 15:20:36 -070034/* HCI Core structures */
Linus Torvalds1da177e2005-04-16 15:20:36 -070035struct inquiry_data {
36 bdaddr_t bdaddr;
37 __u8 pscan_rep_mode;
38 __u8 pscan_period_mode;
39 __u8 pscan_mode;
40 __u8 dev_class[3];
Marcel Holtmann1ebb9252005-11-08 09:57:21 -080041 __le16 clock_offset;
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 __s8 rssi;
Marcel Holtmann41a96212008-07-14 20:13:48 +020043 __u8 ssp_mode;
Linus Torvalds1da177e2005-04-16 15:20:36 -070044};
45
46struct inquiry_entry {
Andrei Emeltchenko70f230202010-12-01 16:58:25 +020047 struct inquiry_entry *next;
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 __u32 timestamp;
49 struct inquiry_data data;
50};
51
52struct inquiry_cache {
Andrei Emeltchenko70f230202010-12-01 16:58:25 +020053 spinlock_t lock;
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 __u32 timestamp;
Andrei Emeltchenko70f230202010-12-01 16:58:25 +020055 struct inquiry_entry *list;
Linus Torvalds1da177e2005-04-16 15:20:36 -070056};
57
58struct hci_conn_hash {
59 struct list_head list;
60 spinlock_t lock;
61 unsigned int acl_num;
62 unsigned int sco_num;
Ville Tervofcd89c02011-02-10 22:38:47 -030063 unsigned int le_num;
Linus Torvalds1da177e2005-04-16 15:20:36 -070064};
65
Johan Hedbergf0358562010-05-18 13:20:32 +020066struct bdaddr_list {
67 struct list_head list;
68 bdaddr_t bdaddr;
69};
Johan Hedberg2aeb9a12011-01-04 12:08:51 +020070
71struct bt_uuid {
72 struct list_head list;
73 u8 uuid[16];
Johan Hedberg1aff6f02011-01-13 21:56:52 +020074 u8 svc_hint;
Johan Hedberg2aeb9a12011-01-04 12:08:51 +020075};
76
Johan Hedberg55ed8ca12011-01-17 14:41:05 +020077struct link_key {
78 struct list_head list;
79 bdaddr_t bdaddr;
80 u8 type;
81 u8 val[16];
82 u8 pin_len;
83};
84
Szymon Janc2763eda2011-03-22 13:12:22 +010085struct oob_data {
86 struct list_head list;
87 bdaddr_t bdaddr;
88 u8 hash[16];
89 u8 randomizer[16];
90};
91
Suraj Sumangalacd4c5392010-07-14 13:02:16 +053092#define NUM_REASSEMBLY 4
Linus Torvalds1da177e2005-04-16 15:20:36 -070093struct hci_dev {
94 struct list_head list;
95 spinlock_t lock;
96 atomic_t refcnt;
97
98 char name[8];
99 unsigned long flags;
100 __u16 id;
Marcel Holtmannc13854c2010-02-08 15:27:07 +0100101 __u8 bus;
Marcel Holtmann943da252010-02-13 02:28:41 +0100102 __u8 dev_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103 bdaddr_t bdaddr;
Johan Hedberg1f6c6372011-03-16 14:29:35 +0200104 __u8 dev_name[HCI_MAX_NAME_LENGTH];
Johan Hedberg80a1e1d2011-03-28 14:07:23 +0300105 __u8 eir[HCI_MAX_EIR_LENGTH];
Marcel Holtmanna9de9242007-10-20 13:33:56 +0200106 __u8 dev_class[3];
Johan Hedberg1aff6f02011-01-13 21:56:52 +0200107 __u8 major_class;
108 __u8 minor_class;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109 __u8 features[8];
Marcel Holtmanna9de9242007-10-20 13:33:56 +0200110 __u8 commands[64];
Marcel Holtmann333140b2008-07-14 20:13:48 +0200111 __u8 ssp_mode;
Marcel Holtmann1143e5a2006-09-23 09:57:20 +0200112 __u8 hci_ver;
113 __u16 hci_rev;
Johan Hedbergd5859e22011-01-25 01:19:58 +0200114 __u8 lmp_ver;
Marcel Holtmann1143e5a2006-09-23 09:57:20 +0200115 __u16 manufacturer;
Johan Hedbergd5859e22011-01-25 01:19:58 +0200116 __le16 lmp_subver;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 __u16 voice_setting;
Johan Hedberg17fa4b92011-01-25 13:28:33 +0200118 __u8 io_capability;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119
120 __u16 pkt_type;
Marcel Holtmann5b7f9902007-07-11 09:51:55 +0200121 __u16 esco_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122 __u16 link_policy;
123 __u16 link_mode;
124
Marcel Holtmann04837f62006-07-03 10:02:33 +0200125 __u32 idle_timeout;
126 __u16 sniff_min_interval;
127 __u16 sniff_max_interval;
128
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 unsigned long quirks;
130
131 atomic_t cmd_cnt;
132 unsigned int acl_cnt;
133 unsigned int sco_cnt;
Ville Tervo6ed58ec2011-02-10 22:38:48 -0300134 unsigned int le_cnt;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135
136 unsigned int acl_mtu;
137 unsigned int sco_mtu;
Ville Tervo6ed58ec2011-02-10 22:38:48 -0300138 unsigned int le_mtu;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139 unsigned int acl_pkts;
140 unsigned int sco_pkts;
Ville Tervo6ed58ec2011-02-10 22:38:48 -0300141 unsigned int le_pkts;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143 unsigned long acl_last_tx;
144 unsigned long sco_last_tx;
Ville Tervo6ed58ec2011-02-10 22:38:48 -0300145 unsigned long le_last_tx;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146
Marcel Holtmannf48fd9c2010-03-20 15:20:04 +0100147 struct workqueue_struct *workqueue;
148
Johan Hedbergab81cbf2010-12-15 13:53:18 +0200149 struct work_struct power_on;
150 struct work_struct power_off;
151 struct timer_list off_timer;
152
Ville Tervo6bd32322011-02-16 16:32:41 +0200153 struct timer_list cmd_timer;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154 struct tasklet_struct cmd_task;
155 struct tasklet_struct rx_task;
156 struct tasklet_struct tx_task;
157
158 struct sk_buff_head rx_q;
159 struct sk_buff_head raw_q;
160 struct sk_buff_head cmd_q;
161
162 struct sk_buff *sent_cmd;
Suraj Sumangalacd4c5392010-07-14 13:02:16 +0530163 struct sk_buff *reassembly[NUM_REASSEMBLY];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
Thomas Gleixnera6a67ef2009-07-26 08:18:19 +0000165 struct mutex req_lock;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166 wait_queue_head_t req_wait_q;
167 __u32 req_status;
168 __u32 req_result;
Johan Hedberga5040ef2011-01-10 13:28:59 +0200169
170 __u16 init_last_cmd;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171
172 struct inquiry_cache inq_cache;
173 struct hci_conn_hash conn_hash;
David Millerea4bd8b2010-07-30 21:54:49 -0700174 struct list_head blacklist;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175
Johan Hedberg2aeb9a12011-01-04 12:08:51 +0200176 struct list_head uuids;
177
Johan Hedberg55ed8ca12011-01-17 14:41:05 +0200178 struct list_head link_keys;
179
Szymon Janc2763eda2011-03-22 13:12:22 +0100180 struct list_head remote_oob_data;
181
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182 struct hci_dev_stats stat;
183
184 struct sk_buff_head driver_init;
185
186 void *driver_data;
187 void *core_data;
188
Andrei Emeltchenko70f230202010-12-01 16:58:25 +0200189 atomic_t promisc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190
Marcel Holtmannca325f62010-02-08 16:22:31 +0100191 struct dentry *debugfs;
192
Marcel Holtmanna91f2e32006-07-03 10:02:41 +0200193 struct device *parent;
194 struct device dev;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195
Marcel Holtmann611b30f2009-06-08 14:41:38 +0200196 struct rfkill *rfkill;
197
Andrei Emeltchenko70f230202010-12-01 16:58:25 +0200198 struct module *owner;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199
200 int (*open)(struct hci_dev *hdev);
201 int (*close)(struct hci_dev *hdev);
202 int (*flush)(struct hci_dev *hdev);
203 int (*send)(struct sk_buff *skb);
204 void (*destruct)(struct hci_dev *hdev);
205 void (*notify)(struct hci_dev *hdev, unsigned int evt);
206 int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg);
207};
208
209struct hci_conn {
210 struct list_head list;
211
Szymon Jancadc42662011-02-17 16:42:00 +0100212 atomic_t refcnt;
213 spinlock_t lock;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214
Szymon Jancadc42662011-02-17 16:42:00 +0100215 bdaddr_t dst;
216 __u16 handle;
217 __u16 state;
218 __u8 mode;
219 __u8 type;
220 __u8 out;
221 __u8 attempt;
222 __u8 dev_class[3];
223 __u8 features[8];
224 __u8 ssp_mode;
225 __u16 interval;
226 __u16 pkt_type;
227 __u16 link_policy;
228 __u32 link_mode;
Waldemar Rymarkiewicz13d39312011-04-28 12:07:55 +0200229 __u8 key_type;
Szymon Jancadc42662011-02-17 16:42:00 +0100230 __u8 auth_type;
231 __u8 sec_level;
232 __u8 pending_sec_level;
233 __u8 pin_length;
234 __u8 io_capability;
235 __u8 power_save;
236 __u16 disc_timeout;
237 unsigned long pend;
Marcel Holtmann04837f62006-07-03 10:02:33 +0200238
Johan Hedberg03b555e2011-01-04 15:40:05 +0200239 __u8 remote_cap;
240 __u8 remote_oob;
241 __u8 remote_auth;
242
Szymon Jancadc42662011-02-17 16:42:00 +0100243 unsigned int sent;
Marcel Holtmann04837f62006-07-03 10:02:33 +0200244
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245 struct sk_buff_head data_q;
246
Marcel Holtmann04837f62006-07-03 10:02:33 +0200247 struct timer_list disc_timer;
248 struct timer_list idle_timer;
249
Roger Quadrosf3784d82009-04-23 14:50:54 +0300250 struct work_struct work_add;
251 struct work_struct work_del;
Marcel Holtmannb219e3a2006-07-06 12:38:46 +0200252
253 struct device dev;
Marcel Holtmann9eba32b2009-08-22 14:19:26 -0700254 atomic_t devref;
Marcel Holtmannb219e3a2006-07-06 12:38:46 +0200255
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256 struct hci_dev *hdev;
257 void *l2cap_data;
258 void *sco_data;
259 void *priv;
260
261 struct hci_conn *link;
Johan Hedberge9a416b2011-02-19 12:05:56 -0300262
263 void (*connect_cfm_cb) (struct hci_conn *conn, u8 status);
264 void (*security_cfm_cb) (struct hci_conn *conn, u8 status);
265 void (*disconn_cfm_cb) (struct hci_conn *conn, u8 reason);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266};
267
268extern struct hci_proto *hci_proto[];
269extern struct list_head hci_dev_list;
270extern struct list_head hci_cb_list;
271extern rwlock_t hci_dev_list_lock;
272extern rwlock_t hci_cb_list_lock;
273
274/* ----- Inquiry cache ----- */
Andrei Emeltchenko70f230202010-12-01 16:58:25 +0200275#define INQUIRY_CACHE_AGE_MAX (HZ*30) /* 30 seconds */
276#define INQUIRY_ENTRY_AGE_MAX (HZ*60) /* 60 seconds */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277
278#define inquiry_cache_lock(c) spin_lock(&c->lock)
279#define inquiry_cache_unlock(c) spin_unlock(&c->lock)
280#define inquiry_cache_lock_bh(c) spin_lock_bh(&c->lock)
281#define inquiry_cache_unlock_bh(c) spin_unlock_bh(&c->lock)
282
283static inline void inquiry_cache_init(struct hci_dev *hdev)
284{
285 struct inquiry_cache *c = &hdev->inq_cache;
286 spin_lock_init(&c->lock);
287 c->list = NULL;
288}
289
290static inline int inquiry_cache_empty(struct hci_dev *hdev)
291{
292 struct inquiry_cache *c = &hdev->inq_cache;
Eric Dumazeta02cec22010-09-22 20:43:57 +0000293 return c->list == NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294}
295
296static inline long inquiry_cache_age(struct hci_dev *hdev)
297{
298 struct inquiry_cache *c = &hdev->inq_cache;
299 return jiffies - c->timestamp;
300}
301
302static inline long inquiry_entry_age(struct inquiry_entry *e)
303{
304 return jiffies - e->timestamp;
305}
306
307struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
308void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data);
309
310/* ----- HCI Connections ----- */
311enum {
312 HCI_CONN_AUTH_PEND,
313 HCI_CONN_ENCRYPT_PEND,
Marcel Holtmann04837f62006-07-03 10:02:33 +0200314 HCI_CONN_RSWITCH_PEND,
315 HCI_CONN_MODE_CHANGE_PEND,
Marcel Holtmanne73439d2010-07-26 10:06:00 -0400316 HCI_CONN_SCO_SETUP_PEND,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317};
318
319static inline void hci_conn_hash_init(struct hci_dev *hdev)
320{
321 struct hci_conn_hash *h = &hdev->conn_hash;
322 INIT_LIST_HEAD(&h->list);
323 spin_lock_init(&h->lock);
324 h->acl_num = 0;
325 h->sco_num = 0;
326}
327
328static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
329{
330 struct hci_conn_hash *h = &hdev->conn_hash;
331 list_add(&c->list, &h->list);
Ville Tervofcd89c02011-02-10 22:38:47 -0300332 switch (c->type) {
333 case ACL_LINK:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334 h->acl_num++;
Ville Tervofcd89c02011-02-10 22:38:47 -0300335 break;
336 case LE_LINK:
337 h->le_num++;
338 break;
339 case SCO_LINK:
340 case ESCO_LINK:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341 h->sco_num++;
Ville Tervofcd89c02011-02-10 22:38:47 -0300342 break;
343 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344}
345
346static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
347{
348 struct hci_conn_hash *h = &hdev->conn_hash;
349 list_del(&c->list);
Ville Tervofcd89c02011-02-10 22:38:47 -0300350 switch (c->type) {
351 case ACL_LINK:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352 h->acl_num--;
Ville Tervofcd89c02011-02-10 22:38:47 -0300353 break;
354 case LE_LINK:
355 h->le_num--;
356 break;
357 case SCO_LINK:
358 case ESCO_LINK:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700359 h->sco_num--;
Ville Tervofcd89c02011-02-10 22:38:47 -0300360 break;
361 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362}
363
364static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,
Szymon Jancadc42662011-02-17 16:42:00 +0100365 __u16 handle)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366{
367 struct hci_conn_hash *h = &hdev->conn_hash;
368 struct list_head *p;
369 struct hci_conn *c;
370
371 list_for_each(p, &h->list) {
372 c = list_entry(p, struct hci_conn, list);
373 if (c->handle == handle)
374 return c;
375 }
376 return NULL;
377}
378
379static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev,
Szymon Jancadc42662011-02-17 16:42:00 +0100380 __u8 type, bdaddr_t *ba)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381{
382 struct hci_conn_hash *h = &hdev->conn_hash;
383 struct list_head *p;
384 struct hci_conn *c;
385
386 list_for_each(p, &h->list) {
387 c = list_entry(p, struct hci_conn, list);
388 if (c->type == type && !bacmp(&c->dst, ba))
389 return c;
390 }
391 return NULL;
392}
393
Marcel Holtmann4c67bc72006-10-15 17:30:56 +0200394static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev,
Szymon Jancadc42662011-02-17 16:42:00 +0100395 __u8 type, __u16 state)
Marcel Holtmann4c67bc72006-10-15 17:30:56 +0200396{
397 struct hci_conn_hash *h = &hdev->conn_hash;
398 struct list_head *p;
399 struct hci_conn *c;
400
401 list_for_each(p, &h->list) {
402 c = list_entry(p, struct hci_conn, list);
403 if (c->type == type && c->state == state)
404 return c;
405 }
406 return NULL;
407}
408
409void hci_acl_connect(struct hci_conn *conn);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700410void hci_acl_disconn(struct hci_conn *conn, __u8 reason);
411void hci_add_sco(struct hci_conn *conn, __u16 handle);
Marcel Holtmannb6a0dc82007-10-20 14:55:10 +0200412void hci_setup_sync(struct hci_conn *conn, __u16 handle);
Marcel Holtmanne73439d2010-07-26 10:06:00 -0400413void hci_sco_setup(struct hci_conn *conn, __u8 status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414
415struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst);
Marcel Holtmanna9de9242007-10-20 13:33:56 +0200416int hci_conn_del(struct hci_conn *conn);
417void hci_conn_hash_flush(struct hci_dev *hdev);
418void hci_conn_check_pending(struct hci_dev *hdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100420struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 sec_level, __u8 auth_type);
Marcel Holtmanne7c29cb2008-09-09 07:19:20 +0200421int hci_conn_check_link_mode(struct hci_conn *conn);
Marcel Holtmann0684e5f2009-02-09 02:48:38 +0100422int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700423int hci_conn_change_link_key(struct hci_conn *conn);
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100424int hci_conn_switch_role(struct hci_conn *conn, __u8 role);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425
Marcel Holtmann04837f62006-07-03 10:02:33 +0200426void hci_conn_enter_active_mode(struct hci_conn *conn);
427void hci_conn_enter_sniff_mode(struct hci_conn *conn);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428
Marcel Holtmann9eba32b2009-08-22 14:19:26 -0700429void hci_conn_hold_device(struct hci_conn *conn);
430void hci_conn_put_device(struct hci_conn *conn);
431
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432static inline void hci_conn_hold(struct hci_conn *conn)
433{
434 atomic_inc(&conn->refcnt);
Marcel Holtmann04837f62006-07-03 10:02:33 +0200435 del_timer(&conn->disc_timer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436}
437
438static inline void hci_conn_put(struct hci_conn *conn)
439{
440 if (atomic_dec_and_test(&conn->refcnt)) {
Marcel Holtmann04837f62006-07-03 10:02:33 +0200441 unsigned long timeo;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700442 if (conn->type == ACL_LINK) {
Marcel Holtmann04837f62006-07-03 10:02:33 +0200443 del_timer(&conn->idle_timer);
Marcel Holtmann6ac59342006-09-26 09:43:48 +0200444 if (conn->state == BT_CONNECTED) {
Marcel Holtmann052b30b2009-04-26 20:01:22 +0200445 timeo = msecs_to_jiffies(conn->disc_timeout);
Marcel Holtmann6ac59342006-09-26 09:43:48 +0200446 if (!conn->out)
Marcel Holtmann052b30b2009-04-26 20:01:22 +0200447 timeo *= 2;
Marcel Holtmann6ac59342006-09-26 09:43:48 +0200448 } else
449 timeo = msecs_to_jiffies(10);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450 } else
Marcel Holtmann04837f62006-07-03 10:02:33 +0200451 timeo = msecs_to_jiffies(10);
452 mod_timer(&conn->disc_timer, jiffies + timeo);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700453 }
454}
455
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456/* ----- HCI Devices ----- */
457static inline void __hci_dev_put(struct hci_dev *d)
458{
459 if (atomic_dec_and_test(&d->refcnt))
460 d->destruct(d);
461}
462
463static inline void hci_dev_put(struct hci_dev *d)
Ron Shaffer04fafe42010-05-28 11:53:45 -0400464{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465 __hci_dev_put(d);
466 module_put(d->owner);
467}
468
469static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
470{
471 atomic_inc(&d->refcnt);
472 return d;
473}
474
475static inline struct hci_dev *hci_dev_hold(struct hci_dev *d)
476{
477 if (try_module_get(d->owner))
478 return __hci_dev_hold(d);
479 return NULL;
480}
481
482#define hci_dev_lock(d) spin_lock(&d->lock)
483#define hci_dev_unlock(d) spin_unlock(&d->lock)
484#define hci_dev_lock_bh(d) spin_lock_bh(&d->lock)
485#define hci_dev_unlock_bh(d) spin_unlock_bh(&d->lock)
486
487struct hci_dev *hci_dev_get(int index);
488struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst);
489
490struct hci_dev *hci_alloc_dev(void);
491void hci_free_dev(struct hci_dev *hdev);
492int hci_register_dev(struct hci_dev *hdev);
493int hci_unregister_dev(struct hci_dev *hdev);
494int hci_suspend_dev(struct hci_dev *hdev);
495int hci_resume_dev(struct hci_dev *hdev);
496int hci_dev_open(__u16 dev);
497int hci_dev_close(__u16 dev);
498int hci_dev_reset(__u16 dev);
499int hci_dev_reset_stat(__u16 dev);
500int hci_dev_cmd(unsigned int cmd, void __user *arg);
501int hci_get_dev_list(void __user *arg);
502int hci_get_dev_info(void __user *arg);
503int hci_get_conn_list(void __user *arg);
504int hci_get_conn_info(struct hci_dev *hdev, void __user *arg);
Marcel Holtmann40be4922008-07-14 20:13:50 +0200505int hci_get_auth_info(struct hci_dev *hdev, void __user *arg);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700506int hci_inquiry(void __user *arg);
507
Johan Hedbergf0358562010-05-18 13:20:32 +0200508struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
509int hci_blacklist_clear(struct hci_dev *hdev);
510
Johan Hedberg2aeb9a12011-01-04 12:08:51 +0200511int hci_uuids_clear(struct hci_dev *hdev);
512
Johan Hedberg55ed8ca12011-01-17 14:41:05 +0200513int hci_link_keys_clear(struct hci_dev *hdev);
514struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
515int hci_add_link_key(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr,
516 u8 *key, u8 type, u8 pin_len);
517int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
518
Szymon Janc2763eda2011-03-22 13:12:22 +0100519int hci_remote_oob_data_clear(struct hci_dev *hdev);
520struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev,
521 bdaddr_t *bdaddr);
522int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash,
523 u8 *randomizer);
524int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
525
Johan Hedbergab81cbf2010-12-15 13:53:18 +0200526void hci_del_off_timer(struct hci_dev *hdev);
527
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
529
Marcel Holtmann76bca882009-11-18 00:40:39 +0100530int hci_recv_frame(struct sk_buff *skb);
Marcel Holtmannef222012007-07-11 06:42:04 +0200531int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count);
Suraj Sumangala99811512010-07-14 13:02:19 +0530532int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count);
Marcel Holtmannef222012007-07-11 06:42:04 +0200533
Linus Torvalds1da177e2005-04-16 15:20:36 -0700534int hci_register_sysfs(struct hci_dev *hdev);
535void hci_unregister_sysfs(struct hci_dev *hdev);
Marcel Holtmanna67e8992009-05-02 18:24:06 -0700536void hci_conn_init_sysfs(struct hci_conn *conn);
Marcel Holtmannb219e3a2006-07-06 12:38:46 +0200537void hci_conn_add_sysfs(struct hci_conn *conn);
538void hci_conn_del_sysfs(struct hci_conn *conn);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700539
Marcel Holtmanna91f2e32006-07-03 10:02:41 +0200540#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->parent = (pdev))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700541
542/* ----- LMP capabilities ----- */
Marcel Holtmann04837f62006-07-03 10:02:33 +0200543#define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH)
544#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT)
545#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF)
546#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
Marcel Holtmann5b7f9902007-07-11 09:51:55 +0200547#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO)
Marcel Holtmann769be972008-07-14 20:13:49 +0200548#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR)
Andrei Emeltchenkoe7021122011-01-03 11:14:36 +0200549#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)
Ville Tervo6ed58ec2011-02-10 22:38:48 -0300550#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700551
552/* ----- HCI protocols ----- */
553struct hci_proto {
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100554 char *name;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700555 unsigned int id;
556 unsigned long flags;
557
558 void *priv;
559
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100560 int (*connect_ind) (struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700561 int (*connect_cfm) (struct hci_conn *conn, __u8 status);
Marcel Holtmann2950f212009-02-12 14:02:50 +0100562 int (*disconn_ind) (struct hci_conn *conn);
563 int (*disconn_cfm) (struct hci_conn *conn, __u8 reason);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564 int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb, __u16 flags);
565 int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb);
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100566 int (*security_cfm) (struct hci_conn *conn, __u8 status, __u8 encrypt);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700567};
568
569static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type)
570{
571 register struct hci_proto *hp;
572 int mask = 0;
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100573
Linus Torvalds1da177e2005-04-16 15:20:36 -0700574 hp = hci_proto[HCI_PROTO_L2CAP];
575 if (hp && hp->connect_ind)
576 mask |= hp->connect_ind(hdev, bdaddr, type);
577
578 hp = hci_proto[HCI_PROTO_SCO];
579 if (hp && hp->connect_ind)
580 mask |= hp->connect_ind(hdev, bdaddr, type);
581
582 return mask;
583}
584
585static inline void hci_proto_connect_cfm(struct hci_conn *conn, __u8 status)
586{
587 register struct hci_proto *hp;
588
589 hp = hci_proto[HCI_PROTO_L2CAP];
590 if (hp && hp->connect_cfm)
591 hp->connect_cfm(conn, status);
592
593 hp = hci_proto[HCI_PROTO_SCO];
594 if (hp && hp->connect_cfm)
595 hp->connect_cfm(conn, status);
Johan Hedberge9a416b2011-02-19 12:05:56 -0300596
597 if (conn->connect_cfm_cb)
598 conn->connect_cfm_cb(conn, status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700599}
600
Marcel Holtmann2950f212009-02-12 14:02:50 +0100601static inline int hci_proto_disconn_ind(struct hci_conn *conn)
602{
603 register struct hci_proto *hp;
604 int reason = 0x13;
605
606 hp = hci_proto[HCI_PROTO_L2CAP];
607 if (hp && hp->disconn_ind)
608 reason = hp->disconn_ind(conn);
609
610 hp = hci_proto[HCI_PROTO_SCO];
611 if (hp && hp->disconn_ind)
612 reason = hp->disconn_ind(conn);
613
614 return reason;
615}
616
617static inline void hci_proto_disconn_cfm(struct hci_conn *conn, __u8 reason)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618{
619 register struct hci_proto *hp;
620
621 hp = hci_proto[HCI_PROTO_L2CAP];
Marcel Holtmann2950f212009-02-12 14:02:50 +0100622 if (hp && hp->disconn_cfm)
623 hp->disconn_cfm(conn, reason);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700624
625 hp = hci_proto[HCI_PROTO_SCO];
Marcel Holtmann2950f212009-02-12 14:02:50 +0100626 if (hp && hp->disconn_cfm)
627 hp->disconn_cfm(conn, reason);
Johan Hedberge9a416b2011-02-19 12:05:56 -0300628
629 if (conn->disconn_cfm_cb)
630 conn->disconn_cfm_cb(conn, reason);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631}
632
633static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status)
634{
635 register struct hci_proto *hp;
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100636 __u8 encrypt;
637
638 if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
639 return;
640
641 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700642
643 hp = hci_proto[HCI_PROTO_L2CAP];
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100644 if (hp && hp->security_cfm)
645 hp->security_cfm(conn, status, encrypt);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700646
647 hp = hci_proto[HCI_PROTO_SCO];
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100648 if (hp && hp->security_cfm)
649 hp->security_cfm(conn, status, encrypt);
Johan Hedberge9a416b2011-02-19 12:05:56 -0300650
651 if (conn->security_cfm_cb)
652 conn->security_cfm_cb(conn, status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700653}
654
Marcel Holtmann9719f8a2008-07-14 20:13:45 +0200655static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656{
657 register struct hci_proto *hp;
658
659 hp = hci_proto[HCI_PROTO_L2CAP];
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100660 if (hp && hp->security_cfm)
661 hp->security_cfm(conn, status, encrypt);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700662
663 hp = hci_proto[HCI_PROTO_SCO];
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100664 if (hp && hp->security_cfm)
665 hp->security_cfm(conn, status, encrypt);
Johan Hedberge9a416b2011-02-19 12:05:56 -0300666
667 if (conn->security_cfm_cb)
668 conn->security_cfm_cb(conn, status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700669}
670
671int hci_register_proto(struct hci_proto *hproto);
672int hci_unregister_proto(struct hci_proto *hproto);
673
674/* ----- HCI callbacks ----- */
675struct hci_cb {
676 struct list_head list;
677
678 char *name;
679
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100680 void (*security_cfm) (struct hci_conn *conn, __u8 status, __u8 encrypt);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700681 void (*key_change_cfm) (struct hci_conn *conn, __u8 status);
682 void (*role_switch_cfm) (struct hci_conn *conn, __u8 status, __u8 role);
683};
684
685static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
686{
687 struct list_head *p;
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100688 __u8 encrypt;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700689
690 hci_proto_auth_cfm(conn, status);
691
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100692 if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
693 return;
694
695 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00;
696
Linus Torvalds1da177e2005-04-16 15:20:36 -0700697 read_lock_bh(&hci_cb_list_lock);
698 list_for_each(p, &hci_cb_list) {
699 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100700 if (cb->security_cfm)
701 cb->security_cfm(conn, status, encrypt);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700702 }
703 read_unlock_bh(&hci_cb_list_lock);
704}
705
706static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt)
707{
708 struct list_head *p;
709
Marcel Holtmann435fef22009-02-09 03:55:28 +0100710 if (conn->sec_level == BT_SECURITY_SDP)
711 conn->sec_level = BT_SECURITY_LOW;
712
Marcel Holtmann9719f8a2008-07-14 20:13:45 +0200713 hci_proto_encrypt_cfm(conn, status, encrypt);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700714
715 read_lock_bh(&hci_cb_list_lock);
716 list_for_each(p, &hci_cb_list) {
717 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
Marcel Holtmann8c1b2352009-01-15 21:58:04 +0100718 if (cb->security_cfm)
719 cb->security_cfm(conn, status, encrypt);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700720 }
721 read_unlock_bh(&hci_cb_list_lock);
722}
723
724static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
725{
726 struct list_head *p;
727
728 read_lock_bh(&hci_cb_list_lock);
729 list_for_each(p, &hci_cb_list) {
730 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
731 if (cb->key_change_cfm)
732 cb->key_change_cfm(conn, status);
733 }
734 read_unlock_bh(&hci_cb_list_lock);
735}
736
737static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, __u8 role)
738{
739 struct list_head *p;
740
741 read_lock_bh(&hci_cb_list_lock);
742 list_for_each(p, &hci_cb_list) {
743 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
744 if (cb->role_switch_cfm)
745 cb->role_switch_cfm(conn, status, role);
746 }
747 read_unlock_bh(&hci_cb_list_lock);
748}
749
750int hci_register_cb(struct hci_cb *hcb);
751int hci_unregister_cb(struct hci_cb *hcb);
752
753int hci_register_notifier(struct notifier_block *nb);
754int hci_unregister_notifier(struct notifier_block *nb);
755
Marcel Holtmanna9de9242007-10-20 13:33:56 +0200756int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param);
Gustavo F. Padovan9a9c6a32010-05-01 16:15:43 -0300757void hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags);
Gustavo F. Padovan0d861d82010-05-01 16:15:35 -0300758void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700759
Marcel Holtmanna9de9242007-10-20 13:33:56 +0200760void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700761
762void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data);
763
764/* ----- HCI Sockets ----- */
Johan Hedbergeec8d2b2010-12-16 10:17:38 +0200765void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb,
766 struct sock *skip_sk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700767
Johan Hedberg03811012010-12-08 00:21:06 +0200768/* Management interface */
769int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len);
Johan Hedbergc71e97b2010-12-13 21:07:07 +0200770int mgmt_index_added(u16 index);
771int mgmt_index_removed(u16 index);
Johan Hedberg5add6af2010-12-16 10:00:37 +0200772int mgmt_powered(u16 index, u8 powered);
Johan Hedberg73f22f62010-12-29 16:00:25 +0200773int mgmt_discoverable(u16 index, u8 discoverable);
Johan Hedberg9fbcbb42010-12-30 00:18:33 +0200774int mgmt_connectable(u16 index, u8 connectable);
Johan Hedberg55ed8ca12011-01-17 14:41:05 +0200775int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type);
Johan Hedbergf7520542011-01-20 12:34:39 +0200776int mgmt_connected(u16 index, bdaddr_t *bdaddr);
777int mgmt_disconnected(u16 index, bdaddr_t *bdaddr);
Johan Hedberg8962ee72011-01-20 12:40:27 +0200778int mgmt_disconnect_failed(u16 index);
Johan Hedberg17d5c042011-01-22 06:09:08 +0200779int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status);
Waldemar Rymarkiewicza770bb52011-04-28 12:07:59 +0200780int mgmt_pin_code_request(u16 index, bdaddr_t *bdaddr, u8 secure);
Johan Hedberg980e1a52011-01-22 06:10:07 +0200781int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
782int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
Johan Hedberga5c29682011-02-19 12:05:57 -0300783int mgmt_user_confirm_request(u16 index, bdaddr_t *bdaddr, __le32 value);
784int mgmt_user_confirm_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
785int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr,
786 u8 status);
Johan Hedberg2a611692011-02-19 12:06:00 -0300787int mgmt_auth_failed(u16 index, bdaddr_t *bdaddr, u8 status);
Johan Hedbergb312b1612011-03-16 14:29:37 +0200788int mgmt_set_local_name_complete(u16 index, u8 *name, u8 status);
Szymon Jancc35938b2011-03-22 13:12:21 +0100789int mgmt_read_local_oob_data_reply_complete(u16 index, u8 *hash, u8 *randomizer,
790 u8 status);
Johan Hedberge17acd42011-03-30 23:57:16 +0300791int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi,
792 u8 *eir);
Johan Hedberga88a9652011-03-30 13:18:12 +0300793int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name);
Johan Hedberg314b2382011-04-27 10:29:57 -0400794int mgmt_discovering(u16 index, u8 discovering);
Johan Hedberg03811012010-12-08 00:21:06 +0200795
Linus Torvalds1da177e2005-04-16 15:20:36 -0700796/* HCI info for socket */
797#define hci_pi(sk) ((struct hci_pinfo *) sk)
798
799struct hci_pinfo {
800 struct bt_sock bt;
801 struct hci_dev *hdev;
802 struct hci_filter filter;
803 __u32 cmsg_mask;
Johan Hedbergc02178d2010-12-08 00:21:05 +0200804 unsigned short channel;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805};
806
807/* HCI security filter */
808#define HCI_SFLT_MAX_OGF 5
809
810struct hci_sec_filter {
811 __u32 type_mask;
812 __u32 event_mask[2];
813 __u32 ocf_mask[HCI_SFLT_MAX_OGF + 1][4];
814};
815
816/* ----- HCI requests ----- */
817#define HCI_REQ_DONE 0
818#define HCI_REQ_PEND 1
819#define HCI_REQ_CANCELED 2
820
Thomas Gleixnera6a67ef2009-07-26 08:18:19 +0000821#define hci_req_lock(d) mutex_lock(&d->req_lock)
822#define hci_req_unlock(d) mutex_unlock(&d->req_lock)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823
Johan Hedberg23bb5762010-12-21 23:01:27 +0200824void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700825
Claudio Takahasi2ce603e2011-02-16 20:44:53 -0200826void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
827 u16 latency, u16 to_multiplier);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700828#endif /* __HCI_CORE_H */