7c78744ec0fdc1534d02179d6bf0d46257d1b451
[pandora-kernel.git] / include / net / bluetooth / hci_core.h
1 /* 
2    BlueZ - Bluetooth protocol stack for Linux
3    Copyright (C) 2000-2001 Qualcomm Incorporated
4
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
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 #ifndef __HCI_CORE_H
26 #define __HCI_CORE_H
27
28 #include <net/bluetooth/hci.h>
29
30 /* HCI upper protocols */
31 #define HCI_PROTO_L2CAP 0
32 #define HCI_PROTO_SCO   1
33
34 /* HCI Core structures */
35 struct 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];
41         __le16          clock_offset;
42         __s8            rssi;
43 };
44
45 struct inquiry_entry {
46         struct inquiry_entry    *next;
47         __u32                   timestamp;
48         struct inquiry_data     data;
49 };
50
51 struct inquiry_cache {
52         spinlock_t              lock;
53         __u32                   timestamp;
54         struct inquiry_entry    *list;
55 };
56
57 struct hci_conn_hash {
58         struct list_head list;
59         spinlock_t       lock;
60         unsigned int     acl_num;
61         unsigned int     sco_num;
62 };
63
64 struct hci_dev {
65         struct list_head list;
66         spinlock_t      lock;
67         atomic_t        refcnt;
68
69         char            name[8];
70         unsigned long   flags;
71         __u16           id;
72         __u8            type;
73         bdaddr_t        bdaddr;
74         __u8            features[8];
75         __u8            hci_ver;
76         __u16           hci_rev;
77         __u16           manufacturer;
78         __u16           voice_setting;
79
80         __u16           pkt_type;
81         __u16           link_policy;
82         __u16           link_mode;
83
84         __u32           idle_timeout;
85         __u16           sniff_min_interval;
86         __u16           sniff_max_interval;
87
88         unsigned long   quirks;
89
90         atomic_t        cmd_cnt;
91         unsigned int    acl_cnt;
92         unsigned int    sco_cnt;
93
94         unsigned int    acl_mtu;
95         unsigned int    sco_mtu;
96         unsigned int    acl_pkts;
97         unsigned int    sco_pkts;
98
99         unsigned long   cmd_last_tx;
100         unsigned long   acl_last_tx;
101         unsigned long   sco_last_tx;
102
103         struct tasklet_struct   cmd_task;
104         struct tasklet_struct   rx_task;
105         struct tasklet_struct   tx_task;
106
107         struct sk_buff_head     rx_q;
108         struct sk_buff_head     raw_q;
109         struct sk_buff_head     cmd_q;
110
111         struct sk_buff          *sent_cmd;
112         struct sk_buff          *reassembly[3];
113
114         struct semaphore        req_lock;
115         wait_queue_head_t       req_wait_q;
116         __u32                   req_status;
117         __u32                   req_result;
118
119         struct inquiry_cache    inq_cache;
120         struct hci_conn_hash    conn_hash;
121
122         struct hci_dev_stats    stat;
123
124         struct sk_buff_head     driver_init;
125
126         void                    *driver_data;
127         void                    *core_data;
128
129         atomic_t                promisc;
130
131         struct device           *parent;
132         struct device           dev;
133
134         struct module           *owner;
135
136         int (*open)(struct hci_dev *hdev);
137         int (*close)(struct hci_dev *hdev);
138         int (*flush)(struct hci_dev *hdev);
139         int (*send)(struct sk_buff *skb);
140         void (*destruct)(struct hci_dev *hdev);
141         void (*notify)(struct hci_dev *hdev, unsigned int evt);
142         int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg);
143 };
144
145 struct hci_conn {
146         struct list_head list;
147
148         atomic_t         refcnt;
149         spinlock_t       lock;
150
151         bdaddr_t         dst;
152         __u16            handle;
153         __u16            state;
154         __u8             mode;
155         __u8             type;
156         __u8             out;
157         __u8             attempt;
158         __u8             dev_class[3];
159         __u8             features[8];
160         __u16            interval;
161         __u16            link_policy;
162         __u32            link_mode;
163         __u8             power_save;
164         unsigned long    pend;
165
166         unsigned int     sent;
167
168         struct sk_buff_head data_q;
169
170         struct timer_list disc_timer;
171         struct timer_list idle_timer;
172
173         struct work_struct work;
174
175         struct device   dev;
176
177         struct hci_dev  *hdev;
178         void            *l2cap_data;
179         void            *sco_data;
180         void            *priv;
181
182         struct hci_conn *link;
183 };
184
185 extern struct hci_proto *hci_proto[];
186 extern struct list_head hci_dev_list;
187 extern struct list_head hci_cb_list;
188 extern rwlock_t hci_dev_list_lock;
189 extern rwlock_t hci_cb_list_lock;
190
191 /* ----- Inquiry cache ----- */
192 #define INQUIRY_CACHE_AGE_MAX   (HZ*30)   // 30 seconds
193 #define INQUIRY_ENTRY_AGE_MAX   (HZ*60)   // 60 seconds
194
195 #define inquiry_cache_lock(c)           spin_lock(&c->lock)
196 #define inquiry_cache_unlock(c)         spin_unlock(&c->lock)
197 #define inquiry_cache_lock_bh(c)        spin_lock_bh(&c->lock)
198 #define inquiry_cache_unlock_bh(c)      spin_unlock_bh(&c->lock)
199
200 static inline void inquiry_cache_init(struct hci_dev *hdev)
201 {
202         struct inquiry_cache *c = &hdev->inq_cache;
203         spin_lock_init(&c->lock);
204         c->list = NULL;
205 }
206
207 static inline int inquiry_cache_empty(struct hci_dev *hdev)
208 {
209         struct inquiry_cache *c = &hdev->inq_cache;
210         return (c->list == NULL);
211 }
212
213 static inline long inquiry_cache_age(struct hci_dev *hdev)
214 {
215         struct inquiry_cache *c = &hdev->inq_cache;
216         return jiffies - c->timestamp;
217 }
218
219 static inline long inquiry_entry_age(struct inquiry_entry *e)
220 {
221         return jiffies - e->timestamp;
222 }
223
224 struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
225 void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data);
226
227 /* ----- HCI Connections ----- */
228 enum {
229         HCI_CONN_AUTH_PEND,
230         HCI_CONN_ENCRYPT_PEND,
231         HCI_CONN_RSWITCH_PEND,
232         HCI_CONN_MODE_CHANGE_PEND,
233 };
234
235 static inline void hci_conn_hash_init(struct hci_dev *hdev)
236 {
237         struct hci_conn_hash *h = &hdev->conn_hash;
238         INIT_LIST_HEAD(&h->list);
239         spin_lock_init(&h->lock);
240         h->acl_num = 0;
241         h->sco_num = 0;
242 }
243
244 static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
245 {
246         struct hci_conn_hash *h = &hdev->conn_hash;
247         list_add(&c->list, &h->list);
248         if (c->type == ACL_LINK)
249                 h->acl_num++;
250         else
251                 h->sco_num++;
252 }
253
254 static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
255 {
256         struct hci_conn_hash *h = &hdev->conn_hash;
257         list_del(&c->list);
258         if (c->type == ACL_LINK)
259                 h->acl_num--;
260         else
261                 h->sco_num--;
262 }
263
264 static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,
265                                         __u16 handle)
266 {
267         struct hci_conn_hash *h = &hdev->conn_hash;
268         struct list_head *p;
269         struct hci_conn  *c;
270
271         list_for_each(p, &h->list) {
272                 c = list_entry(p, struct hci_conn, list);
273                 if (c->handle == handle)
274                         return c;
275         }
276         return NULL;
277 }
278
279 static inline struct hci_conn *hci_conn_hash_lookup_ba(struct hci_dev *hdev,
280                                         __u8 type, bdaddr_t *ba)
281 {
282         struct hci_conn_hash *h = &hdev->conn_hash;
283         struct list_head *p;
284         struct hci_conn  *c;
285
286         list_for_each(p, &h->list) {
287                 c = list_entry(p, struct hci_conn, list);
288                 if (c->type == type && !bacmp(&c->dst, ba))
289                         return c;
290         }
291         return NULL;
292 }
293
294 static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev,
295                                         __u8 type, __u16 state)
296 {
297         struct hci_conn_hash *h = &hdev->conn_hash;
298         struct list_head *p;
299         struct hci_conn  *c;
300
301         list_for_each(p, &h->list) {
302                 c = list_entry(p, struct hci_conn, list);
303                 if (c->type == type && c->state == state)
304                         return c;
305         }
306         return NULL;
307 }
308
309 void hci_acl_connect(struct hci_conn *conn);
310 void hci_acl_disconn(struct hci_conn *conn, __u8 reason);
311 void hci_add_sco(struct hci_conn *conn, __u16 handle);
312
313 struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst);
314 int    hci_conn_del(struct hci_conn *conn);
315 void   hci_conn_hash_flush(struct hci_dev *hdev);
316
317 struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *src);
318 int hci_conn_auth(struct hci_conn *conn);
319 int hci_conn_encrypt(struct hci_conn *conn);
320 int hci_conn_change_link_key(struct hci_conn *conn);
321 int hci_conn_switch_role(struct hci_conn *conn, uint8_t role);
322
323 void hci_conn_enter_active_mode(struct hci_conn *conn);
324 void hci_conn_enter_sniff_mode(struct hci_conn *conn);
325
326 static inline void hci_conn_hold(struct hci_conn *conn)
327 {
328         atomic_inc(&conn->refcnt);
329         del_timer(&conn->disc_timer);
330 }
331
332 static inline void hci_conn_put(struct hci_conn *conn)
333 {
334         if (atomic_dec_and_test(&conn->refcnt)) {
335                 unsigned long timeo;
336                 if (conn->type == ACL_LINK) {
337                         del_timer(&conn->idle_timer);
338                         if (conn->state == BT_CONNECTED) {
339                                 timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT);
340                                 if (!conn->out)
341                                         timeo *= 2;
342                         } else
343                                 timeo = msecs_to_jiffies(10);
344                 } else
345                         timeo = msecs_to_jiffies(10);
346                 mod_timer(&conn->disc_timer, jiffies + timeo);
347         }
348 }
349
350 /* ----- HCI tasks ----- */
351 static inline void hci_sched_cmd(struct hci_dev *hdev)
352 {
353         tasklet_schedule(&hdev->cmd_task);
354 }
355
356 static inline void hci_sched_rx(struct hci_dev *hdev)
357 {
358         tasklet_schedule(&hdev->rx_task);
359 }
360
361 static inline void hci_sched_tx(struct hci_dev *hdev)
362 {
363         tasklet_schedule(&hdev->tx_task);
364 }
365
366 /* ----- HCI Devices ----- */
367 static inline void __hci_dev_put(struct hci_dev *d)
368 {
369         if (atomic_dec_and_test(&d->refcnt))
370                 d->destruct(d);
371 }
372
373 static inline void hci_dev_put(struct hci_dev *d)
374
375         __hci_dev_put(d);
376         module_put(d->owner);
377 }
378
379 static inline struct hci_dev *__hci_dev_hold(struct hci_dev *d)
380 {
381         atomic_inc(&d->refcnt);
382         return d;
383 }
384
385 static inline struct hci_dev *hci_dev_hold(struct hci_dev *d)
386 {
387         if (try_module_get(d->owner))
388                 return __hci_dev_hold(d);
389         return NULL;
390 }
391
392 #define hci_dev_lock(d)         spin_lock(&d->lock)
393 #define hci_dev_unlock(d)       spin_unlock(&d->lock)
394 #define hci_dev_lock_bh(d)      spin_lock_bh(&d->lock)
395 #define hci_dev_unlock_bh(d)    spin_unlock_bh(&d->lock)
396
397 struct hci_dev *hci_dev_get(int index);
398 struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst);
399
400 struct hci_dev *hci_alloc_dev(void);
401 void hci_free_dev(struct hci_dev *hdev);
402 int hci_register_dev(struct hci_dev *hdev);
403 int hci_unregister_dev(struct hci_dev *hdev);
404 int hci_suspend_dev(struct hci_dev *hdev);
405 int hci_resume_dev(struct hci_dev *hdev);
406 int hci_dev_open(__u16 dev);
407 int hci_dev_close(__u16 dev);
408 int hci_dev_reset(__u16 dev);
409 int hci_dev_reset_stat(__u16 dev);
410 int hci_dev_cmd(unsigned int cmd, void __user *arg);
411 int hci_get_dev_list(void __user *arg);
412 int hci_get_dev_info(void __user *arg);
413 int hci_get_conn_list(void __user *arg);
414 int hci_get_conn_info(struct hci_dev *hdev, void __user *arg);
415 int hci_inquiry(void __user *arg);
416
417 void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
418
419 /* Receive frame from HCI drivers */
420 static inline int hci_recv_frame(struct sk_buff *skb)
421 {
422         struct hci_dev *hdev = (struct hci_dev *) skb->dev;
423         if (!hdev || (!test_bit(HCI_UP, &hdev->flags) 
424                         && !test_bit(HCI_INIT, &hdev->flags))) {
425                 kfree_skb(skb);
426                 return -ENXIO;
427         }
428
429         /* Incomming skb */
430         bt_cb(skb)->incoming = 1;
431
432         /* Time stamp */
433         __net_timestamp(skb);
434
435         /* Queue frame for rx task */
436         skb_queue_tail(&hdev->rx_q, skb);
437         hci_sched_rx(hdev);
438         return 0;
439 }
440
441 int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count);
442
443 int hci_register_sysfs(struct hci_dev *hdev);
444 void hci_unregister_sysfs(struct hci_dev *hdev);
445 void hci_conn_add_sysfs(struct hci_conn *conn);
446 void hci_conn_del_sysfs(struct hci_conn *conn);
447
448 #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->parent = (pdev))
449
450 /* ----- LMP capabilities ----- */
451 #define lmp_rswitch_capable(dev)   ((dev)->features[0] & LMP_RSWITCH)
452 #define lmp_encrypt_capable(dev)   ((dev)->features[0] & LMP_ENCRYPT)
453 #define lmp_sniff_capable(dev)     ((dev)->features[0] & LMP_SNIFF)
454 #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
455
456 /* ----- HCI protocols ----- */
457 struct hci_proto {
458         char            *name;
459         unsigned int    id;
460         unsigned long   flags;
461
462         void            *priv;
463
464         int (*connect_ind)      (struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type);
465         int (*connect_cfm)      (struct hci_conn *conn, __u8 status);
466         int (*disconn_ind)      (struct hci_conn *conn, __u8 reason);
467         int (*recv_acldata)     (struct hci_conn *conn, struct sk_buff *skb, __u16 flags);
468         int (*recv_scodata)     (struct hci_conn *conn, struct sk_buff *skb);
469         int (*auth_cfm)         (struct hci_conn *conn, __u8 status);
470         int (*encrypt_cfm)      (struct hci_conn *conn, __u8 status);
471 };
472
473 static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type)
474 {
475         register struct hci_proto *hp;
476         int mask = 0;
477         
478         hp = hci_proto[HCI_PROTO_L2CAP];
479         if (hp && hp->connect_ind)
480                 mask |= hp->connect_ind(hdev, bdaddr, type);
481
482         hp = hci_proto[HCI_PROTO_SCO];
483         if (hp && hp->connect_ind)
484                 mask |= hp->connect_ind(hdev, bdaddr, type);
485
486         return mask;
487 }
488
489 static inline void hci_proto_connect_cfm(struct hci_conn *conn, __u8 status)
490 {
491         register struct hci_proto *hp;
492
493         hp = hci_proto[HCI_PROTO_L2CAP];
494         if (hp && hp->connect_cfm)
495                 hp->connect_cfm(conn, status);
496
497         hp = hci_proto[HCI_PROTO_SCO];
498         if (hp && hp->connect_cfm)
499                 hp->connect_cfm(conn, status);
500 }
501
502 static inline void hci_proto_disconn_ind(struct hci_conn *conn, __u8 reason)
503 {
504         register struct hci_proto *hp;
505
506         hp = hci_proto[HCI_PROTO_L2CAP];
507         if (hp && hp->disconn_ind)
508                 hp->disconn_ind(conn, reason);
509
510         hp = hci_proto[HCI_PROTO_SCO];
511         if (hp && hp->disconn_ind)
512                 hp->disconn_ind(conn, reason);
513 }
514
515 static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status)
516 {
517         register struct hci_proto *hp;
518
519         hp = hci_proto[HCI_PROTO_L2CAP];
520         if (hp && hp->auth_cfm)
521                 hp->auth_cfm(conn, status);
522
523         hp = hci_proto[HCI_PROTO_SCO];
524         if (hp && hp->auth_cfm)
525                 hp->auth_cfm(conn, status);
526 }
527
528 static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status)
529 {
530         register struct hci_proto *hp;
531
532         hp = hci_proto[HCI_PROTO_L2CAP];
533         if (hp && hp->encrypt_cfm)
534                 hp->encrypt_cfm(conn, status);
535
536         hp = hci_proto[HCI_PROTO_SCO];
537         if (hp && hp->encrypt_cfm)
538                 hp->encrypt_cfm(conn, status);
539 }
540
541 int hci_register_proto(struct hci_proto *hproto);
542 int hci_unregister_proto(struct hci_proto *hproto);
543
544 /* ----- HCI callbacks ----- */
545 struct hci_cb {
546         struct list_head list;
547
548         char *name;
549
550         void (*auth_cfm)        (struct hci_conn *conn, __u8 status);
551         void (*encrypt_cfm)     (struct hci_conn *conn, __u8 status, __u8 encrypt);
552         void (*key_change_cfm)  (struct hci_conn *conn, __u8 status);
553         void (*role_switch_cfm) (struct hci_conn *conn, __u8 status, __u8 role);
554 };
555
556 static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
557 {
558         struct list_head *p;
559
560         hci_proto_auth_cfm(conn, status);
561
562         read_lock_bh(&hci_cb_list_lock);
563         list_for_each(p, &hci_cb_list) {
564                 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
565                 if (cb->auth_cfm)
566                         cb->auth_cfm(conn, status);
567         }
568         read_unlock_bh(&hci_cb_list_lock);
569 }
570
571 static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt)
572 {
573         struct list_head *p;
574
575         hci_proto_encrypt_cfm(conn, status);
576
577         read_lock_bh(&hci_cb_list_lock);
578         list_for_each(p, &hci_cb_list) {
579                 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
580                 if (cb->encrypt_cfm)
581                         cb->encrypt_cfm(conn, status, encrypt);
582         }
583         read_unlock_bh(&hci_cb_list_lock);
584 }
585
586 static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
587 {
588         struct list_head *p;
589
590         read_lock_bh(&hci_cb_list_lock);
591         list_for_each(p, &hci_cb_list) {
592                 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
593                 if (cb->key_change_cfm)
594                         cb->key_change_cfm(conn, status);
595         }
596         read_unlock_bh(&hci_cb_list_lock);
597 }
598
599 static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, __u8 role)
600 {
601         struct list_head *p;
602
603         read_lock_bh(&hci_cb_list_lock);
604         list_for_each(p, &hci_cb_list) {
605                 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
606                 if (cb->role_switch_cfm)
607                         cb->role_switch_cfm(conn, status, role);
608         }
609         read_unlock_bh(&hci_cb_list_lock);
610 }
611
612 int hci_register_cb(struct hci_cb *hcb);
613 int hci_unregister_cb(struct hci_cb *hcb);
614
615 int hci_register_notifier(struct notifier_block *nb);
616 int hci_unregister_notifier(struct notifier_block *nb);
617
618 int hci_send_cmd(struct hci_dev *hdev, __u16 ogf, __u16 ocf, __u32 plen, void *param);
619 int hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags);
620 int hci_send_sco(struct hci_conn *conn, struct sk_buff *skb);
621
622 void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 ogf, __u16 ocf);
623
624 void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data);
625
626 /* ----- HCI Sockets ----- */
627 void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb);
628
629 /* HCI info for socket */
630 #define hci_pi(sk) ((struct hci_pinfo *) sk)
631
632 struct hci_pinfo {
633         struct bt_sock    bt;
634         struct hci_dev    *hdev;
635         struct hci_filter filter;
636         __u32             cmsg_mask;
637 };
638
639 /* HCI security filter */
640 #define HCI_SFLT_MAX_OGF  5
641
642 struct hci_sec_filter {
643         __u32 type_mask;
644         __u32 event_mask[2];
645         __u32 ocf_mask[HCI_SFLT_MAX_OGF + 1][4];
646 };
647
648 /* ----- HCI requests ----- */
649 #define HCI_REQ_DONE      0
650 #define HCI_REQ_PEND      1
651 #define HCI_REQ_CANCELED  2
652
653 #define hci_req_lock(d)         down(&d->req_lock)
654 #define hci_req_unlock(d)       up(&d->req_lock)
655
656 void hci_req_complete(struct hci_dev *hdev, int result);
657
658 #endif /* __HCI_CORE_H */