All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings
@ 2025-08-06 19:48 Luiz Augusto von Dentz
  2025-08-06 19:48 ` [PATCH v3 2/2] Bluetooth: hci_core: Fix using ll_privacy_capable " Luiz Augusto von Dentz
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2025-08-06 19:48 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

{cis,bis}_capable only indicates the controller supports the feature
since it doesn't check that LE is enabled so it shall not be used for
current setting, instead this introduces {cis,bis}_enabled macros that
can be used to indicate that these features are currently enabled.

Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
Fixes: ae7533613133 ("Bluetooth: Check for ISO support in controller")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 include/net/bluetooth/bluetooth.h |  4 ++--
 include/net/bluetooth/hci_core.h  | 13 ++++++++++++-
 net/bluetooth/hci_sync.c          |  4 ++--
 net/bluetooth/iso.c               | 14 +++++++-------
 net/bluetooth/mgmt.c              | 10 +++++-----
 5 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index ada5b56a4413..e5751f3070b8 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -647,7 +647,7 @@ static inline void sco_exit(void)
 #if IS_ENABLED(CONFIG_BT_LE)
 int iso_init(void);
 int iso_exit(void);
-bool iso_enabled(void);
+bool iso_inited(void);
 #else
 static inline int iso_init(void)
 {
@@ -659,7 +659,7 @@ static inline int iso_exit(void)
 	return 0;
 }
 
-static inline bool iso_enabled(void)
+static inline bool iso_inited(void)
 {
 	return false;
 }
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 4dc11c66f7b8..bc29f2e2e16f 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1915,6 +1915,8 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
 				!hci_dev_test_flag(dev, HCI_RPA_EXPIRED))
 #define adv_rpa_valid(adv)     (bacmp(&adv->random_addr, BDADDR_ANY) && \
 				!adv->rpa_expired)
+#define le_enabled(dev)        (lmp_le_capable(dev) && \
+				hci_dev_test_flag(dev, HCI_LE_ENABLED))
 
 #define scan_1m(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_1M) || \
 		      ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_1M))
@@ -1981,14 +1983,23 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
 
 /* CIS Master/Slave and BIS support */
 #define iso_capable(dev) (cis_capable(dev) || bis_capable(dev))
+#define iso_enabled(dev) (le_enabled(dev) && iso_capable(dev))
 #define cis_capable(dev) \
 	(cis_central_capable(dev) || cis_peripheral_capable(dev))
+#define cis_enabled(dev) (le_enabled(dev) && cis_capable(dev))
 #define cis_central_capable(dev) \
 	((dev)->le_features[3] & HCI_LE_CIS_CENTRAL)
+#define cis_central_enabled(dev) \
+	(le_enabled(dev) && cis_central_capable(dev))
 #define cis_peripheral_capable(dev) \
 	((dev)->le_features[3] & HCI_LE_CIS_PERIPHERAL)
+#define cis_peripheral_enabled(dev) \
+	(le_enabled(dev) && cis_peripheral_capable(dev))
 #define bis_capable(dev) ((dev)->le_features[3] & HCI_LE_ISO_BROADCASTER)
-#define sync_recv_capable(dev) ((dev)->le_features[3] & HCI_LE_ISO_SYNC_RECEIVER)
+#define bis_enabled(dev) (le_enabled(dev) && bis_capable(dev))
+#define sync_recv_capable(dev) \
+	((dev)->le_features[3] & HCI_LE_ISO_SYNC_RECEIVER)
+#define sync_recv_enabled(dev) (le_enabled(dev) && sync_recv_capable(dev))
 
 #define mws_transport_config_capable(dev) (((dev)->commands[30] & 0x08) && \
 	(!hci_test_quirk((dev), HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG)))
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 387c128f2ba0..aa7d7a8ec3ee 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4531,14 +4531,14 @@ static int hci_le_set_host_feature_sync(struct hci_dev *hdev)
 {
 	struct hci_cp_le_set_host_feature cp;
 
-	if (!cis_capable(hdev))
+	if (!iso_capable(hdev))
 		return 0;
 
 	memset(&cp, 0, sizeof(cp));
 
 	/* Connected Isochronous Channels (Host Support) */
 	cp.bit_number = 32;
-	cp.bit_value = 1;
+	cp.bit_value = iso_enabled(hdev) ? 0x01 : 0x00;
 
 	return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_HOST_FEATURE,
 				     sizeof(cp), &cp, HCI_CMD_TIMEOUT);
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index eaffd25570e3..5ce823ca3aaf 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -2483,11 +2483,11 @@ static const struct net_proto_family iso_sock_family_ops = {
 	.create	= iso_sock_create,
 };
 
-static bool iso_inited;
+static bool inited;
 
-bool iso_enabled(void)
+bool iso_inited(void)
 {
-	return iso_inited;
+	return inited;
 }
 
 int iso_init(void)
@@ -2496,7 +2496,7 @@ int iso_init(void)
 
 	BUILD_BUG_ON(sizeof(struct sockaddr_iso) > sizeof(struct sockaddr));
 
-	if (iso_inited)
+	if (inited)
 		return -EALREADY;
 
 	err = proto_register(&iso_proto, 0);
@@ -2524,7 +2524,7 @@ int iso_init(void)
 		iso_debugfs = debugfs_create_file("iso", 0444, bt_debugfs,
 						  NULL, &iso_debugfs_fops);
 
-	iso_inited = true;
+	inited = true;
 
 	return 0;
 
@@ -2535,7 +2535,7 @@ int iso_init(void)
 
 int iso_exit(void)
 {
-	if (!iso_inited)
+	if (!inited)
 		return -EALREADY;
 
 	bt_procfs_cleanup(&init_net, "iso");
@@ -2549,7 +2549,7 @@ int iso_exit(void)
 
 	proto_unregister(&iso_proto);
 
-	iso_inited = false;
+	inited = false;
 
 	return 0;
 }
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 1ce682038b51..c42dffe77daf 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -922,16 +922,16 @@ static u32 get_current_settings(struct hci_dev *hdev)
 	if (hci_dev_test_flag(hdev, HCI_WIDEBAND_SPEECH_ENABLED))
 		settings |= MGMT_SETTING_WIDEBAND_SPEECH;
 
-	if (cis_central_capable(hdev))
+	if (cis_central_enabled(hdev))
 		settings |= MGMT_SETTING_CIS_CENTRAL;
 
-	if (cis_peripheral_capable(hdev))
+	if (cis_peripheral_enabled(hdev))
 		settings |= MGMT_SETTING_CIS_PERIPHERAL;
 
-	if (bis_capable(hdev))
+	if (bis_enabled(hdev))
 		settings |= MGMT_SETTING_ISO_BROADCASTER;
 
-	if (sync_recv_capable(hdev))
+	if (sync_recv_enabled(hdev))
 		settings |= MGMT_SETTING_ISO_SYNC_RECEIVER;
 
 	if (ll_privacy_capable(hdev))
@@ -4513,7 +4513,7 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev,
 	}
 
 	if (IS_ENABLED(CONFIG_BT_LE)) {
-		flags = iso_enabled() ? BIT(0) : 0;
+		flags = iso_inited() ? BIT(0) : 0;
 		memcpy(rp->features[idx].uuid, iso_socket_uuid, 16);
 		rp->features[idx].flags = cpu_to_le32(flags);
 		idx++;
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v3 2/2] Bluetooth: hci_core: Fix using ll_privacy_capable for current settings
  2025-08-06 19:48 [PATCH v3 1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings Luiz Augusto von Dentz
@ 2025-08-06 19:48 ` Luiz Augusto von Dentz
  2025-08-07  8:01   ` Paul Menzel
  2025-08-06 20:37 ` [v3,1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable " bluez.test.bot
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2025-08-06 19:48 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

ll_privacy_capable only indicates that the controller supports the
feature but it doesnt' check that LE is enabled so it end up being
marked as active in the current settings when it shouldn't.

Fixes: ad383c2c65a5 ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 include/net/bluetooth/hci_core.h | 1 +
 net/bluetooth/mgmt.c             | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index bc29f2e2e16f..bb30bde6f0e8 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1934,6 +1934,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
 			 ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED))
 
 #define ll_privacy_capable(dev) ((dev)->le_features[0] & HCI_LE_LL_PRIVACY)
+#define ll_privacy_enabled(dev) (le_enabled(dev) && ll_privacy_capable(dev))
 
 #define privacy_mode_capable(dev) (ll_privacy_capable(dev) && \
 				   ((dev)->commands[39] & 0x04))
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index c42dffe77daf..3166f5fb876b 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -934,7 +934,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
 	if (sync_recv_enabled(hdev))
 		settings |= MGMT_SETTING_ISO_SYNC_RECEIVER;
 
-	if (ll_privacy_capable(hdev))
+	if (ll_privacy_enabled(hdev))
 		settings |= MGMT_SETTING_LL_PRIVACY;
 
 	return settings;
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [v3,1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings
  2025-08-06 19:48 [PATCH v3 1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings Luiz Augusto von Dentz
  2025-08-06 19:48 ` [PATCH v3 2/2] Bluetooth: hci_core: Fix using ll_privacy_capable " Luiz Augusto von Dentz
@ 2025-08-06 20:37 ` bluez.test.bot
  2025-08-07  8:01 ` [PATCH v3 1/2] " Paul Menzel
  2025-08-07 15:50 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2025-08-06 20:37 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 2616 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=988875

---Test result---

Test Summary:
CheckPatch                    PENDING   0.38 seconds
GitLint                       PENDING   0.26 seconds
SubjectPrefix                 PASS      0.26 seconds
BuildKernel                   PASS      24.78 seconds
CheckAllWarning               PASS      27.12 seconds
CheckSparse                   PASS      30.89 seconds
BuildKernel32                 PASS      24.62 seconds
TestRunnerSetup               PASS      484.24 seconds
TestRunner_l2cap-tester       PASS      25.14 seconds
TestRunner_iso-tester         PASS      38.15 seconds
TestRunner_bnep-tester        PASS      6.05 seconds
TestRunner_mgmt-tester        FAIL      128.82 seconds
TestRunner_rfcomm-tester      PASS      9.59 seconds
TestRunner_sco-tester         PASS      14.87 seconds
TestRunner_ioctl-tester       PASS      10.17 seconds
TestRunner_mesh-tester        FAIL      11.42 seconds
TestRunner_smp-tester         PASS      8.67 seconds
TestRunner_userchan-tester    PASS      6.33 seconds
IncrementalBuild              PENDING   0.91 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 490, Passed: 481 (98.2%), Failed: 5, Not Run: 4

Failed Test Cases
Add Ext Advertising - Success 22 (LE -> off, Remove) Failed       0.136 seconds
Set Device ID - Power off and Power on               Failed       0.125 seconds
Set Device ID - SSP off and Power on                 Failed       0.124 seconds
LL Privacy - Add Device 3 (AL is full)               Failed       0.213 seconds
LL Privacy - Set Flags 1 (Add to RL)                 Failed       0.145 seconds
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0

Failed Test Cases
Mesh - Send cancel - 1                               Timed out    2.028 seconds
Mesh - Send cancel - 2                               Timed out    1.997 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings
  2025-08-06 19:48 [PATCH v3 1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings Luiz Augusto von Dentz
  2025-08-06 19:48 ` [PATCH v3 2/2] Bluetooth: hci_core: Fix using ll_privacy_capable " Luiz Augusto von Dentz
  2025-08-06 20:37 ` [v3,1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable " bluez.test.bot
@ 2025-08-07  8:01 ` Paul Menzel
  2025-08-07 15:50 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 6+ messages in thread
From: Paul Menzel @ 2025-08-07  8:01 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Dear Luiz,


Am 06.08.25 um 21:48 schrieb Luiz Augusto von Dentz:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> {cis,bis}_capable only indicates the controller supports the feature
> since it doesn't check that LE is enabled so it shall not be used for
> current setting, instead this introduces {cis,bis}_enabled macros that
> can be used to indicate that these features are currently enabled.
> 
> Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
> Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
> Fixes: ae7533613133 ("Bluetooth: Check for ISO support in controller")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
>   include/net/bluetooth/bluetooth.h |  4 ++--
>   include/net/bluetooth/hci_core.h  | 13 ++++++++++++-
>   net/bluetooth/hci_sync.c          |  4 ++--
>   net/bluetooth/iso.c               | 14 +++++++-------
>   net/bluetooth/mgmt.c              | 10 +++++-----
>   5 files changed, 28 insertions(+), 17 deletions(-)
> 
> diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
> index ada5b56a4413..e5751f3070b8 100644
> --- a/include/net/bluetooth/bluetooth.h
> +++ b/include/net/bluetooth/bluetooth.h
> @@ -647,7 +647,7 @@ static inline void sco_exit(void)
>   #if IS_ENABLED(CONFIG_BT_LE)
>   int iso_init(void);
>   int iso_exit(void);
> -bool iso_enabled(void);
> +bool iso_inited(void);
>   #else
>   static inline int iso_init(void)
>   {
> @@ -659,7 +659,7 @@ static inline int iso_exit(void)
>   	return 0;
>   }
>   
> -static inline bool iso_enabled(void)
> +static inline bool iso_inited(void)
>   {
>   	return false;
>   }
> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> index 4dc11c66f7b8..bc29f2e2e16f 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -1915,6 +1915,8 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
>   				!hci_dev_test_flag(dev, HCI_RPA_EXPIRED))
>   #define adv_rpa_valid(adv)     (bacmp(&adv->random_addr, BDADDR_ANY) && \
>   				!adv->rpa_expired)
> +#define le_enabled(dev)        (lmp_le_capable(dev) && \
> +				hci_dev_test_flag(dev, HCI_LE_ENABLED))
>   
>   #define scan_1m(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_1M) || \
>   		      ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_1M))
> @@ -1981,14 +1983,23 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
>   
>   /* CIS Master/Slave and BIS support */
>   #define iso_capable(dev) (cis_capable(dev) || bis_capable(dev))
> +#define iso_enabled(dev) (le_enabled(dev) && iso_capable(dev))
>   #define cis_capable(dev) \
>   	(cis_central_capable(dev) || cis_peripheral_capable(dev))
> +#define cis_enabled(dev) (le_enabled(dev) && cis_capable(dev))
>   #define cis_central_capable(dev) \
>   	((dev)->le_features[3] & HCI_LE_CIS_CENTRAL)
> +#define cis_central_enabled(dev) \
> +	(le_enabled(dev) && cis_central_capable(dev))
>   #define cis_peripheral_capable(dev) \
>   	((dev)->le_features[3] & HCI_LE_CIS_PERIPHERAL)
> +#define cis_peripheral_enabled(dev) \
> +	(le_enabled(dev) && cis_peripheral_capable(dev))
>   #define bis_capable(dev) ((dev)->le_features[3] & HCI_LE_ISO_BROADCASTER)
> -#define sync_recv_capable(dev) ((dev)->le_features[3] & HCI_LE_ISO_SYNC_RECEIVER)
> +#define bis_enabled(dev) (le_enabled(dev) && bis_capable(dev))
> +#define sync_recv_capable(dev) \
> +	((dev)->le_features[3] & HCI_LE_ISO_SYNC_RECEIVER)
> +#define sync_recv_enabled(dev) (le_enabled(dev) && sync_recv_capable(dev))
>   
>   #define mws_transport_config_capable(dev) (((dev)->commands[30] & 0x08) && \
>   	(!hci_test_quirk((dev), HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG)))
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index 387c128f2ba0..aa7d7a8ec3ee 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -4531,14 +4531,14 @@ static int hci_le_set_host_feature_sync(struct hci_dev *hdev)
>   {
>   	struct hci_cp_le_set_host_feature cp;
>   
> -	if (!cis_capable(hdev))
> +	if (!iso_capable(hdev))
>   		return 0;
>   
>   	memset(&cp, 0, sizeof(cp));
>   
>   	/* Connected Isochronous Channels (Host Support) */
>   	cp.bit_number = 32;
> -	cp.bit_value = 1;
> +	cp.bit_value = iso_enabled(hdev) ? 0x01 : 0x00;
>   
>   	return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_HOST_FEATURE,
>   				     sizeof(cp), &cp, HCI_CMD_TIMEOUT);
> diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
> index eaffd25570e3..5ce823ca3aaf 100644
> --- a/net/bluetooth/iso.c
> +++ b/net/bluetooth/iso.c
> @@ -2483,11 +2483,11 @@ static const struct net_proto_family iso_sock_family_ops = {
>   	.create	= iso_sock_create,
>   };
>   
> -static bool iso_inited;
> +static bool inited;
>   
> -bool iso_enabled(void)
> +bool iso_inited(void)
>   {
> -	return iso_inited;
> +	return inited;
>   }
>   
>   int iso_init(void)
> @@ -2496,7 +2496,7 @@ int iso_init(void)
>   
>   	BUILD_BUG_ON(sizeof(struct sockaddr_iso) > sizeof(struct sockaddr));
>   
> -	if (iso_inited)
> +	if (inited)
>   		return -EALREADY;
>   
>   	err = proto_register(&iso_proto, 0);
> @@ -2524,7 +2524,7 @@ int iso_init(void)
>   		iso_debugfs = debugfs_create_file("iso", 0444, bt_debugfs,
>   						  NULL, &iso_debugfs_fops);
>   
> -	iso_inited = true;
> +	inited = true;
>   
>   	return 0;
>   
> @@ -2535,7 +2535,7 @@ int iso_init(void)
>   
>   int iso_exit(void)
>   {
> -	if (!iso_inited)
> +	if (!inited)
>   		return -EALREADY;
>   
>   	bt_procfs_cleanup(&init_net, "iso");
> @@ -2549,7 +2549,7 @@ int iso_exit(void)
>   
>   	proto_unregister(&iso_proto);
>   
> -	iso_inited = false;
> +	inited = false;
>   
>   	return 0;
>   }
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index 1ce682038b51..c42dffe77daf 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -922,16 +922,16 @@ static u32 get_current_settings(struct hci_dev *hdev)
>   	if (hci_dev_test_flag(hdev, HCI_WIDEBAND_SPEECH_ENABLED))
>   		settings |= MGMT_SETTING_WIDEBAND_SPEECH;
>   
> -	if (cis_central_capable(hdev))
> +	if (cis_central_enabled(hdev))
>   		settings |= MGMT_SETTING_CIS_CENTRAL;
>   
> -	if (cis_peripheral_capable(hdev))
> +	if (cis_peripheral_enabled(hdev))
>   		settings |= MGMT_SETTING_CIS_PERIPHERAL;
>   
> -	if (bis_capable(hdev))
> +	if (bis_enabled(hdev))
>   		settings |= MGMT_SETTING_ISO_BROADCASTER;
>   
> -	if (sync_recv_capable(hdev))
> +	if (sync_recv_enabled(hdev))
>   		settings |= MGMT_SETTING_ISO_SYNC_RECEIVER;
>   
>   	if (ll_privacy_capable(hdev))
> @@ -4513,7 +4513,7 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev,
>   	}
>   
>   	if (IS_ENABLED(CONFIG_BT_LE)) {
> -		flags = iso_enabled() ? BIT(0) : 0;
> +		flags = iso_inited() ? BIT(0) : 0;
>   		memcpy(rp->features[idx].uuid, iso_socket_uuid, 16);
>   		rp->features[idx].flags = cpu_to_le32(flags);
>   		idx++;

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 2/2] Bluetooth: hci_core: Fix using ll_privacy_capable for current settings
  2025-08-06 19:48 ` [PATCH v3 2/2] Bluetooth: hci_core: Fix using ll_privacy_capable " Luiz Augusto von Dentz
@ 2025-08-07  8:01   ` Paul Menzel
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Menzel @ 2025-08-07  8:01 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Dear Luiz,


Thank you for your patch.

Am 06.08.25 um 21:48 schrieb Luiz Augusto von Dentz:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> ll_privacy_capable only indicates that the controller supports the
> feature but it doesnt' check that LE is enabled so it end up being
> marked as active in the current settings when it shouldn't.
> 
> Fixes: ad383c2c65a5 ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
>   include/net/bluetooth/hci_core.h | 1 +
>   net/bluetooth/mgmt.c             | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> index bc29f2e2e16f..bb30bde6f0e8 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -1934,6 +1934,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
>   			 ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED))
>   
>   #define ll_privacy_capable(dev) ((dev)->le_features[0] & HCI_LE_LL_PRIVACY)
> +#define ll_privacy_enabled(dev) (le_enabled(dev) && ll_privacy_capable(dev))
>   
>   #define privacy_mode_capable(dev) (ll_privacy_capable(dev) && \
>   				   ((dev)->commands[39] & 0x04))
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index c42dffe77daf..3166f5fb876b 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -934,7 +934,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
>   	if (sync_recv_enabled(hdev))
>   		settings |= MGMT_SETTING_ISO_SYNC_RECEIVER;
>   
> -	if (ll_privacy_capable(hdev))
> +	if (ll_privacy_enabled(hdev))
>   		settings |= MGMT_SETTING_LL_PRIVACY;
>   
>   	return settings;

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings
  2025-08-06 19:48 [PATCH v3 1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings Luiz Augusto von Dentz
                   ` (2 preceding siblings ...)
  2025-08-07  8:01 ` [PATCH v3 1/2] " Paul Menzel
@ 2025-08-07 15:50 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+bluetooth @ 2025-08-07 15:50 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed,  6 Aug 2025 15:48:35 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> {cis,bis}_capable only indicates the controller supports the feature
> since it doesn't check that LE is enabled so it shall not be used for
> current setting, instead this introduces {cis,bis}_enabled macros that
> can be used to indicate that these features are currently enabled.
> 
> [...]

Here is the summary with links:
  - [v3,1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings
    https://git.kernel.org/bluetooth/bluetooth-next/c/3ca23aaba210
  - [v3,2/2] Bluetooth: hci_core: Fix using ll_privacy_capable for current settings
    https://git.kernel.org/bluetooth/bluetooth-next/c/c244fc08ac4e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-08-07 15:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 19:48 [PATCH v3 1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings Luiz Augusto von Dentz
2025-08-06 19:48 ` [PATCH v3 2/2] Bluetooth: hci_core: Fix using ll_privacy_capable " Luiz Augusto von Dentz
2025-08-07  8:01   ` Paul Menzel
2025-08-06 20:37 ` [v3,1/2] Bluetooth: hci_core: Fix using {cis,bis}_capable " bluez.test.bot
2025-08-07  8:01 ` [PATCH v3 1/2] " Paul Menzel
2025-08-07 15:50 ` patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.