rpms/lirc/F-12 lirc-0.8.6-devinput-pass-mouse-events.patch, NONE, 1.1 lirc-0.8.6-ioctl-portability.patch, NONE, 1.1 lirc-0.8.6-remove-obsolete-modes.patch, NONE, 1.1 lirc.spec, 1.62, 1.63

Jarod Wilson jwilson at fedoraproject.org
Mon Feb 15 19:10:29 UTC 2010


Author: jwilson

Update of /cvs/pkgs/rpms/lirc/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30459

Modified Files:
	lirc.spec 
Added Files:
	lirc-0.8.6-devinput-pass-mouse-events.patch 
	lirc-0.8.6-ioctl-portability.patch 
	lirc-0.8.6-remove-obsolete-modes.patch 
Log Message:
* Mon Feb 15 2010 Jarod Wilson <jarod at redhat.com> 0.8.6-3
- Fix up ioctl portability between 32-bit and 64-bit
- Add devinput mouse event passthru to uinput support from lirc cvs


lirc-0.8.6-devinput-pass-mouse-events.patch:
 hw_devinput.c |  192 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 190 insertions(+), 2 deletions(-)

--- NEW FILE lirc-0.8.6-devinput-pass-mouse-events.patch ---
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;
 

lirc-0.8.6-ioctl-portability.patch:
 lirc.h |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

--- NEW FILE lirc-0.8.6-ioctl-portability.patch ---
Index: lirc-0.8.6/drivers/lirc.h
===================================================================
--- lirc-0.8.6.orig/drivers/lirc.h
+++ lirc-0.8.6/drivers/lirc.h
@@ -68,27 +68,27 @@ 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, uint64_t)
 
-#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_SEND_MODE             _IOR('i', 0x00000001, uint64_t)
+#define LIRC_GET_REC_MODE              _IOR('i', 0x00000002, uint64_t)
+#define LIRC_GET_SEND_CARRIER          _IOR('i', 0x00000003, uint32_t)
+#define LIRC_GET_REC_CARRIER           _IOR('i', 0x00000004, uint32_t)
+#define LIRC_GET_SEND_DUTY_CYCLE       _IOR('i', 0x00000005, uint32_t)
+#define LIRC_GET_REC_DUTY_CYCLE        _IOR('i', 0x00000006, uint32_t)
+#define LIRC_GET_REC_RESOLUTION        _IOR('i', 0x00000007, uint32_t)
 
 /* 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, uint64_t)
 
-#define LIRC_SET_SEND_MODE             _IOW('i', 0x00000011, unsigned long)
-#define LIRC_SET_REC_MODE              _IOW('i', 0x00000012, unsigned long)
+#define LIRC_SET_SEND_MODE             _IOW('i', 0x00000011, uint64_t)
+#define LIRC_SET_REC_MODE              _IOW('i', 0x00000012, uint64_t)
 /* 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, uint32_t)
+#define LIRC_SET_REC_CARRIER           _IOW('i', 0x00000014, uint32_t)
+#define LIRC_SET_SEND_DUTY_CYCLE       _IOW('i', 0x00000015, uint32_t)
+#define LIRC_SET_REC_DUTY_CYCLE        _IOW('i', 0x00000016, uint32_t)
+#define LIRC_SET_TRANSMITTER_MASK      _IOW('i', 0x00000017, uint32_t)
 
 /*
  * to set a range use
@@ -97,8 +97,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, uint32_t)
+#define LIRC_SET_REC_CARRIER_RANGE     _IOW('i', 0x0000001f, uint32_t)
 
 #define LIRC_NOTIFY_DECODE             _IO('i', 0x00000020)
 

lirc-0.8.6-remove-obsolete-modes.patch:
 daemons/hw_alsa_usb.c         |    4 +-
 daemons/hw_awlibusb.c         |   62 ------------------------------------------
 daemons/hw_bte.c              |    4 --
 daemons/hw_creative_infracd.c |    2 -
 daemons/hw_default.c          |   52 ++---------------------------------
 daemons/hw_mplay.c            |    4 +-
 daemons/irrecord.c            |   16 ----------
 daemons/receive.c             |   27 ++----------------
 drivers/lirc.h                |    7 ----
 tools/mode2.c                 |    6 ----
 10 files changed, 17 insertions(+), 167 deletions(-)

--- NEW FILE lirc-0.8.6-remove-obsolete-modes.patch ---
Index: lirc-0.8.6/drivers/lirc.h
===================================================================
--- lirc-0.8.6.orig/drivers/lirc.h
+++ lirc-0.8.6/drivers/lirc.h
@@ -11,6 +11,7 @@
 #define __USE_LINUX_IOCTL_DEFS
 #include <sys/ioctl.h>
 #endif
+#include <stdint.h>
 
 #define PULSE_BIT  0x01000000
 #define PULSE_MASK 0x00FFFFFF
@@ -27,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
 
@@ -48,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,10 @@ 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 */
 #else
-	LIRC_CAN_REC_STRING,      /* features */
 	0,                        /* send_mode */
 #endif
 
-	LIRC_MODE_STRING,         /* 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 */


Index: lirc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/lirc/F-12/lirc.spec,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -p -r1.62 -r1.63
--- lirc.spec	14 Sep 2009 03:30:46 -0000	1.62
+++ lirc.spec	15 Feb 2010 19:10:28 -0000	1.63
@@ -18,7 +18,7 @@
 
 Name:           lirc
 Version:        0.8.6
-Release:        1%{?pre:.%{pre}}%{?dist}
+Release:        3%{?pre:.%{pre}}%{?dist}
 Summary:        The Linux Infrared Remote Control package
 
 Group:          System Environment/Daemons
@@ -29,10 +29,13 @@ Source0:        http://downloads.sourcef
 Source1:        %{name}.init
 Source2:        %{name}.sysconfig
 Patch0:         lirc-use-new-instead-of-conf-as-filename-suffix.patch
+Patch1:         lirc-0.8.6-devinput-pass-mouse-events.patch
 # https://bugzilla.redhat.com/show_bug.cgi?id=457273
 # http://thread.gmane.org/gmane.comp.hardware.lirc/6884
-Patch1:		lirc-0.8.6-standardized-remote-keycodes.patch
-Patch2:         lirc-0.8.4-make-remote-names-all-unique.patch
+Patch2:		lirc-0.8.6-standardized-remote-keycodes.patch
+Patch3:         lirc-0.8.4-make-remote-names-all-unique.patch
+Patch4:         lirc-0.8.6-ioctl-portability.patch
+Patch5:         lirc-0.8.6-remove-obsolete-modes.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  %{__perl}
@@ -56,6 +59,8 @@ Requires(post): /sbin/chkconfig
 Requires(post): /sbin/ldconfig
 Requires(preun): /sbin/chkconfig
 Requires(postun): /sbin/ldconfig
+# ioctl interface altered in 2.6.32
+Requires:       kernel >= 2.6.32
 
 %description
 LIRC is a package that allows you to decode and send infra-red and
@@ -119,6 +124,7 @@ of remote control configuration files.
 %prep
 %setup -q -n %{name}-%{version}%{?pre}
 %patch0 -p1
+%patch1 -p1
 
 chmod 644 contrib/*
 chmod +x contrib/hal
@@ -159,8 +165,10 @@ touch -r aclocal.m4 configure.ac # avoid
 
 # Do this after, as we're touching the remote definitions earlier
 # Don't create a backup, or the original definitions will get installed
-%patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
 # Re-run autofoo for new cvs features
 #autoreconf -i -f
 #automake
@@ -283,6 +291,12 @@ fi
 
 
 %changelog
+* Mon Feb 15 2010 Jarod Wilson <jarod at redhat.com> 0.8.6-3
+- Fix up ioctl portability between 32-bit and 64-bit
+
+* Thu Nov 12 2009 Jarod Wilson <jarod at redhat.com> 0.8.6-2
+- Add devinput mouse event passthru to uinput support from lirc cvs
+
 * Sun Sep 13 2009 Jarod Wilson <jarod at redhat.com> 0.8.6-1
 - Update to lirc 0.8.6 release
 



More information about the scm-commits mailing list