# ChangeLog for app-misc/lirc
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/ChangeLog,v 1.88 2006/05/31 18:52:09 zzam Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/ChangeLog,v 1.89 2006/06/05 10:31:55 zzam Exp $
+
+*lirc-0.8.0-r1 (05 Jun 2006)
+
+ 05 Jun 2006; Matthias Schwarzott <zzam@gentoo.org>
+ +files/lirc-0.8.0-imon-pad2keys.patch,
+ +files/lirc-0.8.0pre4-xbox-remote.diff, +lirc-0.8.0-r1.ebuild:
+ Redesigned ebuild to use use-expanded variable LIRC_DEVICES instead of
+ LIRC_OPTS. Now uses /dev/lirc/0 per default as created by udev. Has proper
+ depends now (Bug #131306). Added support for xboxusb (Bug #135490). Added
+ imon_pad2keys driver. Removed ~ppc64 because of not keyworded
+ media-libs/libirman.
31 May 2006; Matthias Schwarzott <zzam@gentoo.org> lirc-0.8.0.ebuild:
Small corrections (sleep -> epause, added missing call to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
+AUX lirc-0.8.0-imon-pad2keys.patch 8304 RMD160 0634e8a61bb26d01b8ab860d33873842d320b7b9 SHA1 24c0d2f687250e489d0d9d8d649e7d340fb71a55 SHA256 ea6e28ca5af7226410d9ccf544bf476593fafed88aa38dffabd71bf9b843038d
+MD5 d8a7ab1e0afcc759b946010dfe76d2a0 files/lirc-0.8.0-imon-pad2keys.patch 8304
+RMD160 0634e8a61bb26d01b8ab860d33873842d320b7b9 files/lirc-0.8.0-imon-pad2keys.patch 8304
+SHA256 ea6e28ca5af7226410d9ccf544bf476593fafed88aa38dffabd71bf9b843038d files/lirc-0.8.0-imon-pad2keys.patch 8304
AUX lirc-0.8.0-kernel-2.6.16.diff 5356 RMD160 c09a2476bf1914b2673cfb73a2ca127b5af20ed3 SHA1 0fdabbd70e3aaca995847f456320037e9220f324 SHA256 47fe2f6220b6cdf38cd34d89d0eedabda302bcea644d0e007588a6d3d136446e
MD5 ffd478e500c79b4be37d4f46641ec2a6 files/lirc-0.8.0-kernel-2.6.16.diff 5356
RMD160 c09a2476bf1914b2673cfb73a2ca127b5af20ed3 files/lirc-0.8.0-kernel-2.6.16.diff 5356
SHA256 47fe2f6220b6cdf38cd34d89d0eedabda302bcea644d0e007588a6d3d136446e files/lirc-0.8.0-kernel-2.6.16.diff 5356
+AUX lirc-0.8.0pre4-xbox-remote.diff 7632 RMD160 5eb2095df76136270e827c686671c94304d4820d SHA1 6c158eb3b95c7237e657726dbe3db2fc19a87b88 SHA256 0cd73451b1310ca6abd377d4098e7bb6f18555d176cf11aab992766f6e3fc0ec
+MD5 2a27a2540f0a87847d932f1651cd2e86 files/lirc-0.8.0pre4-xbox-remote.diff 7632
+RMD160 5eb2095df76136270e827c686671c94304d4820d files/lirc-0.8.0pre4-xbox-remote.diff 7632
+SHA256 0cd73451b1310ca6abd377d4098e7bb6f18555d176cf11aab992766f6e3fc0ec files/lirc-0.8.0pre4-xbox-remote.diff 7632
AUX lircd 450 RMD160 73cf3057f420632e90e80eeb30e79cdbb3390b5d SHA1 e43d500a672bf89b7dc5e6bdedc9ed8e90dac3b3 SHA256 a9d6d2cc0abd0efe3267c1477fac012378e63e26aa021cfce7a0e25b27f196df
MD5 ab341c2bcfd5c4f94560dc256e32a70c files/lircd 450
RMD160 73cf3057f420632e90e80eeb30e79cdbb3390b5d files/lircd 450
MD5 cb4d1fc7278b7357a6ca6aee2b1adc1c lirc-0.7.2.ebuild 4472
RMD160 c9fef11718083b8cb2358a224b506e027ae34dc2 lirc-0.7.2.ebuild 4472
SHA256 a4edfe95537b344e988525e50ef64c918299618ab8b150b7690c537f28482bd1 lirc-0.7.2.ebuild 4472
+EBUILD lirc-0.8.0-r1.ebuild 6692 RMD160 90299b9d742ae870c55db1dc533a1c3548db8543 SHA1 71e29ad105d3db2f37df6cd7697ff4dc018008c6 SHA256 fb5ccfa92998d94aaa0798066f83c7a080f740f9dad7f66a6fa1644fb4cfa567
+MD5 e1aaf7dc0067ad891ccd7ca1a9298d2e lirc-0.8.0-r1.ebuild 6692
+RMD160 90299b9d742ae870c55db1dc533a1c3548db8543 lirc-0.8.0-r1.ebuild 6692
+SHA256 fb5ccfa92998d94aaa0798066f83c7a080f740f9dad7f66a6fa1644fb4cfa567 lirc-0.8.0-r1.ebuild 6692
EBUILD lirc-0.8.0.ebuild 4591 RMD160 c05c238e8e2f5c8d3d6fab054a0f8912bd0de95a SHA1 e56fe62b27c15c116ae78667cbaf40a9df37279e SHA256 b39a55b033142e1728655d0da2df1a322c338b146250ae1ea31a3325712223da
MD5 4a33acb90d00d9ea6d84d615956153bf lirc-0.8.0.ebuild 4591
RMD160 c05c238e8e2f5c8d3d6fab054a0f8912bd0de95a lirc-0.8.0.ebuild 4591
SHA256 b39a55b033142e1728655d0da2df1a322c338b146250ae1ea31a3325712223da lirc-0.8.0.ebuild 4591
-MISC ChangeLog 12874 RMD160 cbd6da38a79384ef5077aa2b1c0e6eff9b8c2dd7 SHA1 332ecc92d223af1f5b5911f8032231f2ed2c8f5a SHA256 2c8c6c6ce2a54e7e3965acc06f52b172657876460a105f52c5f4db3744a8a8b3
-MD5 0e27fe466da160b758f9f3eb3e9433ea ChangeLog 12874
-RMD160 cbd6da38a79384ef5077aa2b1c0e6eff9b8c2dd7 ChangeLog 12874
-SHA256 2c8c6c6ce2a54e7e3965acc06f52b172657876460a105f52c5f4db3744a8a8b3 ChangeLog 12874
+MISC ChangeLog 13377 RMD160 38e22a484a201e9e0b8c7db3ba14a619e26057e1 SHA1 a07408456a1dea9a0d5d43af595a8e537e7b2a8c SHA256 938eb9ae1981d75648f3dc2b437735c1ae0a6012656cb65bbfa4db545a2d554a
+MD5 92e4b9c2228ef97068273bd1184e2050 ChangeLog 13377
+RMD160 38e22a484a201e9e0b8c7db3ba14a619e26057e1 ChangeLog 13377
+SHA256 938eb9ae1981d75648f3dc2b437735c1ae0a6012656cb65bbfa4db545a2d554a ChangeLog 13377
MISC metadata.xml 252 RMD160 e1c170c221f61fa9787a04feac90fab777639d88 SHA1 9fdd5da8466c39d7ff3b40412c4dfa77dd2446b7 SHA256 4e8b5c34b3e50b781a18c9be9e6199442f1b0299e00d66ba35024f8b743b9c32
MD5 abf8a9c4b96bc3bb50f04a48349dae34 metadata.xml 252
RMD160 e1c170c221f61fa9787a04feac90fab777639d88 metadata.xml 252
MD5 17322bfb3604e1c6663bbc5a6fb80e96 files/digest-lirc-0.8.0 235
RMD160 efdbebbf9c02e761392c245f3ee1df0938778785 files/digest-lirc-0.8.0 235
SHA256 e24d5fc3d5ed85823419cd88ebc5dfa9fd7fc924e746daf282885564aa84e8cc files/digest-lirc-0.8.0 235
+MD5 17322bfb3604e1c6663bbc5a6fb80e96 files/digest-lirc-0.8.0-r1 235
+RMD160 efdbebbf9c02e761392c245f3ee1df0938778785 files/digest-lirc-0.8.0-r1 235
+SHA256 e24d5fc3d5ed85823419cd88ebc5dfa9fd7fc924e746daf282885564aa84e8cc files/digest-lirc-0.8.0-r1 235
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
-iD8DBQFEfeXkZfSl1Kp5KmoRAopxAKDL5XxKzGPqsBb6Eu/v6ygrI1ZOtgCaAwQH
-pA8ay+1X1ClUHep9Cyq60SY=
-=wuzs
+iD8DBQFEhAhHZfSl1Kp5KmoRAmGLAJ99lFcdGA5V08cCYyUzQXHMKxPXKQCg7DcH
+/1MMyCr5nIodOaXgdOBPai4=
+=NEYC
-----END PGP SIGNATURE-----
--- /dev/null
+MD5 0bf28bf82c7766a462f90927b6bf3af1 lirc-0.8.0.tar.bz2 514359
+RMD160 045c95754820e77891bd0b3baa269ad3f04cba8c lirc-0.8.0.tar.bz2 514359
+SHA256 cc8d7fb41a045278680ea530cffaf05181977f41244b9f0ed64075cd7630b5d2 lirc-0.8.0.tar.bz2 514359
--- /dev/null
+Downloaded from http://www.brakemeier.de/
+
+diff -uBbwr lirc-0.8.0/drivers/lirc_imon/lirc_imon.c lirc-0.8.0-imon-pad2keys/drivers/lirc_imon/lirc_imon.c
+--- lirc-0.8.0/drivers/lirc_imon/lirc_imon.c 2005-12-03 16:18:07.000000000 +0100
++++ lirc-0.8.0-imon-pad2keys/drivers/lirc_imon/lirc_imon.c 2006-03-31 19:06:00.000000000 +0200
+@@ -65,10 +65,27 @@
+ #include "drivers/lirc_dev/lirc_dev.h"
+
+
++// imon pad2keys patch
++//
++// make PAD and mouse buttons available for use with VDR,
++// based on pad-mouse-emu patch from venky's forum
++//
++// M.Brakemeier 2006-03-31
++//
++// generated PAD key codes:
++// Mouse_N 0x690281B7
++// Mouse_S 0x688291B7
++// Mouse_W 0x6A8281B7
++// Mouse_E 0x688A81B7
++//
++// mouse buttons (non-synthetic):
++// MouseRightClick 0x688481B7
++// MouseLeftClick 0x688301B7
++
+ #define MOD_AUTHOR "Venky Raju <dev@venky.ws>"
+-#define MOD_DESC "Driver for Soundgraph iMON MultiMedian IR/VFD"
++#define MOD_DESC "Driver for Soundgraph iMON MultiMedian IR/VFD w/imon pad2keys patch"
+ #define MOD_NAME "lirc_imon"
+-#define MOD_VERSION "0.3"
++#define MOD_VERSION "0.3p2k"
+
+ #define VFD_MINOR_BASE 144 /* Same as LCD */
+ #define DEVFS_MODE S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
+@@ -83,6 +100,7 @@
+ #define TRUE 1
+ #define FALSE 0
+
++#define CURSOR_LIMIT 16
+
+ /* ------------------------------------------------------------
+ * P R O T O T Y P E S
+@@ -161,6 +179,10 @@
+ atomic_t busy; /* write in progress */
+ int status; /* status of tx completion */
+ } tx;
++
++ int key_x;
++ int key_y;
++ int last_count; /* number of times pressed */
+ };
+
+ #define LOCK_CONTEXT down (&context ->sem)
+@@ -251,6 +273,7 @@
+
+ MODULE_AUTHOR (MOD_AUTHOR);
+ MODULE_DESCRIPTION (MOD_DESC);
++MODULE_VERSION(MOD_VERSION); /* MBr: was missing */
+ MODULE_LICENSE ("GPL");
+ module_param (debug, int, 0);
+ MODULE_PARM_DESC (debug, "Debug messages: 0=no, 1=yes (default: no)");
+@@ -575,6 +598,11 @@
+ context ->rx.initial_space = 1;
+ context ->rx.prev_bit = 0;
+
++ /* init pad context */
++ context ->key_x = 0;
++ context ->key_y = 0;
++ context ->last_count = 0;
++
+ usb_fill_int_urb (context ->rx_urb, context ->dev,
+ usb_rcvintpipe (context ->dev,
+ context ->rx_endpoint-> bEndpointAddress),
+@@ -705,6 +733,76 @@
+
+ /* The signals have been decoded onboard the iMON controller */
+
++ /* encode mouse pad as key events */
++ /* we like pad events, not mouse button events*/
++ if((buf[0] & 0x40) &&
++ !(buf[1] & 0x01 || buf[1] >> 2 & 0x01))
++ {
++ int rel_x = (buf[1] & 0x08) | (buf[1] & 0x10) >> 2 | (buf[1] & 0x20) >> 4 | (buf[1] & 0x40) >> 6;
++ int rel_y = (buf[2] & 0x08) | (buf[2] & 0x10) >> 2 | (buf[2] & 0x20) >> 4 | (buf[2] & 0x40) >> 6;
++
++ if(buf[0] & 0x02)
++ rel_x |= ~0x10+1;
++ if(buf[0] & 0x01)
++ rel_y |= ~0x10+1;
++
++ /* keyboard direction key emulation */
++ if( context->last_count > 32 )
++ { /* Hopefully eliminate drift*/
++ context->last_count=0;
++ context->key_y=0;
++ context->key_x=0;
++ }
++ context->last_count++;
++
++ /* limit decoded events */
++ if(abs(context->key_x) > CURSOR_LIMIT || abs(context->key_y) > CURSOR_LIMIT )
++ {
++ if(abs(context->key_y ) > abs(context->key_x))
++ { /* mouse s/n */
++ if(context->key_y > 0 && rel_y > 0)
++ { /* mouse s */
++ buf[0] = 0x68;
++ buf[1] = 0x82;
++ buf[2] = 0x91;
++ }
++ else if(context->key_y < 0 && rel_y < 0)
++ { /* mouse n */
++ buf[0] = 0x69;
++ buf[1] = 0x02;
++ buf[2] = 0x81;
++ }
++ }
++ else
++ { /* mouse e/w*/
++ if(context->key_x > 0 && rel_x > 0 )
++ { /* mouse e */
++ buf[0] = 0x68;
++ buf[1] = 0x8A;
++ buf[2] = 0x81;
++ }
++ else if(context->key_x < 0 && rel_x < 0 )
++ { /* mouse w */
++ buf[0] = 0x6A;
++ buf[1] = 0x82;
++ buf[2] = 0x81;
++ }
++ }
++ }
++ else
++ {
++ context->key_x += rel_x;
++ context->key_y += rel_y;
++
++ return; /* discard those key codes */
++ }
++ }
++
++ /* a key was pressed, reset count */
++ context->key_x = 0;
++ context->key_y = 0;
++ context->last_count = 0;
++
+ lirc_buffer_write_1 (context ->plugin ->rbuf, buf);
+ wake_up (&context ->plugin ->rbuf ->wait_poll);
+ return;
+diff -uBbwr lirc-0.8.0/remotes/imon/lircd.conf.imon-pad lirc-0.8.0-imon-pad2keys/remotes/imon/lircd.conf.imon-pad
+--- lirc-0.8.0/remotes/imon/lircd.conf.imon-pad 2005-04-15 02:50:16.000000000 +0200
++++ lirc-0.8.0-imon-pad2keys/remotes/imon/lircd.conf.imon-pad 2006-03-31 19:04:09.000000000 +0200
+@@ -2,11 +2,11 @@
+ # by sending it to <lirc@bartelmus.de>\r
+ #\r
+ # this config file was automatically generated\r
+-# using lirc-0.7.1pre2(imon) on Tue Mar 1 23:15:44 2005\r
++# using lirc-0.8.0(imon_pad) on Mon Jan 23 20:22:11 2006
+ #\r
+-# contributed by Venky Raju\r
++# contributed by M.Brakemeier
+ #\r
+-# brand: iMON-New\r
++# brand: SoundGraph
+ # model no. of remote control: iMON-PAD\r
+ # devices being controlled by this remote:\r
+ #\r
+@@ -24,12 +24,12 @@
+ min_repeat 1\r
+ toggle_bit 0\r
+ \r
+-\r
+ begin codes\r
+ AppExit 0x288195B7\r
++ Power 0x289115B7
+ Record 0x298115B7\r
+ Play 0x2A8115B7\r
+- SlowMotion 0x29B195B7\r
++ Open 0x29B1D5B7
+ Rewind 0x2A8195B7\r
+ Pause 0x2A9115B7\r
+ FastForward 0x2B8115B7\r
+@@ -59,15 +59,15 @@
+ 0 0x2BA595B7\r
+ ShiftTab 0x28B515B7\r
+ Tab 0x29A115B7\r
+- MyMovie 0x2B8515B7\r
+- MyMusic 0x299195B7\r
+- MyPhoto 0x2BA115B7\r
+- MyTV 0x28A515B7\r
++ Red 0x2B8515B7 # MyMovie
++ Green 0x299195B7 # MyMusic
++ Blue 0x2BA115B7 # MyPhoto
++ Yellow 0x28A515B7 # MyTV
+ Bookmark 0x288515B7\r
+ Thumbnail 0x2AB715B7\r
+ AspectRatio 0x29A595B7\r
+ FullScreen 0x2AA395B7\r
+- MyDVD 0x29A295B7\r
++ Purple 0x29A295B7 # MyDVD
+ Menu 0x2BA385B7\r
+ Caption 0x298595B7\r
+ Language 0x2B8595B7\r
+@@ -79,6 +79,10 @@
+ MouseLeftClick 0x688301B7\r
+ WindowsKey 0x2B8195B7\r
+ Backspace 0x28A115B7\r
++ Mouse_N 0x690281B7
++ Mouse_S 0x688291B7
++ Mouse_W 0x6A8281B7
++ Mouse_E 0x688A81B7
+ end codes\r
+ \r
+ end remote \r
--- /dev/null
+Downloaded from http://wojci.dk/lirc-xbox/
+
+diff -d -r -u lirc-0.8.0pre4-orig/drivers/Makefile.kernel lirc-0.8.0pre4/drivers/Makefile.kernel
+--- lirc-0.8.0pre4-orig/drivers/Makefile.kernel 2004-01-19 21:04:09.000000000 +0100
++++ lirc-0.8.0pre4/drivers/Makefile.kernel 2006-01-22 14:44:25.000000000 +0100
+@@ -1,5 +1,5 @@
+
+-EXTRA_CFLAGS += $(LIRC_EXTRA_CFLAGS)
++EXTRA_CFLAGS += $(LIRC_EXTRA_CFLAGS) -DXBOX_SUPPORT=1
+
+ obj-m=$(module_DATA)
+ MI_OBJS = $(module_DATA)
+diff -d -r -u lirc-0.8.0pre4-orig/drivers/lirc_atiusb/lirc_atiusb.c lirc-0.8.0pre4/drivers/lirc_atiusb/lirc_atiusb.c
+--- lirc-0.8.0pre4-orig/drivers/lirc_atiusb/lirc_atiusb.c 2005-10-29 16:18:53.000000000 +0200
++++ lirc-0.8.0pre4/drivers/lirc_atiusb/lirc_atiusb.c 2006-01-22 14:22:47.000000000 +0100
+@@ -62,11 +62,22 @@
+ #define DRIVER_VERSION "0.5"
+ #define DRIVER_AUTHOR "Paul Miller <pmiller9@users.sourceforge.net>"
+ #define DRIVER_DESC "USB remote driver for LIRC"
+-#define DRIVER_NAME "lirc_atiusb"
+
+-#define CODE_LENGTH 5
+-#define CODE_LENGTH_ATI2 3
+-#define CODE_MIN_LENGTH 3
++#ifdef XBOX_SUPPORT
++# define DRIVER_NAME "lirc_atiusb (xbox version)"
++#else
++# define DRIVER_NAME "lirc_atiusb"
++#endif // XBOX_SUPPORT
++
++#ifdef XBOX_SUPPORT
++# define CODE_LENGTH 1 // length of code sent to lirc
++# define CODE_MIN_LENGTH 1
++# define USB_BUFLEN 6 // code received from xbox ir
++#else
++# define CODE_LENGTH 5
++# define CODE_LENGTH_ATI2 3
++# define CODE_MIN_LENGTH 3
++#endif // XBOX_SUPPORT
+
+ #define RW2_MODENAV_KEYCODE 0x3F
+ #define RW2_NULL_MODE 0xFF
+@@ -79,11 +90,16 @@
+ #define RW2_RELEASE_CODE 0
+
+ /* module parameters */
++//#ifndef XBOX_SUPPORT
+ #ifdef CONFIG_USB_DEBUG
+ static int debug = 1;
+ #else
+ static int debug = 0;
+ #endif
++//#else
++// static int debug = 1;
++//#endif // !XBOX_SUPPORT
++
+ #define dprintk(fmt, args...) \
+ do{ \
+ if(debug) printk(KERN_DEBUG fmt, ## args); \
+@@ -120,8 +136,14 @@
+
+ #define VENDOR_ATI1 0x0bc7
+ #define VENDOR_ATI2 0x0471
++#define VENDOR_MS1 0x040b
++#define VENDOR_MS2 0x045e
+
+ static struct usb_device_id usb_remote_table [] = {
++#ifdef XBOX_SUPPORT
++ { USB_DEVICE(VENDOR_MS1, 0x6521) }, /* Gamester Xbox DVD Movie Playback Kit IR */
++ { USB_DEVICE(VENDOR_MS2, 0x0284) }, /* Microsoft Xbox DVD Movie Playback Kit IR */
++#else
+ { USB_DEVICE(VENDOR_ATI1, 0x0002) }, /* X10 USB Firecracker Interface */
+ { USB_DEVICE(VENDOR_ATI1, 0x0003) }, /* X10 VGA Video Sender */
+ { USB_DEVICE(VENDOR_ATI1, 0x0004) }, /* ATI Wireless Remote Receiver */
+@@ -139,6 +161,7 @@
+
+ { USB_DEVICE(VENDOR_ATI2, 0x0602) }, /* ATI Remote Wonder 2: Input Device */
+ { USB_DEVICE(VENDOR_ATI2, 0x0603) }, /* ATI Remote Wonder 2: Controller (???) */
++#endif // XBOX_SUPPORT
+
+ { } /* Terminating entry */
+ };
+@@ -168,7 +191,13 @@
+ #endif
+
+ /* handle repeats */
++#if XBOX_SUPPORT
++ // Store the whole input and use
++ // to compare when receiving new data.
++ unsigned char old[USB_BUFLEN];
++#else
+ unsigned char old[CODE_LENGTH];
++#endif // XBOX_SUPPORT
+ unsigned long old_jiffies;
+ };
+
+@@ -367,6 +396,26 @@
+ MOD_DEC_USE_COUNT;
+ }
+
++#ifdef XBOX_SUPPORT
++static void print_xbox_data(char* buf, int len)
++{
++ unsigned char *idata=buf;
++ if (len >= USB_BUFLEN)
++ {
++ dprintk(DRIVER_NAME ": received bytes %02x %02x %02x %02x %02x %02x\n",
++ idata[0],
++ idata[1],
++ idata[2],
++ idata[3],
++ idata[4],
++ idata[5]);
++ }
++ else
++ {
++ dprintk(DRIVER_NAME ": unrecognized, length=%d\n", len);
++ }
++}
++#else
+ static void print_data(struct in_endpt *iep, char *buf, int len)
+ {
+ char codes[CODE_LENGTH*3 + 1];
+@@ -381,7 +430,42 @@
+ printk(DRIVER_NAME "[%d]: data received %s (ep=0x%x length=%d)\n",
+ iep->ir->devnum, codes, iep->ep->bEndpointAddress, len);
+ }
++#endif // XBOX_SUPPORT
++
++#ifdef XBOX_SUPPORT
++static int code_check_xbox(struct in_endpt *iep, int len)
++{
++ int i;
++
++ if (len != USB_BUFLEN)
++ {
++ dprintk(DRIVER_NAME ": We didn't get 6 bytes from xbox ir.. ?\n");
++ return -1;
++ }
++
++ // Using USB_BUFLEN, as the original input is compared.
++
++ /* check for repeats */
++ if (memcmp(iep->old, iep->buf, len) == 0)
++ {
++ if (iep->old_jiffies + repeat_jiffies > jiffies)
++ {
++ return -1;
++ }
++ }
++ else
++ {
++ for (i = len; i < USB_BUFLEN; i++)
++ {
++ iep->buf[i] = 0;
++ }
++ memcpy(iep->old, iep->buf, USB_BUFLEN);
++ }
++ iep->old_jiffies = jiffies;
+
++ return SUCCESS;
++}
++#else
+ static int code_check_ati1(struct in_endpt *iep, int len)
+ {
+ struct irctl *ir = iep->ir;
+@@ -598,6 +682,7 @@
+ return SUCCESS;
+ }
+
++#endif // !XBOX_SUPPORT
+
+ #ifdef KERNEL_2_5
+ static void usb_remote_recv(struct urb *urb, struct pt_regs *regs)
+@@ -607,6 +692,9 @@
+ {
+ struct in_endpt *iep;
+ int len, result;
++#if XBOX_SUPPORT
++ char buf[CODE_LENGTH];
++#endif // XBOX_SUPPORT
+
+ if (!urb)
+ return;
+@@ -622,13 +710,37 @@
+
+ len = urb->actual_length;
+ if (debug)
++#ifdef XBOX_SUPPORT
++ print_xbox_data(urb->transfer_buffer, len);
++#else
+ print_data(iep,urb->transfer_buffer,len);
++#endif // XBOX_SUPPORT
+
+ switch (urb->status) {
+
+ /* success */
+ case SUCCESS:
++#ifdef XBOX_SUPPORT
++ {
++ if (len != USB_BUFLEN)
++ {
++ dprintk(DRIVER_NAME ": We didn't get 6 bytes from xbox ir.. ?\n");
++ return;
++ }
++
++ if (code_check_xbox(iep, len) == SUCCESS)
++ {
++ // the third byte of xbox ir packet seems to contain key info
++ // the last two bytes are.. some kind of clock?
++ buf[0]=((char*)urb->transfer_buffer)[2];
+
++ dprintk(DRIVER_NAME ": write to lirc buffer and wakeup\n");
++ lirc_buffer_write_1(iep->ir->p->rbuf, buf);
++ wake_up(&iep->ir->p->rbuf->wait_poll);
++ }
++ break;
++ }
++#else
+ switch (iep->ir->remote_type) {
+ case ATI2_COMPATIBLE:
+ result = code_check_ati2(iep, len);
+@@ -641,7 +753,7 @@
+ lirc_buffer_write_1(iep->ir->p->rbuf, iep->buf);
+ wake_up(&iep->ir->p->rbuf->wait_poll);
+ break;
+-
++#endif // XBOX_SUPPORT
+ /* unlink */
+ case -ECONNRESET:
+ case -ENOENT:
+@@ -759,9 +871,18 @@
+ pipe = usb_rcvintpipe(dev, addr);
+ maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
+
++#ifdef XBOX_SUPPORT
++ dprintk("maxp = %d\n", maxp);
++#endif // XBOX_SUPPORT
++
+ // len = (maxp > USB_BUFLEN) ? USB_BUFLEN : maxp;
+ // len -= (len % CODE_LENGTH);
++
++#if XBOX_SUPPORT
++ len = USB_BUFLEN;
++#else
+ len = CODE_LENGTH;
++#endif // XBOX_SUPPORT
+
+ dprintk(DRIVER_NAME "[%d]: acceptable inbound endpoint (0x%x) found (maxp=%d len=%d)\n", ir->devnum, addr, maxp, len);
+
+@@ -940,12 +1061,19 @@
+
+ /* determine remote type */
+ switch (dev->descriptor.idVendor) {
++#ifdef XBOX_SUPPORT
++ case VENDOR_MS1:
++ case VENDOR_MS2:
++ type = ATI1_COMPATIBLE;
++ break;
++#else
+ case VENDOR_ATI1:
+ type = ATI1_COMPATIBLE;
+ break;
+ case VENDOR_ATI2:
+ type = ATI2_COMPATIBLE;
+ break;
++#endif // XBOX_SUPPORT
+ default:
+ dprintk(DRIVER_NAME "[%d]: unknown type\n", devnum);
+ return NULL;
+@@ -1140,9 +1268,10 @@
+
+ /* Note new driver registration in kernel logs */
+ log_usb_dev_info(dev);
+-
++//#ifndef XBOX_SUPPORT
+ /* outbound data (initialization) */
+ send_outbound_init(ir);
++//#endif // !XBOX_SUPPORT
+ }
+
+ #ifdef KERNEL_2_5
+@@ -1196,6 +1325,9 @@
+ printk("\n" DRIVER_NAME ": " DRIVER_DESC " v" DRIVER_VERSION "\n");
+ printk(DRIVER_NAME ": " DRIVER_AUTHOR "\n");
+ dprintk(DRIVER_NAME ": debug mode enabled: $Id: lirc_atiusb.c,v 1.51 2005/10/29 14:18:53 lirc Exp $\n");
++#ifdef XBOX_SUPPORT
++ dprintk(DRIVER_NAME ": XBOX support enabled..\n");
++#endif
+
+ request_module("lirc_dev");
+
--- /dev/null
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/lirc-0.8.0-r1.ebuild,v 1.1 2006/06/05 10:31:55 zzam Exp $
+
+inherit eutils linux-mod flag-o-matic autotools
+
+DESCRIPTION="LIRC is a package that allows you to decode and send infra-red \
+ signals of many (but not all) commonly used remote controls."
+HOMEPAGE="http://www.lirc.org"
+
+SLOT="0"
+LICENSE="GPL-2"
+IUSE="alsa debug doc X usb hardware-carrier transmitter"
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~x86"
+SRC_URI="mirror://sourceforge/lirc/${P/_pre/pre}.tar.bz2"
+
+S=${WORKDIR}/${P/_pre/pre}
+
+
+IUSE_LIRC_DEVICES_DIRECT="
+ all userspace act200l act220l
+ adaptec alsa_usb animax atilibusb
+ atiusb audio audio_alsa avermedia avermedia_vdomate
+ avermedia98 bestbuy bestbuy2 breakoutbox
+ bte bw6130 caraca chronos cmdir com1 com2 com3 com4
+ cph06x creative creative_infracd
+ devinput digimatrix dsp dvico ea65
+ exaudio flyvideo gvbctv5pci hauppauge
+ hauppauge_dvb hercules_smarttv_stereo
+ igorplugusb imon imon_pad imon_rsc
+ irdeo irdeo_remote irman irreal it87
+ knc_one kworld leadtek_0007 leadtek_0010
+ leadtek_pvr2000 livedrive_midi
+ livedrive_seq logitech lpt1 lpt2 mceusb
+ mceusb2 mediafocusI mouseremote
+ mouseremote_ps2 mp3anywhere nslu2
+ packard_bell parallel pcmak pcmak_usb
+ pctv pixelview_bt878 pixelview_pak
+ pixelview_pro provideo realmagic
+ remotemaster sa1100 sasem serial
+ silitek sir slinke streamzap tekram
+ tekram_bt829 tira tvbox udp uirt2
+ uirt2_raw"
+
+IUSE_LIRC_DEVICES_SPECIAL="imon_pad2keys serial_igor_cesko xboxusb"
+IUSE_LIRC_DEVICES="${IUSE_LIRC_DEVICES_DIRECT} ${IUSE_LIRC_DEVICES_SPECIAL}"
+
+
+
+RDEPEND="virtual/libc
+ sys-apps/coreutils
+ X? ( || ( ( x11-libs/libX11
+ x11-libs/libSM
+ x11-libs/libICE )
+ virtual/x11 ) )
+ lirc_devices_alsa_usb? ( media-libs/alsa-lib )
+ lirc_devices_audio? ( media-libs/portaudio )
+ lirc_devices_irman? ( media-libs/libirman )"
+
+
+#device-driver which use libusb
+LIBUSB_USED_BY_DEV="
+ all atiusb sasem igorplugusb imon imon_pad imon_pad2keys
+ imon_rsc streamzap mceusb mceusb2 xboxusb"
+
+for dev in ${LIBUSB_USED_BY_DEV}; do
+ RDEPEND="${RDEPEND} lirc_devices_${dev}? ( dev-libs/libusb )"
+done
+
+DEPEND="${RDEPEND}
+ virtual/linux-sources
+ sys-devel/autoconf
+ sys-devel/libtool"
+
+
+# add all devices to IUSE
+for dev in ${IUSE_LIRC_DEVICES}; do
+ IUSE="${IUSE} lirc_devices_${dev}"
+done
+
+
+add_device() {
+ : $(( lirc_device_count++ ))
+
+ if [[ ${lirc_device_count} -eq 2 ]]; then
+ ewarn
+ #ewarn "When selecting multiple devices for lirc to be supported,"
+ #ewarn "it can not be garanteed that the drivers play nice together."
+ ewarn "lirc does at the moment support only one driver be compiled at a time."
+ ewarn "Please reduce LIRC_DEVICES to one item."
+ die "Multiple drivers selected for lirc."
+ fi
+
+
+ local dev="${1}"
+ local desc="device ${dev}"
+ if [[ -n "${2}" ]]; then
+ desc="${2}"
+ fi
+
+ einfo "Compiling support for ${desc}"
+ MY_OPTS="${MY_OPTS} --with-driver=${dev}"
+}
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ # set default configure options
+ MY_OPTS=""
+ lirc_driver_count=0
+
+ local dev
+
+ if use lirc_devices_all; then
+ # compile in drivers for a lot of devices
+ add_device all "a lot of devices"
+ else
+ # compile in only requested drivers
+ for dev in ${IUSE_LIRC_DEVICES_DIRECT}; do
+ if use lirc_devices_${dev}; then
+ add_device ${dev}
+ fi
+ done
+
+ if use lirc_devices_serial_igor_cesko; then
+ add_device serial "serial with Igor Cesko design"
+ MY_OPTS="${MY_OPTS} --with-igor"
+ fi
+
+ if use lirc_devices_imon_pad2keys; then
+ add_device imon_pad "device imon_pad (with converting pad input to keyspresses)"
+ fi
+
+ if use lirc_devices_xboxusb; then
+ add_device atiusb "device xboxusb"
+ fi
+
+ if [[ "${MY_OPTS}" == "" ]]; then
+ if [[ "${PROFILE_ARCH}" == "xbox" ]]; then
+ # on xbox: use special driver
+ add_device atiusb "device xboxusb"
+ else
+ # no driver requested
+ einfo
+ einfo "Compiling only the lirc-applications, but no drivers."
+ einfo "Enable drivers with LIRC_DEVICES if you need them."
+ MY_OPTS="--with-driver=none"
+ fi
+ fi
+ fi
+
+ use hardware-carrier && MY_OPTS="${MY_OPTS} --without-soft-carrier"
+ use transmitter && MY_OPTS="${MY_OPTS} --with-transmitter"
+
+
+ if [[ -n "${LIRC_OPTS}" ]] ; then
+ ewarn
+ ewarn "LIRC_OPTS is deprecated from lirc-0.8.0-r1 on."
+ ewarn
+ ewarn "Please use LIRC_DEVICES from now on."
+ ewarn "e.g. LIRC_DEVICES=\"serial sir\""
+ ewarn
+ ewarn "Flags are now set per use-flags."
+ ewarn "e.g. transmitter, hardware-carrier"
+
+ local opt
+ local unsupported_opts=""
+
+ # test for allowed options for LIRC_OPTS
+ for opt in ${LIRC_OPTS}; do
+ case ${opt} in
+ --with-port=*|--with-irq=*|--with-timer=*|--with-tty=*)
+ MY_OPTS="${MY_OPTS} ${opt}"
+ ;;
+ *)
+ unsupported_opts="${unsupported_opts} ${opt}"
+ ;;
+ esac
+ done
+ if [[ -n ${unsupported_opts} ]]; then
+ ewarn "These options are no longer allowed to be set"
+ ewarn "with LIRC_OPTS: ${unsupported_opts}"
+ die "LIRC_OPTS is no longer recommended."
+ fi
+ fi
+
+ MODULE_NAMES="lirc(misc:${S})"
+ BUILD_TARGETS="all"
+
+ ECONF_PARAMS=" --localstatedir=/var
+ --with-syslog=LOG_DAEMON
+ --enable-sandboxed
+ --with-kerneldir=${KV_DIR}
+ --with-moduledir=/lib/modules/${KV_FULL}/misc
+ $(use_enable debug)
+ $(use_with X)
+ ${MY_OPTS}
+ CPPFLAGS=-DLIRC_HAVE_DEVFS"
+
+ einfo
+ einfo "lirc-configure-opts: ${MY_OPTS}"
+
+ export WANT_AUTOCONF=2.5
+ filter-flags -Wl,-O1
+}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ epatch ${FILESDIR}/${P}-kernel-2.6.16.diff
+
+ use lirc_devices_xboxusb && epatch ${FILESDIR}/lirc-0.8.0pre4-xbox-remote.diff
+ use lirc_devices_imon_pad2keys && epatch ${FILESDIR}/${P}-imon-pad2keys.patch
+
+ # remove parallel driver on SMP systems
+ if linux_chkconfig_present SMP ; then
+ sed -i -e "s:lirc_parallel::" drivers/Makefile.in
+ fi
+
+ sed -i -e 's:CFLAGS="-O2:CFLAGS=""\n#CFLAGS="-O2:' configure.in
+
+ eautoreconf || "autoreconf failed"
+}
+
+
+src_install() {
+ make DESTDIR=${D} install || die "make install failed"
+
+ newinitd ${FILESDIR}/lircd lircd
+ newinitd ${FILESDIR}/lircmd lircmd
+ newconfd ${FILESDIR}/lircd.conf lircd
+
+ has_version sys-fs/udev && (
+ insinto /etc/udev/rules.d/;
+ newins ${S}/contrib/lirc.rules 10-lirc.rules )
+
+ if use doc ; then
+ dohtml doc/html/*.html
+ insinto /usr/share/doc/${PF}/images
+ doins doc/images/*
+ fi
+}
+
+pkg_preinst() {
+ linux-mod_pkg_preinst
+ [[ -f "${ROOT}/etc/lircd.conf" ]] && cp ${ROOT}/etc/lircd.conf ${IMAGE}/etc
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ echo
+ einfo "The lirc Linux Infrared Remote Control Package has been"
+ einfo "merged, please read the documentation at http://www.lirc.org"
+ echo
+}
+