1From f8903bc2be7ae5ac9fb9bbeed8512e974c6e60ec Mon Sep 17 00:00:00 2001
2From: Giulio Benetti <giulio.benetti@benettiengineering.com>
3Date: Mon, 3 Jun 2024 21:53:38 +0200
4Subject: [PATCH] esp_hosted_ng: Fix Bluetooth build failure on Linux 6.8.11+
5
6After Linux commit:
7https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=84a4bb6548a29326564f0e659fb8064503ecc1c7
8BT_HS has been removed and consequently AMP controllers can't be created,
9so at this point only HCI_PRIMARY has been left as unique controller type
10to be created and this became implicit with no need to define if the
11controller if HCI_PRIMARY or HCI_AMP. So let's assign HCI_PRIMARY up to
12Linux 6.8.11 only preventing build failure.
13
14Upstream: https://github.com/espressif/esp-hosted/pull/400
15
16Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
17---
18 esp_hosted_ng/host/esp_bt.c | 2 ++
19 1 file changed, 2 insertions(+)
20
21diff --git a/esp_hosted_ng/host/esp_bt.c b/esp_hosted_ng/host/esp_bt.c
22index 3b78c11698..4598ac0e0a 100644
23--- a/esp_hosted_ng/host/esp_bt.c
24+++ b/esp_hosted_ng/host/esp_bt.c
25@@ -240,7 +240,9 @@ int esp_init_bt(struct esp_adapter *adapter)
26 	hdev->set_bdaddr = esp_bt_set_bdaddr;
27 #endif
28
29+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(6, 8, 11))
30 	hdev->dev_type = HCI_PRIMARY;
31+#endif
32
33 	SET_HCIDEV_DEV(hdev, adapter->dev);
34
35--
362.34.1
37
38