svn commit: r360070 - head/usr.sbin/bluetooth/hccontrol

Hans Petter Selasky hselasky at FreeBSD.org
Sat Apr 18 08:29:18 UTC 2020


Author: hselasky
Date: Sat Apr 18 08:29:16 2020
New Revision: 360070
URL: https://svnweb.freebsd.org/changeset/base/360070

Log:
  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 <marc at bumblingdork.com>
  PR:		245354
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/usr.sbin/bluetooth/hccontrol/info.c
  head/usr.sbin/bluetooth/hccontrol/link_control.c
  head/usr.sbin/bluetooth/hccontrol/node.c
  head/usr.sbin/bluetooth/hccontrol/util.c

Modified: head/usr.sbin/bluetooth/hccontrol/info.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/info.c	Sat Apr 18 08:00:58 2020	(r360069)
+++ head/usr.sbin/bluetooth/hccontrol/info.c	Sat Apr 18 08:29:16 2020	(r360070)
@@ -78,7 +78,7 @@ hci_read_local_supported_features(int s, int argc, cha
 {
 	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,

Modified: head/usr.sbin/bluetooth/hccontrol/link_control.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/link_control.c	Sat Apr 18 08:00:58 2020	(r360069)
+++ head/usr.sbin/bluetooth/hccontrol/link_control.c	Sat Apr 18 08:29:16 2020	(r360070)
@@ -612,7 +612,7 @@ hci_read_remote_supported_features(int s, int argc, ch
 	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) {

Modified: head/usr.sbin/bluetooth/hccontrol/node.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/node.c	Sat Apr 18 08:00:58 2020	(r360069)
+++ head/usr.sbin/bluetooth/hccontrol/node.c	Sat Apr 18 08:29:16 2020	(r360070)
@@ -153,7 +153,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)

Modified: head/usr.sbin/bluetooth/hccontrol/util.c
==============================================================================
--- head/usr.sbin/bluetooth/hccontrol/util.c	Sat Apr 18 08:00:58 2020	(r360069)
+++ head/usr.sbin/bluetooth/hccontrol/util.c	Sat Apr 18 08:29:16 2020	(r360070)
@@ -289,7 +289,57 @@ hci_features2str(uint8_t *features, char *buffer, int 
 		/* 4 */ "<Flow control lag (bit0)> ",
 		/* 5 */ "<Flow control lag (bit1)> ",
 		/* 6 */ "<Flow control lag (bit2)> ",
-		/* 7 */ "<Unknown2.7> "
+		/* 7 */ "<Broadcast Encryption> "
+	},
+	{ /* byte 3 */
+		/* 0 */ "<Unknown 3.0> ",
+		/* 1 */ "<EDR ACL 2 Mb/s> ",
+		/* 2 */ "<EDR ACL 3 Mb/s> ",
+		/* 3 */ "<Enhanced inquiry scan> ",
+		/* 4 */ "<Interlaced inquiry scan> ",
+		/* 5 */ "<Interlaced page scan> ",
+		/* 6 */ "<RSSI with inquiry results> ",
+		/* 7 */ "<Extended SCO link (EV3 packets)> "
+	},
+	{ /* byte 4 */
+		/* 0 */ "<EV4 packets> ",
+		/* 1 */ "<EV5 packets> ",
+		/* 2 */ "<Unknown 4.2> ",
+		/* 3 */ "<AFH capable slave> ",
+		/* 4 */ "<AFH classification slave> ",
+		/* 5 */ "<BR/EDR Not Supported> ",
+		/* 6 */ "<LE Supported (Controller)> ",
+		/* 7 */ "<3-Slot EDR ACL packets> "
+	},
+	{ /* byte 5 */
+		/* 0 */ "<5-Slot EDR ACL packets> ",
+		/* 1 */ "<Sniff subrating> ",
+		/* 2 */ "<Pause encryption> ",
+		/* 3 */ "<AFH capable master> ",
+		/* 4 */ "<AFH classification master> ",
+		/* 5 */ "<EDR eSCO 2 Mb/s mode> ",
+		/* 6 */ "<EDR eSCO 3 Mb/s mode> ",
+		/* 7 */ "<3-Slot EDR eSCO packets> "
+	},
+	{ /* byte 6 */
+		/* 0 */ "<Enhanced Inquiry Response> ",
+		/* 1 */ "<Simultaneous LE and BR/EDR (Controller)> ",
+		/* 2 */ "<Unknown 6.2> ",
+		/* 3 */ "<Secure Simple Pairing (Controller Support)> ",
+		/* 4 */ "<Encapsulated PDU> ",
+		/* 5 */ "<Erroneous Data Reporting> ",
+		/* 6 */ "<Non-flushable Packed Boundary Flag> ",
+		/* 7 */ "<Unknown 6.7> "
+	},
+	{ /* byte 7 */
+		/* 0 */ "<HCI_Link_Supervision_Timeout_Changed event> ",
+		/* 1 */ "<Variable Inquiry TX Power Level> ",
+		/* 2 */ "<Enhanced Power Control> ",
+		/* 3 */ "<Unknown 7.3> ",
+		/* 4 */ "<Unknown 7.4> ",
+		/* 5 */ "<Unknown 7.5> ",
+		/* 6 */ "<Unknown 7.6> ",
+		/* 7 */ "<Extended features> "
 	}};
 
 	if (buffer != NULL && size > 0) {


More information about the svn-src-all mailing list