Skip to content

Instantly share code, notes, and snippets.

@adeveloper79
Forked from pawitp/patch.diff
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeveloper79/ef705aa0142a0188144d to your computer and use it in GitHub Desktop.
Save adeveloper79/ef705aa0142a0188144d to your computer and use it in GitHub Desktop.
From 9ea34a45b82771a564ba9549752d152fbd529acf Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 10 Dec 2013 20:09:12 +0700
Subject: [PATCH] libbt: switch to N_BRCM_HCI line disclipline for userial
ioctl
Change-Id: I12c297c6b26fc0cb6f0a36ed8f5d04d4d36a4092
---
src/userial_vendor.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/userial_vendor.c b/src/userial_vendor.c
index 5233d19..86d98e8 100755
--- a/src/userial_vendor.c
+++ b/src/userial_vendor.c
@@ -183,6 +183,10 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg)
uint16_t parity;
uint8_t stop_bits;
+#if (BT_WAKE_VIA_USERIAL_IOCTL==TRUE)
+ int ldisc;
+#endif
+
vnd_userial.fd = -1;
if (!userial_to_tcio_baud(p_cfg->baud, &baud))
@@ -252,6 +256,13 @@ int userial_vendor_open(tUSERIAL_CFG *p_cfg)
tcsetattr(vnd_userial.fd, TCSANOW, &vnd_userial.termios);
#if (BT_WAKE_VIA_USERIAL_IOCTL==TRUE)
+ // TODO: check for breakage on tuna (Galaxy Nexus). It defines this,
+ // but does not contain the kernel code to support it.
+
+ // Switch to N_BRCM_HCI line disclipline for ioctl to work
+ ldisc = 25; // N_BRCM_HCI
+ ioctl(vnd_userial.fd, TIOCSETD, &ldisc);
+
userial_ioctl_init_bt_wake(vnd_userial.fd);
#endif
--
1.8.3.4 (Apple Git-47)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment