3 * Bluetooth HCI UART driver
5 * Copyright (C) 2002-2003 Fabrizio Gennari <fabrizio.gennari@philips.com>
6 * Copyright (C) 2004-2005 Marcel Holtmann <marcel@holtmann.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include <linux/module.h>
27 #include <linux/kernel.h>
28 #include <linux/init.h>
29 #include <linux/types.h>
30 #include <linux/fcntl.h>
31 #include <linux/interrupt.h>
32 #include <linux/ptrace.h>
33 #include <linux/poll.h>
35 #include <linux/slab.h>
36 #include <linux/tty.h>
37 #include <linux/errno.h>
38 #include <linux/string.h>
39 #include <linux/signal.h>
40 #include <linux/ioctl.h>
41 #include <linux/skbuff.h>
42 #include <linux/bitrev.h>
43 #include <asm/unaligned.h>
45 #include <net/bluetooth/bluetooth.h>
46 #include <net/bluetooth/hci_core.h>
52 static bool txcrc
= 1;
53 static bool hciextn
= 1;
55 #define BCSP_TXWINSIZE 4
57 #define BCSP_ACK_PKT 0x05
58 #define BCSP_LE_PKT 0x06
61 struct sk_buff_head unack
; /* Unack'ed packets queue */
62 struct sk_buff_head rel
; /* Reliable packets queue */
63 struct sk_buff_head unrel
; /* Unreliable packets queue */
65 unsigned long rx_count
;
66 struct sk_buff
*rx_skb
;
67 u8 rxseq_txack
; /* rxseq == txack. */
68 u8 rxack
; /* Last packet sent by us that the peer ack'ed */
69 struct timer_list tbcsp
;
72 BCSP_W4_PKT_DELIMITER
,
86 u8 txack_req
; /* Do we need to send ack's to the peer? */
88 /* Reliable packet sequence number - used to assign seq to each rel pkt. */
92 /* ---- BCSP CRC calculation ---- */
94 /* Table for calculating CRC for polynomial 0x1021, LSB processed first,
95 initial value 0xffff, bits shifted in reverse order. */
97 static const u16 crc_table
[] = {
98 0x0000, 0x1081, 0x2102, 0x3183,
99 0x4204, 0x5285, 0x6306, 0x7387,
100 0x8408, 0x9489, 0xa50a, 0xb58b,
101 0xc60c, 0xd68d, 0xe70e, 0xf78f
104 /* Initialise the crc calculator */
105 #define BCSP_CRC_INIT(x) x = 0xffff
108 Update crc with next data byte
111 The data byte is treated as two nibbles. The crc is generated
112 in reverse, i.e., bits are fed into the register from the top.
114 static void bcsp_crc_update(u16
*crc
, u8 d
)
118 reg
= (reg
>> 4) ^ crc_table
[(reg
^ d
) & 0x000f];
119 reg
= (reg
>> 4) ^ crc_table
[(reg
^ (d
>> 4)) & 0x000f];
124 /* ---- BCSP core ---- */
126 static void bcsp_slip_msgdelim(struct sk_buff
*skb
)
128 const char pkt_delim
= 0xc0;
130 memcpy(skb_put(skb
, 1), &pkt_delim
, 1);
133 static void bcsp_slip_one_byte(struct sk_buff
*skb
, u8 c
)
135 const char esc_c0
[2] = { 0xdb, 0xdc };
136 const char esc_db
[2] = { 0xdb, 0xdd };
140 memcpy(skb_put(skb
, 2), &esc_c0
, 2);
143 memcpy(skb_put(skb
, 2), &esc_db
, 2);
146 memcpy(skb_put(skb
, 1), &c
, 1);
150 static int bcsp_enqueue(struct hci_uart
*hu
, struct sk_buff
*skb
)
152 struct bcsp_struct
*bcsp
= hu
->priv
;
154 if (skb
->len
> 0xFFF) {
155 BT_ERR("Packet too long");
160 switch (bt_cb(skb
)->pkt_type
) {
161 case HCI_ACLDATA_PKT
:
162 case HCI_COMMAND_PKT
:
163 skb_queue_tail(&bcsp
->rel
, skb
);
166 case HCI_SCODATA_PKT
:
167 skb_queue_tail(&bcsp
->unrel
, skb
);
171 BT_ERR("Unknown packet type");
179 static struct sk_buff
*bcsp_prepare_pkt(struct bcsp_struct
*bcsp
, u8
*data
,
180 int len
, int pkt_type
)
182 struct sk_buff
*nskb
;
184 u16
BCSP_CRC_INIT(bcsp_txmsg_crc
);
188 case HCI_ACLDATA_PKT
:
189 chan
= 6; /* BCSP ACL channel */
190 rel
= 1; /* reliable channel */
192 case HCI_COMMAND_PKT
:
193 chan
= 5; /* BCSP cmd/evt channel */
194 rel
= 1; /* reliable channel */
196 case HCI_SCODATA_PKT
:
197 chan
= 7; /* BCSP SCO channel */
198 rel
= 0; /* unreliable channel */
201 chan
= 1; /* BCSP LE channel */
202 rel
= 0; /* unreliable channel */
205 chan
= 0; /* BCSP internal channel */
206 rel
= 0; /* unreliable channel */
209 BT_ERR("Unknown packet type");
213 if (hciextn
&& chan
== 5) {
214 __le16 opcode
= ((struct hci_command_hdr
*)data
)->opcode
;
216 /* Vendor specific commands */
217 if (hci_opcode_ogf(__le16_to_cpu(opcode
)) == 0x3f) {
218 u8 desc
= *(data
+ HCI_COMMAND_HDR_SIZE
);
219 if ((desc
& 0xf0) == 0xc0) {
220 data
+= HCI_COMMAND_HDR_SIZE
+ 1;
221 len
-= HCI_COMMAND_HDR_SIZE
+ 1;
227 /* Max len of packet: (original len +4(bcsp hdr) +2(crc))*2
228 (because bytes 0xc0 and 0xdb are escaped, worst case is
229 when the packet is all made of 0xc0 and 0xdb :) )
230 + 2 (0xc0 delimiters at start and end). */
232 nskb
= alloc_skb((len
+ 6) * 2 + 2, GFP_ATOMIC
);
236 bt_cb(nskb
)->pkt_type
= pkt_type
;
238 bcsp_slip_msgdelim(nskb
);
240 hdr
[0] = bcsp
->rxseq_txack
<< 3;
242 BT_DBG("We request packet no %u to card", bcsp
->rxseq_txack
);
245 hdr
[0] |= 0x80 + bcsp
->msgq_txseq
;
246 BT_DBG("Sending packet with seqno %u", bcsp
->msgq_txseq
);
247 bcsp
->msgq_txseq
= (bcsp
->msgq_txseq
+ 1) & 0x07;
253 hdr
[1] = ((len
<< 4) & 0xff) | chan
;
255 hdr
[3] = ~(hdr
[0] + hdr
[1] + hdr
[2]);
257 /* Put BCSP header */
258 for (i
= 0; i
< 4; i
++) {
259 bcsp_slip_one_byte(nskb
, hdr
[i
]);
262 bcsp_crc_update(&bcsp_txmsg_crc
, hdr
[i
]);
266 for (i
= 0; i
< len
; i
++) {
267 bcsp_slip_one_byte(nskb
, data
[i
]);
270 bcsp_crc_update(&bcsp_txmsg_crc
, data
[i
]);
275 bcsp_txmsg_crc
= bitrev16(bcsp_txmsg_crc
);
276 bcsp_slip_one_byte(nskb
, (u8
) ((bcsp_txmsg_crc
>> 8) & 0x00ff));
277 bcsp_slip_one_byte(nskb
, (u8
) (bcsp_txmsg_crc
& 0x00ff));
280 bcsp_slip_msgdelim(nskb
);
284 /* This is a rewrite of pkt_avail in ABCSP */
285 static struct sk_buff
*bcsp_dequeue(struct hci_uart
*hu
)
287 struct bcsp_struct
*bcsp
= hu
->priv
;
291 /* First of all, check for unreliable messages in the queue,
292 since they have priority */
294 skb
= skb_dequeue(&bcsp
->unrel
);
296 struct sk_buff
*nskb
= bcsp_prepare_pkt(bcsp
, skb
->data
, skb
->len
, bt_cb(skb
)->pkt_type
);
301 skb_queue_head(&bcsp
->unrel
, skb
);
302 BT_ERR("Could not dequeue pkt because alloc_skb failed");
306 /* Now, try to send a reliable pkt. We can only send a
307 reliable packet if the number of packets sent but not yet ack'ed
308 is < than the winsize */
310 spin_lock_irqsave_nested(&bcsp
->unack
.lock
, flags
, SINGLE_DEPTH_NESTING
);
312 if (bcsp
->unack
.qlen
< BCSP_TXWINSIZE
) {
313 skb
= skb_dequeue(&bcsp
->rel
);
315 struct sk_buff
*nskb
= bcsp_prepare_pkt(bcsp
, skb
->data
, skb
->len
,
316 bt_cb(skb
)->pkt_type
);
318 __skb_queue_tail(&bcsp
->unack
, skb
);
319 mod_timer(&bcsp
->tbcsp
, jiffies
+ HZ
/ 4);
320 spin_unlock_irqrestore(&bcsp
->unack
.lock
, flags
);
323 skb_queue_head(&bcsp
->rel
, skb
);
324 BT_ERR("Could not dequeue pkt because alloc_skb failed");
329 spin_unlock_irqrestore(&bcsp
->unack
.lock
, flags
);
331 /* We could not send a reliable packet, either because there are
332 none or because there are too many unack'ed pkts. Did we receive
333 any packets we have not acknowledged yet ? */
335 if (bcsp
->txack_req
) {
336 /* if so, craft an empty ACK pkt and send it on BCSP unreliable
338 struct sk_buff
*nskb
= bcsp_prepare_pkt(bcsp
, NULL
, 0, BCSP_ACK_PKT
);
342 /* We have nothing to send */
346 static int bcsp_flush(struct hci_uart
*hu
)
352 /* Remove ack'ed packets */
353 static void bcsp_pkt_cull(struct bcsp_struct
*bcsp
)
355 struct sk_buff
*skb
, *tmp
;
357 int i
, pkts_to_be_removed
;
360 spin_lock_irqsave(&bcsp
->unack
.lock
, flags
);
362 pkts_to_be_removed
= skb_queue_len(&bcsp
->unack
);
363 seqno
= bcsp
->msgq_txseq
;
365 while (pkts_to_be_removed
) {
366 if (bcsp
->rxack
== seqno
)
368 pkts_to_be_removed
--;
369 seqno
= (seqno
- 1) & 0x07;
372 if (bcsp
->rxack
!= seqno
)
373 BT_ERR("Peer acked invalid packet");
375 BT_DBG("Removing %u pkts out of %u, up to seqno %u",
376 pkts_to_be_removed
, skb_queue_len(&bcsp
->unack
),
380 skb_queue_walk_safe(&bcsp
->unack
, skb
, tmp
) {
381 if (i
>= pkts_to_be_removed
)
385 __skb_unlink(skb
, &bcsp
->unack
);
389 if (skb_queue_empty(&bcsp
->unack
))
390 del_timer(&bcsp
->tbcsp
);
392 spin_unlock_irqrestore(&bcsp
->unack
.lock
, flags
);
394 if (i
!= pkts_to_be_removed
)
395 BT_ERR("Removed only %u out of %u pkts", i
, pkts_to_be_removed
);
398 /* Handle BCSP link-establishment packets. When we
399 detect a "sync" packet, symptom that the BT module has reset,
400 we do nothing :) (yet) */
401 static void bcsp_handle_le_pkt(struct hci_uart
*hu
)
403 struct bcsp_struct
*bcsp
= hu
->priv
;
404 u8 conf_pkt
[4] = { 0xad, 0xef, 0xac, 0xed };
405 u8 conf_rsp_pkt
[4] = { 0xde, 0xad, 0xd0, 0xd0 };
406 u8 sync_pkt
[4] = { 0xda, 0xdc, 0xed, 0xed };
408 /* spot "conf" pkts and reply with a "conf rsp" pkt */
409 if (bcsp
->rx_skb
->data
[1] >> 4 == 4 && bcsp
->rx_skb
->data
[2] == 0 &&
410 !memcmp(&bcsp
->rx_skb
->data
[4], conf_pkt
, 4)) {
411 struct sk_buff
*nskb
= alloc_skb(4, GFP_ATOMIC
);
413 BT_DBG("Found a LE conf pkt");
416 memcpy(skb_put(nskb
, 4), conf_rsp_pkt
, 4);
417 bt_cb(nskb
)->pkt_type
= BCSP_LE_PKT
;
419 skb_queue_head(&bcsp
->unrel
, nskb
);
420 hci_uart_tx_wakeup(hu
);
422 /* Spot "sync" pkts. If we find one...disaster! */
423 else if (bcsp
->rx_skb
->data
[1] >> 4 == 4 && bcsp
->rx_skb
->data
[2] == 0 &&
424 !memcmp(&bcsp
->rx_skb
->data
[4], sync_pkt
, 4)) {
425 BT_ERR("Found a LE sync pkt, card has reset");
429 static inline void bcsp_unslip_one_byte(struct bcsp_struct
*bcsp
, unsigned char byte
)
431 const u8 c0
= 0xc0, db
= 0xdb;
433 switch (bcsp
->rx_esc_state
) {
434 case BCSP_ESCSTATE_NOESC
:
437 bcsp
->rx_esc_state
= BCSP_ESCSTATE_ESC
;
440 memcpy(skb_put(bcsp
->rx_skb
, 1), &byte
, 1);
441 if ((bcsp
->rx_skb
-> data
[0] & 0x40) != 0 &&
442 bcsp
->rx_state
!= BCSP_W4_CRC
)
443 bcsp_crc_update(&bcsp
->message_crc
, byte
);
448 case BCSP_ESCSTATE_ESC
:
451 memcpy(skb_put(bcsp
->rx_skb
, 1), &c0
, 1);
452 if ((bcsp
->rx_skb
-> data
[0] & 0x40) != 0 &&
453 bcsp
->rx_state
!= BCSP_W4_CRC
)
454 bcsp_crc_update(&bcsp
-> message_crc
, 0xc0);
455 bcsp
->rx_esc_state
= BCSP_ESCSTATE_NOESC
;
460 memcpy(skb_put(bcsp
->rx_skb
, 1), &db
, 1);
461 if ((bcsp
->rx_skb
-> data
[0] & 0x40) != 0 &&
462 bcsp
->rx_state
!= BCSP_W4_CRC
)
463 bcsp_crc_update(&bcsp
-> message_crc
, 0xdb);
464 bcsp
->rx_esc_state
= BCSP_ESCSTATE_NOESC
;
469 BT_ERR ("Invalid byte %02x after esc byte", byte
);
470 kfree_skb(bcsp
->rx_skb
);
472 bcsp
->rx_state
= BCSP_W4_PKT_DELIMITER
;
478 static void bcsp_complete_rx_pkt(struct hci_uart
*hu
)
480 struct bcsp_struct
*bcsp
= hu
->priv
;
483 if (bcsp
->rx_skb
->data
[0] & 0x80) { /* reliable pkt */
484 BT_DBG("Received seqno %u from card", bcsp
->rxseq_txack
);
486 bcsp
->rxseq_txack
%= 0x8;
489 /* If needed, transmit an ack pkt */
490 hci_uart_tx_wakeup(hu
);
493 bcsp
->rxack
= (bcsp
->rx_skb
->data
[0] >> 3) & 0x07;
494 BT_DBG("Request for pkt %u from card", bcsp
->rxack
);
497 if ((bcsp
->rx_skb
->data
[1] & 0x0f) == 6 &&
498 bcsp
->rx_skb
->data
[0] & 0x80) {
499 bt_cb(bcsp
->rx_skb
)->pkt_type
= HCI_ACLDATA_PKT
;
501 } else if ((bcsp
->rx_skb
->data
[1] & 0x0f) == 5 &&
502 bcsp
->rx_skb
->data
[0] & 0x80) {
503 bt_cb(bcsp
->rx_skb
)->pkt_type
= HCI_EVENT_PKT
;
505 } else if ((bcsp
->rx_skb
->data
[1] & 0x0f) == 7) {
506 bt_cb(bcsp
->rx_skb
)->pkt_type
= HCI_SCODATA_PKT
;
508 } else if ((bcsp
->rx_skb
->data
[1] & 0x0f) == 1 &&
509 !(bcsp
->rx_skb
->data
[0] & 0x80)) {
510 bcsp_handle_le_pkt(hu
);
516 struct hci_event_hdr hdr
;
517 u8 desc
= (bcsp
->rx_skb
->data
[1] & 0x0f);
519 if (desc
!= 0 && desc
!= 1) {
522 skb_pull(bcsp
->rx_skb
, 4);
523 memcpy(skb_push(bcsp
->rx_skb
, 1), &desc
, 1);
526 hdr
.plen
= bcsp
->rx_skb
->len
;
527 memcpy(skb_push(bcsp
->rx_skb
, HCI_EVENT_HDR_SIZE
), &hdr
, HCI_EVENT_HDR_SIZE
);
528 bt_cb(bcsp
->rx_skb
)->pkt_type
= HCI_EVENT_PKT
;
530 hci_recv_frame(hu
->hdev
, bcsp
->rx_skb
);
532 BT_ERR ("Packet for unknown channel (%u %s)",
533 bcsp
->rx_skb
->data
[1] & 0x0f,
534 bcsp
->rx_skb
->data
[0] & 0x80 ?
535 "reliable" : "unreliable");
536 kfree_skb(bcsp
->rx_skb
);
539 kfree_skb(bcsp
->rx_skb
);
541 /* Pull out BCSP hdr */
542 skb_pull(bcsp
->rx_skb
, 4);
544 hci_recv_frame(hu
->hdev
, bcsp
->rx_skb
);
547 bcsp
->rx_state
= BCSP_W4_PKT_DELIMITER
;
551 static u16
bscp_get_crc(struct bcsp_struct
*bcsp
)
553 return get_unaligned_be16(&bcsp
->rx_skb
->data
[bcsp
->rx_skb
->len
- 2]);
557 static int bcsp_recv(struct hci_uart
*hu
, void *data
, int count
)
559 struct bcsp_struct
*bcsp
= hu
->priv
;
562 BT_DBG("hu %p count %d rx_state %d rx_count %ld",
563 hu
, count
, bcsp
->rx_state
, bcsp
->rx_count
);
567 if (bcsp
->rx_count
) {
569 BT_ERR("Short BCSP packet");
570 kfree_skb(bcsp
->rx_skb
);
571 bcsp
->rx_state
= BCSP_W4_PKT_START
;
574 bcsp_unslip_one_byte(bcsp
, *ptr
);
580 switch (bcsp
->rx_state
) {
581 case BCSP_W4_BCSP_HDR
:
582 if ((0xff & (u8
) ~ (bcsp
->rx_skb
->data
[0] + bcsp
->rx_skb
->data
[1] +
583 bcsp
->rx_skb
->data
[2])) != bcsp
->rx_skb
->data
[3]) {
584 BT_ERR("Error in BCSP hdr checksum");
585 kfree_skb(bcsp
->rx_skb
);
586 bcsp
->rx_state
= BCSP_W4_PKT_DELIMITER
;
590 if (bcsp
->rx_skb
->data
[0] & 0x80 /* reliable pkt */
591 && (bcsp
->rx_skb
->data
[0] & 0x07) != bcsp
->rxseq_txack
) {
592 BT_ERR ("Out-of-order packet arrived, got %u expected %u",
593 bcsp
->rx_skb
->data
[0] & 0x07, bcsp
->rxseq_txack
);
595 kfree_skb(bcsp
->rx_skb
);
596 bcsp
->rx_state
= BCSP_W4_PKT_DELIMITER
;
600 bcsp
->rx_state
= BCSP_W4_DATA
;
601 bcsp
->rx_count
= (bcsp
->rx_skb
->data
[1] >> 4) +
602 (bcsp
->rx_skb
->data
[2] << 4); /* May be 0 */
606 if (bcsp
->rx_skb
->data
[0] & 0x40) { /* pkt with crc */
607 bcsp
->rx_state
= BCSP_W4_CRC
;
610 bcsp_complete_rx_pkt(hu
);
614 if (bitrev16(bcsp
->message_crc
) != bscp_get_crc(bcsp
)) {
615 BT_ERR ("Checksum failed: computed %04x received %04x",
616 bitrev16(bcsp
->message_crc
),
619 kfree_skb(bcsp
->rx_skb
);
620 bcsp
->rx_state
= BCSP_W4_PKT_DELIMITER
;
624 skb_trim(bcsp
->rx_skb
, bcsp
->rx_skb
->len
- 2);
625 bcsp_complete_rx_pkt(hu
);
628 case BCSP_W4_PKT_DELIMITER
:
631 bcsp
->rx_state
= BCSP_W4_PKT_START
;
634 /*BT_ERR("Ignoring byte %02x", *ptr);*/
640 case BCSP_W4_PKT_START
:
647 bcsp
->rx_state
= BCSP_W4_BCSP_HDR
;
649 bcsp
->rx_esc_state
= BCSP_ESCSTATE_NOESC
;
650 BCSP_CRC_INIT(bcsp
->message_crc
);
652 /* Do not increment ptr or decrement count
653 * Allocate packet. Max len of a BCSP pkt=
654 * 0xFFF (payload) +4 (header) +2 (crc) */
656 bcsp
->rx_skb
= bt_skb_alloc(0x1005, GFP_ATOMIC
);
658 BT_ERR("Can't allocate mem for new packet");
659 bcsp
->rx_state
= BCSP_W4_PKT_DELIMITER
;
671 /* Arrange to retransmit all messages in the relq. */
672 static void bcsp_timed_event(unsigned long arg
)
674 struct hci_uart
*hu
= (struct hci_uart
*) arg
;
675 struct bcsp_struct
*bcsp
= hu
->priv
;
679 BT_DBG("hu %p retransmitting %u pkts", hu
, bcsp
->unack
.qlen
);
681 spin_lock_irqsave_nested(&bcsp
->unack
.lock
, flags
, SINGLE_DEPTH_NESTING
);
683 while ((skb
= __skb_dequeue_tail(&bcsp
->unack
)) != NULL
) {
684 bcsp
->msgq_txseq
= (bcsp
->msgq_txseq
- 1) & 0x07;
685 skb_queue_head(&bcsp
->rel
, skb
);
688 spin_unlock_irqrestore(&bcsp
->unack
.lock
, flags
);
690 hci_uart_tx_wakeup(hu
);
693 static int bcsp_open(struct hci_uart
*hu
)
695 struct bcsp_struct
*bcsp
;
699 bcsp
= kzalloc(sizeof(*bcsp
), GFP_KERNEL
);
704 skb_queue_head_init(&bcsp
->unack
);
705 skb_queue_head_init(&bcsp
->rel
);
706 skb_queue_head_init(&bcsp
->unrel
);
708 init_timer(&bcsp
->tbcsp
);
709 bcsp
->tbcsp
.function
= bcsp_timed_event
;
710 bcsp
->tbcsp
.data
= (u_long
) hu
;
712 bcsp
->rx_state
= BCSP_W4_PKT_DELIMITER
;
720 static int bcsp_close(struct hci_uart
*hu
)
722 struct bcsp_struct
*bcsp
= hu
->priv
;
724 del_timer_sync(&bcsp
->tbcsp
);
730 skb_queue_purge(&bcsp
->unack
);
731 skb_queue_purge(&bcsp
->rel
);
732 skb_queue_purge(&bcsp
->unrel
);
738 static struct hci_uart_proto bcsp
= {
742 .enqueue
= bcsp_enqueue
,
743 .dequeue
= bcsp_dequeue
,
748 int __init
bcsp_init(void)
750 int err
= hci_uart_register_proto(&bcsp
);
753 BT_INFO("HCI BCSP protocol initialized");
755 BT_ERR("HCI BCSP protocol registration failed");
760 int __exit
bcsp_deinit(void)
762 return hci_uart_unregister_proto(&bcsp
);
765 module_param(txcrc
, bool, 0644);
766 MODULE_PARM_DESC(txcrc
, "Transmit CRC with every BCSP packet");
768 module_param(hciextn
, bool, 0644);
769 MODULE_PARM_DESC(hciextn
, "Convert HCI Extensions into BCSP packets");