mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 21:26:49 +00:00
lirc: update to 0.9.4
This commit is contained in:
parent
3fb896a3b8
commit
d47feb3921
@ -17,13 +17,13 @@
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="lirc"
|
||||
PKG_VERSION="0.9.0"
|
||||
PKG_VERSION="0.9.4"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.lirc.org"
|
||||
PKG_URL="$SOURCEFORGE_SRC/lirc/$PKG_NAME-$PKG_VERSION.tar.bz2"
|
||||
PKG_DEPENDS_TARGET="toolchain libftdi1 libusb-compat"
|
||||
PKG_DEPENDS_TARGET="toolchain libftdi1 libusb-compat libxslt"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="sysutils/remote"
|
||||
PKG_SHORTDESC="lirc: Linux Infrared Remote Control"
|
||||
@ -35,25 +35,20 @@ PKG_AUTORECONF="yes"
|
||||
PKG_CONFIGURE_OPTS_TARGET="ac_cv_path_LIBUSB_CONFIG= /
|
||||
ac_cv_func_forkpty=no \
|
||||
ac_cv_lib_util_forkpty=no \
|
||||
ac_cv_prog_HAVE_PYTHON3=no \
|
||||
--localstatedir=/ \
|
||||
--enable-sandboxed \
|
||||
--with-gnu-ld \
|
||||
--without-x \
|
||||
--with-driver=userspace \
|
||||
--with-syslog=LOG_DAEMON"
|
||||
|
||||
if [ "$DEBUG" = yes ]; then
|
||||
PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --enable-debug"
|
||||
else
|
||||
PKG_CONFIGURE_OPTS_TARGET="$PKG_CONFIGURE_OPTS_TARGET --disable-debug"
|
||||
fi
|
||||
|
||||
pre_make_target() {
|
||||
export MAKEFLAGS=-j1
|
||||
}
|
||||
--without-x"
|
||||
|
||||
post_makeinstall_target() {
|
||||
rm -rf $INSTALL/usr/bin/pronto2lirc
|
||||
rm -rf $INSTALL/usr/bin/lirc-setup
|
||||
rm -rf $INSTALL/usr/sbin/lircd-setup
|
||||
rm -rf $INSTALL/usr/lib/python3.4
|
||||
rm -rf $INSTALL/usr/lib/systemd
|
||||
rm -rf $INSTALL/lib
|
||||
rm -rf $INSTALL/usr/share
|
||||
rm -rf $INSTALL/etc
|
||||
|
||||
mkdir -p $INSTALL/etc/lirc
|
||||
cp $PKG_DIR/config/lircd.conf.* $INSTALL/etc/lirc
|
||||
|
@ -1,528 +0,0 @@
|
||||
diff -Naur lirc-0.9.0-old/ANNOUNCE lirc-0.9.0-new/ANNOUNCE
|
||||
--- lirc-0.9.0-old/ANNOUNCE 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/ANNOUNCE 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -1,4 +1,4 @@
|
||||
-LIRC - Linux Infrared Remote Control, Version: 0.9.0
|
||||
+LIRC - Linux Infrared Remote Control, Version: 0.9.1-git
|
||||
|
||||
Copyright (C) 1996 Ralph Metzler <rjkm@thp.uni-koeln.de>
|
||||
Copyright (C) 1998-2010 Christoph Bartelmus <lirc@bartelmus.de>
|
||||
diff -Naur lirc-0.9.0-old/configure.ac lirc-0.9.0-new/configure.ac
|
||||
--- lirc-0.9.0-old/configure.ac 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/configure.ac 2012-02-29 21:46:37.000000000 -0800
|
||||
@@ -7,7 +7,7 @@
|
||||
AC_CONFIG_SRCDIR([daemons/lircd.c])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
-AM_INIT_AUTOMAKE(lirc, 0.9.0)
|
||||
+AM_INIT_AUTOMAKE(lirc, 0.9.1-git)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
CFLAGS="${CFLAGS--O2 -g -Wall}"
|
||||
@@ -20,11 +20,11 @@
|
||||
AC_PATH_PROG(mknod, mknod, /bin/mknod)
|
||||
AC_PATH_PROG(mkfifo, mkfifo, /usr/bin/mkfifo)
|
||||
AC_PATH_PROG(depmod, depmod, /sbin/depmod, $PATH:/sbin)
|
||||
-AC_PATH_PROG(LIBUSB_CONFIG, libusb-config)
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_LIBTOOL
|
||||
AM_PATH_PYTHON(,, [:])
|
||||
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ""])
|
||||
+LIBUSB_CONFIG="pkg-config libusb"
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
@@ -310,15 +310,14 @@
|
||||
AH_TEMPLATE([USE_SYSLOG],
|
||||
[define if you want to log to syslog instead of logfile])
|
||||
|
||||
-if test -n "${LIBUSB_CONFIG}"; then
|
||||
- AC_DEFINE(HAVE_LIBUSB)
|
||||
- possible_drivers="${possible_drivers} (atilibusb) (awlibusb) (dfclibusb) (commandir) (srm7500libusb)"
|
||||
-fi
|
||||
-
|
||||
AC_CHECK_LIB(caraca_client, caraca_init,
|
||||
AC_DEFINE(HAVE_LIBCARACA)
|
||||
possible_drivers="${possible_drivers} (caraca)"
|
||||
)
|
||||
+AC_CHECK_HEADER(usb.h,
|
||||
+ AC_DEFINE(HAVE_LIBUSB)
|
||||
+ possible_drivers="${possible_drivers} (atilibusb) (awlibusb) (dfclibusb) (commandir) (srm7500libusb)"
|
||||
+)
|
||||
AC_CHECK_HEADER(ftdi.h,
|
||||
AC_DEFINE(HAVE_FTDI)
|
||||
possible_drivers="${possible_drivers} (ftdi)"
|
||||
@@ -1449,7 +1448,7 @@
|
||||
Or install these packages from your distro:
|
||||
|
||||
libusb
|
||||
- libusb-dev
|
||||
+ libusb-devel
|
||||
|
||||
])
|
||||
;;
|
||||
@@ -1559,11 +1558,6 @@
|
||||
[ --enable-dyncodes use dynamic codes],
|
||||
test x${enableval} = xyes && AC_DEFINE(DYNCODES))
|
||||
|
||||
-AC_ARG_WITH(major,
|
||||
-[ --with-major=value specify the device major for the driver (61)],
|
||||
-lirc_major=${withval},
|
||||
-lirc_major=61)
|
||||
-
|
||||
AC_ARG_WITH(port,
|
||||
[ --with-port=port specify the port number for the lirc device.],
|
||||
port=${withval}
|
||||
@@ -1678,7 +1672,6 @@
|
||||
AC_SUBST(sysconfdir)
|
||||
AC_SUBST(varrundir)
|
||||
AC_SUBST(moduledir)
|
||||
-AC_SUBST(lirc_major)
|
||||
AC_SUBST(driver)
|
||||
AC_SUBST(lirc_driver)
|
||||
AC_SUBST(hw_module_libs)
|
||||
@@ -1715,7 +1708,9 @@
|
||||
|
||||
AH_TOP([
|
||||
/* device file names - beneath DEVDIR (default /dev) */
|
||||
-#define DEV_LIRC "lirc"
|
||||
+#define DEV_LIRC "lirc0"
|
||||
+
|
||||
+/* daemon socket file names - beneath $varrundir (default /var/run/lirc) */
|
||||
#define DEV_LIRCD "lircd"
|
||||
#define DEV_LIRCM "lircm"
|
||||
|
||||
diff -Naur lirc-0.9.0-old/contrib/release-process.txt lirc-0.9.0-new/contrib/release-process.txt
|
||||
--- lirc-0.9.0-old/contrib/release-process.txt 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/contrib/release-process.txt 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -22,7 +22,7 @@
|
||||
4) Switch back to master:
|
||||
git checkout master
|
||||
5) Clean checkout in new directory:
|
||||
- git clone -b lirc-<version>-preX-branch git://lirc.git.sourceforge.net/gitroot/lirc/lirc
|
||||
+ git clone -b lirc-<version>-preX-branch git://lirc.git.sourceforge.net/gitroot/lirc/lirc lirc-<version>-preX
|
||||
6) Create tarball:
|
||||
./autogen.sh
|
||||
cp INSTALL.txt INSTALL
|
||||
@@ -45,7 +45,7 @@
|
||||
4) Switch back to master:
|
||||
git checkout master
|
||||
5) Clean checkout in new directory:
|
||||
- git clone -b lirc-<version>-branch git://lirc.git.sourceforge.net/gitroot/lirc/lirc
|
||||
+ git clone -b lirc-<version>-branch git://lirc.git.sourceforge.net/gitroot/lirc/lirc lirc-<version>
|
||||
6) Create tarball:
|
||||
./autogen.sh
|
||||
cp INSTALL.txt INSTALL
|
||||
diff -Naur lirc-0.9.0-old/daemons/dump_config.c lirc-0.9.0-new/daemons/dump_config.c
|
||||
--- lirc-0.9.0-old/daemons/dump_config.c 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/daemons/dump_config.c 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -120,11 +120,11 @@
|
||||
if (!is_raw(rem)) {
|
||||
if (rem->pre_data_bits > 0) {
|
||||
fprintf(f, " pre_data_bits %d\n", rem->pre_data_bits);
|
||||
- fprintf(f, " pre_data 0x%llX\n", rem->pre_data);
|
||||
+ fprintf(f, " pre_data 0x%llX\n", (unsigned long long)rem->pre_data);
|
||||
}
|
||||
if (rem->post_data_bits > 0) {
|
||||
fprintf(f, " post_data_bits %d\n", rem->post_data_bits);
|
||||
- fprintf(f, " post_data 0x%llX\n", rem->post_data);
|
||||
+ fprintf(f, " post_data 0x%llX\n", (unsigned long long)rem->post_data);
|
||||
}
|
||||
if (rem->pre_p != 0 && rem->pre_s != 0) {
|
||||
fprintf(f, " pre %5u %5u\n", (__u32) rem->pre_p, (__u32) rem->pre_s);
|
||||
@@ -151,15 +151,15 @@
|
||||
if (rem->min_code_repeat > 0) {
|
||||
fprintf(f, " min_code_repeat %d\n", rem->min_code_repeat);
|
||||
}
|
||||
- fprintf(f, " toggle_bit_mask 0x%llX\n", rem->toggle_bit_mask);
|
||||
+ fprintf(f, " toggle_bit_mask 0x%llX\n", (unsigned long long)rem->toggle_bit_mask);
|
||||
if (has_toggle_mask(rem)) {
|
||||
- fprintf(f, " toggle_mask 0x%llX\n", rem->toggle_mask);
|
||||
+ fprintf(f, " toggle_mask 0x%llX\n", (unsigned long long)rem->toggle_mask);
|
||||
}
|
||||
if (rem->rc6_mask != 0) {
|
||||
- fprintf(f, " rc6_mask 0x%llX\n", rem->rc6_mask);
|
||||
+ fprintf(f, " rc6_mask 0x%llX\n", (unsigned long long)rem->rc6_mask);
|
||||
}
|
||||
if (has_ignore_mask(rem)) {
|
||||
- fprintf(f, " ignore_mask 0x%llX\n", rem->ignore_mask);
|
||||
+ fprintf(f, " ignore_mask 0x%llX\n", (unsigned long long)rem->ignore_mask);
|
||||
}
|
||||
if (is_serial(rem)) {
|
||||
fprintf(f, " baud %d\n", rem->baud);
|
||||
diff -Naur lirc-0.9.0-old/daemons/ir_remote.c lirc-0.9.0-new/daemons/ir_remote.c
|
||||
--- lirc-0.9.0-old/daemons/ir_remote.c 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/daemons/ir_remote.c 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -490,7 +490,8 @@
|
||||
{
|
||||
int len;
|
||||
|
||||
- len = snprintf(buffer, size, "%016llx %02x %s%s %s\n", code, reps, button_name, button_suffix, remote_name);
|
||||
+ len = snprintf(buffer, size, "%016llx %02x %s%s %s\n",
|
||||
+ (unsigned long long)code, reps, button_name, button_suffix, remote_name);
|
||||
|
||||
return len;
|
||||
}
|
||||
diff -Naur lirc-0.9.0-old/daemons/lircd.c lirc-0.9.0-new/daemons/lircd.c
|
||||
--- lirc-0.9.0-old/daemons/lircd.c 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/daemons/lircd.c 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -231,14 +231,10 @@
|
||||
int done, todo = len;
|
||||
|
||||
while (todo) {
|
||||
-#ifdef SIM_REC
|
||||
do {
|
||||
done = write(fd, buf, todo);
|
||||
- }
|
||||
- while (done < 0 && errno == EAGAIN);
|
||||
-#else
|
||||
- done = write(fd, buf, todo);
|
||||
-#endif
|
||||
+ } while (done < 0 && errno == EAGAIN);
|
||||
+
|
||||
if (done <= 0)
|
||||
return (done);
|
||||
buf += done;
|
||||
@@ -1318,7 +1314,7 @@
|
||||
|
||||
codes = remote->codes;
|
||||
while (codes->name != NULL) {
|
||||
- len = snprintf(buffer, PACKET_SIZE, "%016llx %s\n", codes->code, codes->name);
|
||||
+ len = snprintf(buffer, PACKET_SIZE, "%016llx %s\n", (unsigned long long)codes->code, codes->name);
|
||||
if (len >= PACKET_SIZE + 1) {
|
||||
len = sprintf(buffer, "code_too_long\n");
|
||||
}
|
||||
@@ -1338,7 +1334,7 @@
|
||||
(write_socket_len(fd, protocol_string[P_BEGIN]) && write_socket_len(fd, message)
|
||||
&& write_socket_len(fd, protocol_string[P_SUCCESS]) && write_socket_len(fd, protocol_string[P_DATA])))
|
||||
return (0);
|
||||
- len = snprintf(buffer, PACKET_SIZE, "1\n%016llx %s\n", code->code, code->name);
|
||||
+ len = snprintf(buffer, PACKET_SIZE, "1\n%016llx %s\n", (unsigned long long)code->code, code->name);
|
||||
if (len >= PACKET_SIZE + 1) {
|
||||
len = sprintf(buffer, "1\ncode_too_long\n");
|
||||
}
|
||||
diff -Naur lirc-0.9.0-old/drivers/lirc_atiusb/lirc_atiusb.c lirc-0.9.0-new/drivers/lirc_atiusb/lirc_atiusb.c
|
||||
--- lirc-0.9.0-old/drivers/lirc_atiusb/lirc_atiusb.c 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/lirc_atiusb/lirc_atiusb.c 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -1048,7 +1048,7 @@
|
||||
goto new_irctl_failure_check;
|
||||
}
|
||||
|
||||
- if (lirc_buffer_init(driver->rbuf, dclen, 1)) {
|
||||
+ if (lirc_buffer_init(driver->rbuf, dclen, 2)) {
|
||||
mem_failure = 4;
|
||||
goto new_irctl_failure_check;
|
||||
}
|
||||
diff -Naur lirc-0.9.0-old/drivers/lirc_dev/lirc_dev.c lirc-0.9.0-new/drivers/lirc_dev/lirc_dev.c
|
||||
--- lirc-0.9.0-old/drivers/lirc_dev/lirc_dev.c 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/lirc_dev/lirc_dev.c 2012-02-29 21:50:48.000000000 -0800
|
||||
@@ -236,7 +236,9 @@
|
||||
cdev_init(cdev, &lirc_dev_fops);
|
||||
cdev->owner = THIS_MODULE;
|
||||
}
|
||||
- kobject_set_name(&cdev->kobj, "lirc%d", d->minor);
|
||||
+ retval = kobject_set_name(&cdev->kobj, "lirc%d", d->minor);
|
||||
+ if (retval)
|
||||
+ return retval;
|
||||
|
||||
retval = cdev_add(cdev, MKDEV(MAJOR(lirc_base_dev), d->minor), 1);
|
||||
if (retval)
|
||||
@@ -583,6 +585,8 @@
|
||||
|
||||
mutex_unlock(&lirc_dev_lock);
|
||||
|
||||
+ nonseekable_open(inode, file);
|
||||
+
|
||||
return retval;
|
||||
}
|
||||
EXPORT_SYMBOL(lirc_dev_fop_open);
|
||||
@@ -746,10 +750,8 @@
|
||||
}
|
||||
EXPORT_SYMBOL(lirc_dev_fop_ioctl);
|
||||
|
||||
-ssize_t lirc_dev_fop_read(struct file *file,
|
||||
- char *buffer,
|
||||
- size_t length,
|
||||
- loff_t *ppos)
|
||||
+ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer,
|
||||
+ size_t length, loff_t *ppos)
|
||||
{
|
||||
struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)];
|
||||
unsigned char *buf;
|
||||
@@ -767,18 +769,18 @@
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
- if (mutex_lock_interruptible(&ir->irctl_lock))
|
||||
- return -ERESTARTSYS;
|
||||
+ if (mutex_lock_interruptible(&ir->irctl_lock)) {
|
||||
+ ret = -ERESTARTSYS;
|
||||
+ goto out_unlocked;
|
||||
+ }
|
||||
if (!ir->attached) {
|
||||
- mutex_unlock(&ir->irctl_lock);
|
||||
- return -ENODEV;
|
||||
+ ret = -ENODEV;
|
||||
+ goto out_locked;
|
||||
}
|
||||
|
||||
if (length % ir->chunk_size) {
|
||||
- dprintk(LOGHEAD "read result = -EINVAL\n",
|
||||
- ir->d.name, ir->d.minor);
|
||||
- mutex_unlock(&ir->irctl_lock);
|
||||
- return -EINVAL;
|
||||
+ ret = -EINVAL;
|
||||
+ goto out_locked;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -829,19 +831,23 @@
|
||||
lirc_buffer_read(ir->buf, buf);
|
||||
ret = copy_to_user((void *)buffer+written, buf,
|
||||
ir->buf->chunk_size);
|
||||
- written += ir->buf->chunk_size;
|
||||
+ if (!ret)
|
||||
+ written += ir->buf->chunk_size;
|
||||
+ else
|
||||
+ ret = -EFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
remove_wait_queue(&ir->buf->wait_poll, &wait);
|
||||
set_current_state(TASK_RUNNING);
|
||||
|
||||
+out_locked:
|
||||
mutex_unlock(&ir->irctl_lock);
|
||||
|
||||
out_unlocked:
|
||||
kfree(buf);
|
||||
dprintk(LOGHEAD "read result = %s (%d)\n",
|
||||
- ir->d.name, ir->d.minor, ret ? "-EFAULT" : "OK", ret);
|
||||
+ ir->d.name, ir->d.minor, ret ? "<fail>" : "OK", ret);
|
||||
|
||||
return ret ? ret : written;
|
||||
}
|
||||
@@ -864,7 +870,7 @@
|
||||
EXPORT_SYMBOL(lirc_get_pdata);
|
||||
|
||||
|
||||
-ssize_t lirc_dev_fop_write(struct file *file, const char *buffer,
|
||||
+ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
|
||||
size_t length, loff_t *ppos)
|
||||
{
|
||||
struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)];
|
||||
@@ -904,7 +910,7 @@
|
||||
}
|
||||
|
||||
printk(KERN_INFO "lirc_dev: IR Remote Control driver registered, "
|
||||
- "major %d \n", IRCTL_DEV_MAJOR);
|
||||
+ "major %d \n", MAJOR(lirc_base_dev));
|
||||
|
||||
error:
|
||||
return retval;
|
||||
diff -Naur lirc-0.9.0-old/drivers/lirc_dev/lirc_dev.h lirc-0.9.0-new/drivers/lirc_dev/lirc_dev.h
|
||||
--- lirc-0.9.0-old/drivers/lirc_dev/lirc_dev.h 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/lirc_dev/lirc_dev.h 2012-02-29 21:50:02.000000000 -0800
|
||||
@@ -257,9 +257,9 @@
|
||||
#else
|
||||
long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
|
||||
#endif
|
||||
-ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length,
|
||||
+ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length,
|
||||
loff_t *ppos);
|
||||
-ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length,
|
||||
- loff_t *ppos);
|
||||
+ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer,
|
||||
+ size_t length, loff_t *ppos);
|
||||
|
||||
#endif
|
||||
diff -Naur lirc-0.9.0-old/drivers/lirc_sir/lirc_sir.c lirc-0.9.0-new/drivers/lirc_sir/lirc_sir.c
|
||||
--- lirc-0.9.0-old/drivers/lirc_sir/lirc_sir.c 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/lirc_sir/lirc_sir.c 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -203,8 +203,6 @@
|
||||
/* SECTION: Prototypes */
|
||||
|
||||
/* Communication with user-space */
|
||||
-static int lirc_open(struct inode *inode, struct file *file);
|
||||
-static int lirc_close(struct inode *inode, struct file *file);
|
||||
static unsigned int lirc_poll(struct file *file, poll_table *wait);
|
||||
static ssize_t lirc_read(struct file *file, char *buf, size_t count,
|
||||
loff_t *ppos);
|
||||
@@ -275,22 +273,6 @@
|
||||
|
||||
/* SECTION: Communication with user-space */
|
||||
|
||||
-static int lirc_open(struct inode *inode, struct file *file)
|
||||
-{
|
||||
- spin_lock(&dev_lock);
|
||||
- if (MOD_IN_USE) {
|
||||
- spin_unlock(&dev_lock);
|
||||
- return -EBUSY;
|
||||
- }
|
||||
- spin_unlock(&dev_lock);
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-static int lirc_close(struct inode *inode, struct file *file)
|
||||
-{
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static unsigned int lirc_poll(struct file *file, poll_table *wait)
|
||||
{
|
||||
poll_wait(file, &lirc_read_queue, wait);
|
||||
@@ -519,8 +501,8 @@
|
||||
.compat_ioctl = lirc_ioctl,
|
||||
#endif
|
||||
#endif
|
||||
- .open = lirc_open,
|
||||
- .release = lirc_close,
|
||||
+ .open = lirc_dev_fop_open,
|
||||
+ .release = lirc_dev_fop_close,
|
||||
};
|
||||
|
||||
static int set_use_inc(void *data)
|
||||
diff -Naur lirc-0.9.0-old/drivers/lirc_wpc8769l/lirc_wpc8769l.c lirc-0.9.0-new/drivers/lirc_wpc8769l/lirc_wpc8769l.c
|
||||
--- lirc-0.9.0-old/drivers/lirc_wpc8769l/lirc_wpc8769l.c 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/lirc_wpc8769l/lirc_wpc8769l.c 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -816,10 +816,6 @@
|
||||
/* Reset last timeout value. */
|
||||
lastus = 0;
|
||||
|
||||
- /* Init the read buffer. */
|
||||
- if (lirc_buffer_init(&rbuf, sizeof(lirc_t), RBUF_LEN) < 0)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
/* Acquire the IRQ. */
|
||||
result = request_irq(irq, irq_handler,
|
||||
IRQF_DISABLED | IRQF_SHARED,
|
||||
@@ -863,9 +859,6 @@
|
||||
/* Free the IRQ. */
|
||||
free_irq(irq, THIS_MODULE);
|
||||
dprintk("Freed IRQ %d\n", irq);
|
||||
-
|
||||
- /* Free the RX buffer. */
|
||||
- lirc_buffer_free(&rbuf);
|
||||
}
|
||||
|
||||
static struct lirc_driver driver = {
|
||||
@@ -1065,19 +1058,29 @@
|
||||
/* Do load-time checks. */
|
||||
wpc8769l_power_up_and_check_if_we_woke_us_up();
|
||||
|
||||
+ /* Init the read buffer. */
|
||||
+ if (lirc_buffer_init(&rbuf, sizeof(lirc_t), RBUF_LEN) < 0) {
|
||||
+ rc = -ENOMEM;
|
||||
+ goto exit_platform_exit;
|
||||
+ }
|
||||
+
|
||||
/* Configure the driver hooks. */
|
||||
driver.features = LIRC_CAN_REC_MODE2;
|
||||
+ driver.dev = &lirc_wpc8769l_platform_dev->dev;
|
||||
driver.minor = lirc_register_driver(&driver);
|
||||
if (driver.minor < 0) {
|
||||
eprintk("lirc_register_driver failed!\n");
|
||||
rc = -EIO;
|
||||
- goto exit_platform_exit;
|
||||
+ goto exit_release_buffer;
|
||||
}
|
||||
|
||||
iprintk("Driver loaded.\n");
|
||||
|
||||
return 0; /* Everything OK. */
|
||||
|
||||
+exit_release_buffer:
|
||||
+ lirc_buffer_free(&rbuf);
|
||||
+
|
||||
exit_platform_exit:
|
||||
lirc_wpc8769l_platform_exit();
|
||||
|
||||
@@ -1095,12 +1098,15 @@
|
||||
|
||||
static void __exit lirc_wpc8769l_module_exit(void)
|
||||
{
|
||||
- /* Unregister the platform driver and device. */
|
||||
- lirc_wpc8769l_platform_exit();
|
||||
-
|
||||
/* Unregister the LIRC driver. */
|
||||
lirc_unregister_driver(driver.minor);
|
||||
|
||||
+ /* Free the buffer. */
|
||||
+ lirc_buffer_free(&rbuf);
|
||||
+
|
||||
+ /* Unregister the platform driver and device. */
|
||||
+ lirc_wpc8769l_platform_exit();
|
||||
+
|
||||
/* Release the second range. */
|
||||
if (baseport2)
|
||||
release_region(baseport2, WPC8769L_IO_REGION_2_SIZE);
|
||||
diff -Naur lirc-0.9.0-old/drivers/Makefile.am lirc-0.9.0-new/drivers/Makefile.am
|
||||
--- lirc-0.9.0-old/drivers/Makefile.am 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/Makefile.am 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -26,14 +26,3 @@
|
||||
|
||||
CLEANFILES = *~
|
||||
|
||||
-if SANDBOXED
|
||||
-else
|
||||
-install-exec-local: mkdev
|
||||
-uninstall-local: mkdev
|
||||
-endif
|
||||
-
|
||||
-mkdev:
|
||||
- test "@driver@" != "mediafocusI" || test -c $(DESTDIR)$(devdir)/lirc || ($(mkinstalldirs) $(DESTDIR)$(devdir) && @mknod@ $(DESTDIR)$(devdir)/lirc c @lirc_major@ 0)
|
||||
-
|
||||
-rmdev:
|
||||
- -test "@driver@" != "mediafocusI" || test -c $(DESTDIR)$(devdir)/lirc || $(RM) $(DESTDIR)$(devdir)/lirc
|
||||
diff -Naur lirc-0.9.0-old/drivers/Makefile.common lirc-0.9.0-new/drivers/Makefile.common
|
||||
--- lirc-0.9.0-old/drivers/Makefile.common 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/Makefile.common 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -8,7 +8,7 @@
|
||||
# some magic for using linux kernel settings
|
||||
# when compiling module(s)
|
||||
KBUILD_VERBOSE = 1
|
||||
-LIRC_EXTRA_CFLAGS = -DIRCTL_DEV_MAJOR=$(lirc_major) -DEXPORT_SYMTAB $(DEFS) \
|
||||
+LIRC_EXTRA_CFLAGS = -DEXPORT_SYMTAB $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) -I$(LIRC_DEVDIR)/$(srcdir) -I$(LIRC_DEVDIR)/$(builddir) \
|
||||
-I$(LIRC_DEVDIR)/$(top_srcdir) -I$(LIRC_DEVDIR)/$(top_builddir) \
|
||||
-I$(KERNEL_LOCATION)/include/ \
|
||||
@@ -47,18 +47,6 @@
|
||||
|
||||
if SANDBOXED
|
||||
else
|
||||
-install-exec-local: mkdev
|
||||
-uninstall-local: rmdev
|
||||
-endif
|
||||
-
|
||||
-mkdev:
|
||||
- test -e $(DESTDIR)$(devdir)/lirc || ($(mkinstalldirs) $(DESTDIR)$(devdir) && @mknod@ $(DESTDIR)$(devdir)/lirc c @lirc_major@ 0)
|
||||
-
|
||||
-rmdev:
|
||||
- -test -c $(DESTDIR)$(devdir)/lirc && $(RM) $(DESTDIR)$(devdir)/lirc
|
||||
-
|
||||
-if SANDBOXED
|
||||
-else
|
||||
install-data-local: install-moduleDATA
|
||||
-@depmod@ -a
|
||||
endif
|
||||
diff -Naur lirc-0.9.0-old/NEWS lirc-0.9.0-new/NEWS
|
||||
--- lirc-0.9.0-old/NEWS 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/NEWS 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -1,3 +1,6 @@
|
||||
+0.9.1-git: UNDER DEVELOPMENT
|
||||
+ * TBD
|
||||
+
|
||||
0.9.0: 03/25/11
|
||||
* Remove mceusb, streamzap, it8x, ene0100 drivers, as they're
|
||||
now redundant with upstream kernel drivers
|
||||
diff -Naur lirc-0.9.0-old/setup.sh lirc-0.9.0-new/setup.sh
|
||||
--- lirc-0.9.0-old/setup.sh 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/setup.sh 2012-02-29 21:44:36.000000000 -0800
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
|
||||
-LIRC_VERSION="0.9.0"
|
||||
+LIRC_VERSION="0.9.1-git"
|
||||
|
||||
#############################################################################
|
||||
## Default Values
|
@ -1,22 +0,0 @@
|
||||
diff -Naur lirc-0.9.0-old/drivers/lirc_serial/lirc_serial.c lirc-0.9.0-new/drivers/lirc_serial/lirc_serial.c
|
||||
--- lirc-0.9.0-old/drivers/lirc_serial/lirc_serial.c 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/lirc_serial/lirc_serial.c 2012-06-10 14:18:21.000000000 -0700
|
||||
@@ -66,7 +66,6 @@
|
||||
#include <linux/poll.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
-#include <asm/system.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/fcntl.h>
|
||||
diff -Naur lirc-0.9.0-old/drivers/lirc_sir/lirc_sir.c lirc-0.9.0-new/drivers/lirc_sir/lirc_sir.c
|
||||
--- lirc-0.9.0-old/drivers/lirc_sir/lirc_sir.c 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/lirc_sir/lirc_sir.c 2012-06-10 14:18:42.000000000 -0700
|
||||
@@ -59,7 +59,6 @@
|
||||
#include <linux/mm.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/poll.h>
|
||||
-#include <asm/system.h>
|
||||
#include <linux/io.h>
|
||||
#include <asm/irq.h>
|
||||
#include <linux/fcntl.h>
|
@ -1,201 +0,0 @@
|
||||
diff -Naur lirc-0.9.0-old/configure.ac lirc-0.9.0-new/configure.ac
|
||||
--- lirc-0.9.0-old/configure.ac 2012-02-29 21:54:01.000000000 -0800
|
||||
+++ lirc-0.9.0-new/configure.ac 2012-02-29 21:55:06.000000000 -0800
|
||||
@@ -164,7 +164,6 @@
|
||||
(lirc_dev lirc_atiusb) \
|
||||
(lirc_dev lirc_bt829) \
|
||||
(lirc_dev lirc_gpio) \
|
||||
- (lirc_dev lirc_i2c) \
|
||||
(lirc_dev lirc_igorplugusb) \
|
||||
(lirc_dev lirc_ttusbir) \
|
||||
(lirc_dev lirc_imon) \
|
||||
@@ -420,32 +419,31 @@
|
||||
AC_ARG_WITH(driver,
|
||||
[ --with-driver=X specify the driver to use, where X is one of:
|
||||
all, none, userspace, accent, act200l,
|
||||
- act220l, adaptec, alsa_usb, animax, asusdh,
|
||||
+ act220l, alsa_usb, animax, asusdh,
|
||||
atilibusb, atiusb, atwf83, audio, audio_alsa
|
||||
avermedia, avermedia_vdomate, avermedia98,
|
||||
- awlibusb, bestbuy, bestbuy2, breakoutbox,
|
||||
+ awlibusb, bestbuy, bestbuy2,
|
||||
bte, bw6130, caraca, chronos, commandir,
|
||||
comX, cph06x, creative, creative_infracd,
|
||||
devinput, dfclibusb, digimatrix, dsp, dvico, ea65,
|
||||
exaudio, flyvideo, ftdi, gvbctv5pci,
|
||||
- hauppauge, hauppauge_dvb,
|
||||
- hercules_smarttv_stereo, i2cuser,
|
||||
+ i2cuser,
|
||||
igorplugusb, iguanaIR, imon, imon_24g,
|
||||
imon_knob, imon_lcd, imon_pad, imon_rsc,
|
||||
irdeo, irdeo_remote, irlink, irman, irreal,
|
||||
- knc_one, kworld,
|
||||
- leadtek_0007, leadtek_0010, leadtek_pvr2000,
|
||||
+ kworld,
|
||||
+ leadtek_0007, leadtek_0010,
|
||||
livedrive_midi, livedrive_seq, logitech,
|
||||
lptX, macmini, mediafocusI,
|
||||
mouseremote, mouseremote_ps2, mp3anywhere,
|
||||
mplay, nslu2,packard_bell, parallel, pcmak,
|
||||
- pcmak_usb, pctv, pixelview_bt878,
|
||||
- pixelview_pak, pixelview_pro, provideo,
|
||||
+ pcmak_usb, pctv,
|
||||
+ pixelview_pak, pixelview_pro,
|
||||
realmagic, remotemaster, sa1100, samsung,
|
||||
sasem, sb0540, serial, silitek, sir, slinke,
|
||||
srm7500libusb, tekram,
|
||||
tekram_bt829, tira, tira_raw, ttusbir,
|
||||
- tuxbox, tvbox, udp, uirt2, uirt2_raw,
|
||||
+ tuxbox, udp, uirt2, uirt2_raw,
|
||||
usb_uirt_raw, usbx, wpc8769l],
|
||||
driver=${withval},
|
||||
driver="unset"
|
||||
@@ -592,9 +590,6 @@
|
||||
lirc_dev-lirc_gpio)
|
||||
#lirc_driver="${lirc_driver} lirc_dev lirc_gpio"
|
||||
;;
|
||||
- lirc_dev-lirc_i2c)
|
||||
- #lirc_driver="${lirc_driver} lirc_dev lirc_i2c"
|
||||
- ;;
|
||||
lirc_dev-lirc_igorplugusb)
|
||||
;;
|
||||
lirc_dev-lirc_ttusbir)
|
||||
@@ -721,12 +716,6 @@
|
||||
AC_DEFINE(LIRC_SIR_ACTISYS_ACT220L)
|
||||
fi
|
||||
|
||||
-if test "$driver" = "adaptec"; then
|
||||
- lirc_driver="lirc_dev lirc_i2c"
|
||||
- lircd_conf="adaptec/lircd.conf.AVC-2410"
|
||||
-# lircmd_conf="adaptec/lircmd.conf.AVC-2410"
|
||||
-fi
|
||||
-
|
||||
if test "$driver" = "alsa_usb"; then
|
||||
lirc_driver="alsa_usb"
|
||||
hw_module="hw_alsa_usb.o"
|
||||
@@ -828,11 +817,6 @@
|
||||
lircmd_conf="bestbuy/lircmd.conf.bestbuy2"
|
||||
fi
|
||||
|
||||
-if test "$driver" = "breakoutbox"; then
|
||||
- lirc_driver="lirc_dev lirc_i2c"
|
||||
- lircd_conf="creative/lircd.conf.breakoutbox"
|
||||
-fi
|
||||
-
|
||||
if test "$driver" = "bte"; then
|
||||
lirc_driver="none"
|
||||
hw_module="hw_bte.o serial.o"
|
||||
@@ -983,23 +967,6 @@
|
||||
# lircmd_conf="iodata/lircmd.conf.gvbctv5pci"
|
||||
fi
|
||||
|
||||
-if test "$driver" = "hauppauge"; then
|
||||
- lirc_driver="lirc_dev lirc_i2c"
|
||||
- lircd_conf="hauppauge/lircd.conf.hauppauge"
|
||||
- lircmd_conf="hauppauge/lircmd.conf.hauppauge"
|
||||
-fi
|
||||
-
|
||||
-if test "$driver" = "hauppauge_dvb"; then
|
||||
- lirc_driver="lirc_dev"
|
||||
- lircd_conf="hauppauge/lircd.conf.hauppauge"
|
||||
- lircmd_conf="hauppauge/lircmd.conf.hauppauge"
|
||||
-fi
|
||||
-
|
||||
-if test "$driver" = "hercules_smarttv_stereo"; then
|
||||
- lirc_driver="lirc_dev lirc_i2c"
|
||||
- lircd_conf="hercules/lircd.conf.smarttv_stereo"
|
||||
-fi
|
||||
-
|
||||
if test "$driver" = "i2cuser"; then
|
||||
lirc_driver="none"
|
||||
hw_module="hw_i2cuser.o receive.o"
|
||||
@@ -1084,12 +1051,6 @@
|
||||
HW_DEFAULT="hw_irreal"
|
||||
fi
|
||||
|
||||
-if test "$driver" = "knc_one"; then
|
||||
- lirc_driver="lirc_dev lirc_i2c"
|
||||
- lircd_conf="knc_one/lircd.conf.knc_one"
|
||||
-# lircmd_conf="knc_one/lircmd.conf.knc_one"
|
||||
-fi
|
||||
-
|
||||
if test "$driver" = "kworld"; then
|
||||
lirc_driver="lirc_dev lirc_gpio"
|
||||
lircd_conf="kworld/lircd.conf.kworld"
|
||||
@@ -1108,12 +1069,6 @@
|
||||
lircmd_conf="leadtek/lircmd.conf.RM-0010"
|
||||
fi
|
||||
|
||||
-if test "$driver" = "leadtek_pvr2000"; then
|
||||
- lirc_driver="lirc_dev lirc_i2c"
|
||||
- lircd_conf="leadtek/lircd.conf.PVR2000"
|
||||
-# lircmd_conf="leadtek/lircmd.conf.PVR2000"
|
||||
-fi
|
||||
-
|
||||
if test "$driver" = "livedrive_midi"; then
|
||||
lirc_driver="none"
|
||||
hw_module="hw_livedrive_common.o hw_livedrive_midi.o"
|
||||
@@ -1230,12 +1185,6 @@
|
||||
# lircmd_conf="pinnacle_systems/lircmd.conf.pctv"
|
||||
fi
|
||||
|
||||
-if test "$driver" = "pixelview_bt878"; then
|
||||
- lirc_driver="lirc_dev lirc_i2c"
|
||||
- lircd_conf="pixelview/lircd.conf.playtv_bt878"
|
||||
-# lircmd_conf="pixelview/lircmd.conf.pixelview_bt878"
|
||||
-fi
|
||||
-
|
||||
if test "$driver" = "pixelview_pak"; then
|
||||
lirc_driver="lirc_dev lirc_gpio"
|
||||
# the config files are the same as for the PlayTV pro
|
||||
@@ -1249,12 +1198,6 @@
|
||||
lircmd_conf="pixelview/lircmd.conf.playtv_pro"
|
||||
fi
|
||||
|
||||
-if test "$driver" = "provideo"; then
|
||||
- lirc_driver="lirc_dev lirc_i2c"
|
||||
- lircd_conf="provideo/lircd.conf.pv951"
|
||||
-# lircmd_conf="provideo/lircmd.conf.pv951"
|
||||
-fi
|
||||
-
|
||||
if test "$driver" = "realmagic"; then
|
||||
lirc_driver="none"
|
||||
hw_module="hw_pixelview.o serial.o"
|
||||
@@ -1372,11 +1315,6 @@
|
||||
HW_DEFAULT="hw_default"
|
||||
fi
|
||||
|
||||
-if test "$driver" = "tvbox"; then
|
||||
- lirc_driver="lirc_dev lirc_i2c"
|
||||
- lircd_conf="asus/lircd.conf.asus"
|
||||
-fi
|
||||
-
|
||||
if test "$driver" = "udp"; then
|
||||
lirc_driver="none"
|
||||
hw_module="hw_udp.o receive.o"
|
||||
@@ -1512,7 +1450,6 @@
|
||||
lirc_driver="lirc_dev \
|
||||
lirc_atiusb \
|
||||
lirc_bt829 \
|
||||
- lirc_i2c \
|
||||
lirc_igorplugusb \
|
||||
lirc_imon \
|
||||
lirc_parallel \
|
||||
@@ -1779,7 +1716,6 @@
|
||||
drivers/lirc_bt829/Makefile
|
||||
drivers/lirc_dev/Makefile
|
||||
drivers/lirc_gpio/Makefile
|
||||
- drivers/lirc_i2c/Makefile
|
||||
drivers/lirc_igorplugusb/Makefile
|
||||
drivers/lirc_ttusbir/Makefile
|
||||
drivers/lirc_imon/Makefile
|
||||
@@ -1808,9 +1744,6 @@
|
||||
elif test "$driver" = "alsa_usb"; then
|
||||
echo "You will have to use the snd-usb-audio driver from:"
|
||||
echo "http://www.alsa-project.org/"
|
||||
-elif test "$driver" = "hauppauge_dvb"; then
|
||||
- echo "You will have to use the DVB driver from:"
|
||||
- echo "http://www.linuxtv.org"
|
||||
elif test "$kernel_module" = ""; then
|
||||
echo "Your hardware does not require a special LIRC kernel module."
|
||||
if test "${irtty}" != ""; then
|
@ -1,33 +0,0 @@
|
||||
diff -Naur lirc-0.9.0-old-old/drivers/lirc_atiusb/lirc_atiusb.c lirc-0.9.0-old-new/drivers/lirc_atiusb/lirc_atiusb.c
|
||||
--- lirc-0.9.0-old-old/drivers/lirc_atiusb/lirc_atiusb.c 2012-05-01 12:09:19.000000000 -0700
|
||||
+++ lirc-0.9.0-old-new/drivers/lirc_atiusb/lirc_atiusb.c 2012-05-01 12:14:52.000000000 -0700
|
||||
@@ -138,23 +138,23 @@
|
||||
|
||||
static struct usb_device_id usb_remote_table[] = {
|
||||
/* X10 USB Firecracker Interface */
|
||||
- { USB_DEVICE(VENDOR_ATI1, 0x0002) },
|
||||
+ /* { USB_DEVICE(VENDOR_ATI1, 0x0002) }, */
|
||||
|
||||
/* X10 VGA Video Sender */
|
||||
- { USB_DEVICE(VENDOR_ATI1, 0x0003) },
|
||||
+ /* { USB_DEVICE(VENDOR_ATI1, 0x0003) }, */
|
||||
|
||||
/* ATI Wireless Remote Receiver */
|
||||
- { USB_DEVICE(VENDOR_ATI1, 0x0004) },
|
||||
+ /* { USB_DEVICE(VENDOR_ATI1, 0x0004) }, */
|
||||
|
||||
/* NVIDIA Wireless Remote Receiver */
|
||||
- { USB_DEVICE(VENDOR_ATI1, 0x0005) },
|
||||
+ /* { USB_DEVICE(VENDOR_ATI1, 0x0005) }, */
|
||||
|
||||
/* ATI Wireless Remote Receiver */
|
||||
- { USB_DEVICE(VENDOR_ATI1, 0x0006) },
|
||||
+ /* { USB_DEVICE(VENDOR_ATI1, 0x0006) }, */
|
||||
|
||||
/* X10 USB Wireless Transceivers */
|
||||
{ USB_DEVICE(VENDOR_ATI1, 0x0007) },
|
||||
- { USB_DEVICE(VENDOR_ATI1, 0x0008) },
|
||||
+ /* { USB_DEVICE(VENDOR_ATI1, 0x0008) }, */
|
||||
{ USB_DEVICE(VENDOR_ATI1, 0x0009) },
|
||||
{ USB_DEVICE(VENDOR_ATI1, 0x000A) },
|
||||
{ USB_DEVICE(VENDOR_ATI1, 0x000B) },
|
@ -1,11 +0,0 @@
|
||||
diff -Naur lirc-0.9.0-old/drivers/lirc_atiusb/lirc_atiusb.c lirc-0.9.0-new/drivers/lirc_atiusb/lirc_atiusb.c
|
||||
--- lirc-0.9.0-old/drivers/lirc_atiusb/lirc_atiusb.c 2011-07-27 20:45:01.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/lirc_atiusb/lirc_atiusb.c 2011-07-27 20:45:53.000000000 -0700
|
||||
@@ -48,7 +48,6 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kmod.h>
|
||||
-#include <linux/smp_lock.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/usb.h>
|
@ -1,29 +0,0 @@
|
||||
diff -Naur lirc-0.9.0-old/drivers/lirc_wpc8769l/lirc_wpc8769l.c lirc-0.9.0-new/drivers/lirc_wpc8769l/lirc_wpc8769l.c
|
||||
--- lirc-0.9.0-old/drivers/lirc_wpc8769l/lirc_wpc8769l.c 2011-07-27 20:45:36.000000000 -0700
|
||||
+++ lirc-0.9.0-new/drivers/lirc_wpc8769l/lirc_wpc8769l.c 2011-07-27 20:46:22.000000000 -0700
|
||||
@@ -361,14 +361,14 @@
|
||||
size = count << 3;
|
||||
|
||||
ldata = (unsigned long *) data_buf;
|
||||
- next_one = generic_find_next_le_bit(ldata, size, 0);
|
||||
+ next_one = find_next_bit_le(ldata, size, 0);
|
||||
|
||||
if (next_one > 0)
|
||||
put_pulse_bit(next_one
|
||||
* WPC8769L_USECS_PER_BIT);
|
||||
|
||||
while (next_one < size) {
|
||||
- next_zero = generic_find_next_zero_le_bit(ldata,
|
||||
+ next_zero = find_next_zero_bit_le(ldata,
|
||||
size, next_one + 1);
|
||||
|
||||
put_space_bit(
|
||||
@@ -376,7 +376,7 @@
|
||||
* WPC8769L_USECS_PER_BIT);
|
||||
|
||||
if (next_zero < size) {
|
||||
- next_one = generic_find_next_le_bit(ldata,
|
||||
+ next_one = find_next_bit_le(ldata,
|
||||
size, next_zero + 1);
|
||||
|
||||
put_pulse_bit(
|
@ -1,63 +0,0 @@
|
||||
diff -Naur lirc-0.9.0-old/daemons/input_map.c lirc-0.9.0-new/daemons/input_map.c
|
||||
--- lirc-0.9.0-old/daemons/input_map.c 2011-07-27 20:46:13.000000000 -0700
|
||||
+++ lirc-0.9.0-new/daemons/input_map.c 2011-07-27 20:47:15.000000000 -0700
|
||||
@@ -25,6 +25,19 @@
|
||||
NULL, 0}
|
||||
};
|
||||
|
||||
+int get_input_code_by_index(int index, linux_input_code * code)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; input_map[i].name != NULL; i++) {
|
||||
+ if (i == index) {
|
||||
+ *code = input_map[i].code;
|
||||
+ return i;
|
||||
+ }
|
||||
+ }
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
int get_input_code(const char *name, linux_input_code * code)
|
||||
{
|
||||
int i;
|
||||
diff -Naur lirc-0.9.0-old/daemons/input_map.h lirc-0.9.0-new/daemons/input_map.h
|
||||
--- lirc-0.9.0-old/daemons/input_map.h 2011-07-27 20:46:13.000000000 -0700
|
||||
+++ lirc-0.9.0-new/daemons/input_map.h 2011-07-27 20:47:15.000000000 -0700
|
||||
@@ -28,6 +28,7 @@
|
||||
typedef unsigned short linux_input_code;
|
||||
#endif
|
||||
|
||||
+int get_input_code_by_index(int index, linux_input_code * code);
|
||||
int get_input_code(const char *name, linux_input_code * code);
|
||||
void fprint_namespace(FILE * f);
|
||||
int is_in_namespace(const char *name);
|
||||
diff -Naur lirc-0.9.0-old/daemons/lircd.c lirc-0.9.0-new/daemons/lircd.c
|
||||
--- lirc-0.9.0-old/daemons/lircd.c 2011-07-27 20:46:13.000000000 -0700
|
||||
+++ lirc-0.9.0-new/daemons/lircd.c 2011-07-27 20:47:15.000000000 -0700
|
||||
@@ -406,6 +406,8 @@
|
||||
#if defined(__linux__)
|
||||
int fd;
|
||||
int key;
|
||||
+ linux_input_code code;
|
||||
+ int i;
|
||||
struct uinput_user_dev dev;
|
||||
|
||||
fd = open("/dev/input/uinput", O_RDWR);
|
||||
@@ -428,9 +430,13 @@
|
||||
goto setup_error;
|
||||
}
|
||||
|
||||
- for (key = KEY_RESERVED; key <= KEY_UNKNOWN; key++) {
|
||||
- if (ioctl(fd, UI_SET_KEYBIT, key) != 0) {
|
||||
- goto setup_error;
|
||||
+ for(i = 0; get_input_code_by_index(i, &code) >= 0; i++) {
|
||||
+ key = (int)code;
|
||||
+ if (((key >= KEY_ESC) && (key <= KEY_RFKILL )) ||
|
||||
+ ((key >= KEY_OK ) && (key <= KEY_WPS_BUTTON))) {
|
||||
+ if (ioctl(fd, UI_SET_KEYBIT, key) != 0) {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
@ -1,785 +0,0 @@
|
||||
diff -Naur lirc-0.9.0/configure.ac lirc-0.9.0.patch/configure.ac
|
||||
--- lirc-0.9.0/configure.ac 2013-06-01 05:14:37.836893013 +0200
|
||||
+++ lirc-0.9.0.patch/configure.ac 2013-06-01 05:15:53.523904976 +0200
|
||||
@@ -154,6 +154,7 @@
|
||||
(uirt2) \
|
||||
(uirt2_raw) \
|
||||
(usb_uirt_raw) \
|
||||
+ (usb_irtoy) \
|
||||
(usbx) \
|
||||
(udp)"
|
||||
|
||||
@@ -444,7 +445,7 @@
|
||||
srm7500libusb, tekram,
|
||||
tekram_bt829, tira, tira_raw, ttusbir,
|
||||
tuxbox, udp, uirt2, uirt2_raw,
|
||||
- usb_uirt_raw, usbx, wpc8769l],
|
||||
+ usb_uirt_raw, usb_irtoy, usbx, wpc8769l],
|
||||
driver=${withval},
|
||||
driver="unset"
|
||||
)
|
||||
@@ -675,6 +676,9 @@
|
||||
uirt2_raw|usb_uirt_raw)
|
||||
hw_module="${hw_module} hw_uirt2_raw.o hw_uirt2_common.o serial.o receive.o transmit.o"
|
||||
;;
|
||||
+ usb_irtoy)
|
||||
+ hw_module="${hw_module} hw_usbirtoy.o serial.o receive.o transmit.o"
|
||||
+ ;;
|
||||
usbx)
|
||||
hw_module="${hw_module} hw_usbx.o serial.o"
|
||||
;;
|
||||
@@ -1329,6 +1333,11 @@
|
||||
hw_module="hw_uirt2_raw.o hw_uirt2_common.o serial.o receive.o transmit.o"
|
||||
HW_DEFAULT="hw_uirt2_raw"
|
||||
fi
|
||||
+if test "$driver" = "usb_irtoy"; then
|
||||
+ lirc_driver="none"
|
||||
+ hw_module="hw_usbirtoy.o serial.o receive.o transmit.o"
|
||||
+ HW_DEFAULT="hw_usbirtoy"
|
||||
+fi
|
||||
if test "$driver" = "usb_uirt_raw"; then
|
||||
lirc_driver="none"
|
||||
hw_module="hw_uirt2_raw.o hw_uirt2_common.o serial.o receive.o transmit.o"
|
||||
diff -Naur lirc-0.9.0/daemons/hw-types.c lirc-0.9.0.patch/daemons/hw-types.c
|
||||
--- lirc-0.9.0/daemons/hw-types.c 2011-03-25 23:28:18.000000000 +0100
|
||||
+++ lirc-0.9.0.patch/daemons/hw-types.c 2013-06-01 05:17:24.821961521 +0200
|
||||
@@ -58,6 +58,7 @@
|
||||
extern struct hardware hw_uirt2;
|
||||
extern struct hardware hw_uirt2_raw;
|
||||
extern struct hardware hw_usb_uirt_raw;
|
||||
+extern struct hardware hw_usbirtoy;
|
||||
extern struct hardware hw_usbx;
|
||||
|
||||
#ifndef HW_DEFAULT
|
||||
@@ -172,6 +173,7 @@
|
||||
&hw_uirt2,
|
||||
&hw_uirt2_raw,
|
||||
&hw_usb_uirt_raw,
|
||||
+ &hw_usbirtoy,
|
||||
&hw_usbx,
|
||||
#else
|
||||
&HW_DEFAULT,
|
||||
diff -Naur lirc-0.9.0/daemons/hw_usbirtoy.c lirc-0.9.0.patch/daemons/hw_usbirtoy.c
|
||||
--- lirc-0.9.0/daemons/hw_usbirtoy.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ lirc-0.9.0.patch/daemons/hw_usbirtoy.c 2013-06-01 05:15:53.524904977 +0200
|
||||
@@ -0,0 +1,607 @@
|
||||
+/****************************************************************************
|
||||
+ ** hw_usbirtoy.c **********************************************************
|
||||
+ ****************************************************************************
|
||||
+ *
|
||||
+ * Routines for USB Infrared Toy receiver/transmitter in sampling mode
|
||||
+ *
|
||||
+ * Copyright (C) 2011 Peter Kooiman <pkooiman@gmail.com>
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU General Public License as published by
|
||||
+ * the Free Software Foundation; either version 2 of the License, or
|
||||
+ * (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU Library General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
+ */
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+ #include <config.h>
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <stdarg.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <unistd.h>
|
||||
+#include <limits.h>
|
||||
+#include <signal.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/ioctl.h>
|
||||
+#include <errno.h>
|
||||
+
|
||||
+
|
||||
+#include "hardware.h"
|
||||
+#include "serial.h"
|
||||
+#include "ir_remote.h"
|
||||
+#include "lircd.h"
|
||||
+#include "receive.h"
|
||||
+#include "transmit.h"
|
||||
+
|
||||
+#define IRTOY_MINFWVERSION 20
|
||||
+
|
||||
+#define IRTOY_UNIT 21.3333
|
||||
+#define IRTOY_LONGSPACE 1000000
|
||||
+
|
||||
+
|
||||
+const unsigned char IRTOY_COMMAND_TXSTART[] = {0x24, 0x25, 0x26, 0x03};
|
||||
+#define IRTOY_COMMAND_RESET 0
|
||||
+#define IRTOY_COMMAND_SMODE_ENTER 's'
|
||||
+#define IRTOY_COMMAND_VERSION 'v'
|
||||
+
|
||||
+#define IRTOY_REPLY_XMITCOUNT 't'
|
||||
+#define IRTOY_REPLY_XMITSUCCESS 'C'
|
||||
+#define IRTOY_REPLY_VERSION 'V'
|
||||
+#define IRTOY_REPLY_SAMPLEMODEPROTO 'S'
|
||||
+
|
||||
+#define IRTOY_LEN_XMITRES 4
|
||||
+#define IRTOY_LEN_VERSION 4
|
||||
+#define IRTOY_LEN_SAMPLEMODEPROTO 3
|
||||
+
|
||||
+#define IRTOY_TIMEOUT_READYFORDATA 1000000
|
||||
+#define IRTOY_TIMEOUT_FLUSH 20000
|
||||
+#define IRTOY_TIMEOUT_SMODE_ENTER 500000
|
||||
+#define IRTOY_TIMEOUT_VERSION 500000
|
||||
+
|
||||
+
|
||||
+struct tag_irtoy_t {
|
||||
+ int hwVersion;
|
||||
+ int swVersion;
|
||||
+ int protoVersion;
|
||||
+ int fd;
|
||||
+ int awaitingNewSig;
|
||||
+ int pulse;
|
||||
+};
|
||||
+
|
||||
+typedef struct tag_irtoy_t irtoy_t;
|
||||
+
|
||||
+static irtoy_t *dev;
|
||||
+
|
||||
+unsigned char rawSB[WBUF_SIZE * 2 + 2];
|
||||
+
|
||||
+/* exported functions */
|
||||
+static int irtoy_init(void);
|
||||
+static int irtoy_deinit(void);
|
||||
+static int irtoy_send(struct ir_remote *remote, struct ir_ncode *code);
|
||||
+static char *irtoy_rec(struct ir_remote *remotes);
|
||||
+static int irtoy_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp,
|
||||
+ int *repeat_flagp, lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp);
|
||||
+static lirc_t irtoy_readdata(lirc_t timeout);
|
||||
+
|
||||
+
|
||||
+struct hardware hw_usbirtoy = {
|
||||
+#ifndef LIRC_IRTTY
|
||||
+ "/dev/ttyACM0",
|
||||
+#else
|
||||
+ LIRC_IRTTY, /* default device */
|
||||
+#endif
|
||||
+ -1, /* fd */
|
||||
+ LIRC_CAN_REC_MODE2 | LIRC_CAN_SEND_PULSE, /* features */
|
||||
+ LIRC_MODE_PULSE, /* send_mode */
|
||||
+ LIRC_MODE_MODE2, /* rec_mode */
|
||||
+ 0, /* code_length */
|
||||
+ irtoy_init, /* init_func */
|
||||
+ irtoy_deinit, /* deinit_func */
|
||||
+ irtoy_send, /* send_func */
|
||||
+ irtoy_rec, /* rec_func */
|
||||
+ irtoy_decode, /* decode_func */
|
||||
+ NULL, /* ioctl_func */
|
||||
+ irtoy_readdata, /* readdata */
|
||||
+ "usb_irtoy"
|
||||
+};
|
||||
+
|
||||
+
|
||||
+static int irtoy_decode(struct ir_remote *remote, ir_code * prep, ir_code * codep, ir_code * postp,
|
||||
+ int *repeat_flagp, lirc_t * min_remaining_gapp, lirc_t * max_remaining_gapp)
|
||||
+{
|
||||
+ int res;
|
||||
+
|
||||
+ LOGPRINTF(1, "irtoy_decode: enter");
|
||||
+
|
||||
+ res = receive_decode(remote, prep, codep, postp, repeat_flagp, min_remaining_gapp, max_remaining_gapp);
|
||||
+
|
||||
+ LOGPRINTF(1, "irtoy_decode: %d", res);
|
||||
+
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+static ssize_t read_with_timeout(int fd, void *buf, size_t count, long to_usec)
|
||||
+{
|
||||
+ ssize_t rc;
|
||||
+ size_t numread = 0;
|
||||
+ struct timeval timeout;
|
||||
+ fd_set fds;
|
||||
+
|
||||
+ timeout.tv_sec = 0;
|
||||
+ timeout.tv_usec = to_usec;
|
||||
+
|
||||
+ rc = read(fd, (char *) buf, count);
|
||||
+
|
||||
+ if (rc > 0) {
|
||||
+ numread += rc;
|
||||
+ }
|
||||
+
|
||||
+ while ((rc == -1 && errno == EAGAIN) || (rc >= 0 && numread < count)) {
|
||||
+ FD_ZERO(&fds);
|
||||
+ FD_SET(fd, &fds);
|
||||
+
|
||||
+ rc = select(fd + 1, &fds, NULL, NULL, &timeout);
|
||||
+
|
||||
+ if (rc == 0) {
|
||||
+ /* timeout */
|
||||
+ break;
|
||||
+ } else if (rc == -1) {
|
||||
+ /* continue for EAGAIN case */
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ rc = read(fd, ((char *)buf) + numread, count - numread);
|
||||
+
|
||||
+ if (rc > 0) {
|
||||
+ numread += rc;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ return(numread == 0) ? -1 : numread;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int irtoy_readflush(irtoy_t * dev, long timeout)
|
||||
+{
|
||||
+ int res;
|
||||
+ char c;
|
||||
+
|
||||
+ while ((res = read_with_timeout(dev->fd, &c, 1, timeout)) == 1)
|
||||
+ ;
|
||||
+
|
||||
+ if (res != 0)
|
||||
+ return -1;
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static lirc_t irtoy_read(irtoy_t * dev, lirc_t timeout)
|
||||
+{
|
||||
+
|
||||
+ lirc_t data;
|
||||
+ int res;
|
||||
+ unsigned char dur[2];
|
||||
+
|
||||
+ if (!waitfordata(timeout))
|
||||
+ return 0;
|
||||
+
|
||||
+ // lircd expects a space as start of the next transmission, not just at the end of the last one
|
||||
+ // irrecord however likes to see a space at the end of the signal
|
||||
+ // We remember if we saw the 0xFFFF timeout from the usbtoy and send a long space both after last signal and at start of next signal
|
||||
+ // From usb irtoy: <signal...><lastpulse> [usbtoy timeout duration] 0xFFFF [however long it takes before next signal] <firstpulse><signal..>
|
||||
+ // We return: <signal><lastpulse> [usbtoy timeout duration] LONGSPACE [however long it takes before next signal] LONGSPACE <firstpulse><signal>
|
||||
+ if (dev->awaitingNewSig) {
|
||||
+
|
||||
+ LOGPRINTF(1, "new signal after large space");
|
||||
+ dev->pulse = 1;
|
||||
+ dev->awaitingNewSig = 0;
|
||||
+ return IRTOY_LONGSPACE;
|
||||
+ }
|
||||
+
|
||||
+ res = read_with_timeout(dev->fd, dur, 2, 0);
|
||||
+
|
||||
+ if (res != 2) {
|
||||
+ logprintf(LOG_ERR, "irtoy_read: could not get 2 bytes");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+
|
||||
+ LOGPRINTF(3, "read_raw %02x%02x", dur[0], dur[1]);
|
||||
+
|
||||
+
|
||||
+ if (dur[0] == 0xff && dur[1] == 0xff) {
|
||||
+ dev->awaitingNewSig = 1;
|
||||
+ return IRTOY_LONGSPACE;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ data = (lirc_t) (IRTOY_UNIT * (double) (256 * dur[0] + dur[1]));
|
||||
+
|
||||
+ LOGPRINTF(3, "read_raw %d", data);
|
||||
+
|
||||
+
|
||||
+ if (dev->pulse) {
|
||||
+ data = data | PULSE_BIT;
|
||||
+ }
|
||||
+
|
||||
+ dev->pulse = ! (dev->pulse);
|
||||
+
|
||||
+
|
||||
+ return data;
|
||||
+}
|
||||
+
|
||||
+static lirc_t irtoy_readdata(lirc_t timeout)
|
||||
+{
|
||||
+ lirc_t data = irtoy_read(dev, timeout);
|
||||
+
|
||||
+ if (data) {
|
||||
+ LOGPRINTF(1, "irtoy_readdata %d %d", !!(data & PULSE_BIT), data & PULSE_MASK);
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ return(data);
|
||||
+}
|
||||
+
|
||||
+static int irtoy_getversion(irtoy_t *dev)
|
||||
+{
|
||||
+ int res;
|
||||
+ unsigned char buf[16];
|
||||
+ int vNum;
|
||||
+
|
||||
+ irtoy_readflush(dev, IRTOY_TIMEOUT_FLUSH);
|
||||
+
|
||||
+
|
||||
+ buf[0] = IRTOY_COMMAND_VERSION;
|
||||
+ res = write(dev->fd, buf, 1);
|
||||
+
|
||||
+ if (res != 1) {
|
||||
+ logprintf(LOG_ERR, "irtoy_getversion: couldn't write command");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ res = read_with_timeout(dev->fd, buf, IRTOY_LEN_VERSION, IRTOY_TIMEOUT_VERSION);
|
||||
+
|
||||
+ if (res != IRTOY_LEN_VERSION) {
|
||||
+ logprintf(LOG_ERR, "irtoy_getversion: couldn't read version");
|
||||
+ logprintf(LOG_ERR, "please make sure you are using firmware v20 or higher");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ buf[IRTOY_LEN_VERSION] = 0;
|
||||
+
|
||||
+ LOGPRINTF(1, "irtoy_getversion: Got version %s", buf);
|
||||
+
|
||||
+ if (buf[0] != IRTOY_REPLY_VERSION) {
|
||||
+ logprintf(LOG_ERR, "irtoy_getversion: invalid response %02X", buf[0]);
|
||||
+ logprintf(LOG_ERR, "please make sure you are using firmware v20 or higher");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ vNum = atoi(buf + 1);
|
||||
+ dev->hwVersion = vNum / 100;
|
||||
+ dev->swVersion = vNum % 100;
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int irtoy_reset(irtoy_t *dev)
|
||||
+{
|
||||
+ int res;
|
||||
+ unsigned char buf[16];
|
||||
+
|
||||
+ buf[0] = IRTOY_COMMAND_RESET;
|
||||
+ res = write(dev->fd, buf, 1);
|
||||
+
|
||||
+ if (res != 1) {
|
||||
+ logprintf(LOG_ERR, "irtoy_reset: couldn't write command");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ irtoy_readflush(dev, IRTOY_TIMEOUT_FLUSH);
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int irtoy_enter_samplemode(irtoy_t *dev)
|
||||
+{
|
||||
+
|
||||
+ int res;
|
||||
+ unsigned char buf[16];
|
||||
+
|
||||
+ buf[0] = IRTOY_COMMAND_SMODE_ENTER;
|
||||
+ res = write(dev->fd, buf, 1);
|
||||
+
|
||||
+ if (res != 1) {
|
||||
+ logprintf(LOG_ERR, "irtoy_enter_samplemode: couldn't write command");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ res = read_with_timeout(dev->fd, buf, IRTOY_LEN_SAMPLEMODEPROTO, IRTOY_TIMEOUT_SMODE_ENTER);
|
||||
+
|
||||
+ if (res != IRTOY_LEN_SAMPLEMODEPROTO) {
|
||||
+ logprintf(LOG_ERR, "irtoy_enter_samplemode: couldn't read command result");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ buf[IRTOY_LEN_SAMPLEMODEPROTO] = 0;
|
||||
+
|
||||
+ if (buf[0] != IRTOY_REPLY_SAMPLEMODEPROTO) {
|
||||
+ logprintf(LOG_ERR, "irtoy_enter_samplemode: invalid response %02X", buf[0]);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ LOGPRINTF(1, "irtoy_reset: Got protocol %s", buf);
|
||||
+
|
||||
+ dev->protoVersion = atoi(buf + 1);
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static irtoy_t *irtoy_hw_init(int fd)
|
||||
+{
|
||||
+
|
||||
+
|
||||
+ irtoy_t *dev = (irtoy_t *) malloc(sizeof(irtoy_t));
|
||||
+
|
||||
+ if (dev == NULL) {
|
||||
+ logprintf(LOG_ERR, "irtoy_init: out of memory");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ memset(dev, 0, sizeof(irtoy_t));
|
||||
+
|
||||
+ dev->awaitingNewSig = 1;
|
||||
+ dev->fd = fd;
|
||||
+ dev->pulse = 1;
|
||||
+
|
||||
+ irtoy_readflush(dev, IRTOY_TIMEOUT_FLUSH);
|
||||
+
|
||||
+ if (!irtoy_reset(dev) || !irtoy_getversion(dev) || !irtoy_enter_samplemode(dev)) {
|
||||
+ free(dev);
|
||||
+ dev = NULL;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ return dev;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+static int irtoy_init(void)
|
||||
+{
|
||||
+
|
||||
+
|
||||
+
|
||||
+ if (!tty_create_lock(hw.device)) {
|
||||
+ logprintf(LOG_ERR, "usb_irtoy: could not create lock files");
|
||||
+ return(0);
|
||||
+ }
|
||||
+
|
||||
+ if ((hw.fd = open(hw.device, O_RDWR | O_NONBLOCK | O_NOCTTY)) < 0) {
|
||||
+ logprintf(LOG_ERR, "usb_irtoy: could not open %s", hw.device);
|
||||
+ tty_delete_lock();
|
||||
+ return(0);
|
||||
+ }
|
||||
+
|
||||
+ if (!tty_reset(hw.fd)) {
|
||||
+ logprintf(LOG_ERR, "usb_irtoy: could not reset tty");
|
||||
+ close(hw.fd);
|
||||
+ tty_delete_lock();
|
||||
+ return(0);
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ if (!tty_setbaud(hw.fd, 115200)) {
|
||||
+ logprintf(LOG_ERR, "usb_irtoy: could not set baud rate");
|
||||
+ close(hw.fd);
|
||||
+ tty_delete_lock();
|
||||
+ return(0);
|
||||
+ }
|
||||
+
|
||||
+ if (!tty_setcsize(hw.fd, 8)) {
|
||||
+ logprintf(LOG_ERR, "usb_irtoy: could not set csize");
|
||||
+ close(hw.fd);
|
||||
+ tty_delete_lock();
|
||||
+ return(0);
|
||||
+ }
|
||||
+
|
||||
+ if (!tty_setrtscts(hw.fd, 1)) {
|
||||
+ logprintf(LOG_ERR, "usb_irtoy: could not enable hardware flow");
|
||||
+ close(hw.fd);
|
||||
+ tty_delete_lock();
|
||||
+ return(0);
|
||||
+ }
|
||||
+
|
||||
+ if ((dev = irtoy_hw_init(hw.fd)) == NULL) {
|
||||
+ logprintf(LOG_ERR, "usb_irtoy: No USB Irtoy device found at %s", hw.device);
|
||||
+ close(hw.fd);
|
||||
+ tty_delete_lock();
|
||||
+ return(0);
|
||||
+ }
|
||||
+
|
||||
+ LOGPRINTF(1, "Version hw %d, sw %d, protocol %d\n", dev->hwVersion, dev->swVersion, dev->protoVersion);
|
||||
+
|
||||
+ if (dev->swVersion < IRTOY_MINFWVERSION) {
|
||||
+ logprintf(LOG_ERR, "usb_irtoy: Need firmware V%02d or higher, this firmware: %02d", IRTOY_MINFWVERSION, dev->swVersion);
|
||||
+ free(dev);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ init_rec_buffer();
|
||||
+ init_send_buffer();
|
||||
+
|
||||
+
|
||||
+
|
||||
+ return(1);
|
||||
+}
|
||||
+
|
||||
+static int irtoy_deinit(void)
|
||||
+{
|
||||
+
|
||||
+ // IMPORTANT do not remove this reset. it is vital to return the irtoy to IRMAN mode.
|
||||
+ // If we leave the irtoy in sample mode while no-one has the tty open, the linux cdc_acm driver will fail on the next open.
|
||||
+ // This is apparently due to data being sent while the tty is not open and fairly well known (google for "tty_port_close_start: tty->count = 1 port count = 0")
|
||||
+ // IRMAN mode will wait until a signal is actually read before sending the next one, while sample mode will keep streaming (and under fluorescent light it WILL stream..)
|
||||
+ // triggering the problem
|
||||
+ irtoy_reset(dev);
|
||||
+
|
||||
+ free(dev);
|
||||
+ dev = NULL;
|
||||
+
|
||||
+
|
||||
+ close(hw.fd);
|
||||
+ hw.fd = -1;
|
||||
+ tty_delete_lock();
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static char *irtoy_rec(struct ir_remote *remotes)
|
||||
+{
|
||||
+ LOGPRINTF(1, "irtoy_raw_rec");
|
||||
+
|
||||
+
|
||||
+ if (!clear_rec_buffer())
|
||||
+ return(NULL);
|
||||
+
|
||||
+ return decode_all(remotes);
|
||||
+
|
||||
+
|
||||
+}
|
||||
+
|
||||
+static int irtoy_send_double_buffered(unsigned char * signals, int length)
|
||||
+{
|
||||
+ int numToXmit = length;
|
||||
+ int numThisTime;
|
||||
+ int res;
|
||||
+ unsigned char irToyBufLen;
|
||||
+ unsigned char *txPtr;
|
||||
+ unsigned char reply[16];
|
||||
+ int irtoyXmit;
|
||||
+
|
||||
+
|
||||
+ res = write(dev->fd, IRTOY_COMMAND_TXSTART, sizeof(IRTOY_COMMAND_TXSTART));
|
||||
+
|
||||
+ if (res != sizeof(IRTOY_COMMAND_TXSTART)) {
|
||||
+ logprintf(LOG_ERR, "irtoy_send: couldn't write command");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ res = read_with_timeout(dev->fd, &irToyBufLen, 1, IRTOY_TIMEOUT_READYFORDATA);
|
||||
+
|
||||
+ if (res != 1) {
|
||||
+ logprintf(LOG_ERR, "irtoy_send: couldn't read command result");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ LOGPRINTF(1, "irtoy ready for %d bytes\n", irToyBufLen);
|
||||
+
|
||||
+ txPtr = signals;
|
||||
+
|
||||
+ while (numToXmit) {
|
||||
+ numThisTime = (numToXmit < irToyBufLen) ? numToXmit : irToyBufLen;
|
||||
+ res = write(dev->fd, txPtr, numThisTime);
|
||||
+
|
||||
+ if (res != numThisTime) {
|
||||
+ logprintf(LOG_ERR, "irtoy_send: couldn't write command");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ txPtr += numThisTime;
|
||||
+ numToXmit -= numThisTime;
|
||||
+
|
||||
+
|
||||
+ res = read_with_timeout(dev->fd, &irToyBufLen, 1, IRTOY_TIMEOUT_READYFORDATA);
|
||||
+
|
||||
+ if (res != 1) {
|
||||
+ logprintf(LOG_ERR, "irtoy_send: couldn't read command result");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ LOGPRINTF(1, "irtoy ready for %d bytes\n", irToyBufLen);
|
||||
+
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ res = read_with_timeout(dev->fd, reply, IRTOY_LEN_XMITRES, IRTOY_TIMEOUT_READYFORDATA);
|
||||
+
|
||||
+ if (res != IRTOY_LEN_XMITRES) {
|
||||
+ logprintf(LOG_ERR, "irtoy_send: couldn't read command result");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ LOGPRINTF(1, "%c %02X %02X %c\n", reply[0], reply[1], reply[2], reply[3]);
|
||||
+
|
||||
+ if (reply[0] != IRTOY_REPLY_XMITCOUNT) {
|
||||
+ logprintf(LOG_ERR, "irtoy_send: invalid byte count indicator received: %02X", reply[0]);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ irtoyXmit = (reply[1] << 8) | reply[2];
|
||||
+ if (length != irtoyXmit) {
|
||||
+ logprintf(LOG_ERR, "irtoy_send: incorrect byte count received: %d expected: %d", irtoyXmit, length);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (reply[3] != IRTOY_REPLY_XMITSUCCESS) {
|
||||
+ logprintf(LOG_ERR, "irtoy_send: received error status %02X", reply[3]);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return 1;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+static int irtoy_send(struct ir_remote *remote, struct ir_ncode *code)
|
||||
+{
|
||||
+ int length;
|
||||
+ lirc_t *signals;
|
||||
+ int res = 0;
|
||||
+
|
||||
+ int numToXmit;
|
||||
+ int i;
|
||||
+ lirc_t val;
|
||||
+
|
||||
+
|
||||
+ if (!init_send(remote, code)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ length = send_buffer.wptr;
|
||||
+ signals = send_buffer.data;
|
||||
+
|
||||
+ for (i = 0; i < length; i++) {
|
||||
+ val = (lirc_t)(((double) signals[i]) / IRTOY_UNIT);
|
||||
+ rawSB[2*i] = val >> 8;
|
||||
+ rawSB[2*i + 1] = val & 0xFF;
|
||||
+ }
|
||||
+
|
||||
+ rawSB[2 * length] = 0xFF;
|
||||
+ rawSB[2 * length + 1] = 0xFF;
|
||||
+
|
||||
+ numToXmit = 2 * length + 2;
|
||||
+ return irtoy_send_double_buffered(rawSB, numToXmit);
|
||||
+}
|
||||
+
|
||||
+
|
||||
diff -Naur lirc-0.9.0/daemons/Makefile.am lirc-0.9.0.patch/daemons/Makefile.am
|
||||
--- lirc-0.9.0/daemons/Makefile.am 2011-03-25 23:28:18.000000000 +0100
|
||||
+++ lirc-0.9.0.patch/daemons/Makefile.am 2013-06-01 05:17:24.823961522 +0200
|
||||
@@ -55,6 +55,7 @@
|
||||
hw_udp.c \
|
||||
hw_uirt2.c hw_uirt2_raw.c \
|
||||
hw_uirt2_common.c hw_uirt2_common.h \
|
||||
+ hw_usbirtoy.c \
|
||||
hw_usbx.c hw_usbx.h \
|
||||
receive.c receive.h \
|
||||
transmit.c transmit.h \
|
||||
diff -Naur lirc-0.9.0/setup.data lirc-0.9.0.patch/setup.data
|
||||
--- lirc-0.9.0/setup.data 2011-03-25 23:28:18.000000000 +0100
|
||||
+++ lirc-0.9.0.patch/setup.data 2013-06-01 05:15:53.525904978 +0200
|
||||
@@ -119,6 +119,7 @@
|
||||
awlibusb: "Awox RF/IR Remote (userspace)"
|
||||
sb0540: "Creative USB IR Receiver (SB0540)"
|
||||
commandir: "CommandIR Multi-IR Transceiver (userspace)"
|
||||
+ usb_irtoy: "Dangerous Prototypes USB Infrared Toy"
|
||||
dfclibusb: "DFC USB InfraRed Remote Control (userspace)"
|
||||
sasem: "Dign HV5 HTPC IR/VFD Module"
|
||||
dvico: "DViCO USB Remote"
|
||||
@@ -147,6 +148,7 @@
|
||||
mplay: "VLSystem MPlay Blast"
|
||||
mplay: "VLSystem MPlay Mini"
|
||||
|
||||
+
|
||||
param_type: \
|
||||
act200l \
|
||||
act220l \
|
||||
@@ -190,6 +192,9 @@
|
||||
usbx
|
||||
ttyUSB:
|
||||
|
||||
+param_type: usb_irtoy
|
||||
+ ttyACM:
|
||||
+
|
||||
param_type: \
|
||||
adaptec \
|
||||
alsa_usb \
|
||||
@@ -390,6 +395,10 @@
|
||||
usbx
|
||||
ttyUSB1:
|
||||
|
||||
+default_param: usb_irtoy
|
||||
+ ttyACM1:
|
||||
+
|
||||
+
|
||||
remote: \
|
||||
hauppauge \
|
||||
hauppauge_dvb \
|
||||
@@ -424,6 +433,7 @@
|
||||
ttusbir \
|
||||
uirt2_raw \
|
||||
udp \
|
||||
+ usb_irtoy \
|
||||
usb_uirt_raw \
|
||||
wpc8769l
|
||||
any:
|
||||
diff -Naur lirc-0.9.0/setup.sh lirc-0.9.0.patch/setup.sh
|
||||
--- lirc-0.9.0/setup.sh 2011-03-25 23:28:18.000000000 +0100
|
||||
+++ lirc-0.9.0.patch/setup.sh 2013-06-01 05:15:53.525904978 +0200
|
||||
@@ -65,6 +65,10 @@
|
||||
elif test "$DRIVER_PARAMETER" = "ttyUSB2"; then COM2="on"; IRTTY="/dev/ttyUSB1"; LIRC_PORT="none"; LIRC_IRQ="none"
|
||||
elif test "$DRIVER_PARAMETER" = "ttyUSB3"; then COM3="on"; IRTTY="/dev/ttyUSB2"; LIRC_PORT="none"; LIRC_IRQ="none"
|
||||
elif test "$DRIVER_PARAMETER" = "ttyUSB4"; then COM4="on"; IRTTY="/dev/ttyUSB3"; LIRC_PORT="none"; LIRC_IRQ="none"
|
||||
+ elif test "$DRIVER_PARAMETER" = "ttyACM1"; then COM1="on"; IRTTY="/dev/ttyACM0"; LIRC_PORT="none"; LIRC_IRQ="none"
|
||||
+ elif test "$DRIVER_PARAMETER" = "ttyACM2"; then COM2="on"; IRTTY="/dev/ttyACM1"; LIRC_PORT="none"; LIRC_IRQ="none"
|
||||
+ elif test "$DRIVER_PARAMETER" = "ttyACM3"; then COM3="on"; IRTTY="/dev/ttyACM2"; LIRC_PORT="none"; LIRC_IRQ="none"
|
||||
+ elif test "$DRIVER_PARAMETER" = "ttyACM4"; then COM4="on"; IRTTY="/dev/ttyACM3"; LIRC_PORT="none"; LIRC_IRQ="none"
|
||||
elif test "$DRIVER_PARAMETER" = "com1"; then COM1="on"; LIRC_PORT=$COM1_PORT; LIRC_IRQ=$COM1_IRQ
|
||||
elif test "$DRIVER_PARAMETER" = "com2"; then COM2="on"; LIRC_PORT=$COM2_PORT; LIRC_IRQ=$COM2_IRQ
|
||||
elif test "$DRIVER_PARAMETER" = "com3"; then COM3="on"; LIRC_PORT=$COM3_PORT; LIRC_IRQ=$COM3_IRQ
|
||||
@@ -207,6 +211,30 @@
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
+ elif test "$DRIVER_PARAM_TYPE" = "ttyACM"; then
|
||||
+ {
|
||||
+ dialog --clear --backtitle "$BACKTITLE" \
|
||||
+ --title "Select tty to use" \
|
||||
+ --radiolist "$SET_TTY_TEXT" 13 74 6 \
|
||||
+ 1 "/dev/ttyACM0" $COM1 \
|
||||
+ 2 "/dev/ttyACM1" $COM2 \
|
||||
+ 3 "/dev/ttyACM2" $COM3 \
|
||||
+ 4 "/dev/ttyACM3" $COM4 \
|
||||
+ 2> $TEMP
|
||||
+ }
|
||||
+ if test "$?" = "0"; then
|
||||
+ {
|
||||
+ set `cat $TEMP`
|
||||
+ if test "$1" = "1"; then DRIVER_PARAMETER="ttyACM1"
|
||||
+ elif test "$1" = "2"; then DRIVER_PARAMETER="ttyACM2"
|
||||
+ elif test "$1" = "3"; then DRIVER_PARAMETER="ttyACM3"
|
||||
+ elif test "$1" = "4"; then DRIVER_PARAMETER="ttyACM4"
|
||||
+ fi
|
||||
+ GetSelectedDriver
|
||||
+ }
|
||||
+ else
|
||||
+ return 1;
|
||||
+ fi
|
||||
fi
|
||||
return 0;
|
||||
}
|
||||
@@ -347,7 +375,7 @@
|
||||
else echo "--without-timer \\" >>$START;
|
||||
fi
|
||||
}
|
||||
- elif test "$DRIVER_PARAM_TYPE" = "tty" -o "$DRIVER_PARAM_TYPE" = "ttyUSB" -o "$LIRC_DRIVER" = "bte"; then
|
||||
+ elif test "$DRIVER_PARAM_TYPE" = "tty" -o "$DRIVER_PARAM_TYPE" = "ttyUSB" -o "$DRIVER_PARAM_TYPE" = "ttyACM" -o "$LIRC_DRIVER" = "bte"; then
|
||||
{
|
||||
echo "--with-tty=$IRTTY \\" >>$START
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
From 4022c521c26e339152c6cc8febd6d737725de8ee Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Saraev <stefan@saraev.ca>
|
||||
Date: Wed, 22 Jan 2014 15:59:14 +0200
|
||||
Subject: [PATCH] meh alsa...
|
||||
|
||||
---
|
||||
configure.ac | 25 -------------------------
|
||||
1 files changed, 0 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 73a353f..74ccba8 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -342,31 +342,6 @@ AC_CHECK_HEADERS(portaudio.h,[
|
||||
],,${portaudio_lib_other}
|
||||
)]
|
||||
)
|
||||
-dnl audio_alsa driver requires ALSA library installed and some linker flags
|
||||
-have_alsa=no
|
||||
-AC_CHECK_HEADERS(alsa/asoundlib.h,[
|
||||
- AC_CHECK_LIB(asound, snd_pcm_open,[
|
||||
- AC_DEFINE(HAVE_LIBALSA)
|
||||
- have_alsa=yes
|
||||
- possible_drivers="${possible_drivers} (audio_alsa)"
|
||||
- ],,
|
||||
- )]
|
||||
-)
|
||||
-dnl alsa_usb driver requires an ALSA that knows about our hwdep device
|
||||
-if test "$have_alsa" = "yes"; then
|
||||
- AC_MSG_CHECKING(for ALSA SB RC hwdep support)
|
||||
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
-#include <alsa/asoundlib.h>
|
||||
-]], [[
|
||||
- if (snd_hwdep_info_get_iface(NULL) == SND_HWDEP_IFACE_SB_RC) {}
|
||||
-]])],[
|
||||
- AC_MSG_RESULT(yes)
|
||||
- AC_DEFINE(HAVE_ALSA_SB_RC)
|
||||
- possible_drivers="${possible_drivers} (alsa_usb)"
|
||||
- ],[
|
||||
- AC_MSG_RESULT(no)
|
||||
- ])
|
||||
-fi
|
||||
dnl creative_infracd driver requires linux scsi api
|
||||
AC_CHECK_HEADERS(scsi/sg.h,[
|
||||
AC_DEFINE(HAVE_SCSI)
|
||||
--
|
||||
1.7.2.5
|
||||
|
@ -1,70 +0,0 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 74ccba8..e40f51a 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -318,7 +318,7 @@ AC_CHECK_HEADER(usb.h,
|
||||
AC_DEFINE(HAVE_LIBUSB)
|
||||
possible_drivers="${possible_drivers} (atilibusb) (awlibusb) (dfclibusb) (commandir) (srm7500libusb)"
|
||||
)
|
||||
-AC_CHECK_HEADER(ftdi.h,
|
||||
+AC_CHECK_HEADER(libftdi1/ftdi.h,
|
||||
AC_DEFINE(HAVE_FTDI)
|
||||
possible_drivers="${possible_drivers} (ftdi)"
|
||||
)
|
||||
@@ -533,7 +533,7 @@ if test "$driver" = "userspace" -o "$driver" = "all"; then
|
||||
;;
|
||||
ftdi)
|
||||
hw_module="${hw_module} hw_ftdi.o receive.o transmit.o"
|
||||
- ftdi_lib="-lftdi"
|
||||
+ ftdi_lib="-lftdi1"
|
||||
;;
|
||||
i2cuser)
|
||||
hw_module="${hw_module} hw_i2cuser.o receive.o"
|
||||
@@ -934,7 +934,7 @@ if test "$driver" = "ftdi"; then
|
||||
lirc_driver="none"
|
||||
hw_module="hw_ftdi.o receive.o transmit.o"
|
||||
HW_DEFAULT="hw_ftdi"
|
||||
- ftdi_lib="-lftdi"
|
||||
+ ftdi_lib="-lftdi1"
|
||||
fi
|
||||
|
||||
if test "$driver" = "gvbctv5pci"; then
|
||||
diff --git a/daemons/hw_ftdi.c b/daemons/hw_ftdi.c
|
||||
index d867bc9..e5ef563 100644
|
||||
--- a/daemons/hw_ftdi.c
|
||||
+++ b/daemons/hw_ftdi.c
|
||||
@@ -51,7 +51,7 @@
|
||||
#include "transmit.h"
|
||||
#include "hw_default.h"
|
||||
|
||||
-#include <ftdi.h>
|
||||
+#include <libftdi1/ftdi.h>
|
||||
|
||||
/* PID of the child process */
|
||||
static pid_t child_pid = -1;
|
||||
@@ -62,6 +62,7 @@ static pid_t child_pid = -1;
|
||||
static char *device_config = NULL;
|
||||
static int tx_baud_rate = 65536;
|
||||
static int rx_baud_rate = 9600;
|
||||
+static int rx_sample_rate = 16;
|
||||
static int input_pin = 1; /* RXD as input */
|
||||
static int output_pin = 2; /* RTS as output */
|
||||
static int usb_vendor = 0x0403; /* default for FT232 */
|
||||
@@ -94,7 +95,7 @@ static void parsesamples(unsigned char *buf, int n, int pipe_rxir_w)
|
||||
* The datasheet indicates that the sample rate in
|
||||
* bitbang mode is 16 times the baud rate but 32 seems
|
||||
* to be correct. */
|
||||
- usecs = (rxctr * 1000000LL) / (rx_baud_rate * 32);
|
||||
+ usecs = (rxctr * 1000000LL) / (rx_baud_rate * rx_sample_rate);
|
||||
|
||||
/* Clamp */
|
||||
if (usecs > PULSE_MASK) {
|
||||
@@ -142,7 +143,7 @@ static void child_process(int fd_rx2main, int fd_main2tx, int fd_tx2main)
|
||||
|
||||
/* Enable bit-bang mode, setting output & input pins
|
||||
direction */
|
||||
- if (ftdi_enable_bitbang(&ftdic, 1 << output_pin) < 0) {
|
||||
+ if (ftdi_set_bitmode(&ftdic, 1 << output_pin, BITMODE_BITBANG) < 0) {
|
||||
logprintf(LOG_ERR, "unable to enable bitbang mode (%s)", ftdi_get_error_string(&ftdic));
|
||||
goto retry;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
diff -Naur lirc-0.9.0-old/configure.ac lirc-0.9.0-new/configure.ac
|
||||
--- lirc-0.9.0-old/configure.ac 2011-03-25 15:28:18.000000000 -0700
|
||||
+++ lirc-0.9.0-new/configure.ac 2012-12-31 05:01:51.000000000 -0800
|
||||
@@ -8,7 +8,7 @@
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE(lirc, 0.9.1-git)
|
||||
-AM_CONFIG_HEADER(config.h)
|
||||
+AC_CONFIG_HEADERS(config.h)
|
||||
|
||||
CFLAGS="${CFLAGS--O2 -g -Wall}"
|
||||
|
@ -0,0 +1,12 @@
|
||||
diff -Naur a/configure.ac b/configure.ac
|
||||
--- a/configure.ac 2016-05-23 10:18:48.000000000 -0700
|
||||
+++ b/configure.ac 2016-06-08 02:09:11.335251580 -0700
|
||||
@@ -33,7 +33,7 @@
|
||||
AC_MSG_ERROR([
|
||||
xsltproc is required to build. It usually comes with libxml])
|
||||
fi
|
||||
-AM_CONDITIONAL(HAVE_UINPUT, test -e /dev/uinput)
|
||||
+AM_CONDITIONAL(HAVE_UINPUT, true)
|
||||
AC_CHECK_PROG([MAN2HTML],[man2html],[yes],[no])
|
||||
AM_CONDITIONAL(HAVE_MAN2HTML, test x$MAN2HTML = xyes)
|
||||
AC_CHECK_PROG([DOXYGEN],[doxygen],[yes],[no])
|
@ -0,0 +1,38 @@
|
||||
diff -Naur a/configure.ac b/configure.ac
|
||||
--- a/configure.ac 2016-06-08 13:06:09.757102470 -0700
|
||||
+++ b/configure.ac 2016-06-08 13:07:04.620705345 -0700
|
||||
@@ -41,8 +41,8 @@
|
||||
AC_PROG_LN_S
|
||||
LT_INIT([disable-static])
|
||||
AM_PATH_PYTHON([3.1],,)
|
||||
-AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ""])
|
||||
-AC_CHECK_PROG([HAVE_PYTHON3],[python3],[yes],[no])
|
||||
+AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" == ""])
|
||||
+AC_CHECK_PROG([HAVE_PYTHON3],[python3],[no],[no])
|
||||
LIBUSB_CONFIG="pkg-config libusb"
|
||||
|
||||
dnl Checks for header files.
|
||||
diff -Naur a/tools/Makefile.am b/tools/Makefile.am
|
||||
--- a/tools/Makefile.am 2016-05-23 10:18:48.000000000 -0700
|
||||
+++ b/tools/Makefile.am 2016-06-08 13:15:25.711341537 -0700
|
||||
@@ -114,19 +114,12 @@
|
||||
|
||||
install-exec-hook:
|
||||
$(SED) -i -e 's/@version@/$(VERSION)/' \
|
||||
- $(DESTDIR)$(bindir)/lirc-config-tool \
|
||||
- $(DESTDIR)$(bindir)/irdb-get
|
||||
+ $(DESTDIR)$(bindir)/lirc-config-tool
|
||||
rm -f $(DESTDIR)/$(bindir)/lirc-setup
|
||||
$(srcdir)/make_rel_symlink.py \
|
||||
$(DESTDIR)/$(pkgpythondir)/lirc-setup \
|
||||
$(DESTDIR)/$(bindir)/lirc-setup
|
||||
|
||||
-install-data-hook:
|
||||
- rm -f $(DESTDIR)/$(pkgpythondir)/configs
|
||||
- $(srcdir)/make_rel_symlink.py \
|
||||
- $(DESTDIR)$(pkgdatadir)/configs \
|
||||
- $(DESTDIR)$(pkgpythondir)/configs
|
||||
-
|
||||
uninstall-hook:
|
||||
rm -f $(DESTDIR)/$(bindir)/lirc-setup \
|
||||
$(DESTDIR)/$(pkgpythondir)/configs
|
@ -0,0 +1,28 @@
|
||||
--- a/lib/Makefile.am
|
||||
+++ b/lib/Makefile.am
|
||||
@@ -29,7 +29,7 @@
|
||||
transmit.c \
|
||||
util.c
|
||||
|
||||
-libirrecord_la_LDFLAGS = -llirc
|
||||
+libirrecord_la_LIBADD = -llirc
|
||||
libirrecord_la_SOURCES = irrecord.c
|
||||
|
||||
liblirc_client_la_LDFLAGS = -version-info 4:0:4
|
||||
@@ -98,10 +98,16 @@
|
||||
|
||||
input_map.inc: lirc/input_map.inc
|
||||
|
||||
+if BSD
|
||||
+lirc/input_map.inc:
|
||||
+ touch $@
|
||||
+ touch touch input_map.inc
|
||||
+else
|
||||
lirc/input_map.inc:
|
||||
ln -s . lirc || :
|
||||
$(top_srcdir)/tools/lirc-make-devinput -i > input_map.inc
|
||||
$(top_srcdir)/tools/lirc-make-devinput -i > $@
|
||||
+endif
|
||||
|
||||
checkfiles:
|
||||
../git-tools/checkfiles $(SOURCES) $(HEADERS)
|
@ -0,0 +1,110 @@
|
||||
--- a/daemons/lircd.cpp
|
||||
+++ b/daemons/lircd.cpp
|
||||
@@ -901,43 +901,41 @@
|
||||
{
|
||||
int r;
|
||||
char service[64];
|
||||
- struct addrinfo* addr;
|
||||
- struct addrinfo* tmp;
|
||||
+ struct addrinfo* addrinfos;
|
||||
+ struct addrinfo* a;
|
||||
int enable = 1;
|
||||
|
||||
snprintf(service, sizeof(service), "%d", peer->port);
|
||||
peer->socket = socket(AF_INET, SOCK_STREAM, 0);
|
||||
- r = getaddrinfo(peer->host, service, NULL, &addr);
|
||||
+ r = getaddrinfo(peer->host, service, NULL, &addrinfos);
|
||||
if (r != 0) {
|
||||
- log_error("Name lookup failure connecting to %s",
|
||||
- peer->host);
|
||||
- peer->connection_failure++;
|
||||
- gettimeofday(&peer->reconnect, NULL);
|
||||
- peer->reconnect.tv_sec += 5 * peer->connection_failure;
|
||||
- close(peer->socket);
|
||||
- peer->socket = -1;
|
||||
- return;
|
||||
+ log_perror_err("Name lookup failure connecting to %s",
|
||||
+ peer->host);
|
||||
+ goto errexit;
|
||||
}
|
||||
(void)setsockopt(peer->socket,
|
||||
SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable));
|
||||
- do {
|
||||
- r = connect(peer->socket,
|
||||
- addr->ai_addr, sizeof(struct sockaddr));
|
||||
- tmp = addr;
|
||||
- addr = addr->ai_next;
|
||||
- freeaddrinfo(tmp);
|
||||
- } while (r < 0 && addr != NULL);
|
||||
+ for (a = addrinfos; a != NULL; a = a->ai_next) {
|
||||
+ r = connect(peer->socket, a->ai_addr, a->ai_addrlen);
|
||||
+ if (r >= 0)
|
||||
+ break;
|
||||
+ }
|
||||
+ freeaddrinfo(addrinfos);
|
||||
if (r == -1) {
|
||||
log_perror_err("Cannot connect to %s", peer->host);
|
||||
- peer->connection_failure++;
|
||||
- gettimeofday(&peer->reconnect, NULL);
|
||||
- peer->reconnect.tv_sec += 5 * peer->connection_failure;
|
||||
- close(peer->socket);
|
||||
- peer->socket = -1;
|
||||
- return;
|
||||
- }
|
||||
- log_notice("connected to %s", peer->host);
|
||||
+ goto errexit;
|
||||
+ }
|
||||
+ log_notice("Connected to %s", peer->host);
|
||||
peer->connection_failure = 0;
|
||||
+ return;
|
||||
+
|
||||
+errexit:
|
||||
+ peer->connection_failure++;
|
||||
+ gettimeofday(&peer->reconnect, NULL);
|
||||
+ peer->reconnect.tv_sec += 5 * peer->connection_failure;
|
||||
+ close(peer->socket);
|
||||
+ peer->socket = -1;
|
||||
+ return;
|
||||
}
|
||||
|
||||
|
||||
--- a/lib/lirc_client.c
|
||||
+++ b/lib/lirc_client.c
|
||||
@@ -2050,28 +2050,25 @@
|
||||
|
||||
int lirc_get_remote_socket(const char* address, int port, int quiet)
|
||||
{
|
||||
- struct addrinfo* host;
|
||||
- struct addrinfo* tmp;
|
||||
+ struct addrinfo* addrinfos;
|
||||
+ struct addrinfo* a;
|
||||
char service[64];
|
||||
int r;
|
||||
|
||||
snprintf(service, sizeof(service),
|
||||
"%d", port > 0 ? port : LIRC_INET_PORT);
|
||||
- r = getaddrinfo(address, service, NULL, &host);
|
||||
+ r = getaddrinfo(address, service, NULL, &addrinfos);
|
||||
if (r < 0) {
|
||||
if (!quiet)
|
||||
fprintf(stderr, "get_remote_socket: host %s unknown\n",
|
||||
address);
|
||||
return -EADDRNOTAVAIL;
|
||||
}
|
||||
- do {
|
||||
- r = do_connect(host->ai_family,
|
||||
- host->ai_addr,
|
||||
- sizeof(host->ai_addr),
|
||||
- quiet);
|
||||
- tmp = host;
|
||||
- host = host->ai_next;
|
||||
- freeaddrinfo(tmp);
|
||||
- } while (r < 0 && host != NULL);
|
||||
+ for (a = addrinfos; a != NULL; a = a->ai_next) {
|
||||
+ r = do_connect(a->ai_family, a->ai_addr, a->ai_addrlen, quiet);
|
||||
+ if (r >= 0)
|
||||
+ break;
|
||||
+ };
|
||||
+ freeaddrinfo(addrinfos);
|
||||
return r;
|
||||
}
|
12
packages/sysutils/lirc/system.d/lircd-uinput@.service
Normal file
12
packages/sysutils/lirc/system.d/lircd-uinput@.service
Normal file
@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=lircd-uinput with %I
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/lircd-uinput /run/lirc/lircd-%I
|
||||
Slice=system-lircd.slice
|
||||
Restart=on-failure
|
||||
RestartSec=2
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@ -63,6 +63,12 @@ ENV{lircd_driver}=="?*", ENV{lircd_conf}=="?*", ACTION=="add", \
|
||||
TAG+="systemd", ENV{SYSTEMD_WANTS}+="lircd@$name:$env{lircd_driver}:$env{lircd_conf}.service", \
|
||||
RUN+="lircd_wakeup_enable"
|
||||
|
||||
ENV{lircd_driver}=="?*", ENV{lircd_conf}=="?*", ACTION=="add", \
|
||||
TAG+="systemd", ENV{SYSTEMD_WANTS}+="lircd-uinput@$name.service"
|
||||
|
||||
ENV{lircd_driver}=="?*", ENV{lircd_conf}=="?*", ACTION=="remove", \
|
||||
RUN+="/usr/bin/systemctl stop lircd-uinput@$name.service"
|
||||
|
||||
ENV{lircd_driver}=="?*", ENV{lircd_conf}=="?*", ACTION=="remove", \
|
||||
RUN+="/usr/bin/systemctl stop lircd@$name:$env{lircd_driver}:$env{lircd_conf}.service"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user