Skip to contentSkip to conversation

Bluetooth: Fix handling of experimental feature for codec offload

PATCH Applied Marcel Holtmann 1 participant 1 message Sep 28, 2021

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 2/2 Bluetooth: Fix handling of experimental feature for codec offload

The existence of the experimental feature identifiy is the indication that it is supported or not. No extra flag needed and the initial flag should define if a feature is enabled or not. This is actually defined in the management API definition.

Fixes ad93315183285 ("Bluetooth: Add offload feature under experimental flag")
---
 net/bluetooth/mgmt.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
net/bluetooth/mgmt.c +4 -13
index 84336be4d00d..3e5283607b97 100644
@@ -3874,21 +3874,12 @@ static int read_exp_features_info(struct sock *sk, struct hci_dev *hdev,
 		idx++;
 	}
 
-	if (hdev) {
-		if (hdev->get_data_path_id) {
-			/* BIT(0): indicating if offload codecs are
-			 * supported by controller.
-			 */
+	if (hdev && hdev->get_data_path_id) {
+		if (hci_dev_test_flag(hdev, HCI_OFFLOAD_CODECS_ENABLED))
 			flags = BIT(0);
-
-			/* BIT(1): indicating if codec offload feature
-			 * is enabled.
-			 */
-			if (hci_dev_test_flag(hdev, HCI_OFFLOAD_CODECS_ENABLED))
-				flags |= BIT(1);
-		} else {
+		else
 			flags = 0;
-		}
+
 		memcpy(rp->features[idx].uuid, offload_codecs_uuid, 16);
 		rp->features[idx].flags = cpu_to_le32(flags);
 		idx++;
Signature · 1 line
2.31.1