Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netbt add version and extended feature flags defined in ...
details: https://anonhg.NetBSD.org/src/rev/c1bd14bd6b7c
branches: trunk
changeset: 341899:c1bd14bd6b7c
user: plunky <plunky%NetBSD.org@localhost>
date: Sat Nov 28 09:04:34 2015 +0000
description:
add version and extended feature flags defined in 4.2 specification,
add cache for page 2 of extended features and return this in
the SIOCGBTFEAT ioctl (no change in size)
diffstat:
sys/netbt/hci.h | 42 ++++++++++++++++++++++++++++++++++--------
sys/netbt/hci_event.c | 8 ++++++--
sys/netbt/hci_ioctl.c | 5 +++--
3 files changed, 43 insertions(+), 12 deletions(-)
diffs (166 lines):
diff -r 85449376b83c -r c1bd14bd6b7c sys/netbt/hci.h
--- a/sys/netbt/hci.h Sat Nov 28 08:57:33 2015 +0000
+++ b/sys/netbt/hci.h Sat Nov 28 09:04:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hci.h,v 1.40 2015/09/06 06:01:01 dholland Exp $ */
+/* $NetBSD: hci.h,v 1.41 2015/11/28 09:04:34 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -54,14 +54,15 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: hci.h,v 1.40 2015/09/06 06:01:01 dholland Exp $
+ * $Id: hci.h,v 1.41 2015/11/28 09:04:34 plunky Exp $
* $FreeBSD: src/sys/netgraph/bluetooth/include/ng_hci.h,v 1.6 2005/01/07 01:45:43 imp Exp $
*/
/*
* This file contains everything that applications need to know from
* Host Controller Interface (HCI). Information taken from Bluetooth
- * Core Specifications (v1.1, v2.0 and v2.1)
+ * Core Specifications (v1.1, v2.0, v2.1 + EDR, v3.0 + HS,
+ * v4.0 and v4.2)
*
* This file can be included by both kernel and userland applications.
*
@@ -101,7 +102,10 @@
#define HCI_SPEC_V20 0x03 /* v2.0 + EDR */
#define HCI_SPEC_V21 0x04 /* v2.1 + EDR */
#define HCI_SPEC_V30 0x05 /* v3.0 + HS */
-/* 0x06 - 0xFF - reserved for future use */
+#define HCI_SPEC_V40 0x06 /* v4.0 */
+#define HCI_SPEC_V41 0x07 /* v4.1 */
+#define HCI_SPEC_V42 0x08 /* v4.2 */
+/* 0x09 - 0xFF - reserved for future use */
/* LMP features (and page 0 of extended features) */
/* ------------------- byte 0 --------------------*/
@@ -146,8 +150,8 @@
/* reserved 0x04 */
#define HCI_LMP_AFH_CAPABLE_SLAVE 0x08
#define HCI_LMP_AFH_CLASS_SLAVE 0x10
-/* reserved 0x20 */
-/* reserved 0x40 */
+#define HCI_LMP_BR_EDR_UNSUPPORTED 0x20
+#define HCI_LMP_LE_CONTROLLER 0x40
#define HCI_LMP_3SLOT_EDR_ACL 0x80
/* ------------------- byte 5 --------------------*/
#define HCI_LMP_5SLOT_EDR_ACL 0x01
@@ -160,7 +164,7 @@
#define HCI_LMP_3SLOT_EDR_eSCO 0x80
/* ------------------- byte 6 --------------------*/
#define HCI_LMP_EXTENDED_INQUIRY 0x01
-/* reserved 0x02 */
+#define HCI_LMP_LE_BR_EDR_CONTROLLER 0x02
/* reserved 0x04 */
#define HCI_LMP_SIMPLE_PAIRING 0x08
#define HCI_LMP_ENCAPSULATED_PDU 0x10
@@ -176,6 +180,25 @@
/* page 1 of extended features */
/* ------------------- byte 0 --------------------*/
#define HCI_LMP_SSP 0x01
+#define HCI_LMP_LE_HOST 0x02
+#define HCI_LMP_LE_BR_EDR_HOST 0x04
+#define HCI_LMP_SECURE_CONN_HOST 0x08
+
+/* page 2 of extended features */
+/* ------------------- byte 0 --------------------*/
+#define HCI_LMP_CONNLESS_MASTER 0x01
+#define HCI_LMP_CONNLESS_SLAVE 0x02
+#define HCI_LMP_SYNC_TRAIN 0x04
+#define HCI_LMP_SYNC_SCAN 0x08
+#define HCI_LMP_INQ_RSP_NOTIFY 0x10
+#define HCI_LMP_INTERLACE_SCAN 0x20
+#define HCI_LMP_COARSE_CLOCK 0x40
+/* reserved 0x80 */
+/* ------------------- byte 0 --------------------*/
+#define HCI_LMP_SECURE_CONN_CONTROLLER 0x01
+#define HCI_LMP_PING 0x02
+/* reserved 0x04 */
+#define HCI_LMP_TRAIN_NUDGING 0x08
/* Link types */
#define HCI_LINK_SCO 0x00 /* Voice */
@@ -2334,6 +2357,7 @@
struct {
uint8_t btrf_page0[HCI_FEATURES_SIZE]; /* basic */
uint8_t btrf_page1[HCI_FEATURES_SIZE]; /* extended */
+ uint8_t btrf_page2[HCI_FEATURES_SIZE]; /* extended */
} btrf;
struct bt_stats btrs; /* unit stats */
} btru;
@@ -2352,6 +2376,7 @@
#define btr_max_sco btru.btri.btri_max_sco
#define btr_features0 btru.btrf.btrf_page0
#define btr_features1 btru.btrf.btrf_page1
+#define btr_features2 btru.btrf.btrf_page2
#define btr_stats btru.btrs
/* hci_unit & btr_flags */
@@ -2496,7 +2521,8 @@
uint16_t hci_lmp_mask; /* link policy capabilities */
uint8_t hci_feat0[HCI_FEATURES_SIZE]; /* features mask */
- uint8_t hci_feat1[HCI_FEATURES_SIZE]; /* extended */
+ uint8_t hci_feat1[HCI_FEATURES_SIZE]; /* extended page 1 */
+ uint8_t hci_feat2[HCI_FEATURES_SIZE]; /* extended page 2 */
uint8_t hci_cmds[HCI_COMMANDS_SIZE]; /* opcode bitmask */
/* flow control */
diff -r 85449376b83c -r c1bd14bd6b7c sys/netbt/hci_event.c
--- a/sys/netbt/hci_event.c Sat Nov 28 08:57:33 2015 +0000
+++ b/sys/netbt/hci_event.c Sat Nov 28 09:04:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hci_event.c,v 1.23 2011/07/27 10:25:09 plunky Exp $ */
+/* $NetBSD: hci_event.c,v 1.24 2015/11/28 09:04:34 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hci_event.c,v 1.23 2011/07/27 10:25:09 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hci_event.c,v 1.24 2015/11/28 09:04:34 plunky Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -1085,6 +1085,10 @@
rp.page, rp.max_page);
switch (rp.page) {
+ case 2:
+ memcpy(unit->hci_feat2, rp.features, HCI_FEATURES_SIZE);
+ break;
+
case 1:
memcpy(unit->hci_feat1, rp.features, HCI_FEATURES_SIZE);
break;
diff -r 85449376b83c -r c1bd14bd6b7c sys/netbt/hci_ioctl.c
--- a/sys/netbt/hci_ioctl.c Sat Nov 28 08:57:33 2015 +0000
+++ b/sys/netbt/hci_ioctl.c Sat Nov 28 09:04:34 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hci_ioctl.c,v 1.12 2014/07/01 05:49:18 rtr Exp $ */
+/* $NetBSD: hci_ioctl.c,v 1.13 2015/11/28 09:04:34 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hci_ioctl.c,v 1.12 2014/07/01 05:49:18 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hci_ioctl.c,v 1.13 2015/11/28 09:04:34 plunky Exp $");
#include <sys/param.h>
#include <sys/domain.h>
@@ -311,6 +311,7 @@
strlcpy(btr->btr_name, device_xname(unit->hci_dev), HCI_DEVNAME_SIZE);
memcpy(btr->btr_features0, unit->hci_feat0, HCI_FEATURES_SIZE);
memcpy(btr->btr_features1, unit->hci_feat1, HCI_FEATURES_SIZE);
+ memcpy(btr->btr_features2, unit->hci_feat2, HCI_FEATURES_SIZE);
break;
default:
Home |
Main Index |
Thread Index |
Old Index