From 4a1f4fdc0646e683c139891bebc205b67be348d0 Mon Sep 17 00:00:00 2001 From: hselasky Date: Mon, 18 May 2020 08:43:05 +0000 Subject: [PATCH] MFC r360070: Add missing feature descriptions to hci_features2str(). The list of possible features in hccontrol/features2str() is incomplete. Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition". Submitted by: Marc Veldman PR: 245354 Sponsored by: Mellanox Technologies git-svn-id: svn://svn.freebsd.org/base/stable/10@361154 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.sbin/bluetooth/hccontrol/info.c | 2 +- usr.sbin/bluetooth/hccontrol/link_control.c | 2 +- usr.sbin/bluetooth/hccontrol/node.c | 2 +- usr.sbin/bluetooth/hccontrol/util.c | 52 ++++++++++++++++++++- 4 files changed, 54 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bluetooth/hccontrol/info.c b/usr.sbin/bluetooth/hccontrol/info.c index d7bad36bb..7f5c90ac5 100644 --- a/usr.sbin/bluetooth/hccontrol/info.c +++ b/usr.sbin/bluetooth/hccontrol/info.c @@ -75,7 +75,7 @@ hci_read_local_supported_features(int s, int argc, char **argv) { ng_hci_read_local_features_rp rp; int n; - char buffer[1024]; + char buffer[2048]; n = sizeof(rp); if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_INFO, diff --git a/usr.sbin/bluetooth/hccontrol/link_control.c b/usr.sbin/bluetooth/hccontrol/link_control.c index 536520a71..2e05494ad 100644 --- a/usr.sbin/bluetooth/hccontrol/link_control.c +++ b/usr.sbin/bluetooth/hccontrol/link_control.c @@ -609,7 +609,7 @@ hci_read_remote_supported_features(int s, int argc, char **argv) char b[512]; ng_hci_read_remote_features_cp cp; ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b; - char buffer[1024]; + char buffer[2048]; /* parse command parameters */ switch (argc) { diff --git a/usr.sbin/bluetooth/hccontrol/node.c b/usr.sbin/bluetooth/hccontrol/node.c index d5f12d4c2..53abb8ac7 100644 --- a/usr.sbin/bluetooth/hccontrol/node.c +++ b/usr.sbin/bluetooth/hccontrol/node.c @@ -150,7 +150,7 @@ hci_read_node_features(int s, int argc, char **argv) { struct ng_btsocket_hci_raw_node_features r; int n; - char buffer[1024]; + char buffer[2048]; memset(&r, 0, sizeof(r)); if (ioctl(s, SIOC_HCI_RAW_NODE_GET_FEATURES, &r, sizeof(r)) < 0) diff --git a/usr.sbin/bluetooth/hccontrol/util.c b/usr.sbin/bluetooth/hccontrol/util.c index 4bb5000c0..c0c649690 100644 --- a/usr.sbin/bluetooth/hccontrol/util.c +++ b/usr.sbin/bluetooth/hccontrol/util.c @@ -276,7 +276,57 @@ hci_features2str(uint8_t *features, char *buffer, int size) /* 4 */ " ", /* 5 */ " ", /* 6 */ " ", - /* 7 */ " " + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ "
", + /* 6 */ " ", + /* 7 */ "<3-Slot EDR ACL packets> " + }, + { /* byte 5 */ + /* 0 */ "<5-Slot EDR ACL packets> ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ "<3-Slot EDR eSCO packets> " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " }}; if (buffer != NULL && size > 0) { -- 2.42.0