Signed-off-by: Jarod Wilson <jarod@redhat.com>epel8
parent
906c47e5c3
commit
2b9bd2117f
@ -1 +1,5 @@
|
||||
lirc-*.tar.bz2
|
||||
.build-*.log
|
||||
*.rpm
|
||||
lirc-*/
|
||||
lirc-0.8.7pre2.tar.bz2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,262 +0,0 @@
|
||||
diff -Naurp lirc-0.8.6/daemons/hw_devinput.c~ lirc-0.8.6/daemons/hw_devinput.c
|
||||
--- lirc-0.8.6/daemons/hw_devinput.c~ 2009/09/07 18:08:00 5.20
|
||||
+++ lirc-0.8.6/daemons/hw_devinput.c 2009/10/31 09:37:30 5.21
|
||||
@@ -31,8 +31,10 @@
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <fnmatch.h>
|
||||
+#include <limits.h>
|
||||
|
||||
#include <linux/input.h>
|
||||
+#include <linux/uinput.h>
|
||||
|
||||
#ifndef EV_SYN
|
||||
/* previous name */
|
||||
@@ -44,8 +46,18 @@
|
||||
#include "lircd.h"
|
||||
#include "receive.h"
|
||||
|
||||
+/* from evtest.c - Copyright (c) 1999-2000 Vojtech Pavlik */
|
||||
+#define BITS_PER_LONG (sizeof(long) * CHAR_BIT)
|
||||
+/* NBITS was defined in linux/uinput.h */
|
||||
+#undef NBITS
|
||||
+#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
|
||||
+#define OFF(x) ((x)%BITS_PER_LONG)
|
||||
+#define BIT(x) (1UL<<OFF(x))
|
||||
+#define LONG(x) ((x)/BITS_PER_LONG)
|
||||
+#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
|
||||
|
||||
static int devinput_init();
|
||||
+static int devinput_init_fwd();
|
||||
static int devinput_deinit(void);
|
||||
static int devinput_decode(struct ir_remote *remote,
|
||||
ir_code *prep, ir_code *codep, ir_code *postp,
|
||||
@@ -67,7 +76,7 @@
|
||||
0, /* send_mode */
|
||||
LIRC_MODE_LIRCCODE, /* rec_mode */
|
||||
32, /* code_length */
|
||||
- devinput_init, /* init_func */
|
||||
+ devinput_init_fwd, /* init_func */
|
||||
NULL, /* config_func */
|
||||
devinput_deinit, /* deinit_func */
|
||||
NULL, /* send_func */
|
||||
@@ -80,6 +89,141 @@
|
||||
|
||||
static ir_code code;
|
||||
static int repeat_flag=0;
|
||||
+static int exclusive = 0;
|
||||
+static int uinputfd = -1;
|
||||
+
|
||||
+static int setup_uinputfd(const char *name, int source)
|
||||
+{
|
||||
+ int fd;
|
||||
+ int key;
|
||||
+ struct uinput_user_dev dev;
|
||||
+ long events[NBITS(EV_MAX)];
|
||||
+ long bits[NBITS(KEY_MAX)];
|
||||
+
|
||||
+ if(ioctl(source, EVIOCGBIT(0, EV_MAX), events) == -1)
|
||||
+ {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if(!test_bit(EV_REL, events) && !test_bit(EV_ABS, events))
|
||||
+ {
|
||||
+ /* no move events, don't forward anything */
|
||||
+ return -1;
|
||||
+ }
|
||||
+ fd = open("/dev/input/uinput", O_RDWR);
|
||||
+ if(fd == -1)
|
||||
+ {
|
||||
+ fd = open("/dev/uinput", O_RDWR);
|
||||
+ if(fd == -1)
|
||||
+ {
|
||||
+ fd = open("/dev/misc/uinput", O_RDWR);
|
||||
+ if(fd == -1)
|
||||
+ {
|
||||
+ logprintf(LOG_WARNING, "could not open %s\n",
|
||||
+ "uinput");
|
||||
+ logperror(LOG_WARNING, NULL);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ memset(&dev, 0, sizeof(dev));
|
||||
+ if(ioctl(source, EVIOCGNAME(sizeof(dev.name)), dev.name) >= 0)
|
||||
+ {
|
||||
+ dev.name[sizeof(dev.name)-1] = 0;
|
||||
+ if(strlen(dev.name) > 0)
|
||||
+ {
|
||||
+ strncat(dev.name, " ", sizeof(dev.name) -
|
||||
+ strlen(dev.name));
|
||||
+ dev.name[sizeof(dev.name)-1] = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ strncat(dev.name, name, sizeof(dev.name) - strlen(dev.name));
|
||||
+ dev.name[sizeof(dev.name)-1] = 0;
|
||||
+
|
||||
+ if(write(fd, &dev, sizeof(dev)) != sizeof(dev))
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+
|
||||
+ if(test_bit(EV_KEY, events))
|
||||
+ {
|
||||
+ if(ioctl(source, EVIOCGBIT(EV_KEY, KEY_MAX), bits) == -1)
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+
|
||||
+ if(ioctl(fd, UI_SET_EVBIT, EV_KEY) == -1)
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+
|
||||
+ /* only forward mouse button events */
|
||||
+ for(key = BTN_MISC; key <= BTN_GEAR_UP; key++)
|
||||
+ {
|
||||
+ if(test_bit(key, bits))
|
||||
+ {
|
||||
+ if(ioctl(fd, UI_SET_KEYBIT, key) == -1)
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if(test_bit(EV_REL, events))
|
||||
+ {
|
||||
+ if(ioctl(source, EVIOCGBIT(EV_REL, REL_MAX), bits) == -1)
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+ if(ioctl(fd, UI_SET_EVBIT, EV_REL) == -1)
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+ for(key = 0; key <= REL_MAX; key++)
|
||||
+ {
|
||||
+ if(test_bit(key, bits))
|
||||
+ {
|
||||
+ if(ioctl(fd, UI_SET_RELBIT, key) == -1)
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if(test_bit(EV_ABS, events))
|
||||
+ {
|
||||
+ if(ioctl(source, EVIOCGBIT(EV_ABS, ABS_MAX), bits) == -1)
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+ if(ioctl(fd, UI_SET_EVBIT, EV_ABS) == -1)
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+ for(key = 0; key <= ABS_MAX; key++)
|
||||
+ {
|
||||
+ if(test_bit(key, bits))
|
||||
+ {
|
||||
+ if(ioctl(fd, UI_SET_ABSBIT, key) == -1)
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ if(ioctl(fd, UI_DEV_CREATE) == -1)
|
||||
+ {
|
||||
+ goto setup_error;
|
||||
+ }
|
||||
+ return fd;
|
||||
+
|
||||
+ setup_error:
|
||||
+ logprintf(LOG_ERR, "could not setup %s\n", "uinput");
|
||||
+ logperror(LOG_ERR, NULL);
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+}
|
||||
|
||||
#if 0
|
||||
/* using fnmatch */
|
||||
@@ -217,13 +361,26 @@
|
||||
}
|
||||
|
||||
#ifdef EVIOCGRAB
|
||||
+ exclusive = 1;
|
||||
if (ioctl(hw.fd, EVIOCGRAB, 1) == -1)
|
||||
{
|
||||
+ exclusive = 0;
|
||||
logprintf(LOG_WARNING, "can't get exclusive access to events "
|
||||
"coming from `%s' interface",
|
||||
hw.device);
|
||||
}
|
||||
#endif
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+int devinput_init_fwd()
|
||||
+{
|
||||
+ if(!devinput_init()) return 0;
|
||||
+
|
||||
+ if(exclusive)
|
||||
+ {
|
||||
+ uinputfd = setup_uinputfd("(lircd bypass)", hw.fd);
|
||||
+ }
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -232,6 +389,12 @@
|
||||
int devinput_deinit(void)
|
||||
{
|
||||
logprintf(LOG_INFO, "closing '%s'", hw.device);
|
||||
+ if(uinputfd != -1)
|
||||
+ {
|
||||
+ ioctl(uinputfd, UI_DEV_DESTROY);
|
||||
+ close(uinputfd);
|
||||
+ uinputfd = -1;
|
||||
+ }
|
||||
close(hw.fd);
|
||||
hw.fd=-1;
|
||||
return 1;
|
||||
@@ -271,7 +434,10 @@
|
||||
rd = read(hw.fd, &event, sizeof event);
|
||||
if (rd != sizeof event) {
|
||||
logprintf(LOG_ERR, "error reading '%s'", hw.device);
|
||||
- if(rd <= 0 && errno != EINTR) raise(SIGTERM);
|
||||
+ if(rd <= 0 && errno != EINTR)
|
||||
+ {
|
||||
+ devinput_deinit();
|
||||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -292,6 +458,25 @@
|
||||
|
||||
LOGPRINTF(1, "code %.8llx", code);
|
||||
|
||||
+ if(uinputfd != -1)
|
||||
+ {
|
||||
+ if(event.type == EV_REL ||
|
||||
+ event.type == EV_ABS ||
|
||||
+ (event.type == EV_KEY &&
|
||||
+ event.code >= BTN_MISC &&
|
||||
+ event.code <= BTN_GEAR_UP) ||
|
||||
+ event.type == EV_SYN)
|
||||
+ {
|
||||
+ LOGPRINTF(1, "forwarding: %04x %04x", event.type, event.code);
|
||||
+ if(write(uinputfd, &event, sizeof(event)) != sizeof(event))
|
||||
+ {
|
||||
+ logprintf(LOG_ERR, "writing to uinput failed");
|
||||
+ logperror(LOG_ERR, NULL);
|
||||
+ }
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* ignore EV_SYN */
|
||||
if(event.type == EV_SYN) return NULL;
|
||||
|
@ -1,429 +0,0 @@
|
||||
Index: lirc-0.8.6/drivers/lirc.h
|
||||
===================================================================
|
||||
--- lirc-0.8.6.orig/drivers/lirc.h
|
||||
+++ lirc-0.8.6/drivers/lirc.h
|
||||
@@ -28,17 +28,13 @@ typedef int lirc_t;
|
||||
#define LIRC_MODE_RAW 0x00000001
|
||||
#define LIRC_MODE_PULSE 0x00000002
|
||||
#define LIRC_MODE_MODE2 0x00000004
|
||||
-#define LIRC_MODE_CODE 0x00000008
|
||||
#define LIRC_MODE_LIRCCODE 0x00000010
|
||||
-#define LIRC_MODE_STRING 0x00000020
|
||||
|
||||
|
||||
#define LIRC_CAN_SEND_RAW LIRC_MODE2SEND(LIRC_MODE_RAW)
|
||||
#define LIRC_CAN_SEND_PULSE LIRC_MODE2SEND(LIRC_MODE_PULSE)
|
||||
#define LIRC_CAN_SEND_MODE2 LIRC_MODE2SEND(LIRC_MODE_MODE2)
|
||||
-#define LIRC_CAN_SEND_CODE LIRC_MODE2SEND(LIRC_MODE_CODE)
|
||||
#define LIRC_CAN_SEND_LIRCCODE LIRC_MODE2SEND(LIRC_MODE_LIRCCODE)
|
||||
-#define LIRC_CAN_SEND_STRING LIRC_MODE2SEND(LIRC_MODE_STRING)
|
||||
|
||||
#define LIRC_CAN_SEND_MASK 0x0000003f
|
||||
|
||||
@@ -49,9 +45,7 @@ typedef int lirc_t;
|
||||
#define LIRC_CAN_REC_RAW LIRC_MODE2REC(LIRC_MODE_RAW)
|
||||
#define LIRC_CAN_REC_PULSE LIRC_MODE2REC(LIRC_MODE_PULSE)
|
||||
#define LIRC_CAN_REC_MODE2 LIRC_MODE2REC(LIRC_MODE_MODE2)
|
||||
-#define LIRC_CAN_REC_CODE LIRC_MODE2REC(LIRC_MODE_CODE)
|
||||
#define LIRC_CAN_REC_LIRCCODE LIRC_MODE2REC(LIRC_MODE_LIRCCODE)
|
||||
-#define LIRC_CAN_REC_STRING LIRC_MODE2REC(LIRC_MODE_STRING)
|
||||
|
||||
#define LIRC_CAN_REC_MASK LIRC_MODE2REC(LIRC_CAN_SEND_MASK)
|
||||
|
||||
Index: lirc-0.8.6/daemons/hw_alsa_usb.c
|
||||
===================================================================
|
||||
--- lirc-0.8.6.orig/daemons/hw_alsa_usb.c
|
||||
+++ lirc-0.8.6/daemons/hw_alsa_usb.c
|
||||
@@ -37,9 +37,9 @@ static int repeat_flag;
|
||||
struct hardware hw_alsa_usb = {
|
||||
"", /* default device */
|
||||
-1, /* fd */
|
||||
- LIRC_CAN_REC_CODE, /* features */
|
||||
+ LIRC_CAN_REC_LIRCCODE, /* features */
|
||||
0, /* send_mode */
|
||||
- LIRC_MODE_CODE, /* rec_mode */
|
||||
+ LIRC_MODE_LIRCCODE, /* rec_mode */
|
||||
8, /* code_length */
|
||||
init, /* init_func */
|
||||
NULL, /* config_func */
|
||||
Index: lirc-0.8.6/daemons/hw_awlibusb.c
|
||||
===================================================================
|
||||
--- lirc-0.8.6.orig/daemons/hw_awlibusb.c
|
||||
+++ lirc-0.8.6/daemons/hw_awlibusb.c
|
||||
@@ -48,8 +48,6 @@
|
||||
#include "lircd.h"
|
||||
#include "receive.h"
|
||||
|
||||
-#define AW_MODE_LIRCCODE 1
|
||||
-
|
||||
#define AWUSB_RECEIVE_BYTES 5
|
||||
#define USB_TIMEOUT (1000*60)
|
||||
#define AW_VENDOR_THOMSON 0x069b
|
||||
@@ -57,14 +55,6 @@
|
||||
|
||||
#define AW_KEY_GAP 0 /* Original value=200000. Made it 0 to handle it in userspace */
|
||||
|
||||
-#if !defined(AW_MODE_LIRCCODE)
|
||||
-static ir_code code;
|
||||
-static ir_code code_last;
|
||||
-static struct timeval time_current = {0};
|
||||
-static struct timeval time_last = {0};
|
||||
-#endif
|
||||
-
|
||||
-
|
||||
static int awlibusb_init();
|
||||
static int awlibusb_deinit();
|
||||
static char *awlibusb_rec(struct ir_remote *remotes);
|
||||
@@ -72,7 +62,6 @@ static void usb_read_loop(int fd);
|
||||
static struct usb_device *find_usb_device(void);
|
||||
static int find_device_endpoints(struct usb_device *dev);
|
||||
|
||||
-#ifdef AW_MODE_LIRCCODE
|
||||
struct hardware hw_awlibusb =
|
||||
{
|
||||
NULL, /* default device */
|
||||
@@ -91,26 +80,7 @@ struct hardware hw_awlibusb =
|
||||
NULL, /* readdata */
|
||||
"awlibusb"
|
||||
};
|
||||
-#else
|
||||
-struct hardware hw_awlibusb =
|
||||
-{
|
||||
- NULL, /* default device */
|
||||
- -1, /* fd */
|
||||
- LIRC_CAN_REC_CODE, /* features */
|
||||
- 0, /* send_mode */
|
||||
- LIRC_MODE_CODE, /* rec_mode */
|
||||
- CHAR_BIT, /* code_length */
|
||||
- awlibusb_init, /* init_func */
|
||||
- NULL, /* config_func */
|
||||
- awlibusb_deinit, /* deinit_func */
|
||||
- NULL, /* send_func */
|
||||
- awlibusb_rec, /* rec_func */
|
||||
- receive_decode, /* decode_func */
|
||||
- NULL, /* ioctl_func */
|
||||
- NULL, /* readdata */
|
||||
- "awlibusb"
|
||||
-};
|
||||
-#endif
|
||||
+
|
||||
typedef struct {
|
||||
u_int16_t vendor;
|
||||
u_int16_t product;
|
||||
@@ -310,11 +280,6 @@ static void usb_read_loop(int fd)
|
||||
{
|
||||
int inited = 0;
|
||||
int err = 0;
|
||||
-#if !defined(AW_MODE_LIRCCODE)
|
||||
- long elapsed_seconds = 0; /* diff between seconds counter */
|
||||
- long elapsed_useconds = 0; /* diff between microseconds counter */
|
||||
- long time_diff = 0;
|
||||
-#endif
|
||||
|
||||
alarm(0);
|
||||
signal(SIGTERM, SIG_DFL);
|
||||
@@ -348,7 +313,6 @@ static void usb_read_loop(int fd)
|
||||
if (bytes_r == 1) continue;
|
||||
}
|
||||
|
||||
-#ifdef AW_MODE_LIRCCODE
|
||||
bytes_w = write(fd, &(buf[1]), (AWUSB_RECEIVE_BYTES-1));
|
||||
/* ignore first byte */
|
||||
if (bytes_w < 0)
|
||||
@@ -358,30 +322,6 @@ static void usb_read_loop(int fd)
|
||||
err = 1;
|
||||
goto done;
|
||||
}
|
||||
-#else
|
||||
- code = buf[AWUSB_RECEIVE_BYTES-2];
|
||||
-
|
||||
- /* calculate time diff */
|
||||
- gettimeofday(&time_current, NULL);
|
||||
- elapsed_seconds = time_current.tv_sec - time_last.tv_sec;
|
||||
- elapsed_useconds = time_current.tv_usec - time_last.tv_usec;
|
||||
- time_diff = (elapsed_seconds) * 1000000 + elapsed_useconds;
|
||||
- //printf("time_diff = %d usec\n", time_diff);
|
||||
-
|
||||
- if ( !((code == code_last) && (time_diff < AW_KEY_GAP)) )
|
||||
- {
|
||||
- bytes_w = write(fd, &code, 1);
|
||||
- if (bytes_w < 0)
|
||||
- {
|
||||
- logprintf(LOG_ERR, "can't write to pipe: %s",
|
||||
- strerror(errno));
|
||||
- err = 1;
|
||||
- goto done;
|
||||
- }
|
||||
- code_last = code;
|
||||
- memcpy(&time_last, &time_current, sizeof(struct timeval));
|
||||
- }
|
||||
-#endif
|
||||
|
||||
}
|
||||
|
||||
Index: lirc-0.8.6/daemons/hw_default.c
|
||||
===================================================================
|
||||
--- lirc-0.8.6.orig/daemons/hw_default.c
|
||||
+++ lirc-0.8.6/daemons/hw_default.c
|
||||
@@ -42,10 +42,7 @@ extern struct ir_remote *repeat_remote;
|
||||
|
||||
static unsigned long supported_send_modes[]=
|
||||
{
|
||||
- /* LIRC_CAN_SEND_STRING, I don't think there ever will be a driver
|
||||
- that supports that */
|
||||
/* LIRC_CAN_SEND_LIRCCODE, */
|
||||
- /* LIRC_CAN_SEND_CODE, */
|
||||
/* LIRC_CAN_SEND_MODE2, this one would be very easy */
|
||||
LIRC_CAN_SEND_PULSE,
|
||||
/* LIRC_CAN_SEND_RAW, */
|
||||
@@ -53,9 +50,7 @@ static unsigned long supported_send_mode
|
||||
};
|
||||
static unsigned long supported_rec_modes[]=
|
||||
{
|
||||
- LIRC_CAN_REC_STRING,
|
||||
LIRC_CAN_REC_LIRCCODE,
|
||||
- LIRC_CAN_REC_CODE,
|
||||
LIRC_CAN_REC_MODE2,
|
||||
/* LIRC_CAN_REC_PULSE, shouldn't be too hard */
|
||||
/* LIRC_CAN_REC_RAW, */
|
||||
@@ -365,10 +360,6 @@ int default_init()
|
||||
}
|
||||
|
||||
}
|
||||
- else if(hw.rec_mode==LIRC_MODE_CODE)
|
||||
- {
|
||||
- hw.code_length=8;
|
||||
- }
|
||||
else if(hw.rec_mode==LIRC_MODE_LIRCCODE)
|
||||
{
|
||||
if(default_ioctl(LIRC_GET_LENGTH, &hw.code_length)==-1)
|
||||
@@ -524,47 +515,12 @@ int default_send(struct ir_remote *remot
|
||||
|
||||
char *default_rec(struct ir_remote *remotes)
|
||||
{
|
||||
- char c;
|
||||
- int n;
|
||||
- static char message[PACKET_SIZE+1];
|
||||
-
|
||||
-
|
||||
- if(hw.rec_mode==LIRC_MODE_STRING)
|
||||
- {
|
||||
- int failed=0;
|
||||
-
|
||||
- /* inefficient but simple, fix this if you want */
|
||||
- n=0;
|
||||
- do
|
||||
- {
|
||||
- if(read(hw.fd,&c,1)!=1)
|
||||
- {
|
||||
- logprintf(LOG_ERR,"reading in mode "
|
||||
- "LIRC_MODE_STRING failed");
|
||||
- default_deinit();
|
||||
- return NULL;
|
||||
- }
|
||||
- if(n>=PACKET_SIZE-1)
|
||||
- {
|
||||
- failed=1;
|
||||
- n=0;
|
||||
- }
|
||||
- message[n++]=c;
|
||||
- }
|
||||
- while(c!='\n');
|
||||
- message[n]=0;
|
||||
- if(failed) return(NULL);
|
||||
- return(message);
|
||||
- }
|
||||
- else
|
||||
+ if(!clear_rec_buffer())
|
||||
{
|
||||
- if(!clear_rec_buffer())
|
||||
- {
|
||||
- default_deinit();
|
||||
- return NULL;
|
||||
- }
|
||||
- return(decode_all(remotes));
|
||||
+ default_deinit();
|
||||
+ return NULL;
|
||||
}
|
||||
+ return(decode_all(remotes));
|
||||
}
|
||||
|
||||
static int default_config_frequency()
|
||||
Index: lirc-0.8.6/daemons/hw_mplay.c
|
||||
===================================================================
|
||||
--- lirc-0.8.6.orig/daemons/hw_mplay.c
|
||||
+++ lirc-0.8.6/daemons/hw_mplay.c
|
||||
@@ -114,9 +114,9 @@ static struct {
|
||||
struct hardware hw_mplay = {
|
||||
LIRC_DRIVER_DEVICE, /* default device */
|
||||
-1, /* fd */
|
||||
- LIRC_CAN_REC_CODE, /* features */
|
||||
+ LIRC_CAN_REC_LIRCCODE, /* features */
|
||||
0, /* send_mode */
|
||||
- LIRC_MODE_CODE, /* rec_mode */
|
||||
+ LIRC_MODE_LIRCCODE, /* rec_mode */
|
||||
MPLAY_CODE_LENGTH, /* code_length */
|
||||
mplay_init, /* init_func */
|
||||
NULL, /* config_func */
|
||||
Index: lirc-0.8.6/daemons/irrecord.c
|
||||
===================================================================
|
||||
--- lirc-0.8.6.orig/daemons/irrecord.c
|
||||
+++ lirc-0.8.6/daemons/irrecord.c
|
||||
@@ -556,16 +556,7 @@ int main(int argc,char **argv)
|
||||
}
|
||||
aeps = (hw.resolution>aeps ? hw.resolution:aeps);
|
||||
|
||||
- if(hw.rec_mode==LIRC_MODE_STRING)
|
||||
- {
|
||||
- fprintf(stderr,"%s: no config file necessary\n",progname);
|
||||
- fclose(fout);
|
||||
- unlink(filename);
|
||||
- if(hw.deinit_func) hw.deinit_func();
|
||||
- exit(EXIT_SUCCESS);
|
||||
- }
|
||||
if(hw.rec_mode!=LIRC_MODE_MODE2 &&
|
||||
- hw.rec_mode!=LIRC_MODE_CODE &&
|
||||
hw.rec_mode!=LIRC_MODE_LIRCCODE)
|
||||
{
|
||||
fprintf(stderr,"%s: mode not supported\n",progname);
|
||||
@@ -661,10 +652,8 @@ int main(int argc,char **argv)
|
||||
(unsigned long) remote.gap);
|
||||
# endif
|
||||
break;
|
||||
- case LIRC_MODE_CODE:
|
||||
case LIRC_MODE_LIRCCODE:
|
||||
- if(hw.rec_mode==LIRC_MODE_CODE) remote.bits=CHAR_BIT;
|
||||
- else remote.bits=hw.code_length;
|
||||
+ remote.bits=hw.code_length;
|
||||
if(!using_template && !get_gap_length(&remote))
|
||||
{
|
||||
fprintf(stderr,"%s: gap not found,"
|
||||
@@ -995,9 +984,6 @@ void flushhw(void)
|
||||
case LIRC_MODE_MODE2:
|
||||
while(availabledata()) hw.readdata(0);
|
||||
return;
|
||||
- case LIRC_MODE_CODE:
|
||||
- size=sizeof(unsigned char);
|
||||
- break;
|
||||
case LIRC_MODE_LIRCCODE:
|
||||
size=hw.code_length/CHAR_BIT;
|
||||
if(hw.code_length%CHAR_BIT) size++;
|
||||
Index: lirc-0.8.6/daemons/receive.c
|
||||
===================================================================
|
||||
--- lirc-0.8.6.orig/daemons/receive.c
|
||||
+++ lirc-0.8.6/daemons/receive.c
|
||||
@@ -126,18 +126,6 @@ int clear_rec_buffer(void)
|
||||
((ir_code) buffer[i]);
|
||||
}
|
||||
}
|
||||
- else if(hw.rec_mode==LIRC_MODE_CODE)
|
||||
- {
|
||||
- unsigned char c;
|
||||
-
|
||||
- if(read(hw.fd,&c,1)!=1)
|
||||
- {
|
||||
- logprintf(LOG_ERR,"reading in mode LIRC_MODE_CODE "
|
||||
- "failed");
|
||||
- return(0);
|
||||
- }
|
||||
- rec_buffer.decoded=(ir_code) c;
|
||||
- }
|
||||
else
|
||||
{
|
||||
lirc_t data;
|
||||
@@ -1191,8 +1179,7 @@ int receive_decode(struct ir_remote *rem
|
||||
struct ir_ncode *codes,*found;
|
||||
int i;
|
||||
|
||||
- if(hw.rec_mode==LIRC_MODE_CODE ||
|
||||
- hw.rec_mode==LIRC_MODE_LIRCCODE)
|
||||
+ if(hw.rec_mode==LIRC_MODE_LIRCCODE)
|
||||
return(0);
|
||||
|
||||
codes=remote->codes;
|
||||
@@ -1233,8 +1220,7 @@ int receive_decode(struct ir_remote *rem
|
||||
}
|
||||
else
|
||||
{
|
||||
- if(hw.rec_mode==LIRC_MODE_CODE ||
|
||||
- hw.rec_mode==LIRC_MODE_LIRCCODE)
|
||||
+ if(hw.rec_mode==LIRC_MODE_LIRCCODE)
|
||||
{
|
||||
lirc_t sum;
|
||||
ir_code decoded = rec_buffer.decoded;
|
||||
@@ -1244,11 +1230,7 @@ int receive_decode(struct ir_remote *rem
|
||||
# else
|
||||
LOGPRINTF(1,"decoded: %lx", decoded);
|
||||
# endif
|
||||
- if((hw.rec_mode==LIRC_MODE_CODE &&
|
||||
- hw.code_length<bit_count(remote))
|
||||
- ||
|
||||
- (hw.rec_mode==LIRC_MODE_LIRCCODE &&
|
||||
- hw.code_length!=bit_count(remote)))
|
||||
+ if(hw.code_length!=bit_count(remote))
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
@@ -1366,8 +1348,7 @@ int receive_decode(struct ir_remote *rem
|
||||
*repeat_flagp=1;
|
||||
else
|
||||
*repeat_flagp=0;
|
||||
- if(hw.rec_mode==LIRC_MODE_CODE ||
|
||||
- hw.rec_mode==LIRC_MODE_LIRCCODE)
|
||||
+ if(hw.rec_mode==LIRC_MODE_LIRCCODE)
|
||||
{
|
||||
/* Most TV cards don't pass each signal to the
|
||||
driver. This heuristic should fix repeat in such
|
||||
Index: lirc-0.8.6/tools/mode2.c
|
||||
===================================================================
|
||||
--- lirc-0.8.6.orig/tools/mode2.c
|
||||
+++ lirc-0.8.6/tools/mode2.c
|
||||
@@ -273,11 +273,7 @@ int main(int argc,char **argv)
|
||||
|
||||
}
|
||||
|
||||
- if(mode==LIRC_MODE_CODE)
|
||||
- {
|
||||
- count = 1;
|
||||
- }
|
||||
- else if(mode==LIRC_MODE_LIRCCODE)
|
||||
+ if(mode==LIRC_MODE_LIRCCODE)
|
||||
{
|
||||
if(use_raw_access)
|
||||
{
|
||||
Index: lirc-0.8.6/daemons/hw_bte.c
|
||||
===================================================================
|
||||
--- lirc-0.8.6.orig/daemons/hw_bte.c
|
||||
+++ lirc-0.8.6/daemons/hw_bte.c
|
||||
@@ -66,14 +66,14 @@ struct hardware hw_bte=
|
||||
LIRC_DRIVER_DEVICE, /* default device */
|
||||
-1, /* fd */
|
||||
#if BTE_CAN_SEND
|
||||
- LIRC_CAN_REC_STRING|LIRC_CAN_SEND_STRING, /* features */
|
||||
- LIRC_MODE_STRING, /* send_mode */
|
||||
+ LIRC_CAN_REC_LIRCCODE|LIRC_CAN_SEND_LIRCCODE, /* features */
|
||||
+ LIRC_MODE_LIRCCODE, /* send_mode */
|
||||
#else
|
||||
- LIRC_CAN_REC_STRING, /* features */
|
||||
+ LIRC_CAN_REC_LIRCCODE, /* features */
|
||||
0, /* send_mode */
|
||||
#endif
|
||||
|
||||
- LIRC_MODE_STRING, /* rec_mode */
|
||||
+ LIRC_MODE_LIRCCODE, /* rec_mode */
|
||||
16, /* code_length */
|
||||
bte_init, /* init_func */
|
||||
NULL, /* config_func */
|
||||
Index: lirc-0.8.6/daemons/hw_creative_infracd.c
|
||||
===================================================================
|
||||
--- lirc-0.8.6.orig/daemons/hw_creative_infracd.c
|
||||
+++ lirc-0.8.6/daemons/hw_creative_infracd.c
|
||||
@@ -46,7 +46,7 @@
|
||||
struct hardware hw_creative_infracd = {
|
||||
0, /* determine device by probing */
|
||||
-1, /* fd */
|
||||
- LIRC_CAN_REC_CODE, /* features */
|
||||
+ LIRC_CAN_REC_LIRCCODE, /* features */
|
||||
0, /* send_mode */
|
||||
LIRC_MODE_LIRCCODE, /* rec_mode */
|
||||
8, /* code_length */
|
@ -0,0 +1,116 @@
|
||||
Index: lirc-0.8.7pre2/drivers/lirc.h
|
||||
===================================================================
|
||||
--- lirc-0.8.7pre2.orig/drivers/lirc.h
|
||||
+++ lirc-0.8.7pre2/drivers/lirc.h
|
||||
@@ -11,6 +11,9 @@
|
||||
#define __USE_LINUX_IOCTL_DEFS
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
+#include <stdint.h>
|
||||
+
|
||||
+typedef uint32_t __u32;
|
||||
|
||||
/* <obsolete> */
|
||||
#define PULSE_BIT 0x01000000
|
||||
@@ -95,60 +96,60 @@ typedef int lirc_t;
|
||||
|
||||
/*** IOCTL commands for lirc driver ***/
|
||||
|
||||
-#define LIRC_GET_FEATURES _IOR('i', 0x00000000, unsigned long)
|
||||
+#define LIRC_GET_FEATURES _IOR('i', 0x00000000, __u32)
|
||||
|
||||
-#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, unsigned long)
|
||||
-#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, unsigned long)
|
||||
-#define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, unsigned int)
|
||||
-#define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, unsigned int)
|
||||
-#define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, unsigned int)
|
||||
-#define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, unsigned int)
|
||||
-#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, unsigned int)
|
||||
-
|
||||
-#define LIRC_GET_MIN_TIMEOUT _IOR('i', 0x00000008, lirc_t)
|
||||
-#define LIRC_GET_MAX_TIMEOUT _IOR('i', 0x00000009, lirc_t)
|
||||
-
|
||||
-#define LIRC_GET_MIN_FILTER_PULSE _IOR('i', 0x0000000a, lirc_t)
|
||||
-#define LIRC_GET_MAX_FILTER_PULSE _IOR('i', 0x0000000b, lirc_t)
|
||||
-#define LIRC_GET_MIN_FILTER_SPACE _IOR('i', 0x0000000c, lirc_t)
|
||||
-#define LIRC_GET_MAX_FILTER_SPACE _IOR('i', 0x0000000d, lirc_t)
|
||||
+#define LIRC_GET_SEND_MODE _IOR('i', 0x00000001, __u32)
|
||||
+#define LIRC_GET_REC_MODE _IOR('i', 0x00000002, __u32)
|
||||
+#define LIRC_GET_SEND_CARRIER _IOR('i', 0x00000003, __u32)
|
||||
+#define LIRC_GET_REC_CARRIER _IOR('i', 0x00000004, __u32)
|
||||
+#define LIRC_GET_SEND_DUTY_CYCLE _IOR('i', 0x00000005, __u32)
|
||||
+#define LIRC_GET_REC_DUTY_CYCLE _IOR('i', 0x00000006, __u32)
|
||||
+#define LIRC_GET_REC_RESOLUTION _IOR('i', 0x00000007, __u32)
|
||||
+
|
||||
+#define LIRC_GET_MIN_TIMEOUT _IOR('i', 0x00000008, __u32)
|
||||
+#define LIRC_GET_MAX_TIMEOUT _IOR('i', 0x00000009, __u32)
|
||||
+
|
||||
+#define LIRC_GET_MIN_FILTER_PULSE _IOR('i', 0x0000000a, __u32)
|
||||
+#define LIRC_GET_MAX_FILTER_PULSE _IOR('i', 0x0000000b, __u32)
|
||||
+#define LIRC_GET_MIN_FILTER_SPACE _IOR('i', 0x0000000c, __u32)
|
||||
+#define LIRC_GET_MAX_FILTER_SPACE _IOR('i', 0x0000000d, __u32)
|
||||
|
||||
/* code length in bits, currently only for LIRC_MODE_LIRCCODE */
|
||||
-#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, unsigned long)
|
||||
+#define LIRC_GET_LENGTH _IOR('i', 0x0000000f, __u32)
|
||||
|
||||
/* all values set should be reset by the driver when the device is
|
||||
reopened */
|
||||
|
||||
/* obsolete: drivers only support one mode */
|
||||
-#define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, unsigned long)
|
||||
+#define LIRC_SET_SEND_MODE _IOW('i', 0x00000011, __u32)
|
||||
/* obsolete: drivers only support one mode */
|
||||
-#define LIRC_SET_REC_MODE _IOW('i', 0x00000012, unsigned long)
|
||||
+#define LIRC_SET_REC_MODE _IOW('i', 0x00000012, __u32)
|
||||
/* Note: these can reset the according pulse_width */
|
||||
-#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, unsigned int)
|
||||
-#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, unsigned int)
|
||||
-#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, unsigned int)
|
||||
-#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, unsigned int)
|
||||
-#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, unsigned int)
|
||||
+#define LIRC_SET_SEND_CARRIER _IOW('i', 0x00000013, __u32)
|
||||
+#define LIRC_SET_REC_CARRIER _IOW('i', 0x00000014, __u32)
|
||||
+#define LIRC_SET_SEND_DUTY_CYCLE _IOW('i', 0x00000015, __u32)
|
||||
+#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32)
|
||||
+#define LIRC_SET_TRANSMITTER_MASK _IOW('i', 0x00000017, __u32)
|
||||
|
||||
/* a value of 0 disables all hardware timeouts and data should be
|
||||
reported as soon as possible */
|
||||
-#define LIRC_SET_REC_TIMEOUT _IOW('i', 0x00000018, lirc_t)
|
||||
+#define LIRC_SET_REC_TIMEOUT _IOW('i', 0x00000018, __u32)
|
||||
/* 1 enables, 0 disables timeout reports in MODE2 */
|
||||
-#define LIRC_SET_REC_TIMEOUT_REPORTS _IOW('i', 0x00000019, unsigned int)
|
||||
+#define LIRC_SET_REC_TIMEOUT_REPORTS _IOW('i', 0x00000019, __u32)
|
||||
|
||||
/* pulses shorter than this are filtered out by hardware (software
|
||||
emulation in lirc_dev/lircd?) */
|
||||
-#define LIRC_SET_REC_FILTER_PULSE _IOW('i', 0x0000001a, lirc_t)
|
||||
+#define LIRC_SET_REC_FILTER_PULSE _IOW('i', 0x0000001a, __u32)
|
||||
/* spaces shorter than this are filtered out by hardware (software
|
||||
emulation in lirc_dev/lircd?) */
|
||||
-#define LIRC_SET_REC_FILTER_SPACE _IOW('i', 0x0000001b, lirc_t)
|
||||
+#define LIRC_SET_REC_FILTER_SPACE _IOW('i', 0x0000001b, __u32)
|
||||
/* if filter cannot be set independently for pulse/space, this should
|
||||
be used */
|
||||
-#define LIRC_SET_REC_FILTER _IOW('i', 0x0000001c, lirc_t)
|
||||
+#define LIRC_SET_REC_FILTER _IOW('i', 0x0000001c, __u32)
|
||||
|
||||
/* if enabled from the next key press on the driver will send
|
||||
LIRC_MODE2_FREQUENCY packets */
|
||||
-#define LIRC_SET_MEASURE_CARRIER_MODE _IOW('i', 0x0000001d, unsigned int)
|
||||
+#define LIRC_SET_MEASURE_CARRIER_MODE _IOW('i', 0x0000001d, __u32)
|
||||
|
||||
/*
|
||||
* to set a range use
|
||||
@@ -157,8 +158,8 @@ typedef int lirc_t;
|
||||
* LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound
|
||||
*/
|
||||
|
||||
-#define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, unsigned int)
|
||||
-#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, unsigned int)
|
||||
+#define LIRC_SET_REC_DUTY_CYCLE_RANGE _IOW('i', 0x0000001e, __u32)
|
||||
+#define LIRC_SET_REC_CARRIER_RANGE _IOW('i', 0x0000001f, __u32)
|
||||
|
||||
#define LIRC_NOTIFY_DECODE _IO('i', 0x00000020)
|
||||
|
Loading…
Reference in new issue