summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorUwe Stuehler <uwe@cvs.openbsd.org>2008-11-22 04:42:59 +0000
committerUwe Stuehler <uwe@cvs.openbsd.org>2008-11-22 04:42:59 +0000
commitee43d395f23778051691eb4bfc357fa8a319dc36 (patch)
tree39f64994e1dc4a1a4688f1cd259f7a4ac2a1fa41 /sys
parent40b98550b7357a09aad4dfe870e508bc05f03705 (diff)
Sync bluetooth with NetBSD
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/bluetooth/bthidev.c34
-rw-r--r--sys/dev/bluetooth/btkbd.c34
-rw-r--r--sys/dev/bluetooth/btms.c34
-rw-r--r--sys/dev/usb/ubt.c8
-rw-r--r--sys/netbt/bluetooth.h25
-rw-r--r--sys/netbt/bt_proto.c20
-rw-r--r--sys/netbt/hci.h470
-rw-r--r--sys/netbt/hci_event.c113
-rw-r--r--sys/netbt/hci_link.c49
-rw-r--r--sys/netbt/hci_socket.c11
-rw-r--r--sys/netbt/hci_unit.c73
-rw-r--r--sys/netbt/l2cap.h36
-rw-r--r--sys/netbt/l2cap_lower.c9
-rw-r--r--sys/netbt/l2cap_misc.c9
-rw-r--r--sys/netbt/l2cap_socket.c6
-rw-r--r--sys/netbt/l2cap_upper.c4
-rw-r--r--sys/netbt/rfcomm.h16
-rw-r--r--sys/netbt/rfcomm_dlc.c9
-rw-r--r--sys/netbt/rfcomm_session.c9
-rw-r--r--sys/netbt/rfcomm_socket.c6
-rw-r--r--sys/netbt/rfcomm_upper.c4
-rw-r--r--sys/netbt/sco.h4
-rw-r--r--sys/netbt/sco_socket.c6
-rw-r--r--sys/netbt/sco_upper.c9
24 files changed, 561 insertions, 437 deletions
diff --git a/sys/dev/bluetooth/bthidev.c b/sys/dev/bluetooth/bthidev.c
index 07dddfa314d..5fba488ab96 100644
--- a/sys/dev/bluetooth/bthidev.c
+++ b/sys/dev/bluetooth/bthidev.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: bthidev.c,v 1.3 2008/10/15 19:12:19 blambert Exp $ */
-/* $NetBSD: bthidev.c,v 1.13 2007/11/12 19:19:32 plunky Exp $ */
+/* $OpenBSD: bthidev.c,v 1.4 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: bthidev.c,v 1.16 2008/08/06 15:01:23 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -88,7 +88,6 @@ struct bthidev_softc {
#define BTHID_WAIT_CTL 1
#define BTHID_WAIT_INT 2
#define BTHID_OPEN 3
-#define BTHID_DETACHING 4
#define BTHID_RETRY_INTERVAL 5 /* seconds between connection attempts */
@@ -177,7 +176,7 @@ bthidev_attach(struct device *parent, struct device *self, void *aux)
struct bthidev *hidev;
struct hid_data *d;
struct hid_item h;
- int maxid, rep, s;
+ int maxid, rep;
/*
* Init softc
@@ -189,6 +188,8 @@ bthidev_attach(struct device *parent, struct device *self, void *aux)
sc->sc_ctlpsm = L2CAP_PSM_HID_CNTL;
sc->sc_intpsm = L2CAP_PSM_HID_INTR;
+ sc->sc_mode = 0;
+
/*
* copy in our configuration info
*/
@@ -284,13 +285,13 @@ bthidev_attach(struct device *parent, struct device *self, void *aux)
/*
* start bluetooth connections
*/
- s = splsoftnet();
+ mutex_enter(&bt_lock);
if ((sc->sc_flags & BTHID_RECONNECT) == 0)
bthidev_listen(sc);
if (sc->sc_flags & BTHID_CONNECTING)
bthidev_connect(sc);
- splx(s);
+ mutex_exit(&bt_lock);
}
int
@@ -298,9 +299,8 @@ bthidev_detach(struct device *self, int flags)
{
struct bthidev_softc *sc = (struct bthidev_softc *)self;
struct bthidev *hidev;
- int s;
- s = splsoftnet();
+ mutex_enter(&bt_lock);
sc->sc_flags = 0; /* disable reconnecting */
/* release interrupt listen */
@@ -330,10 +330,9 @@ bthidev_detach(struct device *self, int flags)
}
/* remove timeout */
- sc->sc_state = BTHID_DETACHING;
timeout_del(&sc->sc_reconnect);
- splx(s);
+ mutex_exit(&bt_lock);
/* detach children */
while ((hidev = LIST_FIRST(&sc->sc_list)) != NULL) {
@@ -393,9 +392,8 @@ void
bthidev_timeout(void *arg)
{
struct bthidev_softc *sc = arg;
- int s;
- s = splsoftnet();
+ mutex_enter(&bt_lock);
switch (sc->sc_state) {
case BTHID_CLOSED:
@@ -426,14 +424,10 @@ bthidev_timeout(void *arg)
case BTHID_OPEN:
break;
- case BTHID_DETACHING:
- wakeup(sc);
- break;
-
default:
break;
}
- splx(s);
+ mutex_exit(&bt_lock);
}
/*
@@ -865,7 +859,7 @@ bthidev_output(struct bthidev *hidev, uint8_t *report, int rlen)
{
struct bthidev_softc *sc = (struct bthidev_softc *)hidev->sc_parent;
struct mbuf *m;
- int s, err;
+ int err;
if (sc == NULL || sc->sc_state != BTHID_OPEN)
return ENOTCONN;
@@ -897,9 +891,9 @@ bthidev_output(struct bthidev *hidev, uint8_t *report, int rlen)
memcpy(mtod(m, uint8_t *) + 2, report, rlen);
m->m_pkthdr.len = m->m_len = rlen + 2;
- s = splsoftnet();
+ mutex_enter(&bt_lock);
err = l2cap_send(sc->sc_int, m);
- splx(s);
+ mutex_exit(&bt_lock);
return err;
}
diff --git a/sys/dev/bluetooth/btkbd.c b/sys/dev/bluetooth/btkbd.c
index 2793c32c1dc..b67459b625d 100644
--- a/sys/dev/bluetooth/btkbd.c
+++ b/sys/dev/bluetooth/btkbd.c
@@ -1,5 +1,35 @@
-/* $OpenBSD: btkbd.c,v 1.3 2008/02/24 21:46:19 uwe Exp $ */
-/* $NetBSD: btkbd.c,v 1.9 2007/11/03 18:24:01 plunky Exp $ */
+/* $OpenBSD: btkbd.c,v 1.4 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: btkbd.c,v 1.10 2008/09/09 03:54:56 cube Exp $ */
+
+/*
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lennart Augustsson (lennart@augustsson.net) at
+ * Carlstedt Research & Technology.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
/*-
* Copyright (c) 2006 Itronix Inc.
diff --git a/sys/dev/bluetooth/btms.c b/sys/dev/bluetooth/btms.c
index 0f02861ff67..7ef3d457809 100644
--- a/sys/dev/bluetooth/btms.c
+++ b/sys/dev/bluetooth/btms.c
@@ -1,5 +1,35 @@
-/* $OpenBSD: btms.c,v 1.3 2008/02/24 21:46:19 uwe Exp $ */
-/* $NetBSD: btms.c,v 1.7 2007/11/03 17:41:03 plunky Exp $ */
+/* $OpenBSD: btms.c,v 1.4 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: btms.c,v 1.8 2008/09/09 03:54:56 cube Exp $ */
+
+/*
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lennart Augustsson (lennart@augustsson.net) at
+ * Carlstedt Research & Technology.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
/*-
* Copyright (c) 2006 Itronix Inc.
diff --git a/sys/dev/usb/ubt.c b/sys/dev/usb/ubt.c
index a929075b84f..3d6f68141ce 100644
--- a/sys/dev/usb/ubt.c
+++ b/sys/dev/usb/ubt.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: ubt.c,v 1.13 2008/07/10 13:48:54 mbalmer Exp $ */
-/* $NetBSD: ubt.c,v 1.30 2007/12/16 19:01:37 christos Exp $ */
+/* $OpenBSD: ubt.c,v 1.14 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: ubt.c,v 1.35 2008/07/28 14:19:26 drochner Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -449,6 +449,7 @@ ubt_attach(struct device *parent, struct device *self, void *aux)
&sc->sc_dev);
sc->sc_ok = 1;
+ /* XXX pmf_device_deregister in NetBSD (power hook) */
}
int
@@ -459,6 +460,8 @@ ubt_detach(struct device *self, int flags)
DPRINTF("sc=%p flags=%d\n", sc, flags);
+ /* XXX pmf_device_deregister in NetBSD (power hook) */
+
sc->sc_dying = 1;
if (!sc->sc_ok)
@@ -718,7 +721,6 @@ ubt_abortdealloc(struct ubt_softc *sc)
*
* Bluetooth Unit/USB callbacks
*
- * All of this will be called at the IPL_ we specified above
*/
int
ubt_enable(struct device *self)
diff --git a/sys/netbt/bluetooth.h b/sys/netbt/bluetooth.h
index 5c0752e16ce..027a08fee09 100644
--- a/sys/netbt/bluetooth.h
+++ b/sys/netbt/bluetooth.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: bluetooth.h,v 1.5 2008/02/24 21:34:48 uwe Exp $ */
-/* $NetBSD: bluetooth.h,v 1.6 2007/09/17 01:23:17 rillig Exp $ */
+/* $OpenBSD: bluetooth.h,v 1.6 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: bluetooth.h,v 1.8 2008/09/08 23:36:55 gmcgarry Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -53,7 +53,7 @@
*/
typedef struct {
uint8_t b[BLUETOOTH_BDADDR_SIZE];
-} __attribute__ ((packed)) bdaddr_t;
+} __packed bdaddr_t;
/*
* bdaddr utility functions
@@ -143,6 +143,25 @@ extern int bluetooth_debug;
# define UNKNOWN(x) ((void)0)
#endif /* BLUETOOTH_DEBUG */
+extern struct mutex bt_lock;
+
+/* XXX NetBSD compatibility goo, abused for debugging */
+#ifdef BLUETOOTH_DEBUG
+#define mutex_enter(mtx) do { \
+ DPRINTFN(1, "mtx_enter(" __STRING(mtx) ") in %d\n", \
+ curproc ? curproc->p_pid : 0); \
+ mtx_enter((mtx)); \
+} while (/*CONSTCOND*/0)
+#define mutex_exit(mtx) do { \
+ DPRINTFN(1, "mtx_leave(" __STRING(mtx) ") in %d\n", \
+ curproc ? curproc->p_pid : 0); \
+ mtx_leave((mtx)); \
+} while (/*CONSTCOND*/0)
+#else
+#define mutex_enter mtx_enter
+#define mutex_exit mtx_leave
+#endif
+
#endif /* _KERNEL */
#endif /* _NETBT_BLUETOOTH_H_ */
diff --git a/sys/netbt/bt_proto.c b/sys/netbt/bt_proto.c
index 5d379e33137..a07f4071053 100644
--- a/sys/netbt/bt_proto.c
+++ b/sys/netbt/bt_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bt_proto.c,v 1.4 2007/06/24 20:55:27 uwe Exp $ */
+/* $OpenBSD: bt_proto.c,v 1.5 2008/11/22 04:42:58 uwe Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -30,6 +30,8 @@
struct domain btdomain;
+void bt_init(void);
+
struct protosw btsw[] = {
{ SOCK_RAW, &btdomain, BTPROTO_HCI,
PR_ATOMIC | PR_ADDR,
@@ -63,8 +65,22 @@ struct protosw btsw[] = {
struct domain btdomain = {
AF_BLUETOOTH, "bluetooth",
- NULL/*init*/, NULL/*externalize*/, NULL/*dispose*/,
+ bt_init, NULL/*externalize*/, NULL/*dispose*/,
btsw, &btsw[sizeof(btsw) / sizeof(btsw[0])], NULL,
NULL/*rtattach*/, 32, sizeof(struct sockaddr_bt),
NULL/*ifattach*/, NULL/*ifdetach*/
};
+
+struct mutex bt_lock;
+
+void
+bt_init(void)
+{
+ /*
+ * In accordance with mutex(9), since hci_intr() uses the
+ * lock, we associate the subsystem lock with IPL_SOFTNET.
+ * For unknown reasons, in NetBSD the interrupt level is
+ * IPL_NONE.
+ */
+ mtx_init(&bt_lock, IPL_SOFTNET);
+}
diff --git a/sys/netbt/hci.h b/sys/netbt/hci.h
index cc12dc5457f..6868fd862c3 100644
--- a/sys/netbt/hci.h
+++ b/sys/netbt/hci.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: hci.h,v 1.11 2008/05/27 19:41:14 thib Exp $ */
-/* $NetBSD: hci.h,v 1.22 2008/02/10 17:40:54 plunky Exp $ */
+/* $OpenBSD: hci.h,v 1.12 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: hci.h,v 1.28 2008/09/08 23:36:55 gmcgarry Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -55,7 +55,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: hci.h,v 1.11 2008/05/27 19:41:14 thib Exp $
+ * $Id: hci.h,v 1.12 2008/11/22 04:42:58 uwe Exp $
* $FreeBSD: src/sys/netgraph/bluetooth/include/ng_hci.h,v 1.6 2005/01/07 01:45:43 imp Exp $
*/
@@ -405,7 +405,7 @@ typedef struct {
uint8_t type; /* MUST be 0x01 */
uint16_t opcode; /* OpCode */
uint8_t length; /* parameter(s) length in bytes */
-} __attribute__ ((__packed__)) hci_cmd_hdr_t;
+} __packed hci_cmd_hdr_t;
#define HCI_CMD_PKT 0x01
#define HCI_CMD_PKT_SIZE (sizeof(hci_cmd_hdr_t) + 0xff)
@@ -415,7 +415,7 @@ typedef struct {
uint8_t type; /* MUST be 0x02 */
uint16_t con_handle; /* connection handle + PB + BC flags */
uint16_t length; /* payload length in bytes */
-} __attribute__ ((__packed__)) hci_acldata_hdr_t;
+} __packed hci_acldata_hdr_t;
#define HCI_ACL_DATA_PKT 0x02
#define HCI_ACL_PKT_SIZE (sizeof(hci_acldata_hdr_t) + 0xffff)
@@ -425,7 +425,7 @@ typedef struct {
uint8_t type; /* MUST be 0x03 */
uint16_t con_handle; /* connection handle + reserved bits */
uint8_t length; /* payload length in bytes */
-} __attribute__ ((__packed__)) hci_scodata_hdr_t;
+} __packed hci_scodata_hdr_t;
#define HCI_SCO_DATA_PKT 0x03
#define HCI_SCO_PKT_SIZE (sizeof(hci_scodata_hdr_t) + 0xff)
@@ -435,7 +435,7 @@ typedef struct {
uint8_t type; /* MUST be 0x04 */
uint8_t event; /* event */
uint8_t length; /* parameter(s) length in bytes */
-} __attribute__ ((__packed__)) hci_event_hdr_t;
+} __packed hci_event_hdr_t;
#define HCI_EVENT_PKT 0x04
#define HCI_EVENT_PKT_SIZE (sizeof(hci_event_hdr_t) + 0xff)
@@ -443,7 +443,7 @@ typedef struct {
/* HCI status return parameter */
typedef struct {
uint8_t status; /* 0x00 - success */
-} __attribute__ ((__packed__)) hci_status_rp;
+} __packed hci_status_rp;
/**************************************************************************
**************************************************************************
@@ -459,7 +459,7 @@ typedef struct {
uint8_t lap[HCI_LAP_SIZE]; /* LAP */
uint8_t inquiry_length; /* (N x 1.28) sec */
uint8_t num_responses; /* Max. # of responses */
-} __attribute__ ((__packed__)) hci_inquiry_cp;
+} __packed hci_inquiry_cp;
/* No return parameter(s) */
#define HCI_OCF_INQUIRY_CANCEL 0x0002
@@ -475,7 +475,7 @@ typedef struct {
uint8_t lap[HCI_LAP_SIZE]; /* LAP */
uint8_t inquiry_length; /* (inquiry_length * 1.28) sec */
uint8_t num_responses; /* Max. # of responses */
-} __attribute__ ((__packed__)) hci_periodic_inquiry_cp;
+} __packed hci_periodic_inquiry_cp;
typedef hci_status_rp hci_periodic_inquiry_rp;
@@ -493,7 +493,7 @@ typedef struct {
uint8_t page_scan_mode; /* reserved - set to 0x00 */
uint16_t clock_offset; /* clock offset */
uint8_t accept_role_switch; /* accept role switch? 0x00 == No */
-} __attribute__ ((__packed__)) hci_create_con_cp;
+} __packed hci_create_con_cp;
/* No return parameter(s) */
#define HCI_OCF_DISCONNECT 0x0006
@@ -501,7 +501,7 @@ typedef struct {
typedef struct {
uint16_t con_handle; /* connection handle */
uint8_t reason; /* reason to disconnect */
-} __attribute__ ((__packed__)) hci_discon_cp;
+} __packed hci_discon_cp;
/* No return parameter(s) */
/* Add SCO Connection is deprecated */
@@ -510,26 +510,26 @@ typedef struct {
typedef struct {
uint16_t con_handle; /* connection handle */
uint16_t pkt_type; /* packet type */
-} __attribute__ ((__packed__)) hci_add_sco_con_cp;
+} __packed hci_add_sco_con_cp;
/* No return parameter(s) */
#define HCI_OCF_CREATE_CON_CANCEL 0x0008
#define HCI_CMD_CREATE_CON_CANCEL 0x0408
typedef struct {
bdaddr_t bdaddr; /* destination address */
-} __attribute__ ((__packed__)) hci_create_con_cancel_cp;
+} __packed hci_create_con_cancel_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* destination address */
-} __attribute__ ((__packed__)) hci_create_con_cancel_rp;
+} __packed hci_create_con_cancel_rp;
#define HCI_OCF_ACCEPT_CON 0x0009
#define HCI_CMD_ACCEPT_CON 0x0409
typedef struct {
bdaddr_t bdaddr; /* address of unit to be connected */
uint8_t role; /* connection role */
-} __attribute__ ((__packed__)) hci_accept_con_cp;
+} __packed hci_accept_con_cp;
/* No return parameter(s) */
#define HCI_OCF_REJECT_CON 0x000a
@@ -537,7 +537,7 @@ typedef struct {
typedef struct {
bdaddr_t bdaddr; /* remote address */
uint8_t reason; /* reason to reject */
-} __attribute__ ((__packed__)) hci_reject_con_cp;
+} __packed hci_reject_con_cp;
/* No return parameter(s) */
#define HCI_OCF_LINK_KEY_REP 0x000b
@@ -545,23 +545,23 @@ typedef struct {
typedef struct {
bdaddr_t bdaddr; /* remote address */
uint8_t key[HCI_KEY_SIZE]; /* key */
-} __attribute__ ((__packed__)) hci_link_key_rep_cp;
+} __packed hci_link_key_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* unit address */
-} __attribute__ ((__packed__)) hci_link_key_rep_rp;
+} __packed hci_link_key_rep_rp;
#define HCI_OCF_LINK_KEY_NEG_REP 0x000c
#define HCI_CMD_LINK_KEY_NEG_REP 0x040C
typedef struct {
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_link_key_neg_rep_cp;
+} __packed hci_link_key_neg_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* unit address */
-} __attribute__ ((__packed__)) hci_link_key_neg_rep_rp;
+} __packed hci_link_key_neg_rep_rp;
#define HCI_OCF_PIN_CODE_REP 0x000d
#define HCI_CMD_PIN_CODE_REP 0x040D
@@ -569,37 +569,37 @@ typedef struct {
bdaddr_t bdaddr; /* remote address */
uint8_t pin_size; /* pin code length (in bytes) */
uint8_t pin[HCI_PIN_SIZE]; /* pin code */
-} __attribute__ ((__packed__)) hci_pin_code_rep_cp;
+} __packed hci_pin_code_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* unit address */
-} __attribute__ ((__packed__)) hci_pin_code_rep_rp;
+} __packed hci_pin_code_rep_rp;
#define HCI_OCF_PIN_CODE_NEG_REP 0x000e
#define HCI_CMD_PIN_CODE_NEG_REP 0x040E
typedef struct {
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_pin_code_neg_rep_cp;
+} __packed hci_pin_code_neg_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* unit address */
-} __attribute__ ((__packed__)) hci_pin_code_neg_rep_rp;
+} __packed hci_pin_code_neg_rep_rp;
#define HCI_OCF_CHANGE_CON_PACKET_TYPE 0x000f
#define HCI_CMD_CHANGE_CON_PACKET_TYPE 0x040F
typedef struct {
uint16_t con_handle; /* connection handle */
uint16_t pkt_type; /* packet type */
-} __attribute__ ((__packed__)) hci_change_con_pkt_type_cp;
+} __packed hci_change_con_pkt_type_cp;
/* No return parameter(s) */
#define HCI_OCF_AUTH_REQ 0x0011
#define HCI_CMD_AUTH_REQ 0x0411
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_auth_req_cp;
+} __packed hci_auth_req_cp;
/* No return parameter(s) */
#define HCI_OCF_SET_CON_ENCRYPTION 0x0013
@@ -607,21 +607,21 @@ typedef struct {
typedef struct {
uint16_t con_handle; /* connection handle */
uint8_t encryption_enable; /* 0x00 - disable, 0x01 - enable */
-} __attribute__ ((__packed__)) hci_set_con_encryption_cp;
+} __packed hci_set_con_encryption_cp;
/* No return parameter(s) */
#define HCI_OCF_CHANGE_CON_LINK_KEY 0x0015
#define HCI_CMD_CHANGE_CON_LINK_KEY 0x0415
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_change_con_link_key_cp;
+} __packed hci_change_con_link_key_cp;
/* No return parameter(s) */
#define HCI_OCF_MASTER_LINK_KEY 0x0017
#define HCI_CMD_MASTER_LINK_KEY 0x0417
typedef struct {
uint8_t key_flag; /* key flag */
-} __attribute__ ((__packed__)) hci_master_link_key_cp;
+} __packed hci_master_link_key_cp;
/* No return parameter(s) */
#define HCI_OCF_REMOTE_NAME_REQ 0x0019
@@ -631,25 +631,25 @@ typedef struct {
uint8_t page_scan_rep_mode; /* page scan repetition mode */
uint8_t page_scan_mode; /* page scan mode */
uint16_t clock_offset; /* clock offset */
-} __attribute__ ((__packed__)) hci_remote_name_req_cp;
+} __packed hci_remote_name_req_cp;
/* No return parameter(s) */
#define HCI_OCF_REMOTE_NAME_REQ_CANCEL 0x001a
#define HCI_CMD_REMOTE_NAME_REQ_CANCEL 0x041A
typedef struct {
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_remote_name_req_cancel_cp;
+} __packed hci_remote_name_req_cancel_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_remote_name_req_cancel_rp;
+} __packed hci_remote_name_req_cancel_rp;
#define HCI_OCF_READ_REMOTE_FEATURES 0x001b
#define HCI_CMD_READ_REMOTE_FEATURES 0x041B
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_remote_features_cp;
+} __packed hci_read_remote_features_cp;
/* No return parameter(s) */
#define HCI_OCF_READ_REMOTE_EXTENDED_FEATURES 0x001c
@@ -657,35 +657,35 @@ typedef struct {
typedef struct {
uint16_t con_handle; /* connection handle */
uint8_t page; /* page number */
-} __attribute__ ((__packed__)) hci_read_remote_extended_features_cp;
+} __packed hci_read_remote_extended_features_cp;
/* No return parameter(s) */
#define HCI_OCF_READ_REMOTE_VER_INFO 0x001d
#define HCI_CMD_READ_REMOTE_VER_INFO 0x041D
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_remote_ver_info_cp;
+} __packed hci_read_remote_ver_info_cp;
/* No return parameter(s) */
#define HCI_OCF_READ_CLOCK_OFFSET 0x001f
#define HCI_CMD_READ_CLOCK_OFFSET 0x041F
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_clock_offset_cp;
+} __packed hci_read_clock_offset_cp;
/* No return parameter(s) */
#define HCI_OCF_READ_LMP_HANDLE 0x0020
#define HCI_CMD_READ_LMP_HANDLE 0x0420
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_lmp_handle_cp;
+} __packed hci_read_lmp_handle_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint8_t lmp_handle; /* LMP handle */
uint32_t reserved; /* reserved */
-} __attribute__ ((__packed__)) hci_read_lmp_handle_rp;
+} __packed hci_read_lmp_handle_rp;
#define HCI_OCF_SETUP_SCO_CON 0x0028
#define HCI_CMD_SETUP_SCO_CON 0x0428
@@ -697,7 +697,7 @@ typedef struct {
uint16_t voice; /* voice setting */
uint8_t rt_effort; /* retransmission effort */
uint16_t pkt_type; /* packet types */
-} __attribute__ ((__packed__)) hci_setup_sco_con_cp;
+} __packed hci_setup_sco_con_cp;
/* No return parameter(s) */
#define HCI_OCF_ACCEPT_SCO_CON_REQ 0x0029
@@ -710,7 +710,7 @@ typedef struct {
uint16_t content; /* voice setting */
uint8_t rt_effort; /* retransmission effort */
uint16_t pkt_type; /* packet types */
-} __attribute__ ((__packed__)) hci_accept_sco_con_req_cp;
+} __packed hci_accept_sco_con_req_cp;
/* No return parameter(s) */
#define HCI_OCF_REJECT_SCO_CON_REQ 0x002a
@@ -718,7 +718,7 @@ typedef struct {
typedef struct {
bdaddr_t bdaddr; /* remote address */
uint8_t reason; /* reject error code */
-} __attribute__ ((__packed__)) hci_reject_sco_con_req_cp;
+} __packed hci_reject_sco_con_req_cp;
/* No return parameter(s) */
#define HCI_OCF_IO_CAPABILITY_REP 0x002b
@@ -728,57 +728,57 @@ typedef struct {
uint8_t io_cap; /* IO capability */
uint8_t oob_data; /* OOB data present */
uint8_t auth_req; /* auth requirements */
-} __attribute__ ((__packed__)) hci_io_capability_rep_cp;
+} __packed hci_io_capability_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_io_capability_rep_rp;
+} __packed hci_io_capability_rep_rp;
#define HCI_OCF_USER_CONFIRM_REP 0x002c
#define HCI_CMD_USER_CONFIRM_REP 0x042c
typedef struct {
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_user_confirm_rep_cp;
+} __packed hci_user_confirm_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_user_confirm_rep_rp;
+} __packed hci_user_confirm_rep_rp;
#define HCI_OCF_USER_CONFIRM_NEG_REP 0x002d
#define HCI_CMD_USER_CONFIRM_NEG_REP 0x042d
typedef struct {
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_user_confirm_neg_rep_cp;
+} __packed hci_user_confirm_neg_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_user_confirm_neg_rep_rp;
+} __packed hci_user_confirm_neg_rep_rp;
#define HCI_OCF_USER_PASSKEY_REP 0x002e
#define HCI_CMD_USER_PASSKEY_REP 0x042e
typedef struct {
bdaddr_t bdaddr; /* remote address */
uint32_t value; /* 000000 - 999999 */
-} __attribute__ ((__packed__)) hci_user_passkey_rep_cp;
+} __packed hci_user_passkey_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_user_passkey_rep_rp;
+} __packed hci_user_passkey_rep_rp;
#define HCI_OCF_USER_PASSKEY_NEG_REP 0x002f
#define HCI_CMD_USER_PASSKEY_NEG_REP 0x042f
typedef struct {
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_user_passkey_neg_rep_cp;
+} __packed hci_user_passkey_neg_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_user_passkey_neg_rep_rp;
+} __packed hci_user_passkey_neg_rep_rp;
#define HCI_OCF_OOB_DATA_REP 0x0030
#define HCI_CMD_OOB_DATA_REP 0x0430
@@ -786,35 +786,35 @@ typedef struct {
bdaddr_t bdaddr; /* remote address */
uint8_t c[16]; /* pairing hash */
uint8_t r[16]; /* pairing randomizer */
-} __attribute__ ((__packed__)) hci_user_oob_data_rep_cp;
+} __packed hci_user_oob_data_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_user_oob_data_rep_rp;
+} __packed hci_user_oob_data_rep_rp;
#define HCI_OCF_OOB_DATA_NEG_REP 0x0033
#define HCI_CMD_OOB_DATA_NEG_REP 0x0433
typedef struct {
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_user_oob_data_neg_rep_cp;
+} __packed hci_user_oob_data_neg_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_user_oob_data_neg_rep_rp;
+} __packed hci_user_oob_data_neg_rep_rp;
#define HCI_OCF_IO_CAPABILITY_NEG_REP 0x0034
#define HCI_CMD_IO_CAPABILITY_NEG_REP 0x0434
typedef struct {
bdaddr_t bdaddr; /* remote address */
uint8_t reason; /* error code */
-} __attribute__ ((__packed__)) hci_io_capability_neg_rep_cp;
+} __packed hci_io_capability_neg_rep_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_io_capability_neg_rep_rp;
+} __packed hci_io_capability_neg_rep_rp;
/**************************************************************************
**************************************************************************
@@ -830,7 +830,7 @@ typedef struct {
uint16_t con_handle; /* connection handle */
uint16_t max_interval; /* (max_interval * 0.625) msec */
uint16_t min_interval; /* (max_interval * 0.625) msec */
-} __attribute__ ((__packed__)) hci_hold_mode_cp;
+} __packed hci_hold_mode_cp;
/* No return parameter(s) */
#define HCI_OCF_SNIFF_MODE 0x0003
@@ -841,14 +841,14 @@ typedef struct {
uint16_t min_interval; /* (max_interval * 0.625) msec */
uint16_t attempt; /* (2 * attempt - 1) * 0.625 msec */
uint16_t timeout; /* (2 * attempt - 1) * 0.625 msec */
-} __attribute__ ((__packed__)) hci_sniff_mode_cp;
+} __packed hci_sniff_mode_cp;
/* No return parameter(s) */
#define HCI_OCF_EXIT_SNIFF_MODE 0x0004
#define HCI_CMD_EXIT_SNIFF_MODE 0x0804
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_exit_sniff_mode_cp;
+} __packed hci_exit_sniff_mode_cp;
/* No return parameter(s) */
#define HCI_OCF_PARK_MODE 0x0005
@@ -857,14 +857,14 @@ typedef struct {
uint16_t con_handle; /* connection handle */
uint16_t max_interval; /* (max_interval * 0.625) msec */
uint16_t min_interval; /* (max_interval * 0.625) msec */
-} __attribute__ ((__packed__)) hci_park_mode_cp;
+} __packed hci_park_mode_cp;
/* No return parameter(s) */
#define HCI_OCF_EXIT_PARK_MODE 0x0006
#define HCI_CMD_EXIT_PARK_MODE 0x0806
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_exit_park_mode_cp;
+} __packed hci_exit_park_mode_cp;
/* No return parameter(s) */
#define HCI_OCF_QOS_SETUP 0x0007
@@ -877,52 +877,52 @@ typedef struct {
uint32_t peak_bandwidth; /* bytes per second */
uint32_t latency; /* microseconds */
uint32_t delay_variation; /* microseconds */
-} __attribute__ ((__packed__)) hci_qos_setup_cp;
+} __packed hci_qos_setup_cp;
/* No return parameter(s) */
#define HCI_OCF_ROLE_DISCOVERY 0x0009
#define HCI_CMD_ROLE_DISCOVERY 0x0809
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_role_discovery_cp;
+} __packed hci_role_discovery_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint8_t role; /* role for the connection handle */
-} __attribute__ ((__packed__)) hci_role_discovery_rp;
+} __packed hci_role_discovery_rp;
#define HCI_OCF_SWITCH_ROLE 0x000b
#define HCI_CMD_SWITCH_ROLE 0x080B
typedef struct {
bdaddr_t bdaddr; /* remote address */
uint8_t role; /* new local role */
-} __attribute__ ((__packed__)) hci_switch_role_cp;
+} __packed hci_switch_role_cp;
/* No return parameter(s) */
#define HCI_OCF_READ_LINK_POLICY_SETTINGS 0x000c
#define HCI_CMD_READ_LINK_POLICY_SETTINGS 0x080C
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_link_policy_settings_cp;
+} __packed hci_read_link_policy_settings_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint16_t settings; /* link policy settings */
-} __attribute__ ((__packed__)) hci_read_link_policy_settings_rp;
+} __packed hci_read_link_policy_settings_rp;
#define HCI_OCF_WRITE_LINK_POLICY_SETTINGS 0x000d
#define HCI_CMD_WRITE_LINK_POLICY_SETTINGS 0x080D
typedef struct {
uint16_t con_handle; /* connection handle */
uint16_t settings; /* link policy settings */
-} __attribute__ ((__packed__)) hci_write_link_policy_settings_cp;
+} __packed hci_write_link_policy_settings_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_write_link_policy_settings_rp;
+} __packed hci_write_link_policy_settings_rp;
#define HCI_OCF_READ_DEFAULT_LINK_POLICY_SETTINGS 0x000e
#define HCI_CMD_READ_DEFAULT_LINK_POLICY_SETTINGS 0x080E
@@ -930,13 +930,13 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t settings; /* link policy settings */
-} __attribute__ ((__packed__)) hci_read_default_link_policy_settings_rp;
+} __packed hci_read_default_link_policy_settings_rp;
#define HCI_OCF_WRITE_DEFAULT_LINK_POLICY_SETTINGS 0x000f
#define HCI_CMD_WRITE_DEFAULT_LINK_POLICY_SETTINGS 0x080F
typedef struct {
uint16_t settings; /* link policy settings */
-} __attribute__ ((__packed__)) hci_write_default_link_policy_settings_cp;
+} __packed hci_write_default_link_policy_settings_cp;
typedef hci_status_rp hci_write_default_link_policy_settings_rp;
@@ -951,7 +951,7 @@ typedef struct {
uint32_t token_bucket;
uint32_t peak_bandwidth;
uint32_t latency;
-} __attribute__ ((__packed__)) hci_flow_specification_cp;
+} __packed hci_flow_specification_cp;
/* No return parameter(s) */
#define HCI_OCF_SNIFF_SUBRATING 0x0011
@@ -961,12 +961,12 @@ typedef struct {
uint16_t max_latency;
uint16_t max_timeout; /* max remote timeout */
uint16_t min_timeout; /* min local timeout */
-} __attribute__ ((__packed__)) hci_sniff_subrating_cp;
+} __packed hci_sniff_subrating_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_sniff_subrating_rp;
+} __packed hci_sniff_subrating_rp;
/**************************************************************************
**************************************************************************
@@ -980,7 +980,7 @@ typedef struct {
#define HCI_CMD_SET_EVENT_MASK 0x0C01
typedef struct {
uint8_t event_mask[HCI_EVENT_MASK_SIZE]; /* event_mask */
-} __attribute__ ((__packed__)) hci_set_event_mask_cp;
+} __packed hci_set_event_mask_cp;
typedef hci_status_rp hci_set_event_mask_rp;
@@ -996,7 +996,7 @@ typedef struct {
uint8_t filter_condition_type; /* filter condition type */
/* variable size condition
uint8_t condition[]; -- conditions */
-} __attribute__ ((__packed__)) hci_set_event_filter_cp;
+} __packed hci_set_event_filter_cp;
typedef hci_status_rp hci_set_event_filter_rp;
@@ -1004,12 +1004,12 @@ typedef hci_status_rp hci_set_event_filter_rp;
#define HCI_CMD_FLUSH 0x0C08
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_flush_cp;
+} __packed hci_flush_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_flush_rp;
+} __packed hci_flush_rp;
#define HCI_OCF_READ_PIN_TYPE 0x0009
#define HCI_CMD_READ_PIN_TYPE 0x0C09
@@ -1017,13 +1017,13 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t pin_type; /* PIN type */
-} __attribute__ ((__packed__)) hci_read_pin_type_rp;
+} __packed hci_read_pin_type_rp;
#define HCI_OCF_WRITE_PIN_TYPE 0x000a
#define HCI_CMD_WRITE_PIN_TYPE 0x0C0A
typedef struct {
uint8_t pin_type; /* PIN type */
-} __attribute__ ((__packed__)) hci_write_pin_type_cp;
+} __packed hci_write_pin_type_cp;
typedef hci_status_rp hci_write_pin_type_rp;
@@ -1037,13 +1037,13 @@ typedef hci_status_rp hci_create_new_unit_key_rp;
typedef struct {
bdaddr_t bdaddr; /* address */
uint8_t read_all; /* read all keys? 0x01 - yes */
-} __attribute__ ((__packed__)) hci_read_stored_link_key_cp;
+} __packed hci_read_stored_link_key_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t max_num_keys; /* Max. number of keys */
uint16_t num_keys_read; /* Number of stored keys */
-} __attribute__ ((__packed__)) hci_read_stored_link_key_rp;
+} __packed hci_read_stored_link_key_rp;
#define HCI_OCF_WRITE_STORED_LINK_KEY 0x0011
#define HCI_CMD_WRITE_STORED_LINK_KEY 0x0C11
@@ -1052,30 +1052,30 @@ typedef struct {
/* these are repeated "num_keys_write" times
bdaddr_t bdaddr; --- remote address(es)
uint8_t key[HCI_KEY_SIZE]; --- key(s) */
-} __attribute__ ((__packed__)) hci_write_stored_link_key_cp;
+} __packed hci_write_stored_link_key_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t num_keys_written; /* # of keys successfully written */
-} __attribute__ ((__packed__)) hci_write_stored_link_key_rp;
+} __packed hci_write_stored_link_key_rp;
#define HCI_OCF_DELETE_STORED_LINK_KEY 0x0012
#define HCI_CMD_DELETE_STORED_LINK_KEY 0x0C12
typedef struct {
bdaddr_t bdaddr; /* address */
uint8_t delete_all; /* delete all keys? 0x01 - yes */
-} __attribute__ ((__packed__)) hci_delete_stored_link_key_cp;
+} __packed hci_delete_stored_link_key_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t num_keys_deleted; /* Number of keys deleted */
-} __attribute__ ((__packed__)) hci_delete_stored_link_key_rp;
+} __packed hci_delete_stored_link_key_rp;
#define HCI_OCF_WRITE_LOCAL_NAME 0x0013
#define HCI_CMD_WRITE_LOCAL_NAME 0x0C13
typedef struct {
char name[HCI_UNIT_NAME_SIZE]; /* new unit name */
-} __attribute__ ((__packed__)) hci_write_local_name_cp;
+} __packed hci_write_local_name_cp;
typedef hci_status_rp hci_write_local_name_rp;
@@ -1085,7 +1085,7 @@ typedef hci_status_rp hci_write_local_name_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
char name[HCI_UNIT_NAME_SIZE]; /* unit name */
-} __attribute__ ((__packed__)) hci_read_local_name_rp;
+} __packed hci_read_local_name_rp;
#define HCI_OCF_READ_CON_ACCEPT_TIMEOUT 0x0015
#define HCI_CMD_READ_CON_ACCEPT_TIMEOUT 0x0C15
@@ -1093,13 +1093,13 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t timeout; /* (timeout * 0.625) msec */
-} __attribute__ ((__packed__)) hci_read_con_accept_timeout_rp;
+} __packed hci_read_con_accept_timeout_rp;
#define HCI_OCF_WRITE_CON_ACCEPT_TIMEOUT 0x0016
#define HCI_CMD_WRITE_CON_ACCEPT_TIMEOUT 0x0C16
typedef struct {
uint16_t timeout; /* (timeout * 0.625) msec */
-} __attribute__ ((__packed__)) hci_write_con_accept_timeout_cp;
+} __packed hci_write_con_accept_timeout_cp;
typedef hci_status_rp hci_write_con_accept_timeout_rp;
@@ -1109,13 +1109,13 @@ typedef hci_status_rp hci_write_con_accept_timeout_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t timeout; /* (timeout * 0.625) msec */
-} __attribute__ ((__packed__)) hci_read_page_timeout_rp;
+} __packed hci_read_page_timeout_rp;
#define HCI_OCF_WRITE_PAGE_TIMEOUT 0x0018
#define HCI_CMD_WRITE_PAGE_TIMEOUT 0x0C18
typedef struct {
uint16_t timeout; /* (timeout * 0.625) msec */
-} __attribute__ ((__packed__)) hci_write_page_timeout_cp;
+} __packed hci_write_page_timeout_cp;
typedef hci_status_rp hci_write_page_timeout_rp;
@@ -1125,13 +1125,13 @@ typedef hci_status_rp hci_write_page_timeout_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t scan_enable; /* Scan enable */
-} __attribute__ ((__packed__)) hci_read_scan_enable_rp;
+} __packed hci_read_scan_enable_rp;
#define HCI_OCF_WRITE_SCAN_ENABLE 0x001a
#define HCI_CMD_WRITE_SCAN_ENABLE 0x0C1A
typedef struct {
uint8_t scan_enable; /* Scan enable */
-} __attribute__ ((__packed__)) hci_write_scan_enable_cp;
+} __packed hci_write_scan_enable_cp;
typedef hci_status_rp hci_write_scan_enable_rp;
@@ -1142,14 +1142,14 @@ typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t page_scan_interval; /* interval * 0.625 msec */
uint16_t page_scan_window; /* window * 0.625 msec */
-} __attribute__ ((__packed__)) hci_read_page_scan_activity_rp;
+} __packed hci_read_page_scan_activity_rp;
#define HCI_OCF_WRITE_PAGE_SCAN_ACTIVITY 0x001c
#define HCI_CMD_WRITE_PAGE_SCAN_ACTIVITY 0x0C1C
typedef struct {
uint16_t page_scan_interval; /* interval * 0.625 msec */
uint16_t page_scan_window; /* window * 0.625 msec */
-} __attribute__ ((__packed__)) hci_write_page_scan_activity_cp;
+} __packed hci_write_page_scan_activity_cp;
typedef hci_status_rp hci_write_page_scan_activity_rp;
@@ -1160,14 +1160,14 @@ typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t inquiry_scan_interval; /* interval * 0.625 msec */
uint16_t inquiry_scan_window; /* window * 0.625 msec */
-} __attribute__ ((__packed__)) hci_read_inquiry_scan_activity_rp;
+} __packed hci_read_inquiry_scan_activity_rp;
#define HCI_OCF_WRITE_INQUIRY_SCAN_ACTIVITY 0x001e
#define HCI_CMD_WRITE_INQUIRY_SCAN_ACTIVITY 0x0C1E
typedef struct {
uint16_t inquiry_scan_interval; /* interval * 0.625 msec */
uint16_t inquiry_scan_window; /* window * 0.625 msec */
-} __attribute__ ((__packed__)) hci_write_inquiry_scan_activity_cp;
+} __packed hci_write_inquiry_scan_activity_cp;
typedef hci_status_rp hci_write_inquiry_scan_activity_rp;
@@ -1177,13 +1177,13 @@ typedef hci_status_rp hci_write_inquiry_scan_activity_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t auth_enable; /* 0x01 - enabled */
-} __attribute__ ((__packed__)) hci_read_auth_enable_rp;
+} __packed hci_read_auth_enable_rp;
#define HCI_OCF_WRITE_AUTH_ENABLE 0x0020
#define HCI_CMD_WRITE_AUTH_ENABLE 0x0C20
typedef struct {
uint8_t auth_enable; /* 0x01 - enabled */
-} __attribute__ ((__packed__)) hci_write_auth_enable_cp;
+} __packed hci_write_auth_enable_cp;
typedef hci_status_rp hci_write_auth_enable_rp;
@@ -1194,14 +1194,14 @@ typedef hci_status_rp hci_write_auth_enable_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t encryption_mode; /* encryption mode */
-} __attribute__ ((__packed__)) hci_read_encryption_mode_rp;
+} __packed hci_read_encryption_mode_rp;
/* Write Encryption Mode is deprecated */
#define HCI_OCF_WRITE_ENCRYPTION_MODE 0x0022
#define HCI_CMD_WRITE_ENCRYPTION_MODE 0x0C22
typedef struct {
uint8_t encryption_mode; /* encryption mode */
-} __attribute__ ((__packed__)) hci_write_encryption_mode_cp;
+} __packed hci_write_encryption_mode_cp;
typedef hci_status_rp hci_write_encryption_mode_rp;
@@ -1211,13 +1211,13 @@ typedef hci_status_rp hci_write_encryption_mode_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t uclass[HCI_CLASS_SIZE]; /* unit class */
-} __attribute__ ((__packed__)) hci_read_unit_class_rp;
+} __packed hci_read_unit_class_rp;
#define HCI_OCF_WRITE_UNIT_CLASS 0x0024
#define HCI_CMD_WRITE_UNIT_CLASS 0x0C24
typedef struct {
uint8_t uclass[HCI_CLASS_SIZE]; /* unit class */
-} __attribute__ ((__packed__)) hci_write_unit_class_cp;
+} __packed hci_write_unit_class_cp;
typedef hci_status_rp hci_write_unit_class_rp;
@@ -1227,13 +1227,13 @@ typedef hci_status_rp hci_write_unit_class_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t settings; /* voice settings */
-} __attribute__ ((__packed__)) hci_read_voice_setting_rp;
+} __packed hci_read_voice_setting_rp;
#define HCI_OCF_WRITE_VOICE_SETTING 0x0026
#define HCI_CMD_WRITE_VOICE_SETTING 0x0C26
typedef struct {
uint16_t settings; /* voice settings */
-} __attribute__ ((__packed__)) hci_write_voice_setting_cp;
+} __packed hci_write_voice_setting_cp;
typedef hci_status_rp hci_write_voice_setting_rp;
@@ -1241,25 +1241,25 @@ typedef hci_status_rp hci_write_voice_setting_rp;
#define HCI_CMD_READ_AUTO_FLUSH_TIMEOUT 0x0C27
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_auto_flush_timeout_cp;
+} __packed hci_read_auto_flush_timeout_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint16_t timeout; /* 0x00 - no flush, timeout * 0.625 msec */
-} __attribute__ ((__packed__)) hci_read_auto_flush_timeout_rp;
+} __packed hci_read_auto_flush_timeout_rp;
#define HCI_OCF_WRITE_AUTO_FLUSH_TIMEOUT 0x0028
#define HCI_CMD_WRITE_AUTO_FLUSH_TIMEOUT 0x0C28
typedef struct {
uint16_t con_handle; /* connection handle */
uint16_t timeout; /* 0x00 - no flush, timeout * 0.625 msec */
-} __attribute__ ((__packed__)) hci_write_auto_flush_timeout_cp;
+} __packed hci_write_auto_flush_timeout_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_write_auto_flush_timeout_rp;
+} __packed hci_write_auto_flush_timeout_rp;
#define HCI_OCF_READ_NUM_BROADCAST_RETRANS 0x0029
#define HCI_CMD_READ_NUM_BROADCAST_RETRANS 0x0C29
@@ -1267,13 +1267,13 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t counter; /* number of broadcast retransmissions */
-} __attribute__ ((__packed__)) hci_read_num_broadcast_retrans_rp;
+} __packed hci_read_num_broadcast_retrans_rp;
#define HCI_OCF_WRITE_NUM_BROADCAST_RETRANS 0x002a
#define HCI_CMD_WRITE_NUM_BROADCAST_RETRANS 0x0C2A
typedef struct {
uint8_t counter; /* number of broadcast retransmissions */
-} __attribute__ ((__packed__)) hci_write_num_broadcast_retrans_cp;
+} __packed hci_write_num_broadcast_retrans_cp;
typedef hci_status_rp hci_write_num_broadcast_retrans_rp;
@@ -1283,13 +1283,13 @@ typedef hci_status_rp hci_write_num_broadcast_retrans_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t hold_mode_activity; /* Hold mode activities */
-} __attribute__ ((__packed__)) hci_read_hold_mode_activity_rp;
+} __packed hci_read_hold_mode_activity_rp;
#define HCI_OCF_WRITE_HOLD_MODE_ACTIVITY 0x002c
#define HCI_CMD_WRITE_HOLD_MODE_ACTIVITY 0x0C2C
typedef struct {
uint8_t hold_mode_activity; /* Hold mode activities */
-} __attribute__ ((__packed__)) hci_write_hold_mode_activity_cp;
+} __packed hci_write_hold_mode_activity_cp;
typedef hci_status_rp hci_write_hold_mode_activity_rp;
@@ -1298,13 +1298,13 @@ typedef hci_status_rp hci_write_hold_mode_activity_rp;
typedef struct {
uint16_t con_handle; /* connection handle */
uint8_t type; /* Xmit level type */
-} __attribute__ ((__packed__)) hci_read_xmit_level_cp;
+} __packed hci_read_xmit_level_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
char level; /* -30 <= level <= 30 dBm */
-} __attribute__ ((__packed__)) hci_read_xmit_level_rp;
+} __packed hci_read_xmit_level_rp;
#define HCI_OCF_READ_SCO_FLOW_CONTROL 0x002e
#define HCI_CMD_READ_SCO_FLOW_CONTROL 0x0C2E
@@ -1312,13 +1312,13 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t flow_control; /* 0x00 - disabled */
-} __attribute__ ((__packed__)) hci_read_sco_flow_control_rp;
+} __packed hci_read_sco_flow_control_rp;
#define HCI_OCF_WRITE_SCO_FLOW_CONTROL 0x002f
#define HCI_CMD_WRITE_SCO_FLOW_CONTROL 0x0C2F
typedef struct {
uint8_t flow_control; /* 0x00 - disabled */
-} __attribute__ ((__packed__)) hci_write_sco_flow_control_cp;
+} __packed hci_write_sco_flow_control_cp;
typedef hci_status_rp hci_write_sco_flow_control_rp;
@@ -1326,7 +1326,7 @@ typedef hci_status_rp hci_write_sco_flow_control_rp;
#define HCI_CMD_HC2H_FLOW_CONTROL 0x0C31
typedef struct {
uint8_t hc2h_flow; /* Host Controller to Host flow control */
-} __attribute__ ((__packed__)) hci_hc2h_flow_control_cp;
+} __packed hci_hc2h_flow_control_cp;
typedef hci_status_rp hci_h2hc_flow_control_rp;
@@ -1337,7 +1337,7 @@ typedef struct {
uint8_t max_sco_size; /* Max. size of SCO packet (bytes) */
uint16_t num_acl_pkts; /* Max. number of ACL packets */
uint16_t num_sco_pkts; /* Max. number of SCO packets */
-} __attribute__ ((__packed__)) hci_host_buffer_size_cp;
+} __packed hci_host_buffer_size_cp;
typedef hci_status_rp hci_host_buffer_size_rp;
@@ -1348,32 +1348,32 @@ typedef struct {
/* these are repeated "num_con_handles" times
uint16_t con_handle; --- connection handle(s)
uint16_t compl_pkts; --- # of completed packets */
-} __attribute__ ((__packed__)) hci_host_num_compl_pkts_cp;
+} __packed hci_host_num_compl_pkts_cp;
/* No return parameter(s) */
#define HCI_OCF_READ_LINK_SUPERVISION_TIMEOUT 0x0036
#define HCI_CMD_READ_LINK_SUPERVISION_TIMEOUT 0x0C36
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_link_supervision_timeout_cp;
+} __packed hci_read_link_supervision_timeout_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint16_t timeout; /* Link supervision timeout * 0.625 msec */
-} __attribute__ ((__packed__)) hci_read_link_supervision_timeout_rp;
+} __packed hci_read_link_supervision_timeout_rp;
#define HCI_OCF_WRITE_LINK_SUPERVISION_TIMEOUT 0x0037
#define HCI_CMD_WRITE_LINK_SUPERVISION_TIMEOUT 0x0C37
typedef struct {
uint16_t con_handle; /* connection handle */
uint16_t timeout; /* Link supervision timeout * 0.625 msec */
-} __attribute__ ((__packed__)) hci_write_link_supervision_timeout_cp;
+} __packed hci_write_link_supervision_timeout_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_write_link_supervision_timeout_rp;
+} __packed hci_write_link_supervision_timeout_rp;
#define HCI_OCF_READ_NUM_SUPPORTED_IAC 0x0038
#define HCI_CMD_READ_NUM_SUPPORTED_IAC 0x0C38
@@ -1381,7 +1381,7 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t num_iac; /* # of supported IAC during scan */
-} __attribute__ ((__packed__)) hci_read_num_supported_iac_rp;
+} __packed hci_read_num_supported_iac_rp;
#define HCI_OCF_READ_IAC_LAP 0x0039
#define HCI_CMD_READ_IAC_LAP 0x0C39
@@ -1391,7 +1391,7 @@ typedef struct {
uint8_t num_iac; /* # of IAC */
/* these are repeated "num_iac" times
uint8_t laps[HCI_LAP_SIZE]; --- LAPs */
-} __attribute__ ((__packed__)) hci_read_iac_lap_rp;
+} __packed hci_read_iac_lap_rp;
#define HCI_OCF_WRITE_IAC_LAP 0x003a
#define HCI_CMD_WRITE_IAC_LAP 0x0C3A
@@ -1399,7 +1399,7 @@ typedef struct {
uint8_t num_iac; /* # of IAC */
/* these are repeated "num_iac" times
uint8_t laps[HCI_LAP_SIZE]; --- LAPs */
-} __attribute__ ((__packed__)) hci_write_iac_lap_cp;
+} __packed hci_write_iac_lap_cp;
typedef hci_status_rp hci_write_iac_lap_rp;
@@ -1410,14 +1410,14 @@ typedef hci_status_rp hci_write_iac_lap_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t page_scan_period_mode; /* Page scan period mode */
-} __attribute__ ((__packed__)) hci_read_page_scan_period_rp;
+} __packed hci_read_page_scan_period_rp;
/* Write Page Scan Period Mode is deprecated */
#define HCI_OCF_WRITE_PAGE_SCAN_PERIOD 0x003c
#define HCI_CMD_WRITE_PAGE_SCAN_PERIOD 0x0C3C
typedef struct {
uint8_t page_scan_period_mode; /* Page scan period mode */
-} __attribute__ ((__packed__)) hci_write_page_scan_period_cp;
+} __packed hci_write_page_scan_period_cp;
typedef hci_status_rp hci_write_page_scan_period_rp;
@@ -1428,14 +1428,14 @@ typedef hci_status_rp hci_write_page_scan_period_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t page_scan_mode; /* Page scan mode */
-} __attribute__ ((__packed__)) hci_read_page_scan_rp;
+} __packed hci_read_page_scan_rp;
/* Write Page Scan Mode is deprecated */
#define HCI_OCF_WRITE_PAGE_SCAN 0x003e
#define HCI_CMD_WRITE_PAGE_SCAN 0x0C3E
typedef struct {
uint8_t page_scan_mode; /* Page scan mode */
-} __attribute__ ((__packed__)) hci_write_page_scan_cp;
+} __packed hci_write_page_scan_cp;
typedef hci_status_rp hci_write_page_scan_rp;
@@ -1443,7 +1443,7 @@ typedef hci_status_rp hci_write_page_scan_rp;
#define HCI_CMD_SET_AFH_CLASSIFICATION 0x0C3F
typedef struct {
uint8_t classification[10];
-} __attribute__ ((__packed__)) hci_set_afh_classification_cp;
+} __packed hci_set_afh_classification_cp;
typedef hci_status_rp hci_set_afh_classification_rp;
@@ -1454,13 +1454,13 @@ typedef hci_status_rp hci_set_afh_classification_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t type; /* inquiry scan type */
-} __attribute__ ((__packed__)) hci_read_inquiry_scan_type_rp;
+} __packed hci_read_inquiry_scan_type_rp;
#define HCI_OCF_WRITE_INQUIRY_SCAN_TYPE 0x0043
#define HCI_CMD_WRITE_INQUIRY_SCAN_TYPE 0x0C43
typedef struct {
uint8_t type; /* inquiry scan type */
-} __attribute__ ((__packed__)) hci_write_inquiry_scan_type_cp;
+} __packed hci_write_inquiry_scan_type_cp;
typedef hci_status_rp hci_write_inquiry_scan_type_rp;
@@ -1471,13 +1471,13 @@ typedef hci_status_rp hci_write_inquiry_scan_type_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t mode; /* inquiry mode */
-} __attribute__ ((__packed__)) hci_read_inquiry_mode_rp;
+} __packed hci_read_inquiry_mode_rp;
#define HCI_OCF_WRITE_INQUIRY_MODE 0x0045
#define HCI_CMD_WRITE_INQUIRY_MODE 0x0C45
typedef struct {
uint8_t mode; /* inquiry mode */
-} __attribute__ ((__packed__)) hci_write_inquiry_mode_cp;
+} __packed hci_write_inquiry_mode_cp;
typedef hci_status_rp hci_write_inquiry_mode_rp;
@@ -1488,13 +1488,13 @@ typedef hci_status_rp hci_write_inquiry_mode_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t type; /* page scan type */
-} __attribute__ ((__packed__)) hci_read_page_scan_type_rp;
+} __packed hci_read_page_scan_type_rp;
#define HCI_OCF_WRITE_PAGE_SCAN_TYPE 0x0047
#define HCI_CMD_WRITE_PAGE_SCAN_TYPE 0x0C47
typedef struct {
uint8_t type; /* page scan type */
-} __attribute__ ((__packed__)) hci_write_page_scan_type_cp;
+} __packed hci_write_page_scan_type_cp;
typedef hci_status_rp hci_write_page_scan_type_rp;
@@ -1505,13 +1505,13 @@ typedef hci_status_rp hci_write_page_scan_type_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t mode; /* assessment mode */
-} __attribute__ ((__packed__)) hci_read_afh_assessment_rp;
+} __packed hci_read_afh_assessment_rp;
#define HCI_OCF_WRITE_AFH_ASSESSMENT 0x0049
#define HCI_CMD_WRITE_AFH_ASSESSMENT 0x0C49
typedef struct {
uint8_t mode; /* assessment mode */
-} __attribute__ ((__packed__)) hci_write_afh_assessment_cp;
+} __packed hci_write_afh_assessment_cp;
typedef hci_status_rp hci_write_afh_assessment_rp;
@@ -1523,14 +1523,14 @@ typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t fec_required;
uint8_t response[240];
-} __attribute__ ((__packed__)) hci_read_extended_inquiry_rsp_rp;
+} __packed hci_read_extended_inquiry_rsp_rp;
#define HCI_OCF_WRITE_EXTENDED_INQUIRY_RSP 0x0052
#define HCI_CMD_WRITE_EXTENDED_INQUIRY_RSP 0x0C52
typedef struct {
uint8_t fec_required;
uint8_t response[240];
-} __attribute__ ((__packed__)) hci_write_extended_inquiry_rsp_cp;
+} __packed hci_write_extended_inquiry_rsp_cp;
typedef hci_status_rp hci_write_extended_inquiry_rsp_rp;
@@ -1538,7 +1538,7 @@ typedef hci_status_rp hci_write_extended_inquiry_rsp_rp;
#define HCI_CMD_REFRESH_ENCRYPTION_KEY 0x0C53
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_refresh_encryption_key_cp;
+} __packed hci_refresh_encryption_key_cp;
typedef hci_status_rp hci_refresh_encryption_key_rp;
@@ -1549,13 +1549,13 @@ typedef hci_status_rp hci_refresh_encryption_key_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t mode; /* simple pairing mode */
-} __attribute__ ((__packed__)) hci_read_simple_pairing_mode_rp;
+} __packed hci_read_simple_pairing_mode_rp;
#define HCI_OCF_WRITE_SIMPLE_PAIRING_MODE 0x0056
#define HCI_CMD_WRITE_SIMPLE_PAIRING_MODE 0x0C56
typedef struct {
uint8_t mode; /* simple pairing mode */
-} __attribute__ ((__packed__)) hci_write_simple_pairing_mode_cp;
+} __packed hci_write_simple_pairing_mode_cp;
typedef hci_status_rp hci_write_simple_pairing_mode_rp;
@@ -1567,7 +1567,7 @@ typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t c[16]; /* pairing hash */
uint8_t r[16]; /* pairing randomizer */
-} __attribute__ ((__packed__)) hci_read_local_oob_data_rp;
+} __packed hci_read_local_oob_data_rp;
#define HCI_OCF_READ_INQUIRY_RSP_XMIT_POWER 0x0058
#define HCI_CMD_READ_INQUIRY_RSP_XMIT_POWER 0x0C58
@@ -1576,13 +1576,13 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
int8_t power; /* TX power */
-} __attribute__ ((__packed__)) hci_read_inquiry_rsp_xmit_power_rp;
+} __packed hci_read_inquiry_rsp_xmit_power_rp;
#define HCI_OCF_WRITE_INQUIRY_RSP_XMIT_POWER 0x0059
#define HCI_CMD_WRITE_INQUIRY_RSP_XMIT_POWER 0x0C59
typedef struct {
int8_t power; /* TX power */
-} __attribute__ ((__packed__)) hci_write_inquiry_rsp_xmit_power_cp;
+} __packed hci_write_inquiry_rsp_xmit_power_cp;
typedef hci_status_rp hci_write_inquiry_rsp_xmit_power_rp;
@@ -1593,13 +1593,13 @@ typedef hci_status_rp hci_write_inquiry_rsp_xmit_power_rp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t reporting; /* erroneous data reporting */
-} __attribute__ ((__packed__)) hci_read_default_errdata_reporting_rp;
+} __packed hci_read_default_errdata_reporting_rp;
#define HCI_OCF_WRITE_DEFAULT_ERRDATA_REPORTING 0x005B
#define HCI_CMD_WRITE_DEFAULT_ERRDATA_REPORTING 0x0C5B
typedef struct {
uint8_t reporting; /* erroneous data reporting */
-} __attribute__ ((__packed__)) hci_write_default_errdata_reporting_cp;
+} __packed hci_write_default_errdata_reporting_cp;
typedef hci_status_rp hci_write_default_errdata_reporting_rp;
@@ -1608,7 +1608,7 @@ typedef hci_status_rp hci_write_default_errdata_reporting_rp;
typedef struct {
uint16_t con_handle; /* connection handle */
uint8_t packet_type;
-} __attribute__ ((__packed__)) hci_enhanced_flush_cp;
+} __packed hci_enhanced_flush_cp;
/* No response parameter(s) */
@@ -1617,12 +1617,12 @@ typedef struct {
typedef struct {
bdaddr_t bdaddr; /* remote address */
uint8_t type; /* notification type */
-} __attribute__ ((__packed__)) hci_send_keypress_notification_cp;
+} __packed hci_send_keypress_notification_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote address */
-} __attribute__ ((__packed__)) hci_send_keypress_notification_rp;
+} __packed hci_send_keypress_notification_rp;
/**************************************************************************
**************************************************************************
@@ -1642,7 +1642,7 @@ typedef struct {
uint8_t lmp_version; /* LMP version */
uint16_t manufacturer; /* Hardware manufacturer name */
uint16_t lmp_subversion; /* LMP sub-version */
-} __attribute__ ((__packed__)) hci_read_local_ver_rp;
+} __packed hci_read_local_ver_rp;
#define HCI_OCF_READ_LOCAL_COMMANDS 0x0002
#define HCI_CMD_READ_LOCAL_COMMANDS 0x1002
@@ -1650,7 +1650,7 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t commands[HCI_COMMANDS_SIZE]; /* opcode bitmask */
-} __attribute__ ((__packed__)) hci_read_local_commands_rp;
+} __packed hci_read_local_commands_rp;
#define HCI_OCF_READ_LOCAL_FEATURES 0x0003
#define HCI_CMD_READ_LOCAL_FEATURES 0x1003
@@ -1658,20 +1658,20 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t features[HCI_FEATURES_SIZE]; /* LMP features bitmsk*/
-} __attribute__ ((__packed__)) hci_read_local_features_rp;
+} __packed hci_read_local_features_rp;
#define HCI_OCF_READ_LOCAL_EXTENDED_FEATURES 0x0004
#define HCI_CMD_READ_LOCAL_EXTENDED_FEATURES 0x1004
typedef struct {
uint8_t page; /* page number */
-} __attribute__ ((__packed__)) hci_read_local_extended_features_cp;
+} __packed hci_read_local_extended_features_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t page; /* page number */
uint8_t max_page; /* maximum page number */
uint8_t features[HCI_FEATURES_SIZE]; /* LMP features */
-} __attribute__ ((__packed__)) hci_read_local_extended_features_rp;
+} __packed hci_read_local_extended_features_rp;
#define HCI_OCF_READ_BUFFER_SIZE 0x0005
#define HCI_CMD_READ_BUFFER_SIZE 0x1005
@@ -1682,7 +1682,7 @@ typedef struct {
uint8_t max_sco_size; /* Max. size of SCO packet (bytes) */
uint16_t num_acl_pkts; /* Max. number of ACL packets */
uint16_t num_sco_pkts; /* Max. number of SCO packets */
-} __attribute__ ((__packed__)) hci_read_buffer_size_rp;
+} __packed hci_read_buffer_size_rp;
/* Read Country Code is deprecated */
#define HCI_OCF_READ_COUNTRY_CODE 0x0007
@@ -1691,7 +1691,7 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t country_code; /* 0x00 - NAM, EUR, JP; 0x01 - France */
-} __attribute__ ((__packed__)) hci_read_country_code_rp;
+} __packed hci_read_country_code_rp;
#define HCI_OCF_READ_BDADDR 0x0009
#define HCI_CMD_READ_BDADDR 0x1009
@@ -1699,7 +1699,7 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* unit address */
-} __attribute__ ((__packed__)) hci_read_bdaddr_rp;
+} __packed hci_read_bdaddr_rp;
/**************************************************************************
**************************************************************************
@@ -1713,75 +1713,75 @@ typedef struct {
#define HCI_CMD_READ_FAILED_CONTACT_CNTR 0x1401
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_failed_contact_cntr_cp;
+} __packed hci_read_failed_contact_cntr_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint16_t counter; /* number of consecutive failed contacts */
-} __attribute__ ((__packed__)) hci_read_failed_contact_cntr_rp;
+} __packed hci_read_failed_contact_cntr_rp;
#define HCI_OCF_RESET_FAILED_CONTACT_CNTR 0x0002
#define HCI_CMD_RESET_FAILED_CONTACT_CNTR 0x1402
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_reset_failed_contact_cntr_cp;
+} __packed hci_reset_failed_contact_cntr_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_reset_failed_contact_cntr_rp;
+} __packed hci_reset_failed_contact_cntr_rp;
#define HCI_OCF_READ_LINK_QUALITY 0x0003
#define HCI_CMD_READ_LINK_QUALITY 0x1403
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_link_quality_cp;
+} __packed hci_read_link_quality_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint8_t quality; /* higher value means better quality */
-} __attribute__ ((__packed__)) hci_read_link_quality_rp;
+} __packed hci_read_link_quality_rp;
#define HCI_OCF_READ_RSSI 0x0005
#define HCI_CMD_READ_RSSI 0x1405
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_rssi_cp;
+} __packed hci_read_rssi_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
char rssi; /* -127 <= rssi <= 127 dB */
-} __attribute__ ((__packed__)) hci_read_rssi_rp;
+} __packed hci_read_rssi_rp;
#define HCI_OCF_READ_AFH_CHANNEL_MAP 0x0006
#define HCI_CMD_READ_AFH_CHANNEL_MAP 0x1406
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_read_afh_channel_map_cp;
+} __packed hci_read_afh_channel_map_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint8_t mode; /* AFH mode */
uint8_t map[10]; /* AFH Channel Map */
-} __attribute__ ((__packed__)) hci_read_afh_channel_map_rp;
+} __packed hci_read_afh_channel_map_rp;
#define HCI_OCF_READ_CLOCK 0x0007
#define HCI_CMD_READ_CLOCK 0x1407
typedef struct {
uint16_t con_handle; /* connection handle */
uint8_t clock; /* which clock */
-} __attribute__ ((__packed__)) hci_read_clock_cp;
+} __packed hci_read_clock_cp;
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint32_t clock; /* clock value */
uint16_t accuracy; /* clock accuracy */
-} __attribute__ ((__packed__)) hci_read_clock_rp;
+} __packed hci_read_clock_rp;
/**************************************************************************
@@ -1798,13 +1798,13 @@ typedef struct {
typedef struct {
uint8_t status; /* 0x00 - success */
uint8_t lbmode; /* loopback mode */
-} __attribute__ ((__packed__)) hci_read_loopback_mode_rp;
+} __packed hci_read_loopback_mode_rp;
#define HCI_OCF_WRITE_LOOPBACK_MODE 0x0002
#define HCI_CMD_WRITE_LOOPBACK_MODE 0x1802
typedef struct {
uint8_t lbmode; /* loopback mode */
-} __attribute__ ((__packed__)) hci_write_loopback_mode_cp;
+} __packed hci_write_loopback_mode_cp;
typedef hci_status_rp hci_write_loopback_mode_rp;
@@ -1817,7 +1817,7 @@ typedef hci_status_rp hci_enable_unit_under_test_rp;
#define HCI_CMD_WRITE_SIMPLE_PAIRING_DEBUG_MODE 0x1804
typedef struct {
uint8_t mode; /* simple pairing debug mode */
-} __attribute__ ((__packed__)) hci_write_simple_pairing_debug_mode_cp;
+} __packed hci_write_simple_pairing_debug_mode_cp;
typedef hci_status_rp hci_write_simple_pairing_debug_mode_rp;
@@ -1849,13 +1849,13 @@ typedef hci_status_rp hci_write_simple_pairing_debug_mode_rp;
#define HCI_EVENT_INQUIRY_COMPL 0x01
typedef struct {
uint8_t status; /* 0x00 - success */
-} __attribute__ ((__packed__)) hci_inquiry_compl_ep;
+} __packed hci_inquiry_compl_ep;
#define HCI_EVENT_INQUIRY_RESULT 0x02
typedef struct {
uint8_t num_responses; /* number of responses */
/* hci_inquiry_response[num_responses] -- see below */
-} __attribute__ ((__packed__)) hci_inquiry_result_ep;
+} __packed hci_inquiry_result_ep;
typedef struct {
bdaddr_t bdaddr; /* unit address */
@@ -1864,7 +1864,7 @@ typedef struct {
uint8_t page_scan_mode; /* page scan mode */
uint8_t uclass[HCI_CLASS_SIZE]; /* unit class */
uint16_t clock_offset; /* clock offset */
-} __attribute__ ((__packed__)) hci_inquiry_response;
+} __packed hci_inquiry_response;
#define HCI_EVENT_CON_COMPL 0x03
typedef struct {
@@ -1873,61 +1873,61 @@ typedef struct {
bdaddr_t bdaddr; /* remote unit address */
uint8_t link_type; /* Link type */
uint8_t encryption_mode; /* Encryption mode */
-} __attribute__ ((__packed__)) hci_con_compl_ep;
+} __packed hci_con_compl_ep;
#define HCI_EVENT_CON_REQ 0x04
typedef struct {
bdaddr_t bdaddr; /* remote unit address */
uint8_t uclass[HCI_CLASS_SIZE]; /* remote unit class */
uint8_t link_type; /* link type */
-} __attribute__ ((__packed__)) hci_con_req_ep;
+} __packed hci_con_req_ep;
#define HCI_EVENT_DISCON_COMPL 0x05
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint8_t reason; /* reason to disconnect */
-} __attribute__ ((__packed__)) hci_discon_compl_ep;
+} __packed hci_discon_compl_ep;
#define HCI_EVENT_AUTH_COMPL 0x06
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_auth_compl_ep;
+} __packed hci_auth_compl_ep;
#define HCI_EVENT_REMOTE_NAME_REQ_COMPL 0x07
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote unit address */
char name[HCI_UNIT_NAME_SIZE]; /* remote unit name */
-} __attribute__ ((__packed__)) hci_remote_name_req_compl_ep;
+} __packed hci_remote_name_req_compl_ep;
#define HCI_EVENT_ENCRYPTION_CHANGE 0x08
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* Connection handle */
uint8_t encryption_enable; /* 0x00 - disable */
-} __attribute__ ((__packed__)) hci_encryption_change_ep;
+} __packed hci_encryption_change_ep;
#define HCI_EVENT_CHANGE_CON_LINK_KEY_COMPL 0x09
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* Connection handle */
-} __attribute__ ((__packed__)) hci_change_con_link_key_compl_ep;
+} __packed hci_change_con_link_key_compl_ep;
#define HCI_EVENT_MASTER_LINK_KEY_COMPL 0x0a
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* Connection handle */
uint8_t key_flag; /* Key flag */
-} __attribute__ ((__packed__)) hci_master_link_key_compl_ep;
+} __packed hci_master_link_key_compl_ep;
#define HCI_EVENT_READ_REMOTE_FEATURES_COMPL 0x0b
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* Connection handle */
uint8_t features[HCI_FEATURES_SIZE]; /* LMP features bitmsk*/
-} __attribute__ ((__packed__)) hci_read_remote_features_compl_ep;
+} __packed hci_read_remote_features_compl_ep;
#define HCI_EVENT_READ_REMOTE_VER_INFO_COMPL 0x0c
typedef struct {
@@ -1936,7 +1936,7 @@ typedef struct {
uint8_t lmp_version; /* LMP version */
uint16_t manufacturer; /* Hardware manufacturer name */
uint16_t lmp_subversion; /* LMP sub-version */
-} __attribute__ ((__packed__)) hci_read_remote_ver_info_compl_ep;
+} __packed hci_read_remote_ver_info_compl_ep;
#define HCI_EVENT_QOS_SETUP_COMPL 0x0d
typedef struct {
@@ -1948,38 +1948,38 @@ typedef struct {
uint32_t peak_bandwidth; /* bytes per second */
uint32_t latency; /* microseconds */
uint32_t delay_variation; /* microseconds */
-} __attribute__ ((__packed__)) hci_qos_setup_compl_ep;
+} __packed hci_qos_setup_compl_ep;
#define HCI_EVENT_COMMAND_COMPL 0x0e
typedef struct {
uint8_t num_cmd_pkts; /* # of HCI command packets */
uint16_t opcode; /* command OpCode */
/* command return parameters (if any) */
-} __attribute__ ((__packed__)) hci_command_compl_ep;
+} __packed hci_command_compl_ep;
#define HCI_EVENT_COMMAND_STATUS 0x0f
typedef struct {
uint8_t status; /* 0x00 - pending */
uint8_t num_cmd_pkts; /* # of HCI command packets */
uint16_t opcode; /* command OpCode */
-} __attribute__ ((__packed__)) hci_command_status_ep;
+} __packed hci_command_status_ep;
#define HCI_EVENT_HARDWARE_ERROR 0x10
typedef struct {
uint8_t hardware_code; /* hardware error code */
-} __attribute__ ((__packed__)) hci_hardware_error_ep;
+} __packed hci_hardware_error_ep;
#define HCI_EVENT_FLUSH_OCCUR 0x11
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_flush_occur_ep;
+} __packed hci_flush_occur_ep;
#define HCI_EVENT_ROLE_CHANGE 0x12
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* address of remote unit */
uint8_t role; /* new connection role */
-} __attribute__ ((__packed__)) hci_role_change_ep;
+} __packed hci_role_change_ep;
#define HCI_EVENT_NUM_COMPL_PKTS 0x13
typedef struct {
@@ -1987,7 +1987,7 @@ typedef struct {
/* these are repeated "num_con_handles" times
uint16_t con_handle; --- connection handle(s)
uint16_t compl_pkts; --- # of completed packets */
-} __attribute__ ((__packed__)) hci_num_compl_pkts_ep;
+} __packed hci_num_compl_pkts_ep;
#define HCI_EVENT_MODE_CHANGE 0x14
typedef struct {
@@ -1995,7 +1995,7 @@ typedef struct {
uint16_t con_handle; /* connection handle */
uint8_t unit_mode; /* remote unit mode */
uint16_t interval; /* interval * 0.625 msec */
-} __attribute__ ((__packed__)) hci_mode_change_ep;
+} __packed hci_mode_change_ep;
#define HCI_EVENT_RETURN_LINK_KEYS 0x15
typedef struct {
@@ -2003,24 +2003,24 @@ typedef struct {
/* these are repeated "num_keys" times
bdaddr_t bdaddr; --- remote address(es)
uint8_t key[HCI_KEY_SIZE]; --- key(s) */
-} __attribute__ ((__packed__)) hci_return_link_keys_ep;
+} __packed hci_return_link_keys_ep;
#define HCI_EVENT_PIN_CODE_REQ 0x16
typedef struct {
bdaddr_t bdaddr; /* remote unit address */
-} __attribute__ ((__packed__)) hci_pin_code_req_ep;
+} __packed hci_pin_code_req_ep;
#define HCI_EVENT_LINK_KEY_REQ 0x17
typedef struct {
bdaddr_t bdaddr; /* remote unit address */
-} __attribute__ ((__packed__)) hci_link_key_req_ep;
+} __packed hci_link_key_req_ep;
#define HCI_EVENT_LINK_KEY_NOTIFICATION 0x18
typedef struct {
bdaddr_t bdaddr; /* remote unit address */
uint8_t key[HCI_KEY_SIZE]; /* link key */
uint8_t key_type; /* type of the key */
-} __attribute__ ((__packed__)) hci_link_key_notification_ep;
+} __packed hci_link_key_notification_ep;
#define HCI_EVENT_LOOPBACK_COMMAND 0x19
typedef hci_cmd_hdr_t hci_loopback_command_ep;
@@ -2028,45 +2028,45 @@ typedef hci_cmd_hdr_t hci_loopback_command_ep;
#define HCI_EVENT_DATA_BUFFER_OVERFLOW 0x1a
typedef struct {
uint8_t link_type; /* Link type */
-} __attribute__ ((__packed__)) hci_data_buffer_overflow_ep;
+} __packed hci_data_buffer_overflow_ep;
#define HCI_EVENT_MAX_SLOT_CHANGE 0x1b
typedef struct {
uint16_t con_handle; /* connection handle */
uint8_t lmp_max_slots; /* Max. # of slots allowed */
-} __attribute__ ((__packed__)) hci_max_slot_change_ep;
+} __packed hci_max_slot_change_ep;
#define HCI_EVENT_READ_CLOCK_OFFSET_COMPL 0x1c
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* Connection handle */
uint16_t clock_offset; /* Clock offset */
-} __attribute__ ((__packed__)) hci_read_clock_offset_compl_ep;
+} __packed hci_read_clock_offset_compl_ep;
#define HCI_EVENT_CON_PKT_TYPE_CHANGED 0x1d
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
uint16_t pkt_type; /* packet type */
-} __attribute__ ((__packed__)) hci_con_pkt_type_changed_ep;
+} __packed hci_con_pkt_type_changed_ep;
#define HCI_EVENT_QOS_VIOLATION 0x1e
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_qos_violation_ep;
+} __packed hci_qos_violation_ep;
/* Page Scan Mode Change Event is deprecated */
#define HCI_EVENT_PAGE_SCAN_MODE_CHANGE 0x1f
typedef struct {
bdaddr_t bdaddr; /* destination address */
uint8_t page_scan_mode; /* page scan mode */
-} __attribute__ ((__packed__)) hci_page_scan_mode_change_ep;
+} __packed hci_page_scan_mode_change_ep;
#define HCI_EVENT_PAGE_SCAN_REP_MODE_CHANGE 0x20
typedef struct {
bdaddr_t bdaddr; /* destination address */
uint8_t page_scan_rep_mode; /* page scan repetition mode */
-} __attribute__ ((__packed__)) hci_page_scan_rep_mode_change_ep;
+} __packed hci_page_scan_rep_mode_change_ep;
#define HCI_EVENT_FLOW_SPECIFICATION_COMPL 0x21
typedef struct {
@@ -2079,13 +2079,13 @@ typedef struct {
uint32_t bucket_size; /* token bucket size */
uint32_t peak_bandwidth; /* peak bandwidth */
uint32_t latency; /* access latency */
-} __attribute__ ((__packed__)) hci_flow_specification_compl_ep;
+} __packed hci_flow_specification_compl_ep;
#define HCI_EVENT_RSSI_RESULT 0x22
typedef struct {
uint8_t num_responses; /* number of responses */
/* hci_rssi_response[num_responses] -- see below */
-} __attribute__ ((__packed__)) hci_rssi_result_ep;
+} __packed hci_rssi_result_ep;
typedef struct {
bdaddr_t bdaddr; /* unit address */
@@ -2094,7 +2094,7 @@ typedef struct {
uint8_t uclass[HCI_CLASS_SIZE]; /* unit class */
uint16_t clock_offset; /* clock offset */
int8_t rssi; /* rssi */
-} __attribute__ ((__packed__)) hci_rssi_response;
+} __packed hci_rssi_response;
#define HCI_EVENT_READ_REMOTE_EXTENDED_FEATURES 0x23
typedef struct {
@@ -2103,7 +2103,7 @@ typedef struct {
uint8_t page; /* page number */
uint8_t max; /* max page number */
uint8_t features[HCI_FEATURES_SIZE]; /* LMP features bitmsk*/
-} __attribute__ ((__packed__)) hci_read_remote_extended_features_ep;
+} __packed hci_read_remote_extended_features_ep;
#define HCI_EVENT_SCO_CON_COMPL 0x2c
typedef struct {
@@ -2116,7 +2116,7 @@ typedef struct {
uint16_t rxlen; /* rx packet length */
uint16_t txlen; /* tx packet length */
uint8_t mode; /* air mode */
-} __attribute__ ((__packed__)) hci_sco_con_compl_ep;
+} __packed hci_sco_con_compl_ep;
#define HCI_EVENT_SCO_CON_CHANGED 0x2d
typedef struct {
@@ -2126,7 +2126,7 @@ typedef struct {
uint8_t window; /* retransmission window */
uint16_t rxlen; /* rx packet length */
uint16_t txlen; /* tx packet length */
-} __attribute__ ((__packed__)) hci_sco_con_changed_ep;
+} __packed hci_sco_con_changed_ep;
#define HCI_EVENT_SNIFF_SUBRATING 0x2e
typedef struct {
@@ -2136,7 +2136,7 @@ typedef struct {
uint16_t rx_latency; /* max receive latency */
uint16_t remote_timeout; /* remote timeout */
uint16_t local_timeout; /* local timeout */
-} __attribute__ ((__packed__)) hci_sniff_subrating_ep;
+} __packed hci_sniff_subrating_ep;
#define HCI_EVENT_EXTENDED_RESULT 0x2f
typedef struct {
@@ -2148,18 +2148,18 @@ typedef struct {
uint16_t clock_offset;
int8_t rssi;
uint8_t response[240]; /* extended inquiry response */
-} __attribute__ ((__packed__)) hci_extended_result_ep;
+} __packed hci_extended_result_ep;
#define HCI_EVENT_ENCRYPTION_KEY_REFRESH 0x30
typedef struct {
uint8_t status; /* 0x00 - success */
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_encryption_key_refresh_ep;
+} __packed hci_encryption_key_refresh_ep;
#define HCI_EVENT_IO_CAPABILITY_REQ 0x31
typedef struct {
bdaddr_t bdaddr; /* remote device address */
-} __attribute__ ((__packed__)) hci_io_capability_req_ep;
+} __packed hci_io_capability_req_ep;
#define HCI_EVENT_IO_CAPABILITY_RSP 0x32
typedef struct {
@@ -2167,58 +2167,58 @@ typedef struct {
uint8_t io_capability;
uint8_t oob_data_present;
uint8_t auth_requirement;
-} __attribute__ ((__packed__)) hci_io_capability_rsp_ep;
+} __packed hci_io_capability_rsp_ep;
#define HCI_EVENT_USER_CONFIRM_REQ 0x33
typedef struct {
bdaddr_t bdaddr; /* remote device address */
uint32_t value; /* 000000 - 999999 */
-} __attribute__ ((__packed__)) hci_user_confirm_req_ep;
+} __packed hci_user_confirm_req_ep;
#define HCI_EVENT_USER_PASSKEY_REQ 0x34
typedef struct {
bdaddr_t bdaddr; /* remote device address */
-} __attribute__ ((__packed__)) hci_user_passkey_req_ep;
+} __packed hci_user_passkey_req_ep;
#define HCI_EVENT_REMOTE_OOB_DATA_REQ 0x35
typedef struct {
bdaddr_t bdaddr; /* remote device address */
-} __attribute__ ((__packed__)) hci_remote_oob_data_req_ep;
+} __packed hci_remote_oob_data_req_ep;
#define HCI_EVENT_SIMPLE_PAIRING_COMPL 0x36
typedef struct {
uint8_t status; /* 0x00 - success */
bdaddr_t bdaddr; /* remote device address */
-} __attribute__ ((__packed__)) hci_simple_pairing_compl_ep;
+} __packed hci_simple_pairing_compl_ep;
#define HCI_EVENT_LINK_SUPERVISION_TO_CHANGED 0x38
typedef struct {
uint16_t con_handle; /* connection handle */
uint16_t timeout; /* link supervision timeout */
-} __attribute__ ((__packed__)) hci_link_supervision_to_changed_ep;
+} __packed hci_link_supervision_to_changed_ep;
#define HCI_EVENT_ENHANCED_FLUSH_COMPL 0x39
typedef struct {
uint16_t con_handle; /* connection handle */
-} __attribute__ ((__packed__)) hci_enhanced_flush_compl_ep;
+} __packed hci_enhanced_flush_compl_ep;
#define HCI_EVENT_USER_PASSKEY_NOTIFICATION 0x3b
typedef struct {
bdaddr_t bdaddr; /* remote device address */
uint32_t value; /* 000000 - 999999 */
-} __attribute__ ((__packed__)) hci_user_passkey_notification_ep;
+} __packed hci_user_passkey_notification_ep;
#define HCI_EVENT_KEYPRESS_NOTIFICATION 0x3c
typedef struct {
bdaddr_t bdaddr; /* remote device address */
uint8_t notification_type;
-} __attribute__ ((__packed__)) hci_keypress_notification_ep;
+} __packed hci_keypress_notification_ep;
#define HCI_EVENT_REMOTE_FEATURES_NOTIFICATION 0x3d
typedef struct {
bdaddr_t bdaddr; /* remote device address */
uint8_t features[HCI_FEATURES_SIZE]; /* LMP features bitmsk*/
-} __attribute__ ((__packed__)) hci_remote_features_notification_ep;
+} __packed hci_remote_features_notification_ep;
#define HCI_EVENT_BT_LOGO 0xfe
@@ -2427,6 +2427,7 @@ struct hci_link {
#define HCI_LINK_AUTH (1<<3) /* link is authenticated */
#define HCI_LINK_ENCRYPT (1<<4) /* link is encrypted */
#define HCI_LINK_SECURE (1<<5) /* link is secured */
+#define HCI_LINK_CREATE_CON (1<<6) /* "Create Connection" pending */
/*
* Bluetooth Memo
@@ -2465,6 +2466,7 @@ struct hci_unit {
/* device info */
bdaddr_t hci_bdaddr; /* device address */
uint16_t hci_flags; /* see BTF_ above */
+ int hci_init; /* sleep on this */
uint16_t hci_packet_type; /* packet types */
uint16_t hci_acl_mask; /* ACL packet capabilities */
@@ -2531,10 +2533,9 @@ struct hci_link *hci_sco_newconn(struct hci_unit *, bdaddr_t *);
void hci_sco_recv(struct mbuf *, struct hci_unit *);
void hci_sco_start(struct hci_link *);
void hci_sco_complete(struct hci_link *, int);
-struct hci_link *hci_link_alloc(struct hci_unit *);
+struct hci_link *hci_link_alloc(struct hci_unit *, bdaddr_t *, uint8_t);
void hci_link_free(struct hci_link *, int);
-struct hci_link *hci_link_lookup_state(struct hci_unit *, uint16_t, uint16_t);
-struct hci_link *hci_link_lookup_bdaddr(struct hci_unit *, bdaddr_t *, uint16_t);
+struct hci_link *hci_link_lookup_bdaddr(struct hci_unit *, bdaddr_t *, uint8_t);
struct hci_link *hci_link_lookup_handle(struct hci_unit *, uint16_t);
/* hci_misc.c */
@@ -2557,6 +2558,7 @@ int hci_enable(struct hci_unit *);
void hci_disable(struct hci_unit *);
struct hci_unit *hci_unit_lookup(bdaddr_t *);
int hci_send_cmd(struct hci_unit *, uint16_t, void *, uint8_t);
+void hci_num_cmds(struct hci_unit *, uint8_t);
int hci_input_event(struct hci_unit *, struct mbuf *);
int hci_input_acl(struct hci_unit *, struct mbuf *);
int hci_input_sco(struct hci_unit *, struct mbuf *);
diff --git a/sys/netbt/hci_event.c b/sys/netbt/hci_event.c
index e512521cab7..0c408e777b4 100644
--- a/sys/netbt/hci_event.c
+++ b/sys/netbt/hci_event.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: hci_event.c,v 1.7 2008/02/24 21:34:48 uwe Exp $ */
-/* $NetBSD: hci_event.c,v 1.14 2008/02/10 17:40:54 plunky Exp $ */
+/* $OpenBSD: hci_event.c,v 1.8 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: hci_event.c,v 1.18 2008/04/24 11:38:37 ad Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -60,6 +60,7 @@ static void hci_cmd_read_local_features(struct hci_unit *, struct mbuf *);
static void hci_cmd_read_local_ver(struct hci_unit *, struct mbuf *);
static void hci_cmd_read_local_commands(struct hci_unit *, struct mbuf *);
static void hci_cmd_reset(struct hci_unit *, struct mbuf *);
+static void hci_cmd_create_con(struct hci_unit *unit, uint8_t status);
#ifdef BLUETOOTH_DEBUG
int bluetooth_debug;
@@ -230,62 +231,53 @@ hci_event(struct mbuf *m, struct hci_unit *unit)
/*
* Command Status
*
- * Update our record of num_cmd_pkts then post-process any pending commands
- * and optionally restart cmd output on the unit.
+ * Restart command queue and post-process any pending commands
*/
static void
hci_event_command_status(struct hci_unit *unit, struct mbuf *m)
{
hci_command_status_ep ep;
- struct hci_link *link;
KASSERT(m->m_pkthdr.len >= sizeof(ep));
m_copydata(m, 0, sizeof(ep), (caddr_t)&ep);
m_adj(m, sizeof(ep));
+ ep.opcode = letoh16(ep.opcode);
+
DPRINTFN(1, "(%s) opcode (%03x|%04x) status = 0x%x num_cmd_pkts = %d\n",
device_xname(unit->hci_dev),
- HCI_OGF(letoh16(ep.opcode)), HCI_OCF(letoh16(ep.opcode)),
+ HCI_OGF(ep.opcode), HCI_OCF(ep.opcode),
ep.status,
ep.num_cmd_pkts);
- if (ep.status > 0)
- printf("%s: CommandStatus opcode (%03x|%04x) failed (status=0x%02x)\n",
- device_xname(unit->hci_dev), HCI_OGF(letoh16(ep.opcode)),
- HCI_OCF(letoh16(ep.opcode)), ep.status);
-
- unit->hci_num_cmd_pkts = ep.num_cmd_pkts;
+ hci_num_cmds(unit, ep.num_cmd_pkts);
/*
* post processing of pending commands
*/
- switch(letoh16(ep.opcode)) {
+ switch(ep.opcode) {
case HCI_CMD_CREATE_CON:
- switch (ep.status) {
- case 0x12: /* Invalid HCI command parameters */
- DPRINTF("(%s) Invalid HCI command parameters\n",
- device_xname(unit->hci_dev));
- while ((link = hci_link_lookup_state(unit,
- HCI_LINK_ACL, HCI_LINK_WAIT_CONNECT)) != NULL)
- hci_link_free(link, ECONNABORTED);
- break;
- }
- break;
- default:
+ hci_cmd_create_con(unit, ep.status);
break;
- }
- while (unit->hci_num_cmd_pkts > 0 && !IF_IS_EMPTY(&unit->hci_cmdwait)) {
- IF_DEQUEUE(&unit->hci_cmdwait, m);
- hci_output_cmd(unit, m);
+ default:
+ if (ep.status == 0)
+ break;
+
+ DPRINTFN(1,
+ "CommandStatus opcode (%03x|%04x) failed (status=0x%02x)\n",
+ device_xname(unit->hci_dev),
+ HCI_OGF(ep.opcode), HCI_OCF(ep.opcode),
+ ep.status);
+
+ break;
}
}
/*
* Command Complete
*
- * Update our record of num_cmd_pkts then handle the completed command,
- * and optionally restart cmd output on the unit.
+ * Restart command queue and handle the completed command
*/
static void
hci_event_command_compl(struct hci_unit *unit, struct mbuf *m)
@@ -301,6 +293,8 @@ hci_event_command_compl(struct hci_unit *unit, struct mbuf *m)
device_xname(unit->hci_dev), HCI_OGF(letoh16(ep.opcode)),
HCI_OCF(letoh16(ep.opcode)), ep.num_cmd_pkts);
+ hci_num_cmds(unit, ep.num_cmd_pkts);
+
/*
* I am not sure if this is completely correct, it is not guaranteed
* that a command_complete packet will contain the status though most
@@ -312,8 +306,6 @@ hci_event_command_compl(struct hci_unit *unit, struct mbuf *m)
device_xname(unit->hci_dev), HCI_OGF(letoh16(ep.opcode)),
HCI_OCF(letoh16(ep.opcode)), rp.status);
- unit->hci_num_cmd_pkts = ep.num_cmd_pkts;
-
/*
* post processing of completed commands
*/
@@ -345,11 +337,6 @@ hci_event_command_compl(struct hci_unit *unit, struct mbuf *m)
default:
break;
}
-
- while (unit->hci_num_cmd_pkts > 0 && !IF_IS_EMPTY(&unit->hci_cmdwait)) {
- IF_DEQUEUE(&unit->hci_cmdwait, m);
- hci_output_cmd(unit, m);
- }
}
/*
@@ -856,7 +843,7 @@ hci_cmd_read_bdaddr(struct hci_unit *unit, struct mbuf *m)
unit->hci_flags &= ~BTF_INIT_BDADDR;
- wakeup(unit);
+ wakeup(&unit->hci_init);
}
/*
@@ -884,7 +871,7 @@ hci_cmd_read_buffer_size(struct hci_unit *unit, struct mbuf *m)
unit->hci_flags &= ~BTF_INIT_BUFFER_SIZE;
- wakeup(unit);
+ wakeup(&unit->hci_init);
}
/*
@@ -972,7 +959,7 @@ hci_cmd_read_local_features(struct hci_unit *unit, struct mbuf *m)
unit->hci_flags &= ~BTF_INIT_FEATURES;
- wakeup(unit);
+ wakeup(&unit->hci_init);
DPRINTFN(1, "%s: lmp_mask %4.4x, acl_mask %4.4x, sco_mask %4.4x\n",
device_xname(unit->hci_dev), unit->hci_lmp_mask,
@@ -1001,7 +988,7 @@ hci_cmd_read_local_ver(struct hci_unit *unit, struct mbuf *m)
if (rp.hci_version < HCI_SPEC_V12) {
unit->hci_flags &= ~BTF_INIT_COMMANDS;
- wakeup(unit);
+ wakeup(&unit->hci_init);
return;
}
@@ -1029,7 +1016,7 @@ hci_cmd_read_local_commands(struct hci_unit *unit, struct mbuf *m)
unit->hci_flags &= ~BTF_INIT_COMMANDS;
memcpy(unit->hci_cmds, rp.commands, HCI_COMMANDS_SIZE);
- wakeup(unit);
+ wakeup(&unit->hci_init);
}
/*
@@ -1080,3 +1067,45 @@ hci_cmd_reset(struct hci_unit *unit, struct mbuf *m)
if (hci_send_cmd(unit, HCI_CMD_READ_LOCAL_VER, NULL, 0))
return;
}
+
+/*
+ * process command_status event for create_con command
+ *
+ * a "Create Connection" command can sometimes fail to start for whatever
+ * reason and the command_status event returns failure but we get no
+ * indication of which connection failed (for instance in the case where
+ * we tried to open too many connections all at once) So, we keep a flag
+ * on the link to indicate pending status until the command_status event
+ * is returned to help us decide which needs to be failed.
+ *
+ * since created links are inserted at the tail of hci_links, we know that
+ * the first pending link we find will be the one that this command status
+ * refers to.
+ */
+static void
+hci_cmd_create_con(struct hci_unit *unit, uint8_t status)
+{
+ struct hci_link *link;
+
+ TAILQ_FOREACH(link, &unit->hci_links, hl_next) {
+ if ((link->hl_flags & HCI_LINK_CREATE_CON) == 0)
+ continue;
+
+ link->hl_flags &= ~HCI_LINK_CREATE_CON;
+
+ switch(status) {
+ case 0x00: /* success */
+ break;
+
+ case 0x0c: /* "Command Disallowed" */
+ hci_link_free(link, EBUSY);
+ break;
+
+ default: /* some other trouble */
+ hci_link_free(link, /*EPROTO*/ECONNABORTED);
+ break;
+ }
+
+ return;
+ }
+}
diff --git a/sys/netbt/hci_link.c b/sys/netbt/hci_link.c
index b6d9a3e2b70..ab00ee34744 100644
--- a/sys/netbt/hci_link.c
+++ b/sys/netbt/hci_link.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: hci_link.c,v 1.8 2008/09/10 14:01:23 blambert Exp $ */
-/* $NetBSD: hci_link.c,v 1.16 2007/11/10 23:12:22 plunky Exp $ */
+/* $OpenBSD: hci_link.c,v 1.9 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: hci_link.c,v 1.20 2008/04/24 11:38:37 ad Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -75,12 +75,9 @@ hci_acl_open(struct hci_unit *unit, bdaddr_t *bdaddr)
link = hci_link_lookup_bdaddr(unit, bdaddr, HCI_LINK_ACL);
if (link == NULL) {
- link = hci_link_alloc(unit);
+ link = hci_link_alloc(unit, bdaddr, HCI_LINK_ACL);
if (link == NULL)
return NULL;
-
- link->hl_type = HCI_LINK_ACL;
- bdaddr_copy(&link->hl_bdaddr, bdaddr);
}
switch(link->hl_state) {
@@ -108,6 +105,7 @@ hci_acl_open(struct hci_unit *unit, bdaddr_t *bdaddr)
return NULL;
}
+ link->hl_flags |= HCI_LINK_CREATE_CON;
link->hl_state = HCI_LINK_WAIT_CONNECT;
break;
@@ -178,11 +176,9 @@ hci_acl_newconn(struct hci_unit *unit, bdaddr_t *bdaddr)
if (link != NULL)
return NULL;
- link = hci_link_alloc(unit);
+ link = hci_link_alloc(unit, bdaddr, HCI_LINK_ACL);
if (link != NULL) {
link->hl_state = HCI_LINK_WAIT_CONNECT;
- link->hl_type = HCI_LINK_ACL;
- bdaddr_copy(&link->hl_bdaddr, bdaddr);
if (hci_acl_expiry > 0)
timeout_add_sec(&link->hl_expire, hci_acl_expiry);
@@ -196,9 +192,9 @@ hci_acl_timeout(void *arg)
{
struct hci_link *link = arg;
hci_discon_cp cp;
- int s, err;
+ int err;
- s = splsoftnet();
+ mutex_enter(&bt_lock);
if (link->hl_refcnt > 0)
goto out;
@@ -234,7 +230,7 @@ hci_acl_timeout(void *arg)
}
out:
- splx(s);
+ mutex_exit(&bt_lock);
}
/*
@@ -789,15 +785,12 @@ hci_sco_newconn(struct hci_unit *unit, bdaddr_t *bdaddr)
bdaddr_copy(&new->sp_laddr, &unit->hci_bdaddr);
bdaddr_copy(&new->sp_raddr, bdaddr);
- sco = hci_link_alloc(unit);
+ sco = hci_link_alloc(unit, bdaddr, HCI_LINK_SCO);
if (sco == NULL) {
sco_detach(&new);
return NULL;
}
- sco->hl_type = HCI_LINK_SCO;
- bdaddr_copy(&sco->hl_bdaddr, bdaddr);
-
sco->hl_link = hci_acl_open(unit, bdaddr);
KASSERT(sco->hl_link == acl);
@@ -885,7 +878,7 @@ hci_sco_complete(struct hci_link *link, int num)
*/
struct hci_link *
-hci_link_alloc(struct hci_unit *unit)
+hci_link_alloc(struct hci_unit *unit, bdaddr_t *bdaddr, uint8_t type)
{
struct hci_link *link;
@@ -896,7 +889,9 @@ hci_link_alloc(struct hci_unit *unit)
return NULL;
link->hl_unit = unit;
+ link->hl_type = type;
link->hl_state = HCI_LINK_CLOSED;
+ bdaddr_copy(&link->hl_bdaddr, bdaddr);
/* init ACL portion */
timeout_set(&link->hl_expire, hci_acl_timeout, link);
@@ -911,7 +906,7 @@ hci_link_alloc(struct hci_unit *unit)
/* &link->hl_data is already zero-initialized. */
/* attach to unit */
- TAILQ_INSERT_HEAD(&unit->hci_links, link, hl_next);
+ TAILQ_INSERT_TAIL(&unit->hci_links, link, hl_next);
return link;
}
@@ -1009,28 +1004,12 @@ hci_link_free(struct hci_link *link, int err)
}
/*
- * Lookup HCI link by type and state.
- */
-struct hci_link *
-hci_link_lookup_state(struct hci_unit *unit, uint16_t type, uint16_t state)
-{
- struct hci_link *link;
-
- TAILQ_FOREACH(link, &unit->hci_links, hl_next) {
- if (link->hl_type == type && link->hl_state == state)
- break;
- }
-
- return link;
-}
-
-/*
* Lookup HCI link by address and type. Note that for SCO links there may
* be more than one link per address, so we only return links with no
* handle (ie new links)
*/
struct hci_link *
-hci_link_lookup_bdaddr(struct hci_unit *unit, bdaddr_t *bdaddr, uint16_t type)
+hci_link_lookup_bdaddr(struct hci_unit *unit, bdaddr_t *bdaddr, uint8_t type)
{
struct hci_link *link;
diff --git a/sys/netbt/hci_socket.c b/sys/netbt/hci_socket.c
index 4e6fa332a9b..ca5aa5f14a3 100644
--- a/sys/netbt/hci_socket.c
+++ b/sys/netbt/hci_socket.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: hci_socket.c,v 1.6 2008/05/27 19:41:14 thib Exp $ */
-/* $NetBSD: hci_socket.c,v 1.14 2008/02/10 17:40:54 plunky Exp $ */
+/* $OpenBSD: hci_socket.c,v 1.7 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: hci_socket.c,v 1.17 2008/08/06 15:01:24 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -555,12 +555,15 @@ hci_usrreq(struct socket *up, int req, struct mbuf *m,
switch(req) {
case PRU_CONTROL:
- return hci_ioctl((unsigned long)m, (void *)nam, curproc);
+ mutex_enter(&bt_lock);
+ err = hci_ioctl((unsigned long)m, (void *)nam, curproc);
+ mutex_exit(&bt_lock);
+ return err;
case PRU_ATTACH:
+ /* XXX solock() and bt_lock fiddling in NetBSD */
if (pcb)
return EINVAL;
-
err = soreserve(up, hci_sendspace, hci_recvspace);
if (err)
return err;
diff --git a/sys/netbt/hci_unit.c b/sys/netbt/hci_unit.c
index df0e52c01b9..5fb9cc3717b 100644
--- a/sys/netbt/hci_unit.c
+++ b/sys/netbt/hci_unit.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: hci_unit.c,v 1.8 2008/02/24 21:34:48 uwe Exp $ */
-/* $NetBSD: hci_unit.c,v 1.9 2007/12/30 18:26:42 plunky Exp $ */
+/* $OpenBSD: hci_unit.c,v 1.9 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: hci_unit.c,v 1.12 2008/06/26 14:17:27 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -81,7 +81,6 @@ struct hci_unit *
hci_attach(const struct hci_if *hci_if, struct device *dev, uint16_t flags)
{
struct hci_unit *unit;
- int s;
KASSERT(dev != NULL);
KASSERT(hci_if->enable != NULL);
@@ -99,6 +98,7 @@ hci_attach(const struct hci_if *hci_if, struct device *dev, uint16_t flags)
unit->hci_flags = flags;
mtx_init(&unit->hci_devlock, hci_if->ipl);
+ unit->hci_init = 0; /* kcondvar_t in NetBSD */
unit->hci_eventq.ifq_maxlen = hci_eventq_max;
unit->hci_aclrxq.ifq_maxlen = hci_aclrxq_max;
@@ -109,9 +109,9 @@ hci_attach(const struct hci_if *hci_if, struct device *dev, uint16_t flags)
TAILQ_INIT(&unit->hci_links);
LIST_INIT(&unit->hci_memos);
- s = splsoftnet();
+ mutex_enter(&bt_lock);
TAILQ_INSERT_TAIL(&hci_unit_list, unit, hci_next);
- splx(s);
+ mutex_exit(&bt_lock);
return unit;
}
@@ -119,14 +119,14 @@ hci_attach(const struct hci_if *hci_if, struct device *dev, uint16_t flags)
void
hci_detach(struct hci_unit *unit)
{
- int s;
- s = splsoftnet();
+ mutex_enter(&bt_lock);
hci_disable(unit);
TAILQ_REMOVE(&hci_unit_list, unit, hci_next);
- splx(s);
+ mutex_exit(&bt_lock);
+ /* mutex_destroy(&unit->hci_devlock) in NetBSD */
free(unit, M_BLUETOOTH);
}
@@ -178,7 +178,8 @@ hci_enable(struct hci_unit *unit)
goto bad2;
while (unit->hci_flags & BTF_INIT) {
- err = tsleep(unit, PWAIT | PCATCH, __func__, 5 * hz);
+ err = msleep(&unit->hci_init, &bt_lock, PWAIT | PCATCH,
+ __func__, 5 * hz);
if (err)
goto bad2;
@@ -216,8 +217,14 @@ hci_disable(struct hci_unit *unit)
int acl;
if (unit->hci_bthub) {
- config_detach(unit->hci_bthub, DETACH_FORCE);
+ struct device *hub;
+
+ hub = unit->hci_bthub;
unit->hci_bthub = NULL;
+
+ mutex_exit(&bt_lock);
+ config_detach(hub, DETACH_FORCE);
+ mutex_enter(&bt_lock);
}
#ifndef __OpenBSD__
@@ -333,13 +340,14 @@ hci_intr(void *arg)
struct hci_unit *unit = arg;
struct mbuf *m;
+ mutex_enter(&bt_lock);
another:
- mtx_enter(&unit->hci_devlock);
+ mutex_enter(&unit->hci_devlock);
if (unit->hci_eventqlen > 0) {
IF_DEQUEUE(&unit->hci_eventq, m);
unit->hci_eventqlen--;
- mtx_leave(&unit->hci_devlock);
+ mutex_exit(&unit->hci_devlock);
KASSERT(m != NULL);
@@ -356,7 +364,7 @@ another:
if (unit->hci_scorxqlen > 0) {
IF_DEQUEUE(&unit->hci_scorxq, m);
unit->hci_scorxqlen--;
- mtx_leave(&unit->hci_devlock);
+ mutex_exit(&unit->hci_devlock);
KASSERT(m != NULL);
@@ -373,7 +381,7 @@ another:
if (unit->hci_aclrxqlen > 0) {
IF_DEQUEUE(&unit->hci_aclrxq, m);
unit->hci_aclrxqlen--;
- mtx_leave(&unit->hci_devlock);
+ mutex_exit(&unit->hci_devlock);
KASSERT(m != NULL);
@@ -391,7 +399,7 @@ another:
if (m != NULL) {
struct hci_link *link;
- mtx_leave(&unit->hci_devlock);
+ mutex_exit(&unit->hci_devlock);
DPRINTFN(11, "(%s) complete SCO\n",
device_xname(unit->hci_dev));
@@ -409,7 +417,8 @@ another:
goto another;
}
- mtx_leave(&unit->hci_devlock);
+ mutex_exit(&unit->hci_devlock);
+ mutex_exit(&bt_lock);
DPRINTFN(10, "done\n");
}
@@ -428,7 +437,7 @@ hci_input_event(struct hci_unit *unit, struct mbuf *m)
{
int rv;
- mtx_enter(&unit->hci_devlock);
+ mutex_enter(&unit->hci_devlock);
if (unit->hci_eventqlen > hci_eventq_max) {
DPRINTF("(%s) dropped event packet.\n", device_xname(unit->hci_dev));
@@ -441,7 +450,7 @@ hci_input_event(struct hci_unit *unit, struct mbuf *m)
rv = 1;
}
- mtx_leave(&unit->hci_devlock);
+ mutex_exit(&unit->hci_devlock);
return rv;
}
@@ -450,7 +459,7 @@ hci_input_acl(struct hci_unit *unit, struct mbuf *m)
{
int rv;
- mtx_enter(&unit->hci_devlock);
+ mutex_enter(&unit->hci_devlock);
if (unit->hci_aclrxqlen > hci_aclrxq_max) {
DPRINTF("(%s) dropped ACL packet.\n", device_xname(unit->hci_dev));
@@ -463,7 +472,7 @@ hci_input_acl(struct hci_unit *unit, struct mbuf *m)
rv = 1;
}
- mtx_leave(&unit->hci_devlock);
+ mutex_exit(&unit->hci_devlock);
return rv;
}
@@ -472,7 +481,7 @@ hci_input_sco(struct hci_unit *unit, struct mbuf *m)
{
int rv;
- mtx_enter(&unit->hci_devlock);
+ mutex_enter(&unit->hci_devlock);
if (unit->hci_scorxqlen > hci_scorxq_max) {
DPRINTF("(%s) dropped SCO packet.\n", device_xname(unit->hci_dev));
@@ -485,7 +494,7 @@ hci_input_sco(struct hci_unit *unit, struct mbuf *m)
rv = 1;
}
- mtx_leave(&unit->hci_devlock);
+ mutex_exit(&unit->hci_devlock);
return rv;
}
@@ -550,11 +559,27 @@ hci_complete_sco(struct hci_unit *unit, struct mbuf *m)
}
#endif
- mtx_enter(&unit->hci_devlock);
+ mutex_enter(&unit->hci_devlock);
IF_ENQUEUE(&unit->hci_scodone, m);
schednetisr(NETISR_BT);
- mtx_leave(&unit->hci_devlock);
+ mutex_exit(&unit->hci_devlock);
return 1;
}
+
+/*
+ * update num_cmd_pkts and push on pending commands queue
+ */
+void
+hci_num_cmds(struct hci_unit *unit, uint8_t num)
+{
+ struct mbuf *m;
+
+ unit->hci_num_cmd_pkts = num;
+
+ while (unit->hci_num_cmd_pkts > 0 && !IF_IS_EMPTY(&unit->hci_cmdwait)) {
+ IF_DEQUEUE(&unit->hci_cmdwait, m);
+ hci_output_cmd(unit, m);
+ }
+}
diff --git a/sys/netbt/l2cap.h b/sys/netbt/l2cap.h
index cf6a89577a7..d92c3e90348 100644
--- a/sys/netbt/l2cap.h
+++ b/sys/netbt/l2cap.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: l2cap.h,v 1.6 2008/05/27 19:41:14 thib Exp $ */
-/* $NetBSD: l2cap.h,v 1.6 2007/11/03 17:20:17 plunky Exp $ */
+/* $OpenBSD: l2cap.h,v 1.7 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: l2cap.h,v 1.8 2008/09/08 23:36:55 gmcgarry Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -55,7 +55,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: l2cap.h,v 1.6 2008/05/27 19:41:14 thib Exp $
+ * $Id: l2cap.h,v 1.7 2008/11/22 04:42:58 uwe Exp $
* $FreeBSD: src/sys/netgraph/bluetooth/include/l2cap.h,v 1.4 2005/08/31 18:13:23 emax Exp $
*/
@@ -182,7 +182,7 @@ typedef struct {
uint32_t peak_bandwidth; /* bytes per second */
uint32_t latency; /* microseconds */
uint32_t delay_variation; /* microseconds */
-} __attribute__ ((__packed__)) l2cap_qos_t;
+} __packed l2cap_qos_t;
/* L2CAP QoS type */
#define L2CAP_QOS_NO_TRAFFIC 0x00
@@ -198,7 +198,7 @@ typedef struct {
uint16_t retransmit_timo; /* milliseconds */
uint16_t monitor_timo; /* milliseconds */
uint16_t max_pdu_size; /* bytes */
-} __attribute__ ((__packed__)) l2cap_rfc_t;
+} __packed l2cap_rfc_t;
/* L2CAP RFC mode */
#define L2CAP_RFC_BASIC 0x00 /* (default) */
@@ -216,12 +216,12 @@ typedef struct {
typedef struct {
uint16_t length; /* payload size */
uint16_t dcid; /* destination channel ID */
-} __attribute__ ((__packed__)) l2cap_hdr_t;
+} __packed l2cap_hdr_t;
/* L2CAP ConnectionLess Traffic (dcid == L2CAP_CLT_CID) */
typedef struct {
uint16_t psm; /* Protocol/Service Multiplexor */
-} __attribute__ ((__packed__)) l2cap_clt_hdr_t;
+} __packed l2cap_clt_hdr_t;
#define L2CAP_CLT_MTU_MAXIMUM \
(L2CAP_MTU_MAXIMUM - sizeof(l2cap_clt_hdr_t))
@@ -231,21 +231,21 @@ typedef struct {
uint8_t code; /* command OpCode */
uint8_t ident; /* identifier to match request and response */
uint16_t length; /* command parameters length */
-} __attribute__ ((__packed__)) l2cap_cmd_hdr_t;
+} __packed l2cap_cmd_hdr_t;
/* L2CAP Command Reject */
#define L2CAP_COMMAND_REJ 0x01
typedef struct {
uint16_t reason; /* reason to reject command */
uint16_t data[2];/* optional data */
-} __attribute__ ((__packed__)) l2cap_cmd_rej_cp;
+} __packed l2cap_cmd_rej_cp;
/* L2CAP Connection Request */
#define L2CAP_CONNECT_REQ 0x02
typedef struct {
uint16_t psm; /* Protocol/Service Multiplexor (PSM) */
uint16_t scid; /* source channel ID */
-} __attribute__ ((__packed__)) l2cap_con_req_cp;
+} __packed l2cap_con_req_cp;
/* L2CAP Connection Response */
#define L2CAP_CONNECT_RSP 0x03
@@ -254,7 +254,7 @@ typedef struct {
uint16_t scid; /* source channel ID */
uint16_t result; /* 0x00 - success */
uint16_t status; /* more info if result != 0x00 */
-} __attribute__ ((__packed__)) l2cap_con_rsp_cp;
+} __packed l2cap_con_rsp_cp;
/* L2CAP Configuration Request */
#define L2CAP_CONFIG_REQ 0x04
@@ -262,7 +262,7 @@ typedef struct {
uint16_t dcid; /* destination channel ID */
uint16_t flags; /* flags */
/* uint8_t options[] -- options */
-} __attribute__ ((__packed__)) l2cap_cfg_req_cp;
+} __packed l2cap_cfg_req_cp;
/* L2CAP Configuration Response */
#define L2CAP_CONFIG_RSP 0x05
@@ -271,14 +271,14 @@ typedef struct {
uint16_t flags; /* flags */
uint16_t result; /* 0x00 - success */
/* uint8_t options[] -- options */
-} __attribute__ ((__packed__)) l2cap_cfg_rsp_cp;
+} __packed l2cap_cfg_rsp_cp;
/* L2CAP configuration option */
typedef struct {
uint8_t type;
uint8_t length;
/* uint8_t value[] -- option value (depends on type) */
-} __attribute__ ((__packed__)) l2cap_cfg_opt_t;
+} __packed l2cap_cfg_opt_t;
/* L2CAP configuration option value */
typedef union {
@@ -293,7 +293,7 @@ typedef union {
typedef struct {
uint16_t dcid; /* destination channel ID */
uint16_t scid; /* source channel ID */
-} __attribute__ ((__packed__)) l2cap_discon_req_cp;
+} __packed l2cap_discon_req_cp;
/* L2CAP Disconnect Response */
#define L2CAP_DISCONNECT_RSP 0x07
@@ -313,7 +313,7 @@ typedef l2cap_discon_req_cp l2cap_discon_rsp_cp;
#define L2CAP_INFO_REQ 0x0a
typedef struct {
uint16_t type; /* requested information type */
-} __attribute__ ((__packed__)) l2cap_info_req_cp;
+} __packed l2cap_info_req_cp;
/* L2CAP Information Response */
#define L2CAP_INFO_RSP 0x0b
@@ -324,13 +324,13 @@ typedef struct {
*
* L2CAP_CONNLESS_MTU - 2 bytes connectionless MTU
*/
-} __attribute__ ((__packed__)) l2cap_info_rsp_cp;
+} __packed l2cap_info_rsp_cp;
typedef union {
/* L2CAP_CONNLESS_MTU */
struct {
uint16_t mtu;
- } __attribute__ ((__packed__)) mtu;
+ } __packed mtu;
} l2cap_info_rsp_data_t;
/**************************************************************************
diff --git a/sys/netbt/l2cap_lower.c b/sys/netbt/l2cap_lower.c
index f2d6b86c37d..24cdb467f57 100644
--- a/sys/netbt/l2cap_lower.c
+++ b/sys/netbt/l2cap_lower.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: l2cap_lower.c,v 1.2 2008/02/24 21:34:48 uwe Exp $ */
-/* $NetBSD: l2cap_lower.c,v 1.7 2007/11/10 23:12:23 plunky Exp $ */
+/* $OpenBSD: l2cap_lower.c,v 1.3 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: l2cap_lower.c,v 1.9 2008/08/05 13:08:31 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -134,13 +134,14 @@ l2cap_recv_frame(struct mbuf *m, struct hci_link *link)
chan = l2cap_cid_lookup(hdr.dcid);
if (chan != NULL && chan->lc_link == link
+ && chan->lc_imtu >= hdr.length
&& chan->lc_state == L2CAP_OPEN) {
(*chan->lc_proto->input)(chan->lc_upper, m);
return;
}
- DPRINTF("(%s) dropping %d L2CAP data bytes for unknown CID #%d\n",
- device_xname(link->hl_unit->hci_dev), hdr.length, hdr.dcid);
+ DPRINTF("(%s) invalid L2CAP packet dropped, CID #%d, length %d\n",
+ device_xname(link->hl_unit->hci_dev), hdr.dcid, hdr.length);
failed:
m_freem(m);
diff --git a/sys/netbt/l2cap_misc.c b/sys/netbt/l2cap_misc.c
index 9305b8cd7c7..78d3df6ed3e 100644
--- a/sys/netbt/l2cap_misc.c
+++ b/sys/netbt/l2cap_misc.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: l2cap_misc.c,v 1.5 2008/09/10 14:01:23 blambert Exp $ */
-/* $NetBSD: l2cap_misc.c,v 1.5 2007/11/03 17:20:17 plunky Exp $ */
+/* $OpenBSD: l2cap_misc.c,v 1.6 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: l2cap_misc.c,v 1.6 2008/04/24 11:38:37 ad Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -188,9 +188,8 @@ l2cap_rtx(void *arg)
{
struct l2cap_req *req = arg;
struct l2cap_channel *chan;
- int s;
- s = splsoftnet();
+ mutex_enter(&bt_lock);
chan = req->lr_chan;
DPRINTF("cid %d, ident %d\n", (chan ? chan->lc_lcid : 0), req->lr_id);
@@ -200,7 +199,7 @@ l2cap_rtx(void *arg)
if (chan && chan->lc_state != L2CAP_CLOSED)
l2cap_close(chan, ETIMEDOUT);
- splx(s);
+ mutex_exit(&bt_lock);
}
/*
diff --git a/sys/netbt/l2cap_socket.c b/sys/netbt/l2cap_socket.c
index b1d6ee6b355..b67838481a6 100644
--- a/sys/netbt/l2cap_socket.c
+++ b/sys/netbt/l2cap_socket.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: l2cap_socket.c,v 1.2 2008/05/27 19:41:14 thib Exp $ */
-/* $NetBSD: l2cap_socket.c,v 1.7 2007/04/21 06:15:23 plunky Exp $ */
+/* $OpenBSD: l2cap_socket.c,v 1.3 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: l2cap_socket.c,v 1.9 2008/08/06 15:01:24 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -125,9 +125,9 @@ l2cap_usrreq(struct socket *up, int req, struct mbuf *m,
#endif
case PRU_ATTACH:
+ /* XXX solock() and bt_lock fiddling in NetBSD */
if (pcb != NULL)
return EINVAL;
-
/*
* For L2CAP socket PCB we just use an l2cap_channel structure
* since we have nothing to add..
diff --git a/sys/netbt/l2cap_upper.c b/sys/netbt/l2cap_upper.c
index d3236a95a99..4ce612f661e 100644
--- a/sys/netbt/l2cap_upper.c
+++ b/sys/netbt/l2cap_upper.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: l2cap_upper.c,v 1.2 2007/10/01 16:39:30 krw Exp $ */
-/* $NetBSD: l2cap_upper.c,v 1.8 2007/04/29 20:23:36 msaitoh Exp $ */
+/* $OpenBSD: l2cap_upper.c,v 1.3 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: l2cap_upper.c,v 1.9 2008/08/06 15:01:24 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
diff --git a/sys/netbt/rfcomm.h b/sys/netbt/rfcomm.h
index 056d3d49232..2b82380c865 100644
--- a/sys/netbt/rfcomm.h
+++ b/sys/netbt/rfcomm.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: rfcomm.h,v 1.3 2008/05/27 19:41:14 thib Exp $ */
-/* $NetBSD: rfcomm.h,v 1.6 2007/11/20 20:25:58 plunky Exp $ */
+/* $OpenBSD: rfcomm.h,v 1.4 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: rfcomm.h,v 1.8 2008/09/08 23:36:55 gmcgarry Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -56,7 +56,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: rfcomm.h,v 1.3 2008/05/27 19:41:14 thib Exp $
+ * $Id: rfcomm.h,v 1.4 2008/11/22 04:42:58 uwe Exp $
* $FreeBSD: src/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h,v 1.4 2005/01/11 01:39:53 emax Exp $
*/
@@ -164,7 +164,7 @@ struct rfcomm_cmd_hdr
uint8_t control;
uint8_t length;
uint8_t fcs;
-} __attribute__ ((__packed__));
+} __packed;
/* RFCOMM MSC command */
struct rfcomm_mcc_msc
@@ -172,7 +172,7 @@ struct rfcomm_mcc_msc
uint8_t address;
uint8_t modem;
uint8_t brk;
-} __attribute__ ((__packed__));
+} __packed;
/* RFCOMM RPN command */
struct rfcomm_mcc_rpn
@@ -184,14 +184,14 @@ struct rfcomm_mcc_rpn
uint8_t xon_char;
uint8_t xoff_char;
uint16_t param_mask;
-} __attribute__ ((__packed__));
+} __packed;
/* RFCOMM RLS command */
struct rfcomm_mcc_rls
{
uint8_t address;
uint8_t status;
-} __attribute__ ((__packed__));
+} __packed;
/* RFCOMM PN command */
struct rfcomm_mcc_pn
@@ -203,7 +203,7 @@ struct rfcomm_mcc_pn
uint16_t mtu;
uint8_t max_retrans;
uint8_t credits;
-} __attribute__ ((__packed__));
+} __packed;
/* RFCOMM frame parsing macros */
#define RFCOMM_DLCI(b) (((b) & 0xfc) >> 2)
diff --git a/sys/netbt/rfcomm_dlc.c b/sys/netbt/rfcomm_dlc.c
index 95be78bcfa8..7777b2b18cb 100644
--- a/sys/netbt/rfcomm_dlc.c
+++ b/sys/netbt/rfcomm_dlc.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: rfcomm_dlc.c,v 1.3 2008/09/10 14:01:23 blambert Exp $ */
-/* $NetBSD: rfcomm_dlc.c,v 1.4 2007/11/03 17:20:17 plunky Exp $ */
+/* $OpenBSD: rfcomm_dlc.c,v 1.4 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: rfcomm_dlc.c,v 1.6 2008/08/06 15:01:24 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -192,16 +192,15 @@ void
rfcomm_dlc_timeout(void *arg)
{
struct rfcomm_dlc *dlc = arg;
- int s;
- s = splsoftnet();
+ mutex_enter(&bt_lock);
if (dlc->rd_state != RFCOMM_DLC_CLOSED)
rfcomm_dlc_close(dlc, ETIMEDOUT);
else if (dlc->rd_flags & RFCOMM_DLC_DETACH)
free(dlc, M_BLUETOOTH);
- splx(s);
+ mutex_exit(&bt_lock);
}
/*
diff --git a/sys/netbt/rfcomm_session.c b/sys/netbt/rfcomm_session.c
index fca87af3144..a91958111c5 100644
--- a/sys/netbt/rfcomm_session.c
+++ b/sys/netbt/rfcomm_session.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: rfcomm_session.c,v 1.4 2008/09/10 14:01:23 blambert Exp $ */
-/* $NetBSD: rfcomm_session.c,v 1.12 2008/01/31 19:30:23 plunky Exp $ */
+/* $OpenBSD: rfcomm_session.c,v 1.5 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: rfcomm_session.c,v 1.14 2008/08/06 15:01:24 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -298,11 +298,10 @@ rfcomm_session_timeout(void *arg)
{
struct rfcomm_session *rs = arg;
struct rfcomm_dlc *dlc;
- int s;
KASSERT(rs != NULL);
- s = splsoftnet();
+ mutex_enter(&bt_lock);
if (rs->rs_state != RFCOMM_SESSION_OPEN) {
DPRINTF("timeout\n");
@@ -319,7 +318,7 @@ rfcomm_session_timeout(void *arg)
DPRINTF("expiring\n");
rfcomm_session_free(rs);
}
- splx(s);
+ mutex_exit(&bt_lock);
}
/***********************************************************************
diff --git a/sys/netbt/rfcomm_socket.c b/sys/netbt/rfcomm_socket.c
index 1c0e69db564..1ade1aacc99 100644
--- a/sys/netbt/rfcomm_socket.c
+++ b/sys/netbt/rfcomm_socket.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: rfcomm_socket.c,v 1.3 2008/05/27 19:41:14 thib Exp $ */
-/* $NetBSD: rfcomm_socket.c,v 1.8 2007/10/15 18:04:34 plunky Exp $ */
+/* $OpenBSD: rfcomm_socket.c,v 1.4 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: rfcomm_socket.c,v 1.10 2008/08/06 15:01:24 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -122,9 +122,9 @@ rfcomm_usrreq(struct socket *up, int req, struct mbuf *m,
#endif
case PRU_ATTACH:
+ /* XXX solock() and bt_lock fiddling in NetBSD */
if (pcb != NULL)
return EINVAL;
-
/*
* Since we have nothing to add, we attach the DLC
* structure directly to our PCB pointer.
diff --git a/sys/netbt/rfcomm_upper.c b/sys/netbt/rfcomm_upper.c
index 76480ac8633..b6b95feba5b 100644
--- a/sys/netbt/rfcomm_upper.c
+++ b/sys/netbt/rfcomm_upper.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: rfcomm_upper.c,v 1.5 2008/09/10 14:01:23 blambert Exp $ */
-/* $NetBSD: rfcomm_upper.c,v 1.10 2007/11/20 20:25:57 plunky Exp $ */
+/* $OpenBSD: rfcomm_upper.c,v 1.6 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: rfcomm_upper.c,v 1.11 2008/08/06 15:01:24 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
diff --git a/sys/netbt/sco.h b/sys/netbt/sco.h
index 9db741eabcb..80692420a9c 100644
--- a/sys/netbt/sco.h
+++ b/sys/netbt/sco.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: sco.h,v 1.3 2008/05/27 19:41:14 thib Exp $ */
-/* $NetBSD: sco.h,v 1.2 2006/07/26 10:20:56 tron Exp $ */
+/* $OpenBSD: sco.h,v 1.4 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: sco.h,v 1.3 2008/08/06 15:01:24 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
diff --git a/sys/netbt/sco_socket.c b/sys/netbt/sco_socket.c
index 954e0465abd..0ee635d4f13 100644
--- a/sys/netbt/sco_socket.c
+++ b/sys/netbt/sco_socket.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: sco_socket.c,v 1.2 2008/05/27 19:41:14 thib Exp $ */
-/* $NetBSD: sco_socket.c,v 1.9 2007/04/21 06:15:23 plunky Exp $ */
+/* $OpenBSD: sco_socket.c,v 1.3 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: sco_socket.c,v 1.11 2008/08/06 15:01:24 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -117,9 +117,9 @@ sco_usrreq(struct socket *up, int req, struct mbuf *m,
#endif
case PRU_ATTACH:
+ /* XXX solock() and bt_lock fiddling in NetBSD */
if (pcb)
return EINVAL;
-
err = soreserve(up, sco_sendspace, sco_recvspace);
if (err)
return err;
diff --git a/sys/netbt/sco_upper.c b/sys/netbt/sco_upper.c
index 7a27b4a89cf..f53585d7303 100644
--- a/sys/netbt/sco_upper.c
+++ b/sys/netbt/sco_upper.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: sco_upper.c,v 1.2 2007/10/01 16:39:30 krw Exp $ */
-/* $NetBSD: sco_upper.c,v 1.6 2007/03/30 20:47:03 plunky Exp $ */
+/* $OpenBSD: sco_upper.c,v 1.3 2008/11/22 04:42:58 uwe Exp $ */
+/* $NetBSD: sco_upper.c,v 1.8 2008/08/06 15:01:24 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -149,13 +149,10 @@ sco_connect(struct sco_pcb *pcb, struct sockaddr_bt *dest)
if (acl == NULL || acl->hl_state != HCI_LINK_OPEN)
return EHOSTUNREACH;
- sco = hci_link_alloc(unit);
+ sco = hci_link_alloc(unit, &pcb->sp_raddr, HCI_LINK_SCO);
if (sco == NULL)
return ENOMEM;
- sco->hl_type = HCI_LINK_SCO;
- bdaddr_copy(&sco->hl_bdaddr, &pcb->sp_raddr);
-
sco->hl_link = hci_acl_open(unit, &pcb->sp_raddr);
KASSERT(sco->hl_link == acl);