2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
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;
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.
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.
28 #include <net/bluetooth/hci.h>
30 /* HCI upper protocols */
31 #define HCI_PROTO_L2CAP 0
32 #define HCI_PROTO_SCO 1
34 /* HCI Core structures */
38 __u8 pscan_period_mode
;
46 struct inquiry_entry
{
47 struct inquiry_entry
*next
;
49 struct inquiry_data data
;
52 struct inquiry_cache
{
55 struct inquiry_entry
*list
;
58 struct hci_conn_hash
{
59 struct list_head list
;
67 struct list_head list
;
72 struct list_head list
;
78 struct list_head list
;
85 #define NUM_REASSEMBLY 4
87 struct list_head list
;
118 __u16 sniff_min_interval
;
119 __u16 sniff_max_interval
;
121 unsigned long quirks
;
124 unsigned int acl_cnt
;
125 unsigned int sco_cnt
;
128 unsigned int acl_mtu
;
129 unsigned int sco_mtu
;
131 unsigned int acl_pkts
;
132 unsigned int sco_pkts
;
133 unsigned int le_pkts
;
135 unsigned long acl_last_tx
;
136 unsigned long sco_last_tx
;
137 unsigned long le_last_tx
;
139 struct workqueue_struct
*workqueue
;
141 struct work_struct power_on
;
142 struct work_struct power_off
;
143 struct timer_list off_timer
;
145 struct timer_list cmd_timer
;
146 struct tasklet_struct cmd_task
;
147 struct tasklet_struct rx_task
;
148 struct tasklet_struct tx_task
;
150 struct sk_buff_head rx_q
;
151 struct sk_buff_head raw_q
;
152 struct sk_buff_head cmd_q
;
154 struct sk_buff
*sent_cmd
;
155 struct sk_buff
*reassembly
[NUM_REASSEMBLY
];
157 struct mutex req_lock
;
158 wait_queue_head_t req_wait_q
;
164 struct inquiry_cache inq_cache
;
165 struct hci_conn_hash conn_hash
;
166 struct list_head blacklist
;
168 struct list_head uuids
;
170 struct list_head link_keys
;
172 struct hci_dev_stats stat
;
174 struct sk_buff_head driver_init
;
181 struct dentry
*debugfs
;
183 struct device
*parent
;
186 struct rfkill
*rfkill
;
188 struct module
*owner
;
190 int (*open
)(struct hci_dev
*hdev
);
191 int (*close
)(struct hci_dev
*hdev
);
192 int (*flush
)(struct hci_dev
*hdev
);
193 int (*send
)(struct sk_buff
*skb
);
194 void (*destruct
)(struct hci_dev
*hdev
);
195 void (*notify
)(struct hci_dev
*hdev
, unsigned int evt
);
196 int (*ioctl
)(struct hci_dev
*hdev
, unsigned int cmd
, unsigned long arg
);
200 struct list_head list
;
221 __u8 pending_sec_level
;
234 struct sk_buff_head data_q
;
236 struct timer_list disc_timer
;
237 struct timer_list idle_timer
;
239 struct work_struct work_add
;
240 struct work_struct work_del
;
245 struct hci_dev
*hdev
;
250 struct hci_conn
*link
;
253 extern struct hci_proto
*hci_proto
[];
254 extern struct list_head hci_dev_list
;
255 extern struct list_head hci_cb_list
;
256 extern rwlock_t hci_dev_list_lock
;
257 extern rwlock_t hci_cb_list_lock
;
259 /* ----- Inquiry cache ----- */
260 #define INQUIRY_CACHE_AGE_MAX (HZ*30) /* 30 seconds */
261 #define INQUIRY_ENTRY_AGE_MAX (HZ*60) /* 60 seconds */
263 #define inquiry_cache_lock(c) spin_lock(&c->lock)
264 #define inquiry_cache_unlock(c) spin_unlock(&c->lock)
265 #define inquiry_cache_lock_bh(c) spin_lock_bh(&c->lock)
266 #define inquiry_cache_unlock_bh(c) spin_unlock_bh(&c->lock)
268 static inline void inquiry_cache_init(struct hci_dev
*hdev
)
270 struct inquiry_cache
*c
= &hdev
->inq_cache
;
271 spin_lock_init(&c
->lock
);
275 static inline int inquiry_cache_empty(struct hci_dev
*hdev
)
277 struct inquiry_cache
*c
= &hdev
->inq_cache
;
278 return c
->list
== NULL
;
281 static inline long inquiry_cache_age(struct hci_dev
*hdev
)
283 struct inquiry_cache
*c
= &hdev
->inq_cache
;
284 return jiffies
- c
->timestamp
;
287 static inline long inquiry_entry_age(struct inquiry_entry
*e
)
289 return jiffies
- e
->timestamp
;
292 struct inquiry_entry
*hci_inquiry_cache_lookup(struct hci_dev
*hdev
, bdaddr_t
*bdaddr
);
293 void hci_inquiry_cache_update(struct hci_dev
*hdev
, struct inquiry_data
*data
);
295 /* ----- HCI Connections ----- */
298 HCI_CONN_ENCRYPT_PEND
,
299 HCI_CONN_RSWITCH_PEND
,
300 HCI_CONN_MODE_CHANGE_PEND
,
301 HCI_CONN_SCO_SETUP_PEND
,
304 static inline void hci_conn_hash_init(struct hci_dev
*hdev
)
306 struct hci_conn_hash
*h
= &hdev
->conn_hash
;
307 INIT_LIST_HEAD(&h
->list
);
308 spin_lock_init(&h
->lock
);
313 static inline void hci_conn_hash_add(struct hci_dev
*hdev
, struct hci_conn
*c
)
315 struct hci_conn_hash
*h
= &hdev
->conn_hash
;
316 list_add(&c
->list
, &h
->list
);
331 static inline void hci_conn_hash_del(struct hci_dev
*hdev
, struct hci_conn
*c
)
333 struct hci_conn_hash
*h
= &hdev
->conn_hash
;
349 static inline struct hci_conn
*hci_conn_hash_lookup_handle(struct hci_dev
*hdev
,
352 struct hci_conn_hash
*h
= &hdev
->conn_hash
;
356 list_for_each(p
, &h
->list
) {
357 c
= list_entry(p
, struct hci_conn
, list
);
358 if (c
->handle
== handle
)
364 static inline struct hci_conn
*hci_conn_hash_lookup_ba(struct hci_dev
*hdev
,
365 __u8 type
, bdaddr_t
*ba
)
367 struct hci_conn_hash
*h
= &hdev
->conn_hash
;
371 list_for_each(p
, &h
->list
) {
372 c
= list_entry(p
, struct hci_conn
, list
);
373 if (c
->type
== type
&& !bacmp(&c
->dst
, ba
))
379 static inline struct hci_conn
*hci_conn_hash_lookup_state(struct hci_dev
*hdev
,
380 __u8 type
, __u16 state
)
382 struct hci_conn_hash
*h
= &hdev
->conn_hash
;
386 list_for_each(p
, &h
->list
) {
387 c
= list_entry(p
, struct hci_conn
, list
);
388 if (c
->type
== type
&& c
->state
== state
)
394 void hci_acl_connect(struct hci_conn
*conn
);
395 void hci_acl_disconn(struct hci_conn
*conn
, __u8 reason
);
396 void hci_add_sco(struct hci_conn
*conn
, __u16 handle
);
397 void hci_setup_sync(struct hci_conn
*conn
, __u16 handle
);
398 void hci_sco_setup(struct hci_conn
*conn
, __u8 status
);
400 struct hci_conn
*hci_conn_add(struct hci_dev
*hdev
, int type
, bdaddr_t
*dst
);
401 int hci_conn_del(struct hci_conn
*conn
);
402 void hci_conn_hash_flush(struct hci_dev
*hdev
);
403 void hci_conn_check_pending(struct hci_dev
*hdev
);
405 struct hci_conn
*hci_connect(struct hci_dev
*hdev
, int type
, bdaddr_t
*dst
, __u8 sec_level
, __u8 auth_type
);
406 int hci_conn_check_link_mode(struct hci_conn
*conn
);
407 int hci_conn_security(struct hci_conn
*conn
, __u8 sec_level
, __u8 auth_type
);
408 int hci_conn_change_link_key(struct hci_conn
*conn
);
409 int hci_conn_switch_role(struct hci_conn
*conn
, __u8 role
);
411 void hci_conn_enter_active_mode(struct hci_conn
*conn
);
412 void hci_conn_enter_sniff_mode(struct hci_conn
*conn
);
414 void hci_conn_hold_device(struct hci_conn
*conn
);
415 void hci_conn_put_device(struct hci_conn
*conn
);
417 static inline void hci_conn_hold(struct hci_conn
*conn
)
419 atomic_inc(&conn
->refcnt
);
420 del_timer(&conn
->disc_timer
);
423 static inline void hci_conn_put(struct hci_conn
*conn
)
425 if (atomic_dec_and_test(&conn
->refcnt
)) {
427 if (conn
->type
== ACL_LINK
) {
428 del_timer(&conn
->idle_timer
);
429 if (conn
->state
== BT_CONNECTED
) {
430 timeo
= msecs_to_jiffies(conn
->disc_timeout
);
434 timeo
= msecs_to_jiffies(10);
436 timeo
= msecs_to_jiffies(10);
437 mod_timer(&conn
->disc_timer
, jiffies
+ timeo
);
441 /* ----- HCI Devices ----- */
442 static inline void __hci_dev_put(struct hci_dev
*d
)
444 if (atomic_dec_and_test(&d
->refcnt
))
448 static inline void hci_dev_put(struct hci_dev
*d
)
451 module_put(d
->owner
);
454 static inline struct hci_dev
*__hci_dev_hold(struct hci_dev
*d
)
456 atomic_inc(&d
->refcnt
);
460 static inline struct hci_dev
*hci_dev_hold(struct hci_dev
*d
)
462 if (try_module_get(d
->owner
))
463 return __hci_dev_hold(d
);
467 #define hci_dev_lock(d) spin_lock(&d->lock)
468 #define hci_dev_unlock(d) spin_unlock(&d->lock)
469 #define hci_dev_lock_bh(d) spin_lock_bh(&d->lock)
470 #define hci_dev_unlock_bh(d) spin_unlock_bh(&d->lock)
472 struct hci_dev
*hci_dev_get(int index
);
473 struct hci_dev
*hci_get_route(bdaddr_t
*src
, bdaddr_t
*dst
);
475 struct hci_dev
*hci_alloc_dev(void);
476 void hci_free_dev(struct hci_dev
*hdev
);
477 int hci_register_dev(struct hci_dev
*hdev
);
478 int hci_unregister_dev(struct hci_dev
*hdev
);
479 int hci_suspend_dev(struct hci_dev
*hdev
);
480 int hci_resume_dev(struct hci_dev
*hdev
);
481 int hci_dev_open(__u16 dev
);
482 int hci_dev_close(__u16 dev
);
483 int hci_dev_reset(__u16 dev
);
484 int hci_dev_reset_stat(__u16 dev
);
485 int hci_dev_cmd(unsigned int cmd
, void __user
*arg
);
486 int hci_get_dev_list(void __user
*arg
);
487 int hci_get_dev_info(void __user
*arg
);
488 int hci_get_conn_list(void __user
*arg
);
489 int hci_get_conn_info(struct hci_dev
*hdev
, void __user
*arg
);
490 int hci_get_auth_info(struct hci_dev
*hdev
, void __user
*arg
);
491 int hci_inquiry(void __user
*arg
);
493 struct bdaddr_list
*hci_blacklist_lookup(struct hci_dev
*hdev
, bdaddr_t
*bdaddr
);
494 int hci_blacklist_clear(struct hci_dev
*hdev
);
496 int hci_uuids_clear(struct hci_dev
*hdev
);
498 int hci_link_keys_clear(struct hci_dev
*hdev
);
499 struct link_key
*hci_find_link_key(struct hci_dev
*hdev
, bdaddr_t
*bdaddr
);
500 int hci_add_link_key(struct hci_dev
*hdev
, int new_key
, bdaddr_t
*bdaddr
,
501 u8
*key
, u8 type
, u8 pin_len
);
502 int hci_remove_link_key(struct hci_dev
*hdev
, bdaddr_t
*bdaddr
);
504 void hci_del_off_timer(struct hci_dev
*hdev
);
506 void hci_event_packet(struct hci_dev
*hdev
, struct sk_buff
*skb
);
508 int hci_recv_frame(struct sk_buff
*skb
);
509 int hci_recv_fragment(struct hci_dev
*hdev
, int type
, void *data
, int count
);
510 int hci_recv_stream_fragment(struct hci_dev
*hdev
, void *data
, int count
);
512 int hci_register_sysfs(struct hci_dev
*hdev
);
513 void hci_unregister_sysfs(struct hci_dev
*hdev
);
514 void hci_conn_init_sysfs(struct hci_conn
*conn
);
515 void hci_conn_add_sysfs(struct hci_conn
*conn
);
516 void hci_conn_del_sysfs(struct hci_conn
*conn
);
518 #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->parent = (pdev))
520 /* ----- LMP capabilities ----- */
521 #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH)
522 #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT)
523 #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF)
524 #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
525 #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO)
526 #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR)
527 #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)
528 #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
530 /* ----- HCI protocols ----- */
538 int (*connect_ind
) (struct hci_dev
*hdev
, bdaddr_t
*bdaddr
, __u8 type
);
539 int (*connect_cfm
) (struct hci_conn
*conn
, __u8 status
);
540 int (*disconn_ind
) (struct hci_conn
*conn
);
541 int (*disconn_cfm
) (struct hci_conn
*conn
, __u8 reason
);
542 int (*recv_acldata
) (struct hci_conn
*conn
, struct sk_buff
*skb
, __u16 flags
);
543 int (*recv_scodata
) (struct hci_conn
*conn
, struct sk_buff
*skb
);
544 int (*security_cfm
) (struct hci_conn
*conn
, __u8 status
, __u8 encrypt
);
547 static inline int hci_proto_connect_ind(struct hci_dev
*hdev
, bdaddr_t
*bdaddr
, __u8 type
)
549 register struct hci_proto
*hp
;
552 hp
= hci_proto
[HCI_PROTO_L2CAP
];
553 if (hp
&& hp
->connect_ind
)
554 mask
|= hp
->connect_ind(hdev
, bdaddr
, type
);
556 hp
= hci_proto
[HCI_PROTO_SCO
];
557 if (hp
&& hp
->connect_ind
)
558 mask
|= hp
->connect_ind(hdev
, bdaddr
, type
);
563 static inline void hci_proto_connect_cfm(struct hci_conn
*conn
, __u8 status
)
565 register struct hci_proto
*hp
;
567 hp
= hci_proto
[HCI_PROTO_L2CAP
];
568 if (hp
&& hp
->connect_cfm
)
569 hp
->connect_cfm(conn
, status
);
571 hp
= hci_proto
[HCI_PROTO_SCO
];
572 if (hp
&& hp
->connect_cfm
)
573 hp
->connect_cfm(conn
, status
);
576 static inline int hci_proto_disconn_ind(struct hci_conn
*conn
)
578 register struct hci_proto
*hp
;
581 hp
= hci_proto
[HCI_PROTO_L2CAP
];
582 if (hp
&& hp
->disconn_ind
)
583 reason
= hp
->disconn_ind(conn
);
585 hp
= hci_proto
[HCI_PROTO_SCO
];
586 if (hp
&& hp
->disconn_ind
)
587 reason
= hp
->disconn_ind(conn
);
592 static inline void hci_proto_disconn_cfm(struct hci_conn
*conn
, __u8 reason
)
594 register struct hci_proto
*hp
;
596 hp
= hci_proto
[HCI_PROTO_L2CAP
];
597 if (hp
&& hp
->disconn_cfm
)
598 hp
->disconn_cfm(conn
, reason
);
600 hp
= hci_proto
[HCI_PROTO_SCO
];
601 if (hp
&& hp
->disconn_cfm
)
602 hp
->disconn_cfm(conn
, reason
);
605 static inline void hci_proto_auth_cfm(struct hci_conn
*conn
, __u8 status
)
607 register struct hci_proto
*hp
;
610 if (test_bit(HCI_CONN_ENCRYPT_PEND
, &conn
->pend
))
613 encrypt
= (conn
->link_mode
& HCI_LM_ENCRYPT
) ? 0x01 : 0x00;
615 hp
= hci_proto
[HCI_PROTO_L2CAP
];
616 if (hp
&& hp
->security_cfm
)
617 hp
->security_cfm(conn
, status
, encrypt
);
619 hp
= hci_proto
[HCI_PROTO_SCO
];
620 if (hp
&& hp
->security_cfm
)
621 hp
->security_cfm(conn
, status
, encrypt
);
624 static inline void hci_proto_encrypt_cfm(struct hci_conn
*conn
, __u8 status
, __u8 encrypt
)
626 register struct hci_proto
*hp
;
628 hp
= hci_proto
[HCI_PROTO_L2CAP
];
629 if (hp
&& hp
->security_cfm
)
630 hp
->security_cfm(conn
, status
, encrypt
);
632 hp
= hci_proto
[HCI_PROTO_SCO
];
633 if (hp
&& hp
->security_cfm
)
634 hp
->security_cfm(conn
, status
, encrypt
);
637 int hci_register_proto(struct hci_proto
*hproto
);
638 int hci_unregister_proto(struct hci_proto
*hproto
);
640 /* ----- HCI callbacks ----- */
642 struct list_head list
;
646 void (*security_cfm
) (struct hci_conn
*conn
, __u8 status
, __u8 encrypt
);
647 void (*key_change_cfm
) (struct hci_conn
*conn
, __u8 status
);
648 void (*role_switch_cfm
) (struct hci_conn
*conn
, __u8 status
, __u8 role
);
651 static inline void hci_auth_cfm(struct hci_conn
*conn
, __u8 status
)
656 hci_proto_auth_cfm(conn
, status
);
658 if (test_bit(HCI_CONN_ENCRYPT_PEND
, &conn
->pend
))
661 encrypt
= (conn
->link_mode
& HCI_LM_ENCRYPT
) ? 0x01 : 0x00;
663 read_lock_bh(&hci_cb_list_lock
);
664 list_for_each(p
, &hci_cb_list
) {
665 struct hci_cb
*cb
= list_entry(p
, struct hci_cb
, list
);
666 if (cb
->security_cfm
)
667 cb
->security_cfm(conn
, status
, encrypt
);
669 read_unlock_bh(&hci_cb_list_lock
);
672 static inline void hci_encrypt_cfm(struct hci_conn
*conn
, __u8 status
, __u8 encrypt
)
676 if (conn
->sec_level
== BT_SECURITY_SDP
)
677 conn
->sec_level
= BT_SECURITY_LOW
;
679 hci_proto_encrypt_cfm(conn
, status
, encrypt
);
681 read_lock_bh(&hci_cb_list_lock
);
682 list_for_each(p
, &hci_cb_list
) {
683 struct hci_cb
*cb
= list_entry(p
, struct hci_cb
, list
);
684 if (cb
->security_cfm
)
685 cb
->security_cfm(conn
, status
, encrypt
);
687 read_unlock_bh(&hci_cb_list_lock
);
690 static inline void hci_key_change_cfm(struct hci_conn
*conn
, __u8 status
)
694 read_lock_bh(&hci_cb_list_lock
);
695 list_for_each(p
, &hci_cb_list
) {
696 struct hci_cb
*cb
= list_entry(p
, struct hci_cb
, list
);
697 if (cb
->key_change_cfm
)
698 cb
->key_change_cfm(conn
, status
);
700 read_unlock_bh(&hci_cb_list_lock
);
703 static inline void hci_role_switch_cfm(struct hci_conn
*conn
, __u8 status
, __u8 role
)
707 read_lock_bh(&hci_cb_list_lock
);
708 list_for_each(p
, &hci_cb_list
) {
709 struct hci_cb
*cb
= list_entry(p
, struct hci_cb
, list
);
710 if (cb
->role_switch_cfm
)
711 cb
->role_switch_cfm(conn
, status
, role
);
713 read_unlock_bh(&hci_cb_list_lock
);
716 int hci_register_cb(struct hci_cb
*hcb
);
717 int hci_unregister_cb(struct hci_cb
*hcb
);
719 int hci_register_notifier(struct notifier_block
*nb
);
720 int hci_unregister_notifier(struct notifier_block
*nb
);
722 int hci_send_cmd(struct hci_dev
*hdev
, __u16 opcode
, __u32 plen
, void *param
);
723 void hci_send_acl(struct hci_conn
*conn
, struct sk_buff
*skb
, __u16 flags
);
724 void hci_send_sco(struct hci_conn
*conn
, struct sk_buff
*skb
);
726 void *hci_sent_cmd_data(struct hci_dev
*hdev
, __u16 opcode
);
728 void hci_si_event(struct hci_dev
*hdev
, int type
, int dlen
, void *data
);
730 /* ----- HCI Sockets ----- */
731 void hci_send_to_sock(struct hci_dev
*hdev
, struct sk_buff
*skb
,
732 struct sock
*skip_sk
);
734 /* Management interface */
735 int mgmt_control(struct sock
*sk
, struct msghdr
*msg
, size_t len
);
736 int mgmt_index_added(u16 index
);
737 int mgmt_index_removed(u16 index
);
738 int mgmt_powered(u16 index
, u8 powered
);
739 int mgmt_discoverable(u16 index
, u8 discoverable
);
740 int mgmt_connectable(u16 index
, u8 connectable
);
741 int mgmt_new_key(u16 index
, struct link_key
*key
, u8 old_key_type
);
742 int mgmt_connected(u16 index
, bdaddr_t
*bdaddr
);
743 int mgmt_disconnected(u16 index
, bdaddr_t
*bdaddr
);
744 int mgmt_disconnect_failed(u16 index
);
745 int mgmt_connect_failed(u16 index
, bdaddr_t
*bdaddr
, u8 status
);
746 int mgmt_pin_code_request(u16 index
, bdaddr_t
*bdaddr
);
747 int mgmt_pin_code_reply_complete(u16 index
, bdaddr_t
*bdaddr
, u8 status
);
748 int mgmt_pin_code_neg_reply_complete(u16 index
, bdaddr_t
*bdaddr
, u8 status
);
750 /* HCI info for socket */
751 #define hci_pi(sk) ((struct hci_pinfo *) sk)
755 struct hci_dev
*hdev
;
756 struct hci_filter filter
;
758 unsigned short channel
;
761 /* HCI security filter */
762 #define HCI_SFLT_MAX_OGF 5
764 struct hci_sec_filter
{
767 __u32 ocf_mask
[HCI_SFLT_MAX_OGF
+ 1][4];
770 /* ----- HCI requests ----- */
771 #define HCI_REQ_DONE 0
772 #define HCI_REQ_PEND 1
773 #define HCI_REQ_CANCELED 2
775 #define hci_req_lock(d) mutex_lock(&d->req_lock)
776 #define hci_req_unlock(d) mutex_unlock(&d->req_lock)
778 void hci_req_complete(struct hci_dev
*hdev
, __u16 cmd
, int result
);
780 void hci_le_conn_update(struct hci_conn
*conn
, u16 min
, u16 max
,
781 u16 latency
, u16 to_multiplier
);
782 #endif /* __HCI_CORE_H */