81 lines
2.1 KiB
Diff
81 lines
2.1 KiB
Diff
From 848c4f05c81898c986cc3525e84348d4e8dfe933 Mon Sep 17 00:00:00 2001
|
|
From: Weiguang Ruan <[email protected]>
|
|
Date: Fri, 23 Nov 2018 11:20:02 +0800
|
|
Subject: [PATCH] bluez: hciattach, add qca support
|
|
|
|
Change-Id: I3ab67ff643c938120365e7b9627274f264901494
|
|
---
|
|
Makefile.tools | 2 ++
|
|
tools/hciattach.c | 15 +++++++++++++++
|
|
2 files changed, 17 insertions(+)
|
|
|
|
diff --git a/Makefile.tools b/Makefile.tools
|
|
index 2d21dff..4580054 100644
|
|
--- a/Makefile.tools
|
|
+++ b/Makefile.tools
|
|
@@ -392,6 +392,8 @@ tools_hciattach_SOURCES = tools/hciattach.c tools/hciattach.h \
|
|
tools/hciattach_bcm43xx.c
|
|
tools_hciattach_LDADD = lib/libbluetooth-internal.la
|
|
|
|
+tools_hciattach_LDADD += -lpthread
|
|
+
|
|
tools_hciconfig_SOURCES = tools/hciconfig.c
|
|
tools_hciconfig_LDADD = lib/libbluetooth-internal.la
|
|
|
|
diff --git a/tools/hciattach.c b/tools/hciattach.c
|
|
index 276a4e5..d6ddbdc 100644
|
|
--- a/tools/hciattach.c
|
|
+++ b/tools/hciattach.c
|
|
@@ -978,6 +978,8 @@ static int bcm2035(int fd, struct uart_t *u, struct termios *ti)
|
|
return 0;
|
|
}
|
|
|
|
+#include "hciattach_rome.c"
|
|
+
|
|
struct uart_t uart[] = {
|
|
{ "any", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200,
|
|
FLOW_CTL, DISABLE_PM, NULL, NULL },
|
|
@@ -1097,6 +1099,10 @@ struct uart_t uart[] = {
|
|
{ "amp", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200,
|
|
AMP_DEV, DISABLE_PM, NULL, NULL, NULL },
|
|
|
|
+ /* QCA ROME */
|
|
+ { "qca", 0x0000, 0x0000, HCI_UART_H4, 115200, 2000000,
|
|
+ FLOW_CTL, DISABLE_PM, NULL, qca, NULL },
|
|
+
|
|
{ NULL, 0 }
|
|
};
|
|
|
|
@@ -1383,6 +1389,10 @@ int main(int argc, char *argv[])
|
|
sa.sa_handler = sig_hup;
|
|
sigaction(SIGHUP, &sa, NULL);
|
|
|
|
+ sa.sa_handler = qca_sig_usr;
|
|
+ sigaction(SIGUSR1, &sa, NULL);
|
|
+ sigaction(SIGUSR2, &sa, NULL);
|
|
+
|
|
if (detach) {
|
|
if ((pid = fork())) {
|
|
if (printpid)
|
|
@@ -1404,6 +1414,8 @@ int main(int argc, char *argv[])
|
|
sigdelset(&sigs, SIGTERM);
|
|
sigdelset(&sigs, SIGINT);
|
|
sigdelset(&sigs, SIGHUP);
|
|
+ sigdelset(&sigs, SIGUSR1);
|
|
+ sigdelset(&sigs, SIGUSR2);
|
|
|
|
while (!__io_canceled) {
|
|
p.revents = 0;
|
|
@@ -1421,5 +1433,8 @@ int main(int argc, char *argv[])
|
|
exit(1);
|
|
}
|
|
|
|
+ if (!strcmp(u->type, "qca"))
|
|
+ qca_woble_configure(n);
|
|
+
|
|
return 0;
|
|
}
|
|
--
|
|
2.25.1
|
|
|