0002-esp_hosted_ng-Fix-Bluetooth-build-failure-on-Linux-6.patch 1.3 KB

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