aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/bluez/bluez-utils
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/bluez/bluez-utils')
-rw-r--r--recipes/bluez/bluez-utils/handle-eintr.patch23
-rw-r--r--recipes/bluez/bluez-utils/hcid.conf57
-rw-r--r--recipes/bluez/bluez-utils/hid2hci_usb_init.patch33
-rw-r--r--recipes/bluez/bluez-utils/ppoll-uclibc-arm-r0.patch14
-rw-r--r--recipes/bluez/bluez-utils/sbc-thumb.patch11
-rw-r--r--recipes/bluez/bluez-utils/uclibc-fix.patch46
6 files changed, 184 insertions, 0 deletions
diff --git a/recipes/bluez/bluez-utils/handle-eintr.patch b/recipes/bluez/bluez-utils/handle-eintr.patch
new file mode 100644
index 0000000000..effe5d9696
--- /dev/null
+++ b/recipes/bluez/bluez-utils/handle-eintr.patch
@@ -0,0 +1,23 @@
+--- bluez-utils-3.9.org/tools/hciattach.c 2007-01-28 20:16:48.000000000 +0000
++++ bluez-utils-3.9/tools/hciattach.c 2007-02-12 16:50:49.000000000 +0000
+@@ -1135,7 +1256,7 @@
+ int main(int argc, char *argv[])
+ {
+ struct uart_t *u = NULL;
+- int detach, printpid, opt, i, n, ld;
++ int detach, printpid, opt, i, n, ld, err;
+ int to = 5;
+ int init_speed = 0;
+ int send_break = 0;
+@@ -1286,7 +1414,10 @@
+
+ while (!__io_canceled) {
+ p.revents = 0;
+- if (poll(&p, 1, 500))
++ err = poll(&p, 1, 500);
++ if (err < 0 && errno == EINTR)
++ continue;
++ if (err)
+ break;
+ }
+
diff --git a/recipes/bluez/bluez-utils/hcid.conf b/recipes/bluez/bluez-utils/hcid.conf
new file mode 100644
index 0000000000..a7164f6eb0
--- /dev/null
+++ b/recipes/bluez/bluez-utils/hcid.conf
@@ -0,0 +1,57 @@
+#
+# HCI daemon configuration file.
+#
+
+# HCId options
+options {
+ # Automatically initialize new devices
+ autoinit yes;
+
+ # Security Manager mode
+ # none - Security manager disabled
+ # auto - Use local PIN for incoming connections
+ # user - Always ask user for a PIN
+ #
+ security auto;
+
+ # Pairing mode
+ # none - Pairing disabled
+ # multi - Allow pairing with already paired devices
+ # once - Pair once and deny successive attempts
+ pairing multi;
+
+ # Default PIN code for incoming connections
+ passkey "1234";
+}
+
+# Default settings for HCI devices
+device {
+ # Local device name
+ # %d - device id
+ # %h - host name
+ name "%h (%d)";
+
+ # Local device class
+ class 0x120112;
+
+ # Default packet type
+ #pkt_type DH1,DM1,HV1;
+
+ # Inquiry and Page scan
+ iscan enable; pscan enable;
+
+ # Default link mode
+ # none - no specific policy
+ # accept - always accept incoming connections
+ # master - become master on incoming connections,
+ # deny role switch on outgoing connections
+ lm accept;
+
+ # Default link policy
+ # none - no specific policy
+ # rswitch - allow role switch
+ # hold - allow hold mode
+ # sniff - allow sniff mode
+ # park - allow park mode
+ lp rswitch,hold,sniff,park;
+}
diff --git a/recipes/bluez/bluez-utils/hid2hci_usb_init.patch b/recipes/bluez/bluez-utils/hid2hci_usb_init.patch
new file mode 100644
index 0000000000..ed15fd5a1b
--- /dev/null
+++ b/recipes/bluez/bluez-utils/hid2hci_usb_init.patch
@@ -0,0 +1,33 @@
+# Signed-off-by: Khem Raj <raj.khem@gmail.com>
+#
+# Use the new usb1 API for usb_init() and check for fails from
+# usb_init (). Currently we see a crash on a system which does
+# not have USB because usb_init() fails and it cleans up all initialized
+# data (e.g. ctx) which is used in subsequent calls to libusb
+# We return immediately if usb_init() fails for some reason.
+
+Index: bluez-4.24/tools/hid2hci.c
+===================================================================
+--- bluez-4.24.orig/tools/hid2hci.c 2008-10-25 23:40:34.000000000 -0700
++++ bluez-4.24/tools/hid2hci.c 2008-12-29 22:06:04.000000000 -0800
+@@ -337,7 +337,7 @@
+ int main(int argc, char *argv[])
+ {
+ struct device_info dev[16];
+- int i, opt, num, quiet = 0, mode = HCI;
++ int i, ret, opt, num, quiet = 0, mode = HCI;
+
+ while ((opt = getopt_long(argc, argv, "+01qh", main_options, NULL)) != -1) {
+ switch (opt) {
+@@ -361,8 +361,9 @@
+ argc -= optind;
+ argv += optind;
+ optind = 0;
+-
+- usb_init();
++ ret = libusb_init();
++ if (ret < 0)
++ return ret;
+
+ num = find_devices(mode, dev, sizeof(dev) / sizeof(dev[0]));
+ if (num <= 0) {
diff --git a/recipes/bluez/bluez-utils/ppoll-uclibc-arm-r0.patch b/recipes/bluez/bluez-utils/ppoll-uclibc-arm-r0.patch
new file mode 100644
index 0000000000..391a7ae3de
--- /dev/null
+++ b/recipes/bluez/bluez-utils/ppoll-uclibc-arm-r0.patch
@@ -0,0 +1,14 @@
+Index: bluez-utils-3.9/common/ppoll.h
+===================================================================
+--- bluez-utils-3.9.orig/common/ppoll.h 2007-05-17 17:42:23.000000000 +0200
++++ bluez-utils-3.9/common/ppoll.h 2007-05-17 17:43:18.000000000 +0200
+@@ -1,4 +1,8 @@
+-static inline int ppoll(struct pollfd *fds, nfds_t nfds,
++#ifdef ppoll
++#undef ppoll
++#endif
++#define ppoll bluez_ppoll
++static inline int bluez_ppoll(struct pollfd *fds, nfds_t nfds,
+ const struct timespec *timeout, const sigset_t *sigmask)
+ {
+ return poll(fds, nfds, timeout ? timeout->tv_sec * 1000 : 500);
diff --git a/recipes/bluez/bluez-utils/sbc-thumb.patch b/recipes/bluez/bluez-utils/sbc-thumb.patch
new file mode 100644
index 0000000000..3505426053
--- /dev/null
+++ b/recipes/bluez/bluez-utils/sbc-thumb.patch
@@ -0,0 +1,11 @@
+--- bluez/sbc/sbc_math.h~ 2008-03-05 20:18:03.000000000 +0000
++++ bluez/sbc/sbc_math.h 2008-10-27 13:39:27.000000000 +0000
+@@ -59,7 +59,7 @@
+
+ #define SBC_FIXED_0(val) { val = 0; }
+ #define MUL(a, b) ((a) * (b))
+-#ifdef __arm__
++#if defined(__arm__) && !defined(__thumb__)
+ #define MULA(a, b, res) ({ \
+ int tmp = res; \
+ __asm__( \
diff --git a/recipes/bluez/bluez-utils/uclibc-fix.patch b/recipes/bluez/bluez-utils/uclibc-fix.patch
new file mode 100644
index 0000000000..6d4753c2e5
--- /dev/null
+++ b/recipes/bluez/bluez-utils/uclibc-fix.patch
@@ -0,0 +1,46 @@
+Uclibc doesn't define or support speeds above 115200. So check the existence
+of the defines before allowing them to actually be used.
+
+Index: bluez-utils-3.9/tools/hciattach.c
+===================================================================
+--- bluez-utils-3.9.orig/tools/hciattach.c 2007-05-17 12:34:28.000000000 +1000
++++ bluez-utils-3.9/tools/hciattach.c 2007-05-17 12:40:20.000000000 +1000
+@@ -105,22 +105,38 @@
+ return B57600;
+ case 115200:
+ return B115200;
++#ifdef B230400
+ case 230400:
+ return B230400;
++#endif
++#ifdef B460800
+ case 460800:
+ return B460800;
++#endif
++#ifdef B500000
+ case 500000:
+ return B500000;
++#endif
++#ifdef B576000
+ case 576000:
+ return B576000;
++#endif
++#ifdef B921600
+ case 921600:
+ return B921600;
++#endif
++#ifdef B1000000
+ case 1000000:
+ return B1000000;
++#endif
++#ifdef B1152000
+ case 1152000:
+ return B1152000;
++#endif
++#ifdef B1500000
+ case 1500000:
+ return B1500000;
++#endif
+ default:
+ return B57600;
+ }