Diff between d7e1f84d3074fff371bd0ffe5025eee63f57cc3c and bf857b7a57624194da5e51c1aa75db18fa6b908e

Changed Files

File Additions Deletions Status
plugins/hciops.c +7 -17 modified

Full Patch

diff --git a/plugins/hciops.c b/plugins/hciops.c
index 0f8f79d..ddff544 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -1372,20 +1372,6 @@ static inline void remote_features_notify(int index, void *ptr)
 	write_features_info(&dev->bdaddr, &evt->bdaddr, NULL, evt->features);
 }
 
-static void write_le_host_complete(int index, uint8_t status)
-{
-	struct dev_info *dev = &devs[index];
-	uint8_t page_num = 0x01;
-
-	if (status)
-		return;
-
-	if (hci_send_cmd(dev->sk, OGF_INFO_PARAM,
-				OCF_READ_LOCAL_EXT_FEATURES, 1, &page_num) < 0)
-		error("Unable to read extended local features: %s (%d)",
-						strerror(errno), errno);
-}
-
 static void read_local_version_complete(int index,
 				const read_local_version_rp *rp)
 {
@@ -1801,9 +1787,6 @@ static inline void cmd_complete(int index, void *ptr)
 	case cmd_opcode_pack(OGF_LINK_CTL, OCF_INQUIRY_CANCEL):
 		cc_inquiry_cancel(index, status);
 		break;
-	case cmd_opcode_pack(OGF_HOST_CTL, OCF_WRITE_LE_HOST_SUPPORTED):
-		write_le_host_complete(index, status);
-		break;
 	case cmd_opcode_pack(OGF_LE_CTL, OCF_LE_SET_SCAN_ENABLE):
 		cc_le_set_scan_enable(index, status);
 		break;
@@ -2498,6 +2481,13 @@ static void device_devup_setup(int index)
 	bacpy(&dev->bdaddr, &di.bdaddr);
 	memcpy(dev->features, di.features, 8);
 
+	if (dev->features[7] & LMP_EXT_FEAT) {
+		uint8_t page_num = 0x01;
+
+		hci_send_cmd(dev->sk, OGF_INFO_PARAM,
+				OCF_READ_LOCAL_EXT_FEATURES, 1, &page_num);
+	}
+
 	/* Set page timeout */
 	if ((main_opts.flags & (1 << HCID_SET_PAGETO))) {
 		write_page_timeout_cp cp;