diff mbox series

Bluetooth: Enable LE 2M PHY by default

Message ID 20220906215353.2820044-1-luiz.dentz@gmail.com (mailing list archive)
State New, archived
Headers show
Series Bluetooth: Enable LE 2M PHY by default | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint success Gitlint PASS
tedd_an/subjectprefix success PASS
tedd_an/buildkernel success Build Kernel PASS
tedd_an/buildkernel32 success Build Kernel32 PASS
tedd_an/incremental_build success Pass
tedd_an/testrunnersetup success Test Runner Setup PASS
tedd_an/testrunnerl2cap-tester success Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneriso-tester success Total: 55, Passed: 55 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerbnep-tester success Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnermgmt-tester fail Total: 494, Passed: 492 (99.6%), Failed: 2, Not Run: 0
tedd_an/testrunnerrfcomm-tester success Total: 10, Passed: 10 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersco-tester success Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersmp-tester success Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneruserchan-tester success Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0

Commit Message

Luiz Augusto von Dentz Sept. 6, 2022, 9:53 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This enables 2M PHY by default and in case the controller doesn't
support HCI_OP_LE_SET_DEFAULT_PHY then default to just 1M PHY.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_core.c | 4 ++--
 net/bluetooth/hci_sync.c | 9 +++++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

Comments

bluez.test.bot@gmail.com Sept. 6, 2022, 11:08 p.m. UTC | #1
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=674664

---Test result---

Test Summary:
CheckPatch                    PASS      1.77 seconds
GitLint                       PASS      0.98 seconds
SubjectPrefix                 PASS      0.87 seconds
BuildKernel                   PASS      36.43 seconds
BuildKernel32                 PASS      32.20 seconds
Incremental Build with patchesPASS      48.59 seconds
TestRunner: Setup             PASS      529.00 seconds
TestRunner: l2cap-tester      PASS      17.66 seconds
TestRunner: iso-tester        PASS      16.81 seconds
TestRunner: bnep-tester       PASS      6.67 seconds
TestRunner: mgmt-tester       FAIL      108.08 seconds
TestRunner: rfcomm-tester     PASS      10.39 seconds
TestRunner: sco-tester        PASS      9.98 seconds
TestRunner: smp-tester        PASS      9.92 seconds
TestRunner: userchan-tester   PASS      6.90 seconds

Details
##############################
Test: TestRunner: mgmt-tester - FAIL - 108.08 seconds
Run test-runner with mgmt-tester
Total: 494, Passed: 492 (99.6%), Failed: 2, Not Run: 0

Failed Test Cases
Get PHY Success                                      Failed       0.120 seconds
Set PHY 2m Success                                   Timed out    2.402 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 3803e54f23c0..d2d017621c08 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2469,8 +2469,8 @@  struct hci_dev *hci_alloc_dev_priv(int sizeof_priv)
 	hdev->le_max_rx_time = 0x0148;
 	hdev->le_max_key_size = SMP_MAX_ENC_KEY_SIZE;
 	hdev->le_min_key_size = SMP_MIN_ENC_KEY_SIZE;
-	hdev->le_tx_def_phys = HCI_LE_SET_PHY_1M;
-	hdev->le_rx_def_phys = HCI_LE_SET_PHY_1M;
+	hdev->le_tx_def_phys = HCI_LE_SET_PHY_1M | HCI_LE_SET_PHY_2M;
+	hdev->le_rx_def_phys = HCI_LE_SET_PHY_1M | HCI_LE_SET_PHY_2M;
 	hdev->le_num_of_adv_sets = HCI_MAX_ADV_INSTANCES;
 	hdev->def_multi_adv_rotation_duration = HCI_DEFAULT_ADV_DURATION;
 	hdev->def_le_autoconnect_timeout = HCI_LE_AUTOCONN_TIMEOUT;
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 41b6d19c70b0..4eab893cb10e 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4348,13 +4348,18 @@  static int hci_le_set_write_def_data_len_sync(struct hci_dev *hdev)
 				     sizeof(cp), &cp, HCI_CMD_TIMEOUT);
 }
 
-/* Set Default PHY parameters if command is supported */
+/* Set Default PHY parameters if command is supported, if not supported default
+ * to 1M.
+ */
 static int hci_le_set_default_phy_sync(struct hci_dev *hdev)
 {
 	struct hci_cp_le_set_default_phy cp;
 
-	if (!(hdev->commands[35] & 0x20))
+	if (!(hdev->commands[35] & 0x20)) {
+		hdev->le_tx_def_phys = HCI_LE_SET_PHY_1M;
+		hdev->le_rx_def_phys = HCI_LE_SET_PHY_1M;
 		return 0;
+	}
 
 	memset(&cp, 0, sizeof(cp));
 	cp.all_phys = 0x00;