Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added patches for kernel and libdc1394 to cuav repo

  • Loading branch information...
commit cc79aa000b4b2f1d03f824ec4faf16e2c6f11ceb 1 parent 30c53c7
@tridge authored
View
92 patches/0001-aded-no_dtr-option-for-APM2.patch
@@ -0,0 +1,92 @@
+From 99c3fe9f9e383e0479c44cd54dc414ccb0fd23d8 Mon Sep 17 00:00:00 2001
+From: Andrew Tridgell <tridge@samba.org>
+Date: Fri, 4 May 2012 16:45:17 +1000
+Subject: [PATCH 1/3] aded no_dtr option for APM2
+
+---
+ drivers/usb/class/cdc-acm.c | 28 +++++++++++++++++++++++++---
+ 1 file changed, 25 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
+index 158f631..39d14af 100644
+--- a/drivers/usb/class/cdc-acm.c
++++ b/drivers/usb/class/cdc-acm.c
+@@ -65,6 +65,13 @@ static DEFINE_MUTEX(open_mutex);
+ static const struct tty_port_operations acm_port_ops = {
+ };
+
++/*
++ * when no_dtr is set, attempts to set DTR are ignored. This is used
++ * to prevent reset of DTR sensitive devices on reconnect (especially
++ * APM2 AutoPilots where DTR being asserted can cause a UAV to crash)
++ */
++static bool no_dtr;
++
+ /*
+ * Functions for ACM control messages.
+ */
+@@ -457,7 +464,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
+ {
+ struct acm *acm;
+ int rv = -ENODEV;
+-
++ unsigned ctrlout;
++
+ mutex_lock(&open_mutex);
+
+ acm = acm_table[tty->index];
+@@ -492,7 +500,13 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
+ goto bail_out;
+ }
+
+- if (0 > acm_set_control(acm, acm->ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS) &&
++ if (no_dtr) {
++ ctrlout = ACM_CTRL_RTS;
++ } else {
++ ctrlout = ACM_CTRL_DTR | ACM_CTRL_RTS;
++ }
++
++ if (0 > acm_set_control(acm, acm->ctrlout = ctrlout) &&
+ (acm->ctrl_caps & USB_CDC_CAP_LINE))
+ goto bail_out;
+
+@@ -703,7 +717,7 @@ static int acm_tty_tiocmget(struct tty_struct *tty)
+ if (!ACM_READY(acm))
+ return -EINVAL;
+
+- return (acm->ctrlout & ACM_CTRL_DTR ? TIOCM_DTR : 0) |
++ return ((acm->ctrlout & ACM_CTRL_DTR) && !no_dtr ? TIOCM_DTR : 0) |
+ (acm->ctrlout & ACM_CTRL_RTS ? TIOCM_RTS : 0) |
+ (acm->ctrlin & ACM_CTRL_DSR ? TIOCM_DSR : 0) |
+ (acm->ctrlin & ACM_CTRL_RI ? TIOCM_RI : 0) |
+@@ -728,6 +742,9 @@ static int acm_tty_tiocmset(struct tty_struct *tty,
+
+ newctrl = (newctrl & ~clear) | set;
+
++ if (no_dtr)
++ newctrl &= ~ACM_CTRL_DTR;
++
+ if (acm->ctrlout == newctrl)
+ return 0;
+ return acm_set_control(acm, acm->ctrlout = newctrl);
+@@ -782,6 +799,10 @@ static void acm_tty_set_termios(struct tty_struct *tty,
+ } else
+ newctrl |= ACM_CTRL_DTR;
+
++ if (no_dtr) {
++ newctrl &= ~ACM_CTRL_DTR;
++ }
++
+ if (newctrl != acm->ctrlout)
+ acm_set_control(acm, acm->ctrlout = newctrl);
+
+@@ -1684,5 +1705,6 @@ module_exit(acm_exit);
+
+ MODULE_AUTHOR(DRIVER_AUTHOR);
+ MODULE_DESCRIPTION(DRIVER_DESC);
++module_param(no_dtr, bool, S_IRUGO | S_IWUSR);
+ MODULE_LICENSE("GPL");
+ MODULE_ALIAS_CHARDEV_MAJOR(ACM_TTY_MAJOR);
+--
+1.7.9.5
+
View
33 patches/0001-fixed-configure-without-SDL.patch
@@ -0,0 +1,33 @@
+From 863dd4efb2ed7c845b202bd28f5045ae39090253 Mon Sep 17 00:00:00 2001
+From: Andrew Tridgell <tridge@samba.org>
+Date: Fri, 18 May 2012 21:01:33 +1000
+Subject: [PATCH 1/2] fixed configure without SDL
+
+---
+ libdc1394/configure.in | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/libdc1394/configure.in b/libdc1394/configure.in
+index 5b82d8c..891ff2b 100644
+--- a/libdc1394/configure.in
++++ b/libdc1394/configure.in
+@@ -42,11 +42,11 @@ PKG_CHECK_MODULES(LIBUSB, [libusb-1.0],
+ [AC_DEFINE(HAVE_LIBUSB,[],[Defined if libusb is present])],
+ [AC_MSG_WARN([libusb-1.0 not found])])
+
+-MIN_SDL_VERSION=1.2.4
+-AH_TEMPLATE(HAVE_LIBSDL, [SDL library])
+-AM_PATH_SDL($MIN_SDL_VERSION, [AC_DEFINE(HAVE_LIBSDL) HAVE_LIBSDL="yes"])
+-AC_SUBST(SDL_CFLAGS)
+-AC_SUBST(SDL_LIBS)
++#MIN_SDL_VERSION=1.2.4
++#AH_TEMPLATE(HAVE_LIBSDL, [SDL library])
++#AM_PATH_SDL($MIN_SDL_VERSION, [AC_DEFINE(HAVE_LIBSDL) HAVE_LIBSDL="yes"])
++#AC_SUBST(SDL_CFLAGS)
++#AC_SUBST(SDL_LIBS)
+
+ case "$host" in
+ *-*-linux*)
+--
+1.7.9.5
+
View
37 patches/0002-capture-run-as-a-SCHED_FIFO-task.patch
@@ -0,0 +1,37 @@
+From c5b9087393cc9ee37d435a9472e48a886260f7bc Mon Sep 17 00:00:00 2001
+From: Andrew Tridgell <tridge@samba.org>
+Date: Fri, 18 May 2012 21:02:27 +1000
+Subject: [PATCH 2/2] capture: run as a SCHED_FIFO task
+
+this lowers the frame loss from a PtGrey Chameleon on a pandaboard a lot
+---
+ libdc1394/dc1394/usb/capture.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/libdc1394/dc1394/usb/capture.c b/libdc1394/dc1394/usb/capture.c
+index 29aec6d..f2f4d00 100644
+--- a/libdc1394/dc1394/usb/capture.c
++++ b/libdc1394/dc1394/usb/capture.c
+@@ -26,6 +26,7 @@
+ #include <inttypes.h>
+ #include <pthread.h>
+ #include <unistd.h>
++#include <sched.h>
+
+ #include "usb/usb.h"
+
+@@ -68,6 +69,11 @@ static void *
+ capture_thread (void * arg)
+ {
+ platform_camera_t * craw = arg;
++ struct sched_param p;
++
++ // try to make the capture thread realtime
++ p.sched_priority = SCHED_FIFO;
++ sched_setscheduler(0, SCHED_FIFO, &p);
+
+ dc1394_log_debug ("usb: Helper thread starting");
+
+--
+1.7.9.5
+
View
4,044 patches/0002-kernel-config.patch
4,044 additions, 0 deletions not shown
View
50 patches/0003-FTDI-added-no_dtr-option.patch
@@ -0,0 +1,50 @@
+From 5f8b7c39d4b90822c988f42ee55b9ec563ad081e Mon Sep 17 00:00:00 2001
+From: Andrew Tridgell <tridge@samba.org>
+Date: Fri, 18 May 2012 10:21:49 +1000
+Subject: [PATCH 3/3] FTDI: added no_dtr option
+
+---
+ drivers/usb/serial/ftdi_sio.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
+index 60d7b1eb..1d3602b 100644
+--- a/drivers/usb/serial/ftdi_sio.c
++++ b/drivers/usb/serial/ftdi_sio.c
+@@ -59,6 +59,14 @@ static int debug;
+ static __u16 vendor = FTDI_VID;
+ static __u16 product;
+
++/*
++ * when no_dtr is set, attempts to set DTR are ignored. This is used
++ * to prevent reset of DTR sensitive devices on reconnect (especially
++ * APM2 AutoPilots where DTR being asserted can cause a UAV to crash)
++ */
++static bool no_dtr;
++
++
+ struct ftdi_private {
+ struct kref kref;
+ enum ftdi_chip_type chip_type;
+@@ -1050,6 +1058,12 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set,
+
+ clear &= ~set; /* 'set' takes precedence over 'clear' */
+ urb_value = 0;
++
++ if (no_dtr) {
++ clear &= ~TIOCM_DTR;
++ set &= ~TIOCM_DTR;
++ }
++
+ if (clear & TIOCM_DTR)
+ urb_value |= FTDI_SIO_SET_DTR_LOW;
+ if (clear & TIOCM_RTS)
+@@ -2439,4 +2453,5 @@ module_param(product, ushort, 0);
+ MODULE_PARM_DESC(product, "User specified product ID");
+
+ module_param(ndi_latency_timer, int, S_IRUGO | S_IWUSR);
++module_param(no_dtr, bool, S_IRUGO | S_IWUSR);
+ MODULE_PARM_DESC(ndi_latency_timer, "NDI device latency timer override");
+--
+1.7.9.5
+
Please sign in to comment.
Something went wrong with that request. Please try again.