diff --git a/config/functions b/config/functions
index 63c15fcb25..3b61da0767 100644
--- a/config/functions
+++ b/config/functions
@@ -154,5 +154,5 @@ strip_linker_plugin() {
strip_kmod() {
[ -z $1 ] && echo "usage strip_kmod
" && exit 1
- find $1 -type f -name '*.ko' | xargs -r $STRIP -R .comment -R .note -g --strip-unneeded
+ find $1 -type f -name '*.ko' | xargs -r $STRIP --strip-debug
}
diff --git a/config/path b/config/path
index bbfa2a486a..acfd2f6757 100644
--- a/config/path
+++ b/config/path
@@ -37,7 +37,7 @@ HOST_NAME=`$SCRIPTS/configtools/config.guess`
TARGET_NAME=$TARGET_FAMILY-openelec-linux-gnu
OPENELEC_SRC=http://sources.openelec.tv/src/$OPENELEC_VERSION
-BUILD=$BUILD_BASE.OpenELEC-$PROJECT.$TARGET_ARCH.$OPENELEC_VERSION
+BUILD=$BUILD_BASE.$DISTRONAME-$PROJECT.$TARGET_ARCH.$OPENELEC_VERSION
TARGET_IMG=$ROOT/$TARGET
TARGET_ADDONS="$TARGET_IMG/$ADDONS/$ADDON_PATH"
ADDON_BUILD="$BUILD/$ADDONS/$1"
diff --git a/packages/audio/libogg/meta b/packages/audio/libogg/meta
index f9ab5c90c4..92d0fbe0e4 100644
--- a/packages/audio/libogg/meta
+++ b/packages/audio/libogg/meta
@@ -1,5 +1,5 @@
PKG_NAME="libogg"
-PKG_VERSION="1.2.1"
+PKG_VERSION="1.2.2"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="BSD"
diff --git a/packages/databases/sqlite/build b/packages/databases/sqlite/build
index 283bb220f2..315196dd9d 100755
--- a/packages/databases/sqlite/build
+++ b/packages/databases/sqlite/build
@@ -5,14 +5,6 @@
# sqlite fails to compile with fast-math link time optimization.
CFLAGS=`echo $CFLAGS | sed -e "s|-ffast-math||"`
-export config_BUILD_CC="$HOST_CC"
-export config_BUILD_CFLAGS="$HOST_CFLAGS"
-export config_BUILD_LIBS="$HOST_LDFLAGS"
-export config_TARGET_CC="$CC"
-export config_TARGET_LINK="$LD"
-export config_TARGET_CFLAGS="$CFLAGS"
-export config_TARGET_LFLAGS="$LDFLAGS -ldl"
-
cd $PKG_BUILD
./configure --host=$TARGET_NAME \
--build=$HOST_NAME \
@@ -22,9 +14,12 @@ cd $PKG_BUILD
--enable-shared \
--disable-readline \
--enable-threadsafe \
+ --enable-dynamic-extensions \
+ --with-gnu-ld
+
make
$STRIP .libs/sqlite3
-$MAKEINSTALL
\ No newline at end of file
+$MAKEINSTALL
diff --git a/packages/databases/sqlite/meta b/packages/databases/sqlite/meta
index ac3433184f..a18a12e4ea 100644
--- a/packages/databases/sqlite/meta
+++ b/packages/databases/sqlite/meta
@@ -1,10 +1,10 @@
PKG_NAME="sqlite"
-PKG_VERSION="3.7.3"
+PKG_VERSION="autoconf-3070400"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="PublicDomain"
PKG_SITE="http://www.sqlite.org/"
-PKG_URL="http://www.hwaci.com/sw/sqlite/$PKG_NAME-amalgamation-$PKG_VERSION.tar.gz"
+PKG_URL="http://www.hwaci.com/sw/sqlite/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional"
diff --git a/packages/debug/w_scan/build b/packages/debug/w_scan/build
index 772145cba5..97213f4cb1 100755
--- a/packages/debug/w_scan/build
+++ b/packages/debug/w_scan/build
@@ -6,8 +6,5 @@ cd $PKG_BUILD
./configure --host=$TARGET_NAME \
--build=$HOST_NAME \
--prefix=/usr \
- --enable-shared \
- --disable-static \
- --disable-documentation \
make
diff --git a/packages/debug/w_scan/meta b/packages/debug/w_scan/meta
index 97162d867e..7cddde38cc 100644
--- a/packages/debug/w_scan/meta
+++ b/packages/debug/w_scan/meta
@@ -1,5 +1,5 @@
PKG_NAME="w_scan"
-PKG_VERSION="20101001"
+PKG_VERSION="20101204"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
diff --git a/packages/graphics/Mesa/meta b/packages/graphics/Mesa/meta
index 8dc968ac42..a85a13c024 100644
--- a/packages/graphics/Mesa/meta
+++ b/packages/graphics/Mesa/meta
@@ -16,6 +16,6 @@ PKG_IS_ADDON="no"
PKG_AUTORECONF="yes"
if [ $MESA_MASTER = "yes" ]; then
- PKG_VERSION="20101122"
+ PKG_VERSION="20101205"
PKG_URL="http://sources.openelec.tv/svn/$PKG_NAME-$PKG_VERSION.tar.bz2"
fi
diff --git a/packages/graphics/cairo/build b/packages/graphics/cairo/build
index af4011dca8..e5b4d9b78c 100755
--- a/packages/graphics/cairo/build
+++ b/packages/graphics/cairo/build
@@ -2,14 +2,6 @@
. config/options $1
-# cairo fails to build with graphite support
-# see also http://bugs.gentoo.org/336157
- CFLAGS=`echo $CFLAGS | sed -e "s|-ftree-loop-distribution||"`
- CFLAGS=`echo $CFLAGS | sed -e "s|-floop-interchange||"`
- CFLAGS=`echo $CFLAGS | sed -e "s|-floop-strip-mine||"`
- CFLAGS=`echo $CFLAGS | sed -e "s|-floop-block||"`
- CFLAGS=`echo $CFLAGS | sed -e "s|-fgraphite-identity||"`
-
cd $PKG_BUILD
./configure --host=$TARGET_NAME \
--build=$HOST_NAME \
diff --git a/packages/graphics/libdrm/meta b/packages/graphics/libdrm/meta
index b337349e35..733cc768e0 100644
--- a/packages/graphics/libdrm/meta
+++ b/packages/graphics/libdrm/meta
@@ -16,6 +16,6 @@ PKG_IS_ADDON="no"
PKG_AUTORECONF="yes"
if [ $LIBDRM_MASTER = "yes" ]; then
- PKG_VERSION="20101122"
+ PKG_VERSION="20101205"
PKG_URL="http://sources.openelec.tv/svn/$PKG_NAME-$PKG_VERSION.tar.bz2"
fi
diff --git a/packages/graphics/libpng/meta b/packages/graphics/libpng/meta
index 662596cbac..d5b1f3bc55 100644
--- a/packages/graphics/libpng/meta
+++ b/packages/graphics/libpng/meta
@@ -1,5 +1,5 @@
PKG_NAME="libpng"
-PKG_VERSION="1.4.4"
+PKG_VERSION="1.4.5"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="OSS"
diff --git a/packages/graphics/libpng/patches/libpng-1.4.4-autoconf.patch b/packages/graphics/libpng/patches/libpng-1.4.4-autoconf.patch
deleted file mode 100644
index ac2fb16cd0..0000000000
--- a/packages/graphics/libpng/patches/libpng-1.4.4-autoconf.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -Naur libpng-1.4.4-old/configure.ac libpng-1.4.4-new/configure.ac
---- libpng-1.4.4-old/configure.ac 2010-09-23 05:18:36.000000000 -0700
-+++ libpng-1.4.4-new/configure.ac 2010-09-23 12:20:45.000000000 -0700
-@@ -18,16 +18,16 @@
-
- dnl Version number stuff here:
-
--PNGLIB_VERSION=1.4.4
--PNGLIB_MAJOR=1
--PNGLIB_MINOR=4
--PNGLIB_RELEASE=4
--
- AC_INIT([libpng], [1.4.4], [png-mng-implement@lists.sourceforge.net])
- AM_INIT_AUTOMAKE
- dnl stop configure from automagically running automake
- AM_MAINTAINER_MODE
-
-+PNGLIB_VERSION=1.4.4
-+PNGLIB_MAJOR=1
-+PNGLIB_MINOR=4
-+PNGLIB_RELEASE=4
-+
- dnl End of version number stuff
-
- AC_CONFIG_SRCDIR([pngget.c])
diff --git a/packages/graphics/libpng/patches/libpng-1.4.4-apng.patch b/packages/graphics/libpng/patches/libpng-1.4.5-apng.patch
similarity index 100%
rename from packages/graphics/libpng/patches/libpng-1.4.4-apng.patch
rename to packages/graphics/libpng/patches/libpng-1.4.5-apng.patch
diff --git a/packages/lang/Python/build b/packages/lang/Python/build
index 651a802ad3..e6c98702e1 100755
--- a/packages/lang/Python/build
+++ b/packages/lang/Python/build
@@ -35,6 +35,8 @@ setup_toolchain target
# this fixes problems with expat (maybe)
LDFLAGS=`echo $LDFLAGS | sed -e "s|-Wl,--as-needed||"`
+ strip_lto
+
ac_cv_file_dev_ptc=no \
ac_cv_file_dev_ptmx=yes \
ac_cv_func_lchflags_works=no \
diff --git a/packages/linux-drivers/bcm_sta/patches/bcm_sta-5.60.246.6-02_rename_device-0.1.patch b/packages/linux-drivers/bcm_sta/patches/bcm_sta-5.60.246.6-02_rename_device-0.1.patch
new file mode 100644
index 0000000000..f638abccc2
--- /dev/null
+++ b/packages/linux-drivers/bcm_sta/patches/bcm_sta-5.60.246.6-02_rename_device-0.1.patch
@@ -0,0 +1,24 @@
+diff -Naur bcm_sta-5.60.246.6/x86-32/src/wl/sys/wl_linux.c bcm_sta-5.60.246.6.patch/x86-32/src/wl/sys/wl_linux.c
+--- bcm_sta-5.60.246.6/x86-32/src/wl/sys/wl_linux.c 2010-10-22 04:18:57.000000000 +0200
++++ bcm_sta-5.60.246.6.patch/x86-32/src/wl/sys/wl_linux.c 2010-12-02 05:17:28.037326623 +0100
+@@ -187,7 +187,7 @@
+ static int nompc = 0;
+ module_param(nompc, int, 0);
+
+-static char name[IFNAMSIZ] = "eth%d";
++static char name[IFNAMSIZ] = "wlan%d";
+ module_param_string(name, name, IFNAMSIZ, 0);
+
+ #ifndef SRCBASE
+diff -Naur bcm_sta-5.60.246.6/x86-64/src/wl/sys/wl_linux.c bcm_sta-5.60.246.6.patch/x86-64/src/wl/sys/wl_linux.c
+--- bcm_sta-5.60.246.6/x86-64/src/wl/sys/wl_linux.c 2010-10-22 04:23:55.000000000 +0200
++++ bcm_sta-5.60.246.6.patch/x86-64/src/wl/sys/wl_linux.c 2010-12-02 05:17:42.554495917 +0100
+@@ -187,7 +187,7 @@
+ static int nompc = 0;
+ module_param(nompc, int, 0);
+
+-static char name[IFNAMSIZ] = "eth%d";
++static char name[IFNAMSIZ] = "wlan%d";
+ module_param_string(name, name, IFNAMSIZ, 0);
+
+ #ifndef SRCBASE
diff --git a/packages/linux-drivers/rtl8192se/patches/rtl8192se-0018.1025.2010-remove_nasty_printk.patch b/packages/linux-drivers/rtl8192se/patches/rtl8192se-0018.1025.2010-remove_nasty_printk.patch
new file mode 100644
index 0000000000..1e09a62a02
--- /dev/null
+++ b/packages/linux-drivers/rtl8192se/patches/rtl8192se-0018.1025.2010-remove_nasty_printk.patch
@@ -0,0 +1,12 @@
+diff -Naur orig/HAL/rtl8192/rtl_dm.c rtl8192se-0018.1025.2010/HAL/rtl8192/rtl_dm.c
+--- orig/HAL/rtl8192/rtl_dm.c 2010-10-13 07:24:00.000000000 +0200
++++ rtl8192se-0018.1025.2010/HAL/rtl8192/rtl_dm.c 2010-12-04 23:19:57.529063406 +0100
+@@ -3826,7 +3826,7 @@
+ if(priv->pwrdown)
+ {
+ u1Tmp = read_nic_byte(dev, 0x06);
+- printk("pwrdown, 0x6(BIT6)=%02x\n", u1Tmp);
++ //printk("pwrdown, 0x6(BIT6)=%02x\n", u1Tmp);
+ retval = (u1Tmp & BIT6) ? eRfOn: eRfOff;
+
+ if(u1Tmp == 0xff)
diff --git a/packages/linux-firmware/iwlwifi-1000-ucode/meta b/packages/linux-firmware/iwlwifi-1000-ucode/meta
index 62c9a1ca38..da5d42ad5a 100644
--- a/packages/linux-firmware/iwlwifi-1000-ucode/meta
+++ b/packages/linux-firmware/iwlwifi-1000-ucode/meta
@@ -4,7 +4,8 @@ PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Free-to-use"
PKG_SITE="http://www.intellinuxwireless.org"
-PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+#PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+PKG_URL="http://sources.openelec.tv/svn/$PKG_NAME-$PKG_VERSION.tgz"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional"
diff --git a/packages/linux-firmware/iwlwifi-3945-ucode/meta b/packages/linux-firmware/iwlwifi-3945-ucode/meta
index 090da1f98a..57fd83fec1 100644
--- a/packages/linux-firmware/iwlwifi-3945-ucode/meta
+++ b/packages/linux-firmware/iwlwifi-3945-ucode/meta
@@ -4,7 +4,8 @@ PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Free-to-use"
PKG_SITE="http://www.intellinuxwireless.org"
-PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+#PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+PKG_URL="http://sources.openelec.tv/svn/$PKG_NAME-$PKG_VERSION.tgz"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional"
diff --git a/packages/linux-firmware/iwlwifi-4965-ucode/meta b/packages/linux-firmware/iwlwifi-4965-ucode/meta
index ba4bb1b266..6df3af7de9 100644
--- a/packages/linux-firmware/iwlwifi-4965-ucode/meta
+++ b/packages/linux-firmware/iwlwifi-4965-ucode/meta
@@ -4,7 +4,8 @@ PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Free-to-use"
PKG_SITE="http://www.intellinuxwireless.org"
-PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+#PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+PKG_URL="http://sources.openelec.tv/svn/$PKG_NAME-$PKG_VERSION.tgz"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional"
diff --git a/packages/linux-firmware/iwlwifi-5000-ucode/meta b/packages/linux-firmware/iwlwifi-5000-ucode/meta
index c3c827e3f7..c0102b73ab 100644
--- a/packages/linux-firmware/iwlwifi-5000-ucode/meta
+++ b/packages/linux-firmware/iwlwifi-5000-ucode/meta
@@ -4,7 +4,8 @@ PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Free-to-use"
PKG_SITE="http://www.intellinuxwireless.org"
-PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+#PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+PKG_URL="http://sources.openelec.tv/svn/$PKG_NAME-$PKG_VERSION.tgz"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional"
diff --git a/packages/linux-firmware/iwlwifi-5150-ucode/meta b/packages/linux-firmware/iwlwifi-5150-ucode/meta
index 9702b99003..c6ef8de152 100644
--- a/packages/linux-firmware/iwlwifi-5150-ucode/meta
+++ b/packages/linux-firmware/iwlwifi-5150-ucode/meta
@@ -4,7 +4,8 @@ PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Free-to-use"
PKG_SITE="http://www.intellinuxwireless.org"
-PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+#PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+PKG_URL="http://sources.openelec.tv/svn/$PKG_NAME-$PKG_VERSION.tgz"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional"
diff --git a/packages/linux-firmware/iwlwifi-6000-ucode/meta b/packages/linux-firmware/iwlwifi-6000-ucode/meta
index 11721d05da..4f26365d35 100644
--- a/packages/linux-firmware/iwlwifi-6000-ucode/meta
+++ b/packages/linux-firmware/iwlwifi-6000-ucode/meta
@@ -4,7 +4,8 @@ PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Free-to-use"
PKG_SITE="http://www.intellinuxwireless.org"
-PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+#PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+PKG_URL="http://sources.openelec.tv/svn/$PKG_NAME-$PKG_VERSION.tgz"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional"
diff --git a/packages/linux-firmware/iwlwifi-6050-ucode/meta b/packages/linux-firmware/iwlwifi-6050-ucode/meta
index f7010b38d0..d040bc4eae 100644
--- a/packages/linux-firmware/iwlwifi-6050-ucode/meta
+++ b/packages/linux-firmware/iwlwifi-6050-ucode/meta
@@ -4,7 +4,8 @@ PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="Free-to-use"
PKG_SITE="http://www.intellinuxwireless.org"
-PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+#PKG_URL="http://www.intellinuxwireless.org/iwlwifi/downloads/$PKG_NAME-$PKG_VERSION.tgz"
+PKG_URL="http://sources.openelec.tv/svn/$PKG_NAME-$PKG_VERSION.tgz"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional"
diff --git a/packages/linux/linux-2.6.36.2-051_add_ite-cir_driver-0.2.patch b/packages/linux/linux-2.6.36.2-051_add_ite-cir_driver-0.2.patch
new file mode 100644
index 0000000000..307255ab74
--- /dev/null
+++ b/packages/linux/linux-2.6.36.2-051_add_ite-cir_driver-0.2.patch
@@ -0,0 +1,2992 @@
+diff -Naur linux-2.6.36.2/drivers/media/IR/ite-cir.c linux-2.6.36.2.patch/drivers/media/IR/ite-cir.c
+--- linux-2.6.36.2/drivers/media/IR/ite-cir.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.36.2.patch/drivers/media/IR/ite-cir.c 2010-12-11 23:43:35.587999217 +0100
+@@ -0,0 +1,1334 @@
++/*
++ * Driver for ITE Tech Inc. IT8712F/IT8512 CIR
++ *
++ * Copyright (C) 2010 Juan J. Garcia de Soria
++ *
++ * Based on nuvoton-cir and lirc_it87 drivers.
++ *
++ * 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
++ * 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
++ */
++
++#include
++#include
++#include
++#include
++#include
++#include
++#include
++#include
++#include
++#include
++#include
++
++#include "ite-cir.h"
++
++/* module parameters */
++
++/* debug level */
++static int debug;
++module_param(debug, int, S_IRUGO | S_IWUSR);
++MODULE_PARM_DESC(debug, "Enable debugging output");
++
++/* low limit for RX carrier freq, Hz, 0 for no RX demodulation */
++static int rx_low_carrier_freq;
++module_param(rx_low_carrier_freq, int, S_IRUGO | S_IWUSR);
++MODULE_PARM_DESC(rx_low_carrier_freq, "Override low RX carrier frequency, Hz, \
++0 for no RX demodulation");
++
++/* high limit for RX carrier freq, Hz, 0 for no RX demodulation */
++static int rx_high_carrier_freq;
++module_param(rx_high_carrier_freq, int, S_IRUGO | S_IWUSR);
++MODULE_PARM_DESC(rx_high_carrier_freq, "Override high RX carrier frequency, \
++Hz, 0 for no RX demodulation");
++
++/* override tx carrier frequency */
++static int tx_carrier_freq;
++module_param(tx_carrier_freq, int, S_IRUGO | S_IWUSR);
++MODULE_PARM_DESC(tx_carrier_freq, "Override TX carrier frequency, Hz");
++
++/* override tx duty cycle */
++static int tx_duty_cycle;
++module_param(tx_duty_cycle, int, S_IRUGO | S_IWUSR);
++MODULE_PARM_DESC(tx_duty_cycle, "Override TX duty cycle, 1-100");
++
++/* override default sample period */
++static long sample_period;
++module_param(sample_period, long, S_IRUGO | S_IWUSR);
++MODULE_PARM_DESC(sample_period, "Override carrier sample period, \
++us");
++
++/* override detected model id */
++static int model_number = -1;
++module_param(model_number, int, S_IRUGO | S_IWUSR);
++MODULE_PARM_DESC(model_number, "Use this model number, don't \
++autodetect");
++
++
++/* forward declaration */
++static void ite_set_carrier_params(struct ite_dev *dev);
++
++
++/* IT8712F HW-specific functions */
++
++/* retrieve a bitmask of the current causes for a pending interrupt; this may
++ * be composed of ITE_IRQ_TX_FIFO, ITE_IRQ_RX_FIFO and ITE_IRQ_RX_FIFO_OVERRUN
++ * */
++static int it87_get_irq_causes(struct ite_dev *dev)
++{
++ u8 iflags;
++ int ret = 0;
++
++ /* read the interrupt flags */
++ iflags = inb(dev->cir_addr + IT87_IIR) & IT87_II;
++
++ switch (iflags) {
++ case IT87_II_RXDS:
++ ret = ITE_IRQ_RX_FIFO;
++ break;
++ case IT87_II_RXFO:
++ ret = ITE_IRQ_RX_FIFO_OVERRUN;
++ break;
++ case IT87_II_TXLDL:
++ ret = ITE_IRQ_TX_FIFO;
++ break;
++ }
++
++ return ret;
++}
++
++/* set the carrier parameters; to be called with the spinlock held */
++static void it87_set_carrier_params(struct ite_dev *dev, bool high_freq,
++ bool use_demodulator, u8 carrier_freq_bits, u8 allowance_bits,
++ u8 pulse_width_bits)
++{
++ u8 val;
++
++ /* program the RCR register */
++ val = inb(dev->cir_addr + IT87_RCR)
++ & ~(IT87_HCFS | IT87_RXEND | IT87_RXDCR);
++
++ if (high_freq)
++ val |= IT87_HCFS;
++
++ if (use_demodulator)
++ val |= IT87_RXEND;
++
++ val |= allowance_bits;
++
++ outb(val, dev->cir_addr + IT87_RCR);
++
++ /* program the TCR2 register */
++ outb((carrier_freq_bits << IT87_CFQ_SHIFT) | pulse_width_bits,
++ dev->cir_addr + IT87_TCR2);
++}
++
++/* read up to buf_size bytes from the RX FIFO; to be called with the spinlock
++ * held */
++static int it87_get_rx_bytes(struct ite_dev *dev, u8 *buf, int buf_size)
++{
++ int fifo, read = 0;
++
++ /* read how many bytes are still in the FIFO */
++ fifo = inb(dev->cir_addr + IT87_RSR) & IT87_RXBFC;
++
++ while (fifo > 0 && buf_size > 0) {
++ *(buf++) = inb(dev->cir_addr + IT87_DR);
++ fifo--;
++ read++;
++ buf_size--;
++ }
++
++ return read;
++}
++
++/* return how many bytes we can send through the FIFO; this will be called
++ * with the device spinlock NOT HELD while waiting for the TX FIFO to get
++ * empty; let's expect this won't be a problem */
++static int it87_get_tx_free_slots(struct ite_dev *dev)
++{
++ return inb(dev->cir_addr + IT87_TSR) & IT87_TXBFC;
++}
++
++/* put a byte to the TX fifo; this should be called with the spinlock held */
++static void it87_put_tx_byte(struct ite_dev *dev, u8 value)
++{
++ outb(value, dev->cir_addr + IT87_DR);
++}
++
++/* idle the receiver so that we won't receive samples until another
++ pulse is detected; this must be called with the device spinlock held */
++static void it87_idle_rx(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* disable streaming by clearing RXACT writing it as 1 */
++ outb(inb(dev->cir_addr + IT87_RCR) | IT87_RXACT,
++ dev->cir_addr + IT87_RCR);
++
++ /* clear the FIFO */
++ outb(inb(dev->cir_addr + IT87_TCR1) | IT87_FIFOCLR,
++ dev->cir_addr + IT87_TCR1);
++}
++
++/* disable the receiver; this must be called with the device spinlock held */
++static void it87_disable_rx(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* disable the receiver interrupts */
++ outb(inb(dev->cir_addr + IT87_IER) & ~(IT87_RDAIE | IT87_RFOIE),
++ dev->cir_addr + IT87_IER);
++
++ /* disable the receiver */
++ outb(inb(dev->cir_addr + IT87_RCR) & ~IT87_RXEN,
++ dev->cir_addr + IT87_RCR);
++
++ /* clear the FIFO and RXACT (actually RXACT should have been cleared
++ * in the previous outb() call) */
++ it87_idle_rx(dev);
++}
++
++/* enable the receiver; this must be called with the device spinlock held */
++static void it87_enable_rx(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* enable the receiver by setting RXEN */
++ outb(inb(dev->cir_addr + IT87_RCR) | IT87_RXEN,
++ dev->cir_addr + IT87_RCR);
++
++ /* just prepare it to idle for the next reception */
++ it87_idle_rx(dev);
++
++ /* enable the receiver interrupts and master enable flag */
++ outb(inb(dev->cir_addr + IT87_IER)
++ | IT87_RDAIE | IT87_RFOIE | IT87_IEC,
++ dev->cir_addr + IT87_IER);
++}
++
++/* disable the transmitter interrupt; this must be called with the device
++ * spinlock held */
++static void it87_disable_tx_interrupt(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* disable the transmitter interrupts */
++ outb(inb(dev->cir_addr + IT87_IER) & ~IT87_TLDLIE,
++ dev->cir_addr + IT87_IER);
++}
++
++/* enable the transmitter interrupt; this must be called with the device
++ * spinlock held */
++static void it87_enable_tx_interrupt(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* enable the transmitter interrupts and master enable flag */
++ outb(inb(dev->cir_addr + IT87_IER)
++ | IT87_TLDLIE | IT87_IEC,
++ dev->cir_addr + IT87_IER);
++}
++
++/* disable the device; this must be called with the device spinlock held */
++static void it87_disable(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* clear out all interrupt enable flags */
++ outb(inb(dev->cir_addr + IT87_IER) & ~(IT87_IEC | IT87_RFOIE |
++ IT87_RDAIE | IT87_TLDLIE), dev->cir_addr + IT87_IER);
++
++ /* disable the receiver */
++ it87_disable_rx(dev);
++
++ /* erase the FIFO */
++ outb(IT87_FIFOCLR | inb(dev->cir_addr + IT87_TCR1),
++ dev->cir_addr + IT87_TCR1);
++}
++
++/* initialize the hardware */
++static void it87_init_hardware(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* enable just the baud rate divisor register,
++ disabling all the interrupts at the same time */
++ outb((inb(dev->cir_addr + IT87_IER) & ~(IT87_IEC | IT87_RFOIE |
++ IT87_RDAIE | IT87_TLDLIE)) | IT87_BR,
++ dev->cir_addr + IT87_IER);
++
++ /* write out the baud rate divisor */
++ outb(ITE_BAUDRATE_DIVISOR & 0xff, dev->cir_addr + IT87_BDLR);
++ outb((ITE_BAUDRATE_DIVISOR >> 8) & 0xff, dev->cir_addr + IT87_BDHR);
++
++ /* disable the baud rate divisor register again */
++ outb(inb(dev->cir_addr + IT87_IER) & ~IT87_BR,
++ dev->cir_addr + IT87_IER);
++
++ /* program the RCR register defaults */
++ outb(ITE_RXDCR_DEFAULT, dev->cir_addr + IT87_RCR);
++
++ /* program the TCR1 register */
++ outb(IT87_TXMPM_DEFAULT
++ | IT87_TXENDF
++ | IT87_TXRLE
++ | IT87_FIFOTL_DEFAULT
++ | IT87_FIFOCLR, dev->cir_addr + IT87_TCR1);
++
++ /* program the carrier parameters */
++ ite_set_carrier_params(dev);
++}
++
++/* IT8512F on ITE8708 HW-specific functions */
++
++/* retrieve a bitmask of the current causes for a pending interrupt; this may
++ * be composed of ITE_IRQ_TX_FIFO, ITE_IRQ_RX_FIFO and ITE_IRQ_RX_FIFO_OVERRUN
++ * */
++static int it8708_get_irq_causes(struct ite_dev *dev)
++{
++ u8 iflags;
++ int ret = 0;
++
++ /* read the interrupt flags */
++ iflags = inb(dev->cir_addr + IT8708_C0IIR);
++
++ if (iflags & IT85_TLDLI)
++ ret |= ITE_IRQ_TX_FIFO;
++ if (iflags & IT85_RDAI)
++ ret |= ITE_IRQ_RX_FIFO;
++ if (iflags & IT85_RFOI)
++ ret |= ITE_IRQ_RX_FIFO_OVERRUN;
++
++ return ret;
++}
++
++/* set the carrier parameters; to be called with the spinlock held */
++static void it8708_set_carrier_params(struct ite_dev *dev, bool high_freq,
++ bool use_demodulator, u8 carrier_freq_bits, u8 allowance_bits,
++ u8 pulse_width_bits)
++{
++ u8 val;
++
++ /* program the C0CFR register, with HRAE=1 */
++ outb(inb(dev->cir_addr + IT8708_BANKSEL) | IT8708_HRAE, dev->cir_addr
++ + IT8708_BANKSEL);
++
++ val = (inb(dev->cir_addr + IT8708_C0CFR)
++ & ~(IT85_HCFS | IT85_CFQ)) | carrier_freq_bits;
++
++ if (high_freq)
++ val |= IT85_HCFS;
++
++ outb(val, dev->cir_addr + IT8708_C0CFR);
++
++ outb(inb(dev->cir_addr + IT8708_BANKSEL) & ~IT8708_HRAE, dev->cir_addr
++ + IT8708_BANKSEL);
++
++ /* program the C0RCR register */
++ val = inb(dev->cir_addr + IT8708_C0RCR)
++ & ~(IT85_RXEND | IT85_RXDCR);
++
++ if (use_demodulator)
++ val |= IT85_RXEND;
++
++ val |= allowance_bits;
++
++ outb(val, dev->cir_addr + IT8708_C0RCR);
++
++ /* program the C0TCR register */
++ val = inb(dev->cir_addr + IT8708_C0TCR) & ~IT85_TXMPW;
++ val |= pulse_width_bits;
++ outb(val, dev->cir_addr + IT8708_C0TCR);
++}
++
++/* read up to buf_size bytes from the RX FIFO; to be called with the spinlock
++ * held */
++static int it8708_get_rx_bytes(struct ite_dev *dev, u8 *buf, int buf_size)
++{
++ int fifo, read = 0;
++
++ /* read how many bytes are still in the FIFO */
++ fifo = inb(dev->cir_addr + IT8708_C0RFSR) & IT85_RXFBC;
++
++ while (fifo > 0 && buf_size > 0) {
++ *(buf++) = inb(dev->cir_addr + IT8708_C0DR);
++ fifo--;
++ read++;
++ buf_size--;
++ }
++
++ return read;
++}
++
++/* return how many bytes we can send through the FIFO; this will be called
++ * with the device spinlock NOT HELD while waiting for the TX FIFO to get
++ * empty; let's expect this won't be a problem */
++static int it8708_get_tx_free_slots(struct ite_dev *dev)
++{
++ return inb(dev->cir_addr + IT8708_C0TFSR) & IT85_TXFBC;
++}
++
++/* put a byte to the TX fifo; this should be called with the spinlock held */
++static void it8708_put_tx_byte(struct ite_dev *dev, u8 value)
++{
++ outb(value, dev->cir_addr + IT8708_C0DR);
++}
++
++/* idle the receiver so that we won't receive samples until another
++ pulse is detected; this must be called with the device spinlock held */
++static void it8708_idle_rx(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* disable streaming by clearing RXACT writing it as 1 */
++ outb(inb(dev->cir_addr + IT8708_C0RCR) | IT85_RXACT,
++ dev->cir_addr + IT8708_C0RCR);
++
++ /* clear the FIFO */
++ outb(inb(dev->cir_addr + IT8708_C0MSTCR) | IT85_FIFOCLR,
++ dev->cir_addr + IT8708_C0MSTCR);
++}
++
++/* disable the receiver; this must be called with the device spinlock held */
++static void it8708_disable_rx(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* disable the receiver interrupts */
++ outb(inb(dev->cir_addr + IT8708_C0IER) & ~(IT85_RDAIE | IT85_RFOIE),
++ dev->cir_addr + IT8708_C0IER);
++
++ /* disable the receiver */
++ outb(inb(dev->cir_addr + IT8708_C0RCR) & ~IT85_RXEN,
++ dev->cir_addr + IT8708_C0RCR);
++
++ /* clear the FIFO and RXACT (actually RXACT should have been cleared
++ * in the previous outb() call) */
++ it8708_idle_rx(dev);
++}
++
++/* enable the receiver; this must be called with the device spinlock held */
++static void it8708_enable_rx(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* enable the receiver by setting RXEN */
++ outb(inb(dev->cir_addr + IT8708_C0RCR) | IT85_RXEN,
++ dev->cir_addr + IT8708_C0RCR);
++
++ /* just prepare it to idle for the next reception */
++ it8708_idle_rx(dev);
++
++ /* enable the receiver interrupts and master enable flag */
++ outb(inb(dev->cir_addr + IT8708_C0IER)
++ | IT85_RDAIE | IT85_RFOIE | IT85_IEC,
++ dev->cir_addr + IT8708_C0IER);
++}
++
++/* disable the transmitter interrupt; this must be called with the device
++ * spinlock held */
++static void it8708_disable_tx_interrupt(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* disable the transmitter interrupts */
++ outb(inb(dev->cir_addr + IT8708_C0IER) & ~IT85_TLDLIE,
++ dev->cir_addr + IT8708_C0IER);
++}
++
++/* enable the transmitter interrupt; this must be called with the device
++ * spinlock held */
++static void it8708_enable_tx_interrupt(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* enable the transmitter interrupts and master enable flag */
++ outb(inb(dev->cir_addr + IT8708_C0IER)
++ | IT85_TLDLIE | IT85_IEC,
++ dev->cir_addr + IT8708_C0IER);
++}
++
++/* disable the device; this must be called with the device spinlock held */
++static void it8708_disable(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* clear out all interrupt enable flags */
++ outb(inb(dev->cir_addr + IT8708_C0IER) & ~(IT85_IEC | IT85_RFOIE |
++ IT85_RDAIE | IT85_TLDLIE), dev->cir_addr + IT8708_C0IER);
++
++ /* disable the receiver */
++ it8708_disable_rx(dev);
++
++ /* erase the FIFO */
++ outb(IT85_FIFOCLR | inb(dev->cir_addr + IT8708_C0MSTCR),
++ dev->cir_addr + IT8708_C0MSTCR);
++}
++
++/* initialize the hardware */
++static void it8708_init_hardware(struct ite_dev *dev)
++{
++ ite_dbg("%s called", __func__);
++
++ /* disable all the interrupts */
++ outb(inb(dev->cir_addr + IT8708_C0IER) & ~(IT85_IEC | IT85_RFOIE |
++ IT85_RDAIE | IT85_TLDLIE), dev->cir_addr + IT8708_C0IER);
++
++ /* program the baud rate divisor */
++ outb(inb(dev->cir_addr + IT8708_BANKSEL) | IT8708_HRAE, dev->cir_addr
++ + IT8708_BANKSEL);
++
++ outb(ITE_BAUDRATE_DIVISOR & 0xff, dev->cir_addr + IT8708_C0BDLR);
++ outb((ITE_BAUDRATE_DIVISOR >> 8) & 0xff,
++ dev->cir_addr + IT8708_C0BDHR);
++
++ outb(inb(dev->cir_addr + IT8708_BANKSEL) & ~IT8708_HRAE, dev->cir_addr
++ + IT8708_BANKSEL);
++
++
++ /* program the C0MSTCR register defaults */
++ outb((inb(dev->cir_addr + IT8708_C0MSTCR) & ~(IT85_ILSEL | IT85_ILE |
++ IT85_FIFOTL | IT85_FIFOCLR | IT85_RESET)) |
++ IT85_FIFOTL_DEFAULT, dev->cir_addr + IT8708_C0MSTCR);
++
++ /* program the C0RCR register defaults */
++ outb((inb(dev->cir_addr + IT8708_C0RCR) & ~(IT85_RXEN | IT85_RDWOS |
++ IT85_RXEND | IT85_RXACT | IT85_RXDCR)) |
++ ITE_RXDCR_DEFAULT, dev->cir_addr + IT8708_C0RCR);
++
++ /* program the C0TCR register defaults */
++ outb((inb(dev->cir_addr + IT8708_C0TCR) & ~(IT85_TXMPM | IT85_TXMPW))
++ | IT85_TXRLE | IT85_TXENDF | IT85_TXMPM_DEFAULT |
++ IT85_TXMPW_DEFAULT, dev->cir_addr + IT8708_C0TCR);
++
++ /* program the carrier parameters */
++ ite_set_carrier_params(dev);
++}
++
++
++
++
++/* supported models and their parameters */
++static const struct ite_dev_params ite_dev_descs[] = {
++ { /* 0: ITE8704, ITE8713 */
++ .model = "ITE8704/ITE8713 CIR transceiver",
++ .io_region_size = IT87_IOREG_LENGTH,
++ .hw_tx_capable = true,
++ .sample_period = (u32)(1000000000ULL / 115200),
++ .tx_carrier_freq = 38000,
++ .tx_duty_cycle = 33,
++ .rx_low_carrier_freq = 0,
++ .rx_high_carrier_freq = 0,
++
++ /* operations */
++ .get_irq_causes = it87_get_irq_causes,
++ .enable_rx = it87_enable_rx,
++ .idle_rx = it87_idle_rx,
++ .disable_rx = it87_idle_rx,
++ .get_rx_bytes = it87_get_rx_bytes,
++ .enable_tx_interrupt = it87_enable_tx_interrupt,
++ .disable_tx_interrupt = it87_disable_tx_interrupt,
++ .get_tx_free_slots = it87_get_tx_free_slots,
++ .put_tx_byte = it87_put_tx_byte,
++ .disable = it87_disable,
++ .init_hardware = it87_init_hardware,
++ .set_carrier_params = it87_set_carrier_params,
++ },
++ { /* 1: ITE8708 */
++ .model = "ITE8708 CIR transceiver",
++ .io_region_size = IT8708_IOREG_LENGTH,
++ .hw_tx_capable = true,
++ .sample_period = (u32)(1000000000ULL / 115200),
++ .tx_carrier_freq = 38000,
++ .tx_duty_cycle = 33,
++ .rx_low_carrier_freq = 0,
++ .rx_high_carrier_freq = 0,
++
++ /* operations */
++ .get_irq_causes = it8708_get_irq_causes,
++ .enable_rx = it8708_enable_rx,
++ .idle_rx = it8708_idle_rx,
++ .disable_rx = it8708_idle_rx,
++ .get_rx_bytes = it8708_get_rx_bytes,
++ .enable_tx_interrupt = it8708_enable_tx_interrupt,
++ .disable_tx_interrupt = it8708_disable_tx_interrupt,
++ .get_tx_free_slots = it8708_get_tx_free_slots,
++ .put_tx_byte = it8708_put_tx_byte,
++ .disable = it8708_disable,
++ .init_hardware = it8708_init_hardware,
++ .set_carrier_params = it8708_set_carrier_params,
++ },
++};
++
++/* HW-independent code functions */
++
++/* check whether carrier frequency is high frequency */
++static inline bool ite_is_high_carrier_freq(unsigned int freq)
++{
++ return freq >= ITE_HCF_MIN_CARRIER_FREQ;
++}
++
++/* get the bits required to program the carrier frequency in CFQ bits,
++ * unshifted */
++static u8 ite_get_carrier_freq_bits(unsigned int freq)
++{
++ if (ite_is_high_carrier_freq(freq)) {
++ if (freq < 425000)
++ return ITE_CFQ_400;
++ else if (freq < 465000)
++ return ITE_CFQ_450;
++ else if (freq < 490000)
++ return ITE_CFQ_480;
++ else
++ return ITE_CFQ_500;
++ } else {
++ /* trim to limits */
++ if (freq < ITE_LCF_MIN_CARRIER_FREQ)
++ freq = ITE_LCF_MIN_CARRIER_FREQ;
++ if (freq > ITE_LCF_MAX_CARRIER_FREQ)
++ freq = ITE_LCF_MAX_CARRIER_FREQ;
++
++ /* convert to kHz and subtract the base freq */
++ freq = DIV_ROUND_CLOSEST(freq - ITE_LCF_MIN_CARRIER_FREQ,
++ 1000);
++
++ return (u8) freq;
++ }
++}
++
++/* get the bits required to program the pulse with in TXMPW */
++static u8 ite_get_pulse_width_bits(unsigned int freq, int duty_cycle)
++{
++ unsigned long period_ns, on_ns;
++
++ /* sanitize freq into range */
++ if (freq < ITE_LCF_MIN_CARRIER_FREQ)
++ freq = ITE_LCF_MIN_CARRIER_FREQ;
++ if (freq > ITE_HCF_MAX_CARRIER_FREQ)
++ freq = ITE_HCF_MAX_CARRIER_FREQ;
++
++ period_ns = 1000000000UL / freq;
++ on_ns = period_ns * duty_cycle / 100;
++
++ if (ite_is_high_carrier_freq(freq)) {
++ if (on_ns < 750)
++ return ITE_TXMPW_A;
++ else if (on_ns < 850)
++ return ITE_TXMPW_B;
++ else if (on_ns < 950)
++ return ITE_TXMPW_C;
++ else if (on_ns < 1080)
++ return ITE_TXMPW_D;
++ else
++ return ITE_TXMPW_E;
++ } else {
++ if (on_ns < 6500)
++ return ITE_TXMPW_A;
++ else if (on_ns < 7850)
++ return ITE_TXMPW_B;
++ else if (on_ns < 9650)
++ return ITE_TXMPW_C;
++ else if (on_ns < 11950)
++ return ITE_TXMPW_D;
++ else
++ return ITE_TXMPW_E;
++ }
++}
++
++/* set all the rx/tx carrier parameters; this must be called with the device
++ * spinlock held */
++static void ite_set_carrier_params(struct ite_dev *dev)
++{
++ unsigned int freq, low_freq, high_freq;
++ int allowance;
++ bool use_demodulator;
++ bool for_tx = dev->transmitting;
++
++ ite_dbg("%s called", __func__);
++
++ if (for_tx) {
++ /* we don't need no stinking calculations */
++ freq = dev->params.tx_carrier_freq;
++ allowance = ITE_RXDCR_DEFAULT;
++ use_demodulator = false;
++ } else {
++ low_freq = dev->params.rx_low_carrier_freq;
++ high_freq = dev->params.rx_high_carrier_freq;
++
++ if (low_freq == 0) {
++ /* don't demodulate */
++ freq = ITE_DEFAULT_CARRIER_FREQ;
++ allowance = ITE_RXDCR_DEFAULT;
++ use_demodulator = false;
++ } else {
++ /* calculate the middle freq */
++ freq = (low_freq + high_freq) / 2;
++
++ /* calculate the allowance */
++ allowance = DIV_ROUND_CLOSEST(
++ 10000 * (high_freq - low_freq),
++ ITE_RXDCR_PER_10000_STEP *
++ (high_freq + low_freq));
++
++ if (allowance < 1)
++ allowance = 1;
++ if (allowance > ITE_RXDCR_MAX)
++ allowance = ITE_RXDCR_MAX;
++ }
++ }
++
++ /* set the carrier parameters in a device-dependent way */
++ dev->params.set_carrier_params(dev, ite_is_high_carrier_freq(freq),
++ use_demodulator, ite_get_carrier_freq_bits(freq), allowance,
++ ite_get_pulse_width_bits(freq, dev->params.tx_duty_cycle));
++}
++
++/* decode raw bytes as received by the hardware, and push them to the ir-core
++ * layer */
++static void ite_decode_bytes(struct ite_dev *dev, const u8 *data, int
++ length)
++{
++ u32 sample_period;
++ unsigned long *ldata;
++ unsigned int next_one, next_zero, size;
++ DEFINE_IR_RAW_EVENT(ev);
++
++ if (length == 0)
++ return;
++
++ sample_period = dev->params.sample_period;
++ ldata = (unsigned long *) data;
++ size = length << 3;
++ next_one = generic_find_next_le_bit(ldata, size, 0);
++ if (next_one > 0) {
++ ev.pulse = true;
++ ev.duration = ITE_BITS_TO_NS(next_one, sample_period);
++ ir_raw_event_store_with_filter(dev->rdev, &ev);
++ }
++
++ while (next_one < size) {
++ next_zero = generic_find_next_zero_le_bit(ldata,
++ size, next_one + 1);
++ ev.pulse = false;
++ ev.duration = ITE_BITS_TO_NS(next_zero - next_one,
++ sample_period);
++ ir_raw_event_store_with_filter(dev->rdev, &ev);
++
++ if (next_zero < size) {
++ next_one = generic_find_next_le_bit(ldata,
++ size, next_zero + 1);
++ ev.pulse = true;
++ ev.duration = ITE_BITS_TO_NS(next_one - next_zero,
++ sample_period);
++ ir_raw_event_store_with_filter(dev->rdev, &ev);
++ } else
++ next_one = size;
++ }
++
++ ir_raw_event_handle(dev->rdev);
++
++ ite_dbg_verbose("decoded %d bytes.", length);
++}
++
++/* interrupt service routine for incoming and outgoing CIR data */
++static irqreturn_t ite_cir_isr(int irq, void *data)
++{
++ struct ite_dev *dev = data;
++ unsigned long flags;
++ irqreturn_t ret = IRQ_RETVAL(IRQ_NONE);
++ u8 rx_buf[ITE_RX_FIFO_LEN];
++ int rx_bytes;
++ int iflags;
++
++ ite_dbg_verbose("%s firing", __func__);
++
++ /* grab the spinlock */
++ spin_lock_irqsave(&dev->lock, flags);
++
++ /* read the interrupt flags */
++ iflags = dev->params.get_irq_causes(dev);
++
++ /* check for the receive interrupt */
++ if (iflags & (ITE_IRQ_RX_FIFO | ITE_IRQ_RX_FIFO_OVERRUN)) {
++ /* read the FIFO bytes */
++ rx_bytes = dev->params.get_rx_bytes(dev, rx_buf,
++ ITE_RX_FIFO_LEN);
++
++ if (rx_bytes > 0) {
++ /* drop the spinlock, since the ir-core layer
++ * may call us back again through
++ * ite_s_idle() */
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ /* decode the data we've just received */
++ ite_decode_bytes(dev, rx_buf, rx_bytes);
++
++ /* reacquire the spinlock */
++ spin_lock_irqsave(&dev->lock, flags);
++
++ /* mark the interrupt as serviced */
++ ret = IRQ_RETVAL(IRQ_HANDLED);
++ }
++ } else if (iflags & ITE_IRQ_TX_FIFO) {
++ /* FIFO space available interrupt */
++ ite_dbg_verbose("got interrupt for TX FIFO");
++
++ /* wake any sleeping transmitter */
++ wake_up_interruptible(&dev->tx_queue);
++
++ /* mark the interrupt as serviced */
++ ret = IRQ_RETVAL(IRQ_HANDLED);
++ }
++
++ /* drop the spinlock */
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ ite_dbg_verbose("%s done returning %d", __func__, (int) ret);
++
++ return ret;
++}
++
++
++/* set the rx carrier freq range, guess it's in Hz... */
++static int ite_set_rx_carrier_range(struct ir_dev *rcdev, u32 carrier_low, u32
++ carrier_high)
++{
++ unsigned long flags;
++ struct ite_dev *dev = rcdev->priv;
++
++ spin_lock_irqsave(&dev->lock, flags);
++ dev->params.rx_low_carrier_freq = carrier_low;
++ dev->params.rx_high_carrier_freq = carrier_high;
++ ite_set_carrier_params(dev);
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ return 0;
++}
++
++
++/* set the tx carrier freq, guess it's in Hz... */
++static int ite_set_tx_carrier(struct ir_dev *rcdev, u32 carrier)
++{
++ unsigned long flags;
++ struct ite_dev *dev = rcdev->priv;
++
++ spin_lock_irqsave(&dev->lock, flags);
++ dev->params.tx_carrier_freq = carrier;
++ ite_set_carrier_params(dev);
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ return 0;
++}
++
++/* set the tx duty cycle by controlling the pulse width */
++static int ite_set_tx_duty_cycle(struct ir_dev *rcdev, u32 duty_cycle)
++{
++ unsigned long flags;
++ struct ite_dev *dev = rcdev->priv;
++
++ spin_lock_irqsave(&dev->lock, flags);
++ dev->params.tx_duty_cycle = duty_cycle;
++ ite_set_carrier_params(dev);
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ return 0;
++}
++
++/* transmit out IR pulses; what you get here is a batch of alternating
++ * pulse/space/pulse/space lengths that we should write out completely through
++ * the FIFO, blocking on a full FIFO */
++static int ite_tx_ir(struct ir_dev *rcdev, int *txbuf, u32 n)
++{
++ unsigned long flags;
++ struct ite_dev *dev = rcdev->priv;
++ bool is_pulse = false;
++ int remaining_us, fifo_avail, fifo_remaining, last_idx = 0;
++ int max_rle_us, next_rle_us;
++ int ret = n;
++ u8 last_sent[ITE_TX_FIFO_LEN];
++ u8 val;
++
++ ite_dbg("%s called", __func__);
++
++ /* clear the array just in case */
++ memset(last_sent, 0, ARRAY_SIZE(last_sent));
++
++ /* n comes in bytes; convert to ints */
++ n /= sizeof(int);
++
++ spin_lock_irqsave(&dev->lock, flags);
++
++ /* let everybody know we're now transmitting */
++ dev->transmitting = true;
++
++ /* and set the carrier values for transmission */
++ ite_set_carrier_params(dev);
++
++ /* calculate how much time we can send in one byte */
++ max_rle_us = (ITE_BAUDRATE_DIVISOR * dev->params.sample_period *
++ ITE_TX_MAX_RLE) / 1000;
++
++ /* disable the receiver */
++ dev->params.disable_rx(dev);
++
++ /* this is where we'll begin filling in the FIFO, until it's full.
++ * then we'll just activate the interrupt, wait for it to wake us up
++ * again, disable it, continue filling the FIFO... until everything
++ * has been pushed out */
++ fifo_avail = dev->params.get_tx_free_slots(dev);
++
++ while (n > 0 && dev->in_use) {
++ /* transmit the next sample */
++ is_pulse = !is_pulse;
++ remaining_us = *(txbuf++);
++ n--;
++
++ /* repeat while the pulse is non-zero length */
++ while (remaining_us > 0 && dev->in_use) {
++ if (remaining_us > max_rle_us)
++ next_rle_us = max_rle_us;
++ else
++ next_rle_us = remaining_us;
++ remaining_us -= next_rle_us;
++
++ /* check what's the length we have to pump out */
++ val = (ITE_TX_MAX_RLE * next_rle_us) / max_rle_us;
++
++ /* put it into the sent buffer */
++ last_sent[last_idx++] = val;
++ last_idx &= (ITE_TX_FIFO_LEN);
++
++ /* encode it for 7 bits */
++ val = (val - 1) & ITE_TX_RLE_MASK;
++
++ /* take into account pulse/space prefix */
++ if (is_pulse)
++ val |= ITE_TX_PULSE;
++ else
++ val |= ITE_TX_SPACE;
++
++ /* if we get to 0 available, read again, just in case
++ * some other slot got freed */
++ if (fifo_avail <= 0) {
++ fifo_avail =
++ dev->params.get_tx_free_slots(dev);
++ }
++
++ /* if it's still full */
++ if (fifo_avail <= 0) {
++ /* enable the tx interrupt */
++ dev->params.enable_tx_interrupt(dev);
++
++ /* drop the spinlock */
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ /* wait for the FIFO to empty enough */
++ wait_event_interruptible(dev->tx_queue,
++ (fifo_avail =
++ dev->params.get_tx_free_slots(dev))
++ >= 8);
++
++ /* get the spinlock again */
++ spin_lock_irqsave(&dev->lock, flags);
++
++ /* disable the tx interrupt again. */
++ dev->params.disable_tx_interrupt(dev);
++ }
++
++ /* now send the byte through the FIFO */
++ dev->params.put_tx_byte(dev, val);
++ fifo_avail--;
++ }
++ }
++
++ /* wait and don't return until the whole FIFO has been sent out;
++ * otherwise we could configure the RX carrier params instead of the
++ * TX ones while the transmission is still being performed! */
++ fifo_remaining = ITE_TX_FIFO_LEN -
++ dev->params.get_tx_free_slots(dev);
++ remaining_us = 0;
++ while (fifo_remaining > 0) {
++ fifo_remaining--;
++ last_idx--;
++ last_idx &= (ITE_TX_FIFO_LEN - 1);
++ remaining_us += last_sent[last_idx];
++ }
++ remaining_us = (remaining_us * max_rle_us) / (ITE_TX_MAX_RLE);
++
++ /* drop the spinlock while we sleep */
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ /* sleep remaining_us microseconds */
++ mdelay(DIV_ROUND_UP(remaining_us, 1000));
++
++ /* reacquire the spinlock */
++ spin_lock_irqsave(&dev->lock, flags);
++
++ /* now we're not transmitting anymore */
++ dev->transmitting = false;
++
++ /* and set the carrier values for reception */
++ ite_set_carrier_params(dev);
++
++ /* reenable the receiver */
++ if (dev->in_use)
++ dev->params.enable_rx(dev);
++
++ /* notify transmission end */
++ wake_up_interruptible(&dev->tx_ended);
++
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ return ret;
++}
++
++/* idle the receiver if needed */
++static void ite_s_idle(struct ir_dev *rcdev, bool enable)
++{
++ unsigned long flags;
++ struct ite_dev *dev = rcdev->priv;
++
++ ite_dbg("%s called", __func__);
++
++ if (enable) {
++ spin_lock_irqsave(&dev->lock, flags);
++ dev->params.idle_rx(dev);
++ spin_unlock_irqrestore(&dev->lock, flags);
++ }
++}
++
++/* activate the device for use */
++static int ite_open(struct ir_dev *rcdev)
++{
++ struct ite_dev *dev = rcdev->priv;
++ unsigned long flags;
++
++ ite_dbg("%s called", __func__);
++
++ spin_lock_irqsave(&dev->lock, flags);
++ dev->in_use = true;
++
++ /* enable the receiver */
++ dev->params.enable_rx(dev);
++
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ return 0;
++}
++
++/* deactivate the device for use */
++static void ite_close(struct ir_dev *rcdev)
++{
++ struct ite_dev *dev = rcdev->priv;
++ unsigned long flags;
++
++ ite_dbg("%s called", __func__);
++
++ spin_lock_irqsave(&dev->lock, flags);
++ dev->in_use = false;
++
++ /* wait for any transmission to end */
++ spin_unlock_irqrestore(&dev->lock, flags);
++ wait_event_interruptible(dev->tx_ended, !dev->transmitting);
++ spin_lock_irqsave(&dev->lock, flags);
++
++ dev->params.disable(dev);
++
++ spin_unlock_irqrestore(&dev->lock, flags);
++}
++
++/* allocate memory, probe hardware, and initialize everything */
++static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
++ *dev_id)
++{
++ const struct ite_dev_params *dev_desc = NULL;
++ struct ite_dev *itdev = NULL;
++ struct ir_dev *rdev = NULL;
++ int ret = -ENOMEM;
++ int model_no;
++
++ ite_dbg("%s called", __func__);
++
++ itdev = kzalloc(sizeof(struct ite_dev), GFP_KERNEL);
++ if (!itdev)
++ return ret;
++
++ /* input device for IR remote (and tx) */
++ rdev = rc_allocate_device();
++ if (!rdev)
++ goto failure;
++
++ ret = -ENODEV;
++
++
++ /* get the model number */
++ model_no = (int) dev_id->driver_data;
++ ite_pr(KERN_NOTICE, "Auto-detected model: %s\n",
++ ite_dev_descs[model_no].model);
++
++ if (model_number >= 0 && model_number
++ < ARRAY_SIZE(ite_dev_descs)) {
++ model_no = model_number;
++ ite_pr(KERN_NOTICE, "The model has been fixed by a module \
++parameter.");
++ }
++
++ ite_pr(KERN_NOTICE, "Using model: %s\n",
++ ite_dev_descs[model_no].model);
++
++ /* get the description for the device */
++ dev_desc = &ite_dev_descs[model_no];
++
++
++ /* validate pnp resources */
++ if (!pnp_port_valid(pdev, 0) ||
++ pnp_port_len(pdev, 0) != dev_desc->io_region_size) {
++ dev_err(&pdev->dev, "IR PNP Port not valid!\n");
++ goto failure;
++ }
++
++ if (!pnp_irq_valid(pdev, 0)) {
++ dev_err(&pdev->dev, "PNP IRQ not valid!\n");
++ goto failure;
++ }
++
++ /* store resource values */
++ itdev->cir_addr = pnp_port_start(pdev, 0);
++ itdev->cir_irq = pnp_irq(pdev, 0);
++
++ /* initialize spinlocks */
++ spin_lock_init(&itdev->lock);
++
++ /* initialize raw event */
++ init_ir_raw_event(&itdev->rawir);
++
++ ret = -EBUSY;
++ /* now claim resources */
++ if (!request_region(itdev->cir_addr,
++ dev_desc->io_region_size, ITE_DRIVER_NAME))
++ goto failure;
++
++ if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
++ ITE_DRIVER_NAME, (void *)itdev))
++ goto failure;
++
++ /* set driver data into the pnp device */
++ pnp_set_drvdata(pdev, itdev);
++ itdev->pdev = pdev;
++
++ /* initialize waitqueues for transmission */
++ init_waitqueue_head(&itdev->tx_queue);
++ init_waitqueue_head(&itdev->tx_ended);
++
++ /* copy model-specific parameters */
++ itdev->params = *dev_desc;
++
++ /* apply any overrides */
++ if (sample_period > 0)
++ itdev->params.sample_period = sample_period;
++
++ if (tx_carrier_freq > 0)
++ itdev->params.tx_carrier_freq = tx_carrier_freq;
++
++ if (tx_duty_cycle > 0 && tx_duty_cycle <= 100)
++ itdev->params.tx_duty_cycle = tx_duty_cycle;
++
++ if (rx_low_carrier_freq > 0)
++ itdev->params.rx_low_carrier_freq = rx_low_carrier_freq;
++
++ if (rx_high_carrier_freq > 0)
++ itdev->params.rx_high_carrier_freq = rx_high_carrier_freq;
++
++ /* print out parameters */
++ ite_pr(KERN_NOTICE, "TX-capable: %d\n", (int)
++ itdev->params.hw_tx_capable);
++ ite_pr(KERN_NOTICE, "Sample period (ns): %ld\n", (long)
++ itdev->params.sample_period);
++ ite_pr(KERN_NOTICE, "TX carrier frequency (Hz): %d\n", (int)
++ itdev->params.tx_carrier_freq);
++ ite_pr(KERN_NOTICE, "TX duty cycle (%%): %d\n", (int)
++ itdev->params.tx_duty_cycle);
++ ite_pr(KERN_NOTICE, "RX low carrier frequency (Hz): %d\n", (int)
++ itdev->params.rx_low_carrier_freq);
++ ite_pr(KERN_NOTICE, "RX high carrier frequency (Hz): %d\n", (int)
++ itdev->params.rx_high_carrier_freq);
++
++ /* set up hardware initial state */
++ itdev->params.init_hardware(itdev);
++
++ /* set up ir-core props */
++ rdev->priv = itdev;
++ rdev->driver_type = RC_DRIVER_IR_RAW;
++ rdev->allowed_protos = IR_TYPE_ALL;
++ rdev->open = ite_open;
++ rdev->close = ite_close;
++ rdev->s_idle = ite_s_idle;
++ rdev->s_rx_carrier_range = ite_set_rx_carrier_range;
++ rdev->min_timeout = ITE_MIN_IDLE_TIMEOUT;
++ rdev->max_timeout = ITE_MAX_IDLE_TIMEOUT;
++ rdev->timeout = ITE_IDLE_TIMEOUT;
++ rdev->rx_resolution = rdev->tx_resolution = ITE_BAUDRATE_DIVISOR *
++ itdev->params.sample_period;
++
++ /* set up transmitter related values if needed */
++ if (itdev->params.hw_tx_capable) {
++ rdev->tx_ir = ite_tx_ir;
++ rdev->s_tx_carrier = ite_set_tx_carrier;
++ rdev->s_tx_duty_cycle = ite_set_tx_duty_cycle;
++ }
++
++ rdev->input_name = dev_desc->model;
++ rdev->input_id.bustype = BUS_HOST;
++ rdev->input_id.vendor = PCI_VENDOR_ID_ITE;
++ rdev->input_id.product = 0;
++ rdev->input_id.version = 0;
++ rdev->driver_name = ITE_DRIVER_NAME;
++ rdev->map_name = RC_MAP_RC6_MCE;
++
++ ret = rc_register_device(rdev);
++ if (ret)
++ goto failure;
++
++ itdev->rdev = rdev;
++ ite_pr(KERN_NOTICE, "driver has been successfully loaded\n");
++
++ return 0;
++
++failure:
++ if (itdev->cir_irq)
++ free_irq(itdev->cir_irq, itdev);
++ if (itdev->cir_addr)
++ release_region(itdev->cir_addr, itdev->params.io_region_size);
++
++ rc_free_device(rdev);
++ kfree(itdev);
++
++ return ret;
++}
++
++static void __devexit ite_remove(struct pnp_dev *pdev)
++{
++ struct ite_dev *dev = pnp_get_drvdata(pdev);
++ unsigned long flags;
++
++ ite_dbg("%s called", __func__);
++
++ spin_lock_irqsave(&dev->lock, flags);
++
++ /* disable hardware */
++ dev->params.disable(dev);
++
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ /* free resources */
++ free_irq(dev->cir_irq, dev);
++ release_region(dev->cir_addr, dev->params.io_region_size);
++
++ rc_unregister_device(dev->rdev);
++
++ kfree(dev);
++}
++
++static int ite_suspend(struct pnp_dev *pdev, pm_message_t state)
++{
++ struct ite_dev *dev = pnp_get_drvdata(pdev);
++ unsigned long flags;
++
++ ite_dbg("%s called", __func__);
++
++ spin_lock_irqsave(&dev->lock, flags);
++
++ /* disable all interrupts */
++ dev->params.disable(dev);
++
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ return 0;
++}
++
++static int ite_resume(struct pnp_dev *pdev)
++{
++ int ret = 0;
++ struct ite_dev *dev = pnp_get_drvdata(pdev);
++ unsigned long flags;
++
++ ite_dbg("%s called", __func__);
++
++ spin_lock_irqsave(&dev->lock, flags);
++
++ if (dev->transmitting) {
++ /* wake up the transmitter */
++ wake_up_interruptible(&dev->tx_queue);
++ } else {
++ /* enable the receiver */
++ dev->params.enable_rx(dev);
++ }
++
++ spin_unlock_irqrestore(&dev->lock, flags);
++
++ return ret;
++}
++
++static void ite_shutdown(struct pnp_dev *pdev)
++{
++ struct ite_dev *dev = pnp_get_drvdata(pdev);
++ unsigned long flags;
++
++ ite_dbg("%s called", __func__);
++
++ spin_lock_irqsave(&dev->lock, flags);
++
++ /* disable all interrupts */
++ dev->params.disable(dev);
++
++ spin_unlock_irqrestore(&dev->lock, flags);
++}
++
++static const struct pnp_device_id ite_ids[] = {
++ { "ITE8704", 0 }, /* Default model */
++ { "ITE8713", 0 }, /* CIR found in EEEBox 1501U */
++ { "ITE8708", 1 }, /* Bridged IT8512 */
++ { "", 0 },
++};
++
++static struct pnp_driver ite_driver = {
++ .name = ITE_DRIVER_NAME,
++ .id_table = ite_ids,
++ .probe = ite_probe,
++ .remove = __devexit_p(ite_remove),
++ .suspend = ite_suspend,
++ .resume = ite_resume,
++ .shutdown = ite_shutdown,
++};
++
++int ite_init(void)
++{
++ return pnp_register_driver(&ite_driver);
++}
++
++void ite_exit(void)
++{
++ pnp_unregister_driver(&ite_driver);
++}
++
++MODULE_DEVICE_TABLE(pnp, ite_ids);
++MODULE_DESCRIPTION("ITE Tech Inc. IT8712F/ITE8512F CIR driver");
++
++MODULE_AUTHOR("Juan J. Garcia de Soria ");
++MODULE_LICENSE("GPL");
++
++module_init(ite_init);
++module_exit(ite_exit);
+diff -Naur linux-2.6.36.2/drivers/media/IR/ite-cir.h linux-2.6.36.2.patch/drivers/media/IR/ite-cir.h
+--- linux-2.6.36.2/drivers/media/IR/ite-cir.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-2.6.36.2.patch/drivers/media/IR/ite-cir.h 2010-12-11 22:53:05.359095723 +0100
+@@ -0,0 +1,446 @@
++/*
++ * Driver for ITE Tech Inc. IT8712F/IT8512F CIR
++ *
++ * Copyright (C) 2010 Juan J. Garcia de Soria
++ *
++ * Based on nuvoton-cir and lirc_it87 drivers.
++ *
++ * 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
++ * 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
++ */
++
++/* platform driver name to register */
++#define ITE_DRIVER_NAME "ite-cir"
++
++/* logging macros */
++#define ite_pr(level, text, ...) \
++ printk(level KBUILD_MODNAME ": " text, ## __VA_ARGS__)
++
++#define ite_dbg(text, ...) \
++ if (debug) \
++ printk(KERN_DEBUG \
++ KBUILD_MODNAME ": " text "\n" , ## __VA_ARGS__)
++
++#define ite_dbg_verbose(text, ...) \
++ if (debug > 1) \
++ printk(KERN_DEBUG \
++ KBUILD_MODNAME ": " text "\n" , ## __VA_ARGS__)
++
++/* FIFO sizes */
++#define ITE_TX_FIFO_LEN 32
++#define ITE_RX_FIFO_LEN 32
++
++/* interrupt types */
++#define ITE_IRQ_TX_FIFO 1
++#define ITE_IRQ_RX_FIFO 2
++#define ITE_IRQ_RX_FIFO_OVERRUN 4
++
++/* forward declaration */
++struct ite_dev;
++
++/* struct for storing the parameters of different recognized devices */
++struct ite_dev_params {
++ /* model of the device */
++ const char *model;
++
++ /* size of the I/O region */
++ int io_region_size;
++
++ /* true if the hardware supports transmission */
++ bool hw_tx_capable;
++
++ /* base sampling period, in ns */
++ u32 sample_period;
++
++ /* rx low carrier frequency, in Hz, 0 means no demodulation */
++ unsigned int rx_low_carrier_freq;
++
++ /* tx high carrier frequency, in Hz, 0 means no demodulation */
++ unsigned int rx_high_carrier_freq;
++
++ /* tx carrier frequency, in Hz */
++ unsigned int tx_carrier_freq;
++
++ /* duty cycle, 0-100 */
++ int tx_duty_cycle;
++
++ /* hw-specific operation function pointers; most of these must be
++ * called while holding the spin lock, except for the TX FIFO length
++ * one */
++
++ /* get pending interrupt causes */
++ int (*get_irq_causes)(struct ite_dev *dev);
++
++ /* enable rx */
++ void (*enable_rx)(struct ite_dev *dev);
++
++ /* make rx enter the idle state; keep listening for a pulse, but stop
++ * streaming space bytes */
++ void (*idle_rx)(struct ite_dev *dev);
++
++ /* disable rx completely */
++ void (*disable_rx)(struct ite_dev *dev);
++
++ /* read bytes from RX FIFO; return read count */
++ int (*get_rx_bytes)(struct ite_dev *dev, u8 *buf, int buf_size);
++
++ /* enable tx FIFO space available interrupt */
++ void (*enable_tx_interrupt)(struct ite_dev *dev);
++
++ /* disable tx FIFO space available interrupt */
++ void (*disable_tx_interrupt)(struct ite_dev *dev);
++
++ /* get number of available TX FIFO slots */
++ int (*get_tx_free_slots)(struct ite_dev *dev);
++
++ /* put a byte to the TX FIFO */
++ void (*put_tx_byte)(struct ite_dev *dev, u8 value);
++
++ /* disable hardware completely */
++ void (*disable)(struct ite_dev *dev);
++
++ /* initialize the hardware */
++ void (*init_hardware)(struct ite_dev *dev);
++
++ /* set the carrier parameters */
++ void (*set_carrier_params)(struct ite_dev *dev, bool high_freq,
++ bool use_demodulator, u8 carrier_freq_bits,
++ u8 allowance_bits, u8 pulse_width_bits);
++};
++
++/* ITE CIR device structure */
++struct ite_dev {
++ struct pnp_dev *pdev;
++ struct ir_dev *rdev;
++ struct ir_raw_event rawir;
++
++ /* sync data */
++ spinlock_t lock;
++ bool in_use, transmitting;
++
++ /* transmit support */
++ int tx_fifo_allowance;
++ wait_queue_head_t tx_queue, tx_ended;
++
++ /* hardware I/O settings */
++ unsigned long cir_addr;
++ int cir_irq;
++
++ /* overridable copy of model parameters */
++ struct ite_dev_params params;
++};
++
++
++/* common values for all kinds of hardware */
++
++/* baud rate divisor default */
++#define ITE_BAUDRATE_DIVISOR 1
++
++/* low-speed carrier frequency limits (Hz) */
++#define ITE_LCF_MIN_CARRIER_FREQ 27000
++#define ITE_LCF_MAX_CARRIER_FREQ 58000
++
++/* high-speed carrier frequency limits (Hz) */
++#define ITE_HCF_MIN_CARRIER_FREQ 400000
++#define ITE_HCF_MAX_CARRIER_FREQ 500000
++
++/* default carrier freq for when demodulator is off (Hz) */
++#define ITE_DEFAULT_CARRIER_FREQ 38000
++
++/* default idling timeout in ns (0.2 seconds) */
++#define ITE_IDLE_TIMEOUT 200000000UL
++
++/* limit timeout values */
++#define ITE_MIN_IDLE_TIMEOUT 100000000UL
++#define ITE_MAX_IDLE_TIMEOUT 1000000000UL
++
++/* convert bits to us */
++#define ITE_BITS_TO_NS(bits, sample_period) \
++((u32) ((bits) * ITE_BAUDRATE_DIVISOR * sample_period))
++
++/*
++ * n in IT87_RDCR produces a tolerance of +/- n * 6.25% around the center
++ * carrier frequency...
++ *
++ * From two limit frequencies, L (low) and H (high), we can get both the
++ * center frequency F = (L + H) / 2 and the variation from the center
++ * frequency A = (H - L) / (H + L). We can use this in order to honor the
++ * s_rx_carrier_range() call in ir-core. We'll suppose that any request
++ * setting L=0 means we must shut down the demodulator.
++ */
++#define ITE_RXDCR_PER_10000_STEP 625
++
++/* high speed carrier freq values */
++#define ITE_CFQ_400 0x03
++#define ITE_CFQ_450 0x08
++#define ITE_CFQ_480 0x0b
++#define ITE_CFQ_500 0x0d
++
++/* values for pulse widths */
++#define ITE_TXMPW_A 0x02
++#define ITE_TXMPW_B 0x03
++#define ITE_TXMPW_C 0x04
++#define ITE_TXMPW_D 0x05
++#define ITE_TXMPW_E 0x06
++
++/* values for demodulator carrier range allowance */
++#define ITE_RXDCR_DEFAULT 0x01 /* default carrier range */
++#define ITE_RXDCR_MAX 0x07 /* default carrier range */
++
++/* DR TX bits */
++#define ITE_TX_PULSE 0x00
++#define ITE_TX_SPACE 0x80
++#define ITE_TX_MAX_RLE 0x80
++#define ITE_TX_RLE_MASK 0x7F
++
++
++/*
++ * IT8712F
++ *
++ * hardware data obtained from:
++ *
++ * IT8712F
++ * Environment Control – Low Pin Count Input / Output
++ * (EC - LPC I/O)
++ * Preliminary Specification V0. 81
++ */
++
++/* register offsets */
++#define IT87_DR 0x00 /* data register */
++#define IT87_IER 0x01 /* interrupt enable register */
++#define IT87_RCR 0x02 /* receiver control register */
++#define IT87_TCR1 0x03 /* transmitter control register 1 */
++#define IT87_TCR2 0x04 /* transmitter control register 2 */
++#define IT87_TSR 0x05 /* transmitter status register */
++#define IT87_RSR 0x06 /* receiver status register */
++#define IT87_BDLR 0x05 /* baud rate divisor low byte register */
++#define IT87_BDHR 0x06 /* baud rate divisor high byte register */
++#define IT87_IIR 0x07 /* interrupt identification register */
++
++#define IT87_IOREG_LENGTH 0x08 /* length of register file */
++
++/* IER bits */
++#define IT87_TLDLIE 0x01 /* transmitter low data interrupt enable */
++#define IT87_RDAIE 0x02 /* receiver data available interrupt enable */
++#define IT87_RFOIE 0x04 /* receiver FIFO overrun interrupt enable */
++#define IT87_IEC 0x08 /* interrupt enable control */
++#define IT87_BR 0x10 /* baud rate register enable */
++#define IT87_RESET 0x20 /* reset */
++
++/* RCR bits */
++#define IT87_RXDCR 0x07 /* receiver demodulation carrier range mask */
++#define IT87_RXACT 0x08 /* receiver active */
++#define IT87_RXEND 0x10 /* receiver demodulation enable */
++#define IT87_RXEN 0x20 /* receiver enable */
++#define IT87_HCFS 0x40 /* high-speed carrier frequency select */
++#define IT87_RDWOS 0x80 /* receiver data without sync */
++
++/* TCR1 bits */
++#define IT87_TXMPM 0x03 /* transmitter modulation pulse mode mask */
++#define IT87_TXMPM_DEFAULT 0x00 /* modulation pulse mode default */
++#define IT87_TXENDF 0x04 /* transmitter deferral */
++#define IT87_TXRLE 0x08 /* transmitter run length enable */
++#define IT87_FIFOTL 0x30 /* FIFO level threshold mask */
++#define IT87_FIFOTL_DEFAULT 0x20 /* FIFO level threshold default
++ 0x00 -> 1, 0x10 -> 7, 0x20 -> 17,
++ 0x30 -> 25 */
++#define IT87_ILE 0x40 /* internal loopback enable */
++#define IT87_FIFOCLR 0x80 /* FIFO clear bit */
++
++/* TCR2 bits */
++#define IT87_TXMPW 0x07 /* transmitter modulation pulse width mask */
++#define IT87_TXMPW_DEFAULT 0x04 /* default modulation pulse width */
++#define IT87_CFQ 0xf8 /* carrier frequency mask */
++#define IT87_CFQ_SHIFT 3 /* carrier frequency bit shift */
++
++/* TSR bits */
++#define IT87_TXBFC 0x3f /* transmitter FIFO byte count mask */
++
++/* RSR bits */
++#define IT87_RXBFC 0x3f /* receiver FIFO byte count mask */
++#define IT87_RXFTO 0x80 /* receiver FIFO time-out */
++
++/* IIR bits */
++#define IT87_IP 0x01 /* interrupt pending */
++#define IT87_II 0x06 /* interrupt identification mask */
++#define IT87_II_NOINT 0x00 /* no interrupt */
++#define IT87_II_TXLDL 0x02 /* transmitter low data level */
++#define IT87_II_RXDS 0x04 /* receiver data stored */
++#define IT87_II_RXFO 0x06 /* receiver FIFO overrun */
++
++
++/*
++ * IT8512E/F
++ *
++ * Hardware data obtained from:
++ *
++ * IT8512E/F
++ * Embedded Controller
++ * Preliminary Specification V0.4.1
++ *
++ * Note that the CIR registers are not directly available to the host, because
++ * they only are accessible to the integrated microcontroller. Thus, in order
++ * use it, some kind of bridging is required. As the bridging may depend on
++ * the controller firmware in use, we are going to use the PNP ID in order to
++ * determine the strategy and ports available. See after these generic
++ * IT8512E/F register definitions for register definitions for those
++ * strategies.
++ */
++
++/* register offsets */
++#define IT85_C0DR 0x00 /* data register */
++#define IT85_C0MSTCR 0x01 /* master control register */
++#define IT85_C0IER 0x02 /* interrupt enable register */
++#define IT85_C0IIR 0x03 /* interrupt identification register */
++#define IT85_C0CFR 0x04 /* carrier frequency register */
++#define IT85_C0RCR 0x05 /* receiver control register */
++#define IT85_C0TCR 0x06 /* transmitter control register */
++#define IT85_C0SCK 0x07 /* slow clock control register */
++#define IT85_C0BDLR 0x08 /* baud rate divisor low byte register */
++#define IT85_C0BDHR 0x09 /* baud rate divisor high byte register */
++#define IT85_C0TFSR 0x0a /* transmitter FIFO status register */
++#define IT85_C0RFSR 0x0b /* receiver FIFO status register */
++#define IT85_C0WCL 0x0d /* wakeup code length register */
++#define IT85_C0WCR 0x0e /* wakeup code read/write register */
++#define IT85_C0WPS 0x0f /* wakeup power control/status register */
++
++#define IT85_IOREG_LENGTH 0x10 /* length of register file */
++
++/* C0MSTCR bits */
++#define IT85_RESET 0x01 /* reset */
++#define IT85_FIFOCLR 0x02 /* FIFO clear bit */
++#define IT85_FIFOTL 0x0c /* FIFO level threshold mask */
++#define IT85_FIFOTL_DEFAULT 0x08 /* FIFO level threshold default
++ 0x00 -> 1, 0x04 -> 7, 0x08 -> 17,
++ 0x0c -> 25 */
++#define IT85_ILE 0x10 /* internal loopback enable */
++#define IT85_ILSEL 0x20 /* internal loopback select */
++
++/* C0IER bits */
++#define IT85_TLDLIE 0x01 /* TX low data level interrupt enable */
++#define IT85_RDAIE 0x02 /* RX data available interrupt enable */
++#define IT85_RFOIE 0x04 /* RX FIFO overrun interrupt enable */
++#define IT85_IEC 0x80 /* interrupt enable function control */
++
++/* C0IIR bits */
++#define IT85_TLDLI 0x01 /* transmitter low data level interrupt */
++#define IT85_RDAI 0x02 /* receiver data available interrupt */
++#define IT85_RFOI 0x04 /* receiver FIFO overrun interrupt */
++#define IT85_NIP 0x80 /* no interrupt pending */
++
++/* C0CFR bits */
++#define IT85_CFQ 0x1f /* carrier frequency mask */
++#define IT85_HCFS 0x20 /* high speed carrier frequency select */
++
++/* C0RCR bits */
++#define IT85_RXDCR 0x07 /* receiver demodulation carrier range mask */
++#define IT85_RXACT 0x08 /* receiver active */
++#define IT85_RXEND 0x10 /* receiver demodulation enable */
++#define IT85_RDWOS 0x20 /* receiver data without sync */
++#define IT85_RXEN 0x80 /* receiver enable */
++
++/* C0TCR bits */
++#define IT85_TXMPW 0x07 /* transmitter modulation pulse width mask */
++#define IT85_TXMPW_DEFAULT 0x04 /* default modulation pulse width */
++#define IT85_TXMPM 0x18 /* transmitter modulation pulse mode mask */
++#define IT85_TXMPM_DEFAULT 0x00 /* modulation pulse mode default */
++#define IT85_TXENDF 0x20 /* transmitter deferral */
++#define IT85_TXRLE 0x40 /* transmitter run length enable */
++
++/* C0SCK bits */
++#define IT85_SCKS 0x01 /* slow clock select */
++#define IT85_TXDCKG 0x02 /* TXD clock gating */
++#define IT85_DLL1P8E 0x04 /* DLL 1.8432M enable */
++#define IT85_DLLTE 0x08 /* DLL test enable */
++#define IT85_BRCM 0x70 /* baud rate count mode */
++#define IT85_DLLOCK 0x80 /* DLL lock */
++
++/* C0TFSR bits */
++#define IT85_TXFBC 0x3f /* transmitter FIFO count mask */
++
++/* C0RFSR bits */
++#define IT85_RXFBC 0x3f /* receiver FIFO count mask */
++#define IT85_RXFTO 0x80 /* receiver FIFO time-out */
++
++/* C0WCL bits */
++#define IT85_WCL 0x3f /* wakeup code length mask */
++
++/* C0WPS bits */
++#define IT85_CIRPOSIE 0x01 /* power on/off status interrupt enable */
++#define IT85_CIRPOIS 0x02 /* power on/off interrupt status */
++#define IT85_CIRPOII 0x04 /* power on/off interrupt identification */
++#define IT85_RCRST 0x10 /* wakeup code reading counter reset bit */
++#define IT85_WCRST 0x20 /* wakeup code writing counter reset bit */
++
++
++/*
++ * ITE8708
++ *
++ * Hardware data obtained from hacked driver for IT8512 in this forum post:
++ *
++ * http://ubuntuforums.org/showthread.php?t=1028640
++ *
++ * Although there's no official documentation for that driver, analysis would
++ * suggest that it maps the 16 registers of IT8512 onto two 8-register banks,
++ * selectable by a single bank-select bit that's mapped onto both banks. The
++ * IT8512 registers are mapped in a different order, so that the first bank
++ * maps the ones that are used more often, and two registers that share a
++ * reserved high-order bit are placed at the same offset in both banks in
++ * order to reuse the reserved bit as the bank select bit.
++ */
++
++/* register offsets */
++
++/* mapped onto both banks */
++#define IT8708_BANKSEL 0x07 /* bank select register */
++#define IT8708_HRAE 0x80 /* high registers access enable */
++
++/* mapped onto the low bank */
++#define IT8708_C0DR 0x00 /* data register */
++#define IT8708_C0MSTCR 0x01 /* master control register */
++#define IT8708_C0IER 0x02 /* interrupt enable register */
++#define IT8708_C0IIR 0x03 /* interrupt identification register */
++#define IT8708_C0RFSR 0x04 /* receiver FIFO status register */
++#define IT8708_C0RCR 0x05 /* receiver control register */
++#define IT8708_C0TFSR 0x06 /* transmitter FIFO status register */
++#define IT8708_C0TCR 0x07 /* transmitter control register */
++
++/* mapped onto the high bank */
++#define IT8708_C0BDLR 0x01 /* baud rate divisor low byte register */
++#define IT8708_C0BDHR 0x02 /* baud rate divisor high byte register */
++#define IT8708_C0CFR 0x04 /* carrier frequency register */
++
++/* registers whose bank mapping we don't know, since they weren't being used
++ * in the hacked driver... most probably they belong to the high bank too,
++ * since they fit in the holes the other registers leave */
++#define IT8708_C0SCK 0x03 /* slow clock control register */
++#define IT8708_C0WCL 0x05 /* wakeup code length register */
++#define IT8708_C0WCR 0x06 /* wakeup code read/write register */
++#define IT8708_C0WPS 0x07 /* wakeup power control/status register */
++
++#define IT8708_IOREG_LENGTH 0x08 /* length of register file */
++
++/* two more registers that are defined in the hacked driver, but can't be
++ * found in the data sheets; no idea what they are or how they are accessed,
++ * since the hacked driver doesn't seem to use them */
++#define IT8708_CSCRR 0x00
++#define IT8708_CGPINTR 0x01
++
++/* CSCRR bits */
++#define IT8708_CSCRR_SCRB 0x3f
++#define IT8708_CSCRR_PM 0x80
++
++/* CGPINTR bits */
++#define IT8708_CGPINT 0x01
+diff -Naur linux-2.6.36.2/drivers/media/IR/Kconfig linux-2.6.36.2.patch/drivers/media/IR/Kconfig
+--- linux-2.6.36.2/drivers/media/IR/Kconfig 2010-12-09 23:17:27.000000000 +0100
++++ linux-2.6.36.2.patch/drivers/media/IR/Kconfig 2010-12-11 22:50:14.406094135 +0100
+@@ -127,6 +127,19 @@
+ To compile this driver as a module, choose M here: the
+ module will be called ene_ir.
+
++config IR_ITE_CIR
++ tristate "ITE Tech Inc. IT8712/IT8512 Consumer Infrared Transceiver"
++ depends on PNP
++ depends on IR_CORE
++ ---help---
++ Say Y here to enable support for integrated infrared receivers
++ /transceivers made by ITE Tech Inc. These are found in
++ several ASUS devices, like the ASUS Digimatrix or the ASUS
++ EEEBox 1501U.
++
++ To compile this driver as a module, choose M here: the
++ module will be called ite-cir.
++
+ config IR_STREAMZAP
+ tristate "Streamzap PC Remote IR Receiver"
+ depends on USB_ARCH_HAS_HCD
+diff -Naur linux-2.6.36.2/drivers/media/IR/Makefile linux-2.6.36.2.patch/drivers/media/IR/Makefile
+--- linux-2.6.36.2/drivers/media/IR/Makefile 2010-12-09 23:17:27.000000000 +0100
++++ linux-2.6.36.2.patch/drivers/media/IR/Makefile 2010-12-11 22:25:05.388510013 +0100
+@@ -18,3 +18,4 @@
+ obj-$(CONFIG_IR_MCEUSB) += mceusb.o
+ obj-$(CONFIG_IR_ENE) += ene_ir.o
+ obj-$(CONFIG_IR_STREAMZAP) += streamzap.o
++obj-$(CONFIG_IR_ITE_CIR) += ite-cir.o
+diff -Naur linux-2.6.36.2/drivers/staging/lirc/Kconfig linux-2.6.36.2.patch/drivers/staging/lirc/Kconfig
+--- linux-2.6.36.2/drivers/staging/lirc/Kconfig 2010-12-09 23:17:27.000000000 +0100
++++ linux-2.6.36.2.patch/drivers/staging/lirc/Kconfig 2010-12-11 22:18:26.840935467 +0100
+@@ -39,12 +39,6 @@
+
+ Current generation iMON devices use the input layer imon driver.
+
+-config LIRC_IT87
+- tristate "ITE IT87XX CIR Port Receiver"
+- depends on LIRC_STAGING && PNP
+- help
+- Driver for the ITE IT87xx IR Receiver
+-
+ config LIRC_ITE8709
+ tristate "ITE8709 CIR Port Receiver"
+ depends on LIRC_STAGING && PNP
+diff -Naur linux-2.6.36.2/drivers/staging/lirc/lirc_it87.c linux-2.6.36.2.patch/drivers/staging/lirc/lirc_it87.c
+--- linux-2.6.36.2/drivers/staging/lirc/lirc_it87.c 2010-12-09 23:17:27.000000000 +0100
++++ linux-2.6.36.2.patch/drivers/staging/lirc/lirc_it87.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,1022 +0,0 @@
+-/*
+- * LIRC driver for ITE IT8712/IT8705 CIR port
+- *
+- * Copyright (C) 2001 Hans-Gunter Lutke Uphues
+- *
+- * 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
+- * 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
+- *
+- * ITE IT8705 and IT8712(not tested) and IT8720 CIR-port support for lirc based
+- * via cut and paste from lirc_sir.c (C) 2000 Milan Pikula
+- *
+- * Attention: Sendmode only tested with debugging logs
+- *
+- * 2001/02/27 Christoph Bartelmus :
+- * reimplemented read function
+- * 2005/06/05 Andrew Calkin implemented support for Asus Digimatrix,
+- * based on work of the following member of the Outertrack Digimatrix
+- * Forum: Art103
+- * 2009/12/24 James Edwards implemeted support
+- * for ITE8704/ITE8718, on my machine, the DSDT reports 8704, but the
+- * chip identifies as 18.
+- */
+-
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-#include
+-
+-#include
+-#include
+-
+-#include
+-#include
+-
+-#include "lirc_it87.h"
+-
+-#ifdef LIRC_IT87_DIGIMATRIX
+-static int digimatrix = 1;
+-static int it87_freq = 36; /* kHz */
+-static int irq = 9;
+-#else
+-static int digimatrix;
+-static int it87_freq = 38; /* kHz */
+-static int irq = IT87_CIR_DEFAULT_IRQ;
+-#endif
+-
+-static unsigned long it87_bits_in_byte_out;
+-static unsigned long it87_send_counter;
+-static unsigned char it87_RXEN_mask = IT87_CIR_RCR_RXEN;
+-
+-#define RBUF_LEN 1024
+-
+-#define LIRC_DRIVER_NAME "lirc_it87"
+-
+-/* timeout for sequences in jiffies (=5/100s) */
+-/* must be longer than TIME_CONST */
+-#define IT87_TIMEOUT (HZ*5/100)
+-
+-/* module parameters */
+-static int debug;
+-#define dprintk(fmt, args...) \
+- do { \
+- if (debug) \
+- printk(KERN_DEBUG LIRC_DRIVER_NAME ": " \
+- fmt, ## args); \
+- } while (0)
+-
+-static int io = IT87_CIR_DEFAULT_IOBASE;
+-/* receiver demodulator default: off */
+-static int it87_enable_demodulator;
+-
+-static int timer_enabled;
+-static DEFINE_SPINLOCK(timer_lock);
+-static struct timer_list timerlist;
+-/* time of last signal change detected */
+-static struct timeval last_tv = {0, 0};
+-/* time of last UART data ready interrupt */
+-static struct timeval last_intr_tv = {0, 0};
+-static int last_value;
+-
+-static DECLARE_WAIT_QUEUE_HEAD(lirc_read_queue);
+-
+-static DEFINE_SPINLOCK(hardware_lock);
+-static DEFINE_SPINLOCK(dev_lock);
+-static bool device_open;
+-
+-static int rx_buf[RBUF_LEN];
+-unsigned int rx_tail, rx_head;
+-
+-static struct pnp_driver it87_pnp_driver;
+-
+-/* 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);
+-static ssize_t lirc_write(struct file *file, const char *buf,
+- size_t n, loff_t *pos);
+-static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg);
+-static void add_read_queue(int flag, unsigned long val);
+-static int init_chrdev(void);
+-static void drop_chrdev(void);
+-/* Hardware */
+-static irqreturn_t it87_interrupt(int irq, void *dev_id);
+-static void send_space(unsigned long len);
+-static void send_pulse(unsigned long len);
+-static void init_send(void);
+-static void terminate_send(unsigned long len);
+-static int init_hardware(void);
+-static void drop_hardware(void);
+-/* Initialisation */
+-static int init_port(void);
+-static void drop_port(void);
+-
+-
+-/* SECTION: Communication with user-space */
+-
+-static int lirc_open(struct inode *inode, struct file *file)
+-{
+- spin_lock(&dev_lock);
+- if (device_open) {
+- spin_unlock(&dev_lock);
+- return -EBUSY;
+- }
+- device_open = true;
+- spin_unlock(&dev_lock);
+- return 0;
+-}
+-
+-
+-static int lirc_close(struct inode *inode, struct file *file)
+-{
+- spin_lock(&dev_lock);
+- device_open = false;
+- spin_unlock(&dev_lock);
+- return 0;
+-}
+-
+-
+-static unsigned int lirc_poll(struct file *file, poll_table *wait)
+-{
+- poll_wait(file, &lirc_read_queue, wait);
+- if (rx_head != rx_tail)
+- return POLLIN | POLLRDNORM;
+- return 0;
+-}
+-
+-
+-static ssize_t lirc_read(struct file *file, char *buf,
+- size_t count, loff_t *ppos)
+-{
+- int n = 0;
+- int retval = 0;
+-
+- while (n < count) {
+- if (file->f_flags & O_NONBLOCK && rx_head == rx_tail) {
+- retval = -EAGAIN;
+- break;
+- }
+- retval = wait_event_interruptible(lirc_read_queue,
+- rx_head != rx_tail);
+- if (retval)
+- break;
+-
+- if (copy_to_user((void *) buf + n, (void *) (rx_buf + rx_head),
+- sizeof(int))) {
+- retval = -EFAULT;
+- break;
+- }
+- rx_head = (rx_head + 1) & (RBUF_LEN - 1);
+- n += sizeof(int);
+- }
+- if (n)
+- return n;
+- return retval;
+-}
+-
+-
+-static ssize_t lirc_write(struct file *file, const char *buf,
+- size_t n, loff_t *pos)
+-{
+- int i = 0;
+- int *tx_buf;
+-
+- if (n % sizeof(int))
+- return -EINVAL;
+- tx_buf = memdup_user(buf, n);
+- if (IS_ERR(tx_buf))
+- return PTR_ERR(tx_buf);
+- n /= sizeof(int);
+- init_send();
+- while (1) {
+- if (i >= n)
+- break;
+- if (tx_buf[i])
+- send_pulse(tx_buf[i]);
+- i++;
+- if (i >= n)
+- break;
+- if (tx_buf[i])
+- send_space(tx_buf[i]);
+- i++;
+- }
+- terminate_send(tx_buf[i - 1]);
+- return n;
+-}
+-
+-
+-static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
+-{
+- int retval = 0;
+- unsigned long value = 0;
+- unsigned int ivalue;
+- unsigned long hw_flags;
+-
+- if (cmd == LIRC_GET_FEATURES)
+- value = LIRC_CAN_SEND_PULSE |
+- LIRC_CAN_SET_SEND_CARRIER |
+- LIRC_CAN_REC_MODE2;
+- else if (cmd == LIRC_GET_SEND_MODE)
+- value = LIRC_MODE_PULSE;
+- else if (cmd == LIRC_GET_REC_MODE)
+- value = LIRC_MODE_MODE2;
+-
+- switch (cmd) {
+- case LIRC_GET_FEATURES:
+- case LIRC_GET_SEND_MODE:
+- case LIRC_GET_REC_MODE:
+- retval = put_user(value, (unsigned long *) arg);
+- break;
+-
+- case LIRC_SET_SEND_MODE:
+- case LIRC_SET_REC_MODE:
+- retval = get_user(value, (unsigned long *) arg);
+- break;
+-
+- case LIRC_SET_SEND_CARRIER:
+- retval = get_user(ivalue, (unsigned int *) arg);
+- if (retval)
+- return retval;
+- ivalue /= 1000;
+- if (ivalue > IT87_CIR_FREQ_MAX ||
+- ivalue < IT87_CIR_FREQ_MIN)
+- return -EINVAL;
+-
+- it87_freq = ivalue;
+-
+- spin_lock_irqsave(&hardware_lock, hw_flags);
+- outb(((inb(io + IT87_CIR_TCR2) & IT87_CIR_TCR2_TXMPW) |
+- (it87_freq - IT87_CIR_FREQ_MIN) << 3),
+- io + IT87_CIR_TCR2);
+- spin_unlock_irqrestore(&hardware_lock, hw_flags);
+- dprintk("demodulation frequency: %d kHz\n", it87_freq);
+-
+- break;
+-
+- default:
+- retval = -EINVAL;
+- }
+-
+- if (retval)
+- return retval;
+-
+- if (cmd == LIRC_SET_REC_MODE) {
+- if (value != LIRC_MODE_MODE2)
+- retval = -ENOSYS;
+- } else if (cmd == LIRC_SET_SEND_MODE) {
+- if (value != LIRC_MODE_PULSE)
+- retval = -ENOSYS;
+- }
+- return retval;
+-}
+-
+-static void add_read_queue(int flag, unsigned long val)
+-{
+- unsigned int new_rx_tail;
+- int newval;
+-
+- dprintk("add flag %d with val %lu\n", flag, val);
+-
+- newval = val & PULSE_MASK;
+-
+- /*
+- * statistically, pulses are ~TIME_CONST/2 too long. we could
+- * maybe make this more exact, but this is good enough
+- */
+- if (flag) {
+- /* pulse */
+- if (newval > TIME_CONST / 2)
+- newval -= TIME_CONST / 2;
+- else /* should not ever happen */
+- newval = 1;
+- newval |= PULSE_BIT;
+- } else
+- newval += TIME_CONST / 2;
+- new_rx_tail = (rx_tail + 1) & (RBUF_LEN - 1);
+- if (new_rx_tail == rx_head) {
+- dprintk("Buffer overrun.\n");
+- return;
+- }
+- rx_buf[rx_tail] = newval;
+- rx_tail = new_rx_tail;
+- wake_up_interruptible(&lirc_read_queue);
+-}
+-
+-
+-static const struct file_operations lirc_fops = {
+- .owner = THIS_MODULE,
+- .read = lirc_read,
+- .write = lirc_write,
+- .poll = lirc_poll,
+- .unlocked_ioctl = lirc_ioctl,
+- .open = lirc_open,
+- .release = lirc_close,
+-};
+-
+-static int set_use_inc(void *data)
+-{
+- return 0;
+-}
+-
+-static void set_use_dec(void *data)
+-{
+-}
+-
+-static struct lirc_driver driver = {
+- .name = LIRC_DRIVER_NAME,
+- .minor = -1,
+- .code_length = 1,
+- .sample_rate = 0,
+- .data = NULL,
+- .add_to_buf = NULL,
+- .set_use_inc = set_use_inc,
+- .set_use_dec = set_use_dec,
+- .fops = &lirc_fops,
+- .dev = NULL,
+- .owner = THIS_MODULE,
+-};
+-
+-
+-static int init_chrdev(void)
+-{
+- driver.minor = lirc_register_driver(&driver);
+-
+- if (driver.minor < 0) {
+- printk(KERN_ERR LIRC_DRIVER_NAME ": init_chrdev() failed.\n");
+- return -EIO;
+- }
+- return 0;
+-}
+-
+-
+-static void drop_chrdev(void)
+-{
+- lirc_unregister_driver(driver.minor);
+-}
+-
+-
+-/* SECTION: Hardware */
+-static long delta(struct timeval *tv1, struct timeval *tv2)
+-{
+- unsigned long deltv;
+-
+- deltv = tv2->tv_sec - tv1->tv_sec;
+- if (deltv > 15)
+- deltv = 0xFFFFFF;
+- else
+- deltv = deltv*1000000 + tv2->tv_usec - tv1->tv_usec;
+- return deltv;
+-}
+-
+-static void it87_timeout(unsigned long data)
+-{
+- unsigned long flags;
+-
+- /* avoid interference with interrupt */
+- spin_lock_irqsave(&timer_lock, flags);
+-
+- if (digimatrix) {
+- /* We have timed out. Disable the RX mechanism. */
+-
+- outb((inb(io + IT87_CIR_RCR) & ~IT87_CIR_RCR_RXEN) |
+- IT87_CIR_RCR_RXACT, io + IT87_CIR_RCR);
+- if (it87_RXEN_mask)
+- outb(inb(io + IT87_CIR_RCR) | IT87_CIR_RCR_RXEN,
+- io + IT87_CIR_RCR);
+- dprintk(" TIMEOUT\n");
+- timer_enabled = 0;
+-
+- /* fifo clear */
+- outb(inb(io + IT87_CIR_TCR1) | IT87_CIR_TCR1_FIFOCLR,
+- io+IT87_CIR_TCR1);
+-
+- } else {
+- /*
+- * if last received signal was a pulse, but receiving stopped
+- * within the 9 bit frame, we need to finish this pulse and
+- * simulate a signal change to from pulse to space. Otherwise
+- * upper layers will receive two sequences next time.
+- */
+-
+- if (last_value) {
+- unsigned long pulse_end;
+-
+- /* determine 'virtual' pulse end: */
+- pulse_end = delta(&last_tv, &last_intr_tv);
+- dprintk("timeout add %d for %lu usec\n",
+- last_value, pulse_end);
+- add_read_queue(last_value, pulse_end);
+- last_value = 0;
+- last_tv = last_intr_tv;
+- }
+- }
+- spin_unlock_irqrestore(&timer_lock, flags);
+-}
+-
+-static irqreturn_t it87_interrupt(int irq, void *dev_id)
+-{
+- unsigned char data;
+- struct timeval curr_tv;
+- static unsigned long deltv;
+- unsigned long deltintrtv;
+- unsigned long flags, hw_flags;
+- int iir, lsr;
+- int fifo = 0;
+- static char lastbit;
+- char bit;
+-
+- /* Bit duration in microseconds */
+- const unsigned long bit_duration = 1000000ul /
+- (115200 / IT87_CIR_BAUDRATE_DIVISOR);
+-
+-
+- iir = inb(io + IT87_CIR_IIR);
+-
+- switch (iir & IT87_CIR_IIR_IID) {
+- case 0x4:
+- case 0x6:
+- lsr = inb(io + IT87_CIR_RSR) & (IT87_CIR_RSR_RXFTO |
+- IT87_CIR_RSR_RXFBC);
+- fifo = lsr & IT87_CIR_RSR_RXFBC;
+- dprintk("iir: 0x%x fifo: 0x%x\n", iir, lsr);
+-
+- /* avoid interference with timer */
+- spin_lock_irqsave(&timer_lock, flags);
+- spin_lock_irqsave(&hardware_lock, hw_flags);
+- if (digimatrix) {
+- static unsigned long acc_pulse;
+- static unsigned long acc_space;
+-
+- do {
+- data = inb(io + IT87_CIR_DR);
+- data = ~data;
+- fifo--;
+- if (data != 0x00) {
+- if (timer_enabled)
+- del_timer(&timerlist);
+- /*
+- * start timer for end of
+- * sequence detection
+- */
+- timerlist.expires = jiffies +
+- IT87_TIMEOUT;
+- add_timer(&timerlist);
+- timer_enabled = 1;
+- }
+- /* Loop through */
+- for (bit = 0; bit < 8; ++bit) {
+- if ((data >> bit) & 1) {
+- ++acc_pulse;
+- if (lastbit == 0) {
+- add_read_queue(0,
+- acc_space *
+- bit_duration);
+- acc_space = 0;
+- }
+- } else {
+- ++acc_space;
+- if (lastbit == 1) {
+- add_read_queue(1,
+- acc_pulse *
+- bit_duration);
+- acc_pulse = 0;
+- }
+- }
+- lastbit = (data >> bit) & 1;
+- }
+-
+- } while (fifo != 0);
+- } else { /* Normal Operation */
+- do {
+- del_timer(&timerlist);
+- data = inb(io + IT87_CIR_DR);
+-
+- dprintk("data=%02x\n", data);
+- do_gettimeofday(&curr_tv);
+- deltv = delta(&last_tv, &curr_tv);
+- deltintrtv = delta(&last_intr_tv, &curr_tv);
+-
+- dprintk("t %lu , d %d\n",
+- deltintrtv, (int)data);
+-
+- /*
+- * if nothing came in last 2 cycles,
+- * it was gap
+- */
+- if (deltintrtv > TIME_CONST * 2) {
+- if (last_value) {
+- dprintk("GAP\n");
+-
+- /* simulate signal change */
+- add_read_queue(last_value,
+- deltv -
+- deltintrtv);
+- last_value = 0;
+- last_tv.tv_sec =
+- last_intr_tv.tv_sec;
+- last_tv.tv_usec =
+- last_intr_tv.tv_usec;
+- deltv = deltintrtv;
+- }
+- }
+- data = 1;
+- if (data ^ last_value) {
+- /*
+- * deltintrtv > 2*TIME_CONST,
+- * remember ? the other case is
+- * timeout
+- */
+- add_read_queue(last_value,
+- deltv-TIME_CONST);
+- last_value = data;
+- last_tv = curr_tv;
+- if (last_tv.tv_usec >= TIME_CONST)
+- last_tv.tv_usec -= TIME_CONST;
+- else {
+- last_tv.tv_sec--;
+- last_tv.tv_usec += 1000000 -
+- TIME_CONST;
+- }
+- }
+- last_intr_tv = curr_tv;
+- if (data) {
+- /*
+- * start timer for end of
+- * sequence detection
+- */
+- timerlist.expires =
+- jiffies + IT87_TIMEOUT;
+- add_timer(&timerlist);
+- }
+- outb((inb(io + IT87_CIR_RCR) &
+- ~IT87_CIR_RCR_RXEN) |
+- IT87_CIR_RCR_RXACT,
+- io + IT87_CIR_RCR);
+- if (it87_RXEN_mask)
+- outb(inb(io + IT87_CIR_RCR) |
+- IT87_CIR_RCR_RXEN,
+- io + IT87_CIR_RCR);
+- fifo--;
+- } while (fifo != 0);
+- }
+- spin_unlock_irqrestore(&hardware_lock, hw_flags);
+- spin_unlock_irqrestore(&timer_lock, flags);
+-
+- return IRQ_RETVAL(IRQ_HANDLED);
+-
+- default:
+- /* not our irq */
+- dprintk("unknown IRQ (shouldn't happen) !!\n");
+- return IRQ_RETVAL(IRQ_NONE);
+- }
+-}
+-
+-
+-static void send_it87(unsigned long len, unsigned long stime,
+- unsigned char send_byte, unsigned int count_bits)
+-{
+- long count = len / stime;
+- long time_left = 0;
+- static unsigned char byte_out;
+- unsigned long hw_flags;
+-
+- dprintk("%s: len=%ld, sb=%d\n", __func__, len, send_byte);
+-
+- time_left = (long)len - (long)count * (long)stime;
+- count += ((2 * time_left) / stime);
+- while (count) {
+- long i = 0;
+- for (i = 0; i < count_bits; i++) {
+- byte_out = (byte_out << 1) | (send_byte & 1);
+- it87_bits_in_byte_out++;
+- }
+- if (it87_bits_in_byte_out == 8) {
+- dprintk("out=0x%x, tsr_txfbc: 0x%x\n",
+- byte_out,
+- inb(io + IT87_CIR_TSR) &
+- IT87_CIR_TSR_TXFBC);
+-
+- while ((inb(io + IT87_CIR_TSR) &
+- IT87_CIR_TSR_TXFBC) >= IT87_CIR_FIFO_SIZE)
+- ;
+-
+- spin_lock_irqsave(&hardware_lock, hw_flags);
+- outb(byte_out, io + IT87_CIR_DR);
+- spin_unlock_irqrestore(&hardware_lock, hw_flags);
+-
+- it87_bits_in_byte_out = 0;
+- it87_send_counter++;
+- byte_out = 0;
+- }
+- count--;
+- }
+-}
+-
+-
+-/*TODO: maybe exchange space and pulse because it8705 only modulates 0-bits */
+-
+-static void send_space(unsigned long len)
+-{
+- send_it87(len, TIME_CONST, IT87_CIR_SPACE, IT87_CIR_BAUDRATE_DIVISOR);
+-}
+-
+-static void send_pulse(unsigned long len)
+-{
+- send_it87(len, TIME_CONST, IT87_CIR_PULSE, IT87_CIR_BAUDRATE_DIVISOR);
+-}
+-
+-
+-static void init_send()
+-{
+- unsigned long flags;
+-
+- spin_lock_irqsave(&hardware_lock, flags);
+- /* RXEN=0: receiver disable */
+- it87_RXEN_mask = 0;
+- outb(inb(io + IT87_CIR_RCR) & ~IT87_CIR_RCR_RXEN,
+- io + IT87_CIR_RCR);
+- spin_unlock_irqrestore(&hardware_lock, flags);
+- it87_bits_in_byte_out = 0;
+- it87_send_counter = 0;
+-}
+-
+-
+-static void terminate_send(unsigned long len)
+-{
+- unsigned long flags;
+- unsigned long last = 0;
+-
+- last = it87_send_counter;
+- /* make sure all necessary data has been sent */
+- while (last == it87_send_counter)
+- send_space(len);
+- /* wait until all data sent */
+- while ((inb(io + IT87_CIR_TSR) & IT87_CIR_TSR_TXFBC) != 0)
+- ;
+- /* then re-enable receiver */
+- spin_lock_irqsave(&hardware_lock, flags);
+- it87_RXEN_mask = IT87_CIR_RCR_RXEN;
+- outb(inb(io + IT87_CIR_RCR) | IT87_CIR_RCR_RXEN,
+- io + IT87_CIR_RCR);
+- spin_unlock_irqrestore(&hardware_lock, flags);
+-}
+-
+-
+-static int init_hardware(void)
+-{
+- unsigned long flags;
+- unsigned char it87_rcr = 0;
+-
+- spin_lock_irqsave(&hardware_lock, flags);
+- /* init cir-port */
+- /* enable r/w-access to Baudrate-Register */
+- outb(IT87_CIR_IER_BR, io + IT87_CIR_IER);
+- outb(IT87_CIR_BAUDRATE_DIVISOR % 0x100, io+IT87_CIR_BDLR);
+- outb(IT87_CIR_BAUDRATE_DIVISOR / 0x100, io+IT87_CIR_BDHR);
+- /* Baudrate Register off, define IRQs: Input only */
+- if (digimatrix) {
+- outb(IT87_CIR_IER_IEC | IT87_CIR_IER_RFOIE, io + IT87_CIR_IER);
+- /* RX: HCFS=0, RXDCR = 001b (33,75..38,25 kHz), RXEN=1 */
+- } else {
+- outb(IT87_CIR_IER_IEC | IT87_CIR_IER_RDAIE, io + IT87_CIR_IER);
+- /* RX: HCFS=0, RXDCR = 001b (35,6..40,3 kHz), RXEN=1 */
+- }
+- it87_rcr = (IT87_CIR_RCR_RXEN & it87_RXEN_mask) | 0x1;
+- if (it87_enable_demodulator)
+- it87_rcr |= IT87_CIR_RCR_RXEND;
+- outb(it87_rcr, io + IT87_CIR_RCR);
+- if (digimatrix) {
+- /* Set FIFO depth to 1 byte, and disable TX */
+- outb(inb(io + IT87_CIR_TCR1) | 0x00,
+- io + IT87_CIR_TCR1);
+-
+- /*
+- * TX: it87_freq (36kHz), 'reserved' sensitivity
+- * setting (0x00)
+- */
+- outb(((it87_freq - IT87_CIR_FREQ_MIN) << 3) | 0x00,
+- io + IT87_CIR_TCR2);
+- } else {
+- /* TX: 38kHz, 13,3us (pulse-width) */
+- outb(((it87_freq - IT87_CIR_FREQ_MIN) << 3) | 0x06,
+- io + IT87_CIR_TCR2);
+- }
+- spin_unlock_irqrestore(&hardware_lock, flags);
+- return 0;
+-}
+-
+-
+-static void drop_hardware(void)
+-{
+- unsigned long flags;
+-
+- spin_lock_irqsave(&hardware_lock, flags);
+- disable_irq(irq);
+- /* receiver disable */
+- it87_RXEN_mask = 0;
+- outb(0x1, io + IT87_CIR_RCR);
+- /* turn off irqs */
+- outb(0, io + IT87_CIR_IER);
+- /* fifo clear */
+- outb(IT87_CIR_TCR1_FIFOCLR, io+IT87_CIR_TCR1);
+- /* reset */
+- outb(IT87_CIR_IER_RESET, io+IT87_CIR_IER);
+- enable_irq(irq);
+- spin_unlock_irqrestore(&hardware_lock, flags);
+-}
+-
+-
+-static unsigned char it87_read(unsigned char port)
+-{
+- outb(port, IT87_ADRPORT);
+- return inb(IT87_DATAPORT);
+-}
+-
+-
+-static void it87_write(unsigned char port, unsigned char data)
+-{
+- outb(port, IT87_ADRPORT);
+- outb(data, IT87_DATAPORT);
+-}
+-
+-
+-/* SECTION: Initialisation */
+-
+-static int init_port(void)
+-{
+- unsigned long hw_flags;
+- int retval = 0;
+-
+- unsigned char init_bytes[4] = IT87_INIT;
+- unsigned char it87_chipid = 0;
+- unsigned char ldn = 0;
+- unsigned int it87_io = 0;
+- unsigned int it87_irq = 0;
+-
+- /* Enter MB PnP Mode */
+- outb(init_bytes[0], IT87_ADRPORT);
+- outb(init_bytes[1], IT87_ADRPORT);
+- outb(init_bytes[2], IT87_ADRPORT);
+- outb(init_bytes[3], IT87_ADRPORT);
+-
+- /* 8712 or 8705 ? */
+- it87_chipid = it87_read(IT87_CHIP_ID1);
+- if (it87_chipid != 0x87) {
+- retval = -ENXIO;
+- return retval;
+- }
+- it87_chipid = it87_read(IT87_CHIP_ID2);
+- if ((it87_chipid != 0x05) &&
+- (it87_chipid != 0x12) &&
+- (it87_chipid != 0x18) &&
+- (it87_chipid != 0x20)) {
+- printk(KERN_INFO LIRC_DRIVER_NAME
+- ": no IT8704/05/12/18/20 found (claimed IT87%02x), "
+- "exiting..\n", it87_chipid);
+- retval = -ENXIO;
+- return retval;
+- }
+- printk(KERN_INFO LIRC_DRIVER_NAME
+- ": found IT87%02x.\n",
+- it87_chipid);
+-
+- /* get I/O-Port and IRQ */
+- if (it87_chipid == 0x12 || it87_chipid == 0x18)
+- ldn = IT8712_CIR_LDN;
+- else
+- ldn = IT8705_CIR_LDN;
+- it87_write(IT87_LDN, ldn);
+-
+- it87_io = it87_read(IT87_CIR_BASE_MSB) * 256 +
+- it87_read(IT87_CIR_BASE_LSB);
+- if (it87_io == 0) {
+- if (io == 0)
+- io = IT87_CIR_DEFAULT_IOBASE;
+- printk(KERN_INFO LIRC_DRIVER_NAME
+- ": set default io 0x%x\n",
+- io);
+- it87_write(IT87_CIR_BASE_MSB, io / 0x100);
+- it87_write(IT87_CIR_BASE_LSB, io % 0x100);
+- } else
+- io = it87_io;
+-
+- it87_irq = it87_read(IT87_CIR_IRQ);
+- if (digimatrix || it87_irq == 0) {
+- if (irq == 0)
+- irq = IT87_CIR_DEFAULT_IRQ;
+- printk(KERN_INFO LIRC_DRIVER_NAME
+- ": set default irq 0x%x\n",
+- irq);
+- it87_write(IT87_CIR_IRQ, irq);
+- } else
+- irq = it87_irq;
+-
+- spin_lock_irqsave(&hardware_lock, hw_flags);
+- /* reset */
+- outb(IT87_CIR_IER_RESET, io+IT87_CIR_IER);
+- /* fifo clear */
+- outb(IT87_CIR_TCR1_FIFOCLR |
+- /* IT87_CIR_TCR1_ILE | */
+- IT87_CIR_TCR1_TXRLE |
+- IT87_CIR_TCR1_TXENDF, io+IT87_CIR_TCR1);
+- spin_unlock_irqrestore(&hardware_lock, hw_flags);
+-
+- /* get I/O port access and IRQ line */
+- if (request_region(io, 8, LIRC_DRIVER_NAME) == NULL) {
+- printk(KERN_ERR LIRC_DRIVER_NAME
+- ": i/o port 0x%.4x already in use.\n", io);
+- /* Leaving MB PnP Mode */
+- it87_write(IT87_CFGCTRL, 0x2);
+- return -EBUSY;
+- }
+-
+- /* activate CIR-Device */
+- it87_write(IT87_CIR_ACT, 0x1);
+-
+- /* Leaving MB PnP Mode */
+- it87_write(IT87_CFGCTRL, 0x2);
+-
+- retval = request_irq(irq, it87_interrupt, 0 /*IRQF_DISABLED*/,
+- LIRC_DRIVER_NAME, NULL);
+- if (retval < 0) {
+- printk(KERN_ERR LIRC_DRIVER_NAME
+- ": IRQ %d already in use.\n",
+- irq);
+- release_region(io, 8);
+- return retval;
+- }
+-
+- printk(KERN_INFO LIRC_DRIVER_NAME
+- ": I/O port 0x%.4x, IRQ %d.\n", io, irq);
+-
+- init_timer(&timerlist);
+- timerlist.function = it87_timeout;
+- timerlist.data = 0xabadcafe;
+-
+- return 0;
+-}
+-
+-
+-static void drop_port(void)
+-{
+-#if 0
+- unsigned char init_bytes[4] = IT87_INIT;
+-
+- /* Enter MB PnP Mode */
+- outb(init_bytes[0], IT87_ADRPORT);
+- outb(init_bytes[1], IT87_ADRPORT);
+- outb(init_bytes[2], IT87_ADRPORT);
+- outb(init_bytes[3], IT87_ADRPORT);
+-
+- /* deactivate CIR-Device */
+- it87_write(IT87_CIR_ACT, 0x0);
+-
+- /* Leaving MB PnP Mode */
+- it87_write(IT87_CFGCTRL, 0x2);
+-#endif
+-
+- del_timer_sync(&timerlist);
+- free_irq(irq, NULL);
+- release_region(io, 8);
+-}
+-
+-
+-static int init_lirc_it87(void)
+-{
+- int retval;
+-
+- init_waitqueue_head(&lirc_read_queue);
+- retval = init_port();
+- if (retval < 0)
+- return retval;
+- init_hardware();
+- printk(KERN_INFO LIRC_DRIVER_NAME ": Installed.\n");
+- return 0;
+-}
+-
+-static int it87_probe(struct pnp_dev *pnp_dev,
+- const struct pnp_device_id *dev_id)
+-{
+- int retval;
+-
+- driver.dev = &pnp_dev->dev;
+-
+- retval = init_chrdev();
+- if (retval < 0)
+- return retval;
+-
+- retval = init_lirc_it87();
+- if (retval)
+- goto init_lirc_it87_failed;
+-
+- return 0;
+-
+-init_lirc_it87_failed:
+- drop_chrdev();
+-
+- return retval;
+-}
+-
+-static int __init lirc_it87_init(void)
+-{
+- return pnp_register_driver(&it87_pnp_driver);
+-}
+-
+-
+-static void __exit lirc_it87_exit(void)
+-{
+- drop_hardware();
+- drop_chrdev();
+- drop_port();
+- pnp_unregister_driver(&it87_pnp_driver);
+- printk(KERN_INFO LIRC_DRIVER_NAME ": Uninstalled.\n");
+-}
+-
+-/* SECTION: PNP for ITE8704/18 */
+-
+-static const struct pnp_device_id pnp_dev_table[] = {
+- {"ITE8704", 0},
+- {}
+-};
+-
+-MODULE_DEVICE_TABLE(pnp, pnp_dev_table);
+-
+-static struct pnp_driver it87_pnp_driver = {
+- .name = LIRC_DRIVER_NAME,
+- .id_table = pnp_dev_table,
+- .probe = it87_probe,
+-};
+-
+-module_init(lirc_it87_init);
+-module_exit(lirc_it87_exit);
+-
+-MODULE_DESCRIPTION("LIRC driver for ITE IT8704/05/12/18/20 CIR port");
+-MODULE_AUTHOR("Hans-Gunter Lutke Uphues");
+-MODULE_LICENSE("GPL");
+-
+-module_param(io, int, S_IRUGO);
+-MODULE_PARM_DESC(io, "I/O base address (default: 0x310)");
+-
+-module_param(irq, int, S_IRUGO);
+-#ifdef LIRC_IT87_DIGIMATRIX
+-MODULE_PARM_DESC(irq, "Interrupt (1,3-12) (default: 9)");
+-#else
+-MODULE_PARM_DESC(irq, "Interrupt (1,3-12) (default: 7)");
+-#endif
+-
+-module_param(it87_enable_demodulator, bool, S_IRUGO);
+-MODULE_PARM_DESC(it87_enable_demodulator,
+- "Receiver demodulator enable/disable (1/0), default: 0");
+-
+-module_param(debug, bool, S_IRUGO | S_IWUSR);
+-MODULE_PARM_DESC(debug, "Enable debugging messages");
+-
+-module_param(digimatrix, bool, S_IRUGO | S_IWUSR);
+-#ifdef LIRC_IT87_DIGIMATRIX
+-MODULE_PARM_DESC(digimatrix,
+- "Asus Digimatrix it87 compat. enable/disable (1/0), default: 1");
+-#else
+-MODULE_PARM_DESC(digimatrix,
+- "Asus Digimatrix it87 compat. enable/disable (1/0), default: 0");
+-#endif
+-
+-
+-module_param(it87_freq, int, S_IRUGO);
+-#ifdef LIRC_IT87_DIGIMATRIX
+-MODULE_PARM_DESC(it87_freq,
+- "Carrier demodulator frequency (kHz), (default: 36)");
+-#else
+-MODULE_PARM_DESC(it87_freq,
+- "Carrier demodulator frequency (kHz), (default: 38)");
+-#endif
+diff -Naur linux-2.6.36.2/drivers/staging/lirc/lirc_it87.h linux-2.6.36.2.patch/drivers/staging/lirc/lirc_it87.h
+--- linux-2.6.36.2/drivers/staging/lirc/lirc_it87.h 2010-12-09 23:17:27.000000000 +0100
++++ linux-2.6.36.2.patch/drivers/staging/lirc/lirc_it87.h 1970-01-01 01:00:00.000000000 +0100
+@@ -1,116 +0,0 @@
+-/* lirc_it87.h */
+-/* SECTION: Definitions */
+-
+-/********************************* ITE IT87xx ************************/
+-
+-/* based on the following documentation from ITE:
+- a) IT8712F Preliminary CIR Programming Guide V0.1
+- b) IT8705F Simple LPC I/O Preliminary Specification V0.3
+- c) IT8712F EC-LPC I/O Preliminary Specification V0.5
+-*/
+-
+-/* IT8712/05 Ports: */
+-#define IT87_ADRPORT 0x2e
+-#define IT87_DATAPORT 0x2f
+-#define IT87_INIT {0x87, 0x01, 0x55, 0x55}
+-
+-/* alternate Ports: */
+-/*
+-#define IT87_ADRPORT 0x4e
+-#define IT87_DATAPORT 0x4f
+-#define IT87_INIT {0x87, 0x01, 0x55, 0xaa}
+- */
+-
+-/* IT8712/05 Registers */
+-#define IT87_CFGCTRL 0x2
+-#define IT87_LDN 0x7
+-#define IT87_CHIP_ID1 0x20
+-#define IT87_CHIP_ID2 0x21
+-#define IT87_CFG_VERSION 0x22
+-#define IT87_SWSUSPEND 0x23
+-
+-#define IT8712_CIR_LDN 0xa
+-#define IT8705_CIR_LDN 0x7
+-
+-/* CIR Configuration Registers: */
+-#define IT87_CIR_ACT 0x30
+-#define IT87_CIR_BASE_MSB 0x60
+-#define IT87_CIR_BASE_LSB 0x61
+-#define IT87_CIR_IRQ 0x70
+-#define IT87_CIR_CONFIG 0xf0
+-
+-/* List of IT87_CIR registers: offset to BaseAddr */
+-#define IT87_CIR_DR 0
+-#define IT87_CIR_IER 1
+-#define IT87_CIR_RCR 2
+-#define IT87_CIR_TCR1 3
+-#define IT87_CIR_TCR2 4
+-#define IT87_CIR_TSR 5
+-#define IT87_CIR_RSR 6
+-#define IT87_CIR_BDLR 5
+-#define IT87_CIR_BDHR 6
+-#define IT87_CIR_IIR 7
+-
+-/* Bit Definition */
+-/* IER: */
+-#define IT87_CIR_IER_TM_EN 0x80
+-#define IT87_CIR_IER_RESEVED 0x40
+-#define IT87_CIR_IER_RESET 0x20
+-#define IT87_CIR_IER_BR 0x10
+-#define IT87_CIR_IER_IEC 0x8
+-#define IT87_CIR_IER_RFOIE 0x4
+-#define IT87_CIR_IER_RDAIE 0x2
+-#define IT87_CIR_IER_TLDLIE 0x1
+-
+-/* RCR: */
+-#define IT87_CIR_RCR_RDWOS 0x80
+-#define IT87_CIR_RCR_HCFS 0x40
+-#define IT87_CIR_RCR_RXEN 0x20
+-#define IT87_CIR_RCR_RXEND 0x10
+-#define IT87_CIR_RCR_RXACT 0x8
+-#define IT87_CIR_RCR_RXDCR 0x7
+-
+-/* TCR1: */
+-#define IT87_CIR_TCR1_FIFOCLR 0x80
+-#define IT87_CIR_TCR1_ILE 0x40
+-#define IT87_CIR_TCR1_FIFOTL 0x30
+-#define IT87_CIR_TCR1_TXRLE 0x8
+-#define IT87_CIR_TCR1_TXENDF 0x4
+-#define IT87_CIR_TCR1_TXMPM 0x3
+-
+-/* TCR2: */
+-#define IT87_CIR_TCR2_CFQ 0xf8
+-#define IT87_CIR_TCR2_TXMPW 0x7
+-
+-/* TSR: */
+-#define IT87_CIR_TSR_RESERVED 0xc0
+-#define IT87_CIR_TSR_TXFBC 0x3f
+-
+-/* RSR: */
+-#define IT87_CIR_RSR_RXFTO 0x80
+-#define IT87_CIR_RSR_RESERVED 0x40
+-#define IT87_CIR_RSR_RXFBC 0x3f
+-
+-/* IIR: */
+-#define IT87_CIR_IIR_RESERVED 0xf8
+-#define IT87_CIR_IIR_IID 0x6
+-#define IT87_CIR_IIR_IIP 0x1
+-
+-/* TM: */
+-#define IT87_CIR_TM_IL_SEL 0x80
+-#define IT87_CIR_TM_RESERVED 0x40
+-#define IT87_CIR_TM_TM_REG 0x3f
+-
+-#define IT87_CIR_FIFO_SIZE 32
+-
+-/* Baudratedivisor for IT87: power of 2: only 1,2,4 or 8) */
+-#define IT87_CIR_BAUDRATE_DIVISOR 0x1
+-#define IT87_CIR_DEFAULT_IOBASE 0x310
+-#define IT87_CIR_DEFAULT_IRQ 0x7
+-#define IT87_CIR_SPACE 0x00
+-#define IT87_CIR_PULSE 0xff
+-#define IT87_CIR_FREQ_MIN 27
+-#define IT87_CIR_FREQ_MAX 58
+-#define TIME_CONST (IT87_CIR_BAUDRATE_DIVISOR * 8000000ul / 115200ul)
+-
+-/********************************* ITE IT87xx ************************/
+diff -Naur linux-2.6.36.2/drivers/staging/lirc/Makefile linux-2.6.36.2.patch/drivers/staging/lirc/Makefile
+--- linux-2.6.36.2/drivers/staging/lirc/Makefile 2010-12-09 23:17:27.000000000 +0100
++++ linux-2.6.36.2.patch/drivers/staging/lirc/Makefile 2010-12-11 22:18:26.840935467 +0100
+@@ -7,7 +7,6 @@
+ obj-$(CONFIG_LIRC_I2C) += lirc_i2c.o
+ obj-$(CONFIG_LIRC_IGORPLUGUSB) += lirc_igorplugusb.o
+ obj-$(CONFIG_LIRC_IMON) += lirc_imon.o
+-obj-$(CONFIG_LIRC_IT87) += lirc_it87.o
+ obj-$(CONFIG_LIRC_ITE8709) += lirc_ite8709.o
+ obj-$(CONFIG_LIRC_PARALLEL) += lirc_parallel.o
+ obj-$(CONFIG_LIRC_SASEM) += lirc_sasem.o
diff --git a/packages/linux/meta b/packages/linux/meta
index b7dd26647d..fdec60f27e 100644
--- a/packages/linux/meta
+++ b/packages/linux/meta
@@ -1,5 +1,5 @@
PKG_NAME="linux"
-PKG_VERSION="2.6.36.1"
+PKG_VERSION="2.6.36.2"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
diff --git a/packages/linux/patches/linux-2.6.36.1-000_crosscompile.patch b/packages/linux/patches/linux-2.6.36.2-000_crosscompile.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-000_crosscompile.patch
rename to packages/linux/patches/linux-2.6.36.2-000_crosscompile.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-002_bash_only_feature.patch b/packages/linux/patches/linux-2.6.36.2-002_bash_only_feature.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-002_bash_only_feature.patch
rename to packages/linux/patches/linux-2.6.36.2-002_bash_only_feature.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-003-no_dev_console.patch b/packages/linux/patches/linux-2.6.36.2-003-no_dev_console.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-003-no_dev_console.patch
rename to packages/linux/patches/linux-2.6.36.2-003-no_dev_console.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-004_lower_undefined_mode_timeout.patch b/packages/linux/patches/linux-2.6.36.2-004_lower_undefined_mode_timeout.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-004_lower_undefined_mode_timeout.patch
rename to packages/linux/patches/linux-2.6.36.2-004_lower_undefined_mode_timeout.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-005_kconfig_no_timestamp.patch b/packages/linux/patches/linux-2.6.36.2-005_kconfig_no_timestamp.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-005_kconfig_no_timestamp.patch
rename to packages/linux/patches/linux-2.6.36.2-005_kconfig_no_timestamp.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-006_enable_utf8.patch b/packages/linux/patches/linux-2.6.36.2-006_enable_utf8.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-006_enable_utf8.patch
rename to packages/linux/patches/linux-2.6.36.2-006_enable_utf8.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-007_die_floppy_die.patch b/packages/linux/patches/linux-2.6.36.2-007_die_floppy_die.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-007_die_floppy_die.patch
rename to packages/linux/patches/linux-2.6.36.2-007_die_floppy_die.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-008-hda_intel_prealloc_4mb_dmabuffer.patch b/packages/linux/patches/linux-2.6.36.2-008-hda_intel_prealloc_4mb_dmabuffer.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-008-hda_intel_prealloc_4mb_dmabuffer.patch
rename to packages/linux/patches/linux-2.6.36.2-008-hda_intel_prealloc_4mb_dmabuffer.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-009_disable_i8042_check_on_apple_mac.patch b/packages/linux/patches/linux-2.6.36.2-009_disable_i8042_check_on_apple_mac.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-009_disable_i8042_check_on_apple_mac.patch
rename to packages/linux/patches/linux-2.6.36.2-009_disable_i8042_check_on_apple_mac.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-050_add_appleir_usb_driver.patch b/packages/linux/patches/linux-2.6.36.2-050_add_appleir_usb_driver.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-050_add_appleir_usb_driver.patch
rename to packages/linux/patches/linux-2.6.36.2-050_add_appleir_usb_driver.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-051-add_nuvoton_cir-0.2.patch b/packages/linux/patches/linux-2.6.36.2-051-add_nuvoton_cir-0.2.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-051-add_nuvoton_cir-0.2.patch
rename to packages/linux/patches/linux-2.6.36.2-051-add_nuvoton_cir-0.2.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-052-aureal_remote_quirk-0.1.patch b/packages/linux/patches/linux-2.6.36.2-052-aureal_remote_quirk-0.1.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-052-aureal_remote_quirk-0.1.patch
rename to packages/linux/patches/linux-2.6.36.2-052-aureal_remote_quirk-0.1.patch
diff --git a/packages/linux/patches/linux-2.6.36.1-201-drm_vmware_revert_abb295f3b3db602f91accf58b526b30b48673af1.patch b/packages/linux/patches/linux-2.6.36.2-201-drm_vmware_revert_abb295f3b3db602f91accf58b526b30b48673af1.patch
similarity index 100%
rename from packages/linux/patches/linux-2.6.36.1-201-drm_vmware_revert_abb295f3b3db602f91accf58b526b30b48673af1.patch
rename to packages/linux/patches/linux-2.6.36.2-201-drm_vmware_revert_abb295f3b3db602f91accf58b526b30b48673af1.patch
diff --git a/packages/linux/patches/linux-2.6.37-rc3-110-drm_nouveau_upstream-20101122.patch b/packages/linux/patches/linux-2.6.37-rc3-110-drm_nouveau_upstream-20101205.patch
similarity index 95%
rename from packages/linux/patches/linux-2.6.37-rc3-110-drm_nouveau_upstream-20101122.patch
rename to packages/linux/patches/linux-2.6.37-rc3-110-drm_nouveau_upstream-20101205.patch
index eadd453274..118d59f7e6 100644
--- a/packages/linux/patches/linux-2.6.37-rc3-110-drm_nouveau_upstream-20101122.patch
+++ b/packages/linux/patches/linux-2.6.37-rc3-110-drm_nouveau_upstream-20101205.patch
@@ -1,6 +1,6 @@
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/Makefile linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/Makefile
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/Makefile 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/Makefile 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/Makefile 2010-12-03 04:56:22.000000000 +0100
@@ -5,7 +5,7 @@
ccflags-y := -Iinclude/drm
nouveau-y := nouveau_drv.o nouveau_state.o nouveau_channel.o nouveau_mem.o \
@@ -23,7 +23,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/Makefile linux-2.6.37-rc3.no
nv04_crtc.o nv04_display.o nv04_cursor.o nv04_fbcon.o \
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bios.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_bios.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bios.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_bios.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_bios.c 2010-12-03 04:56:22.000000000 +0100
@@ -6039,7 +6039,6 @@
if (type != cte->type)
NV_WARN(dev, " -> type 0x%02x\n", cte->type);
@@ -177,7 +177,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bios.c linux-2.6.37-
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_bo.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bo.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_bo.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_bo.c 2010-12-03 04:56:22.000000000 +0100
@@ -46,9 +46,7 @@
if (unlikely(nvbo->gem))
DRM_ERROR("bo %p still attached to GEM object\n", bo);
@@ -189,7 +189,46 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.37-rc
kfree(nvbo);
}
-@@ -426,8 +424,9 @@
+@@ -244,7 +242,7 @@
+
+ nouveau_bo_placement_set(nvbo, memtype, 0);
+
+- ret = ttm_bo_validate(bo, &nvbo->placement, false, false, false);
++ ret = nouveau_bo_validate(nvbo, false, false, false);
+ if (ret == 0) {
+ switch (bo->mem.mem_type) {
+ case TTM_PL_VRAM:
+@@ -280,7 +278,7 @@
+
+ nouveau_bo_placement_set(nvbo, bo->mem.placement, 0);
+
+- ret = ttm_bo_validate(bo, &nvbo->placement, false, false, false);
++ ret = nouveau_bo_validate(nvbo, false, false, false);
+ if (ret == 0) {
+ switch (bo->mem.mem_type) {
+ case TTM_PL_VRAM:
+@@ -319,6 +317,20 @@
+ ttm_bo_kunmap(&nvbo->kmap);
+ }
+
++int
++nouveau_bo_validate(struct nouveau_bo *nvbo, bool interruptible,
++ bool no_wait_reserve, bool no_wait_gpu)
++{
++ int ret;
++
++ ret = ttm_bo_validate(&nvbo->bo, &nvbo->placement, interruptible,
++ no_wait_reserve, no_wait_gpu);
++ if (ret)
++ return ret;
++
++ return 0;
++}
++
+ u16
+ nouveau_bo_rd16(struct nouveau_bo *nvbo, unsigned index)
+ {
+@@ -426,8 +438,9 @@
switch (dev_priv->gart_info.type) {
case NOUVEAU_GART_AGP:
man->flags = TTM_MEMTYPE_FLAG_MAPPABLE;
@@ -201,7 +240,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.37-rc
break;
case NOUVEAU_GART_SGDMA:
man->flags = TTM_MEMTYPE_FLAG_MAPPABLE |
-@@ -485,16 +484,9 @@
+@@ -485,16 +498,9 @@
if (ret)
return ret;
@@ -219,7 +258,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.37-rc
return ret;
}
-@@ -683,17 +675,24 @@
+@@ -683,17 +689,24 @@
int ret;
chan = nvbo->channel;
@@ -248,7 +287,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.37-rc
}
static int
-@@ -792,7 +791,8 @@
+@@ -792,7 +805,8 @@
} else if (dev_priv->card_type >= NV_10) {
*new_tile = nv10_mem_set_tiling(dev, offset, new_mem->size,
@@ -258,7 +297,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.37-rc
}
return 0;
-@@ -808,9 +808,7 @@
+@@ -808,9 +822,7 @@
if (dev_priv->card_type >= NV_10 &&
dev_priv->card_type < NV_50) {
@@ -269,10 +308,14 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.37-rc
*old_tile = new_tile;
}
}
-@@ -942,6 +940,22 @@
- return ttm_bo_validate(bo, &nvbo->placement, false, true, false);
- }
-
+@@ -939,7 +951,23 @@
+ nvbo->placement.fpfn = 0;
+ nvbo->placement.lpfn = dev_priv->fb_mappable_pages;
+ nouveau_bo_placement_set(nvbo, TTM_PL_VRAM, 0);
+- return ttm_bo_validate(bo, &nvbo->placement, false, true, false);
++ return nouveau_bo_validate(nvbo, false, true, false);
++}
++
+void
+nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence)
+{
@@ -287,12 +330,10 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.37-rc
+ spin_unlock(&nvbo->bo.lock);
+
+ nouveau_fence_unref(&old_fence);
-+}
-+
+ }
+
struct ttm_bo_driver nouveau_bo_driver = {
- .create_ttm_backend_entry = nouveau_bo_create_ttm_backend_entry,
- .invalidate_caches = nouveau_bo_invalidate_caches,
-@@ -949,11 +963,11 @@
+@@ -949,11 +977,11 @@
.evict_flags = nouveau_bo_evict_flags,
.move = nouveau_bo_move,
.verify_access = nouveau_bo_verify_access,
@@ -311,7 +352,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_bo.c linux-2.6.37-rc
.io_mem_free = &nouveau_ttm_io_mem_free,
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_channel.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_channel.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_channel.c 2010-12-03 04:56:22.000000000 +0100
@@ -39,22 +39,22 @@
if (dev_priv->card_type >= NV_50) {
@@ -358,7 +399,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
chan->pushbuf_base = pb->bo.mem.start << PAGE_SHIFT;
}
-@@ -107,53 +106,56 @@
+@@ -107,74 +106,60 @@
int
nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
struct drm_file *file_priv,
@@ -370,9 +411,8 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
struct nouveau_channel *chan;
- int channel, user;
-- int ret;
+ unsigned long flags;
-+ int user, ret;
+ int ret;
- /*
- * Alright, here is the full story
@@ -444,30 +484,28 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
return ret;
}
-@@ -161,18 +163,18 @@
-
- /* Locate channel's user control regs */
- if (dev_priv->card_type < NV_40)
+ nouveau_dma_pre_init(chan);
+-
+- /* Locate channel's user control regs */
+- if (dev_priv->card_type < NV_40)
- user = NV03_USER(channel);
-+ user = NV03_USER(chan->id);
- else
- if (dev_priv->card_type < NV_50)
+- else
+- if (dev_priv->card_type < NV_50)
- user = NV40_USER(channel);
-+ user = NV40_USER(chan->id);
- else
+- else
- user = NV50_USER(channel);
-+ user = NV50_USER(chan->id);
-
- chan->user = ioremap(pci_resource_start(dev->pdev, 0) + user,
- PAGE_SIZE);
- if (!chan->user) {
- NV_ERROR(dev, "ioremap of regs failed.\n");
+-
+- chan->user = ioremap(pci_resource_start(dev->pdev, 0) + user,
+- PAGE_SIZE);
+- if (!chan->user) {
+- NV_ERROR(dev, "ioremap of regs failed.\n");
- nouveau_channel_free(chan);
-+ nouveau_channel_put(&chan);
- return -ENOMEM;
- }
+- return -ENOMEM;
+- }
chan->user_put = 0x40;
-@@ -182,15 +184,15 @@
+ chan->user_get = 0x44;
+
+@@ -182,15 +167,15 @@
ret = nouveau_notifier_init_channel(chan);
if (ret) {
NV_ERROR(dev, "ntfy %d\n", ret);
@@ -486,7 +524,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
return ret;
}
-@@ -198,7 +200,7 @@
+@@ -198,7 +183,7 @@
ret = nouveau_channel_pushbuf_ctxdma_init(chan);
if (ret) {
NV_ERROR(dev, "pbctxdma %d\n", ret);
@@ -495,7 +533,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
return ret;
}
-@@ -206,16 +208,18 @@
+@@ -206,16 +191,18 @@
pfifo->reassign(dev, false);
/* Create a graphics context for new channel */
@@ -519,7 +557,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
return ret;
}
-@@ -225,83 +229,108 @@
+@@ -225,83 +212,108 @@
if (!ret)
ret = nouveau_fence_channel_init(chan);
if (ret) {
@@ -606,13 +644,13 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
- ret = nouveau_fence_wait(fence, NULL, false, false);
- nouveau_fence_unref((void *)&fence);
- }
--
-- if (ret)
-- NV_ERROR(dev, "Failed to idle channel %d.\n", chan->id);
-- }
+ /* give it chance to idle */
+ nouveau_channel_idle(chan);
+- if (ret)
+- NV_ERROR(dev, "Failed to idle channel %d.\n", chan->id);
+- }
+-
- /* Ensure all outstanding fences are signaled. They should be if the
+ /* ensure all outstanding fences are signaled. they should be if the
* above attempts at idling were OK, but if we failed this'll tell TTM
@@ -669,11 +707,14 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
nouveau_gpuobj_ref(NULL, &chan->pushbuf);
if (chan->pushbuf_bo) {
nouveau_bo_unmap(chan->pushbuf_bo);
-@@ -310,44 +339,83 @@
+@@ -310,44 +322,80 @@
}
nouveau_gpuobj_channel_takedown(chan);
nouveau_notifier_takedown_channel(chan);
-+
+- if (chan->user)
+- iounmap(chan->user);
+
+- dev_priv->fifos[chan->id] = NULL;
+ nouveau_channel_ref(NULL, pchan);
+}
+
@@ -690,10 +731,6 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
+ struct nouveau_channel *chan =
+ container_of(ref, struct nouveau_channel, ref);
+
- if (chan->user)
- iounmap(chan->user);
-
-- dev_priv->fifos[chan->id] = NULL;
kfree(chan);
}
@@ -771,7 +808,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
/***********************************
* ioctls wrapping the functions
-@@ -395,24 +463,26 @@
+@@ -395,24 +443,26 @@
/* Named memory object area */
ret = drm_gem_handle_create(file_priv, chan->notifier_bo->gem,
&init->notifier_handle);
@@ -806,7 +843,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
return 0;
}
-@@ -421,18 +491,18 @@
+@@ -421,18 +471,18 @@
***********************************/
struct drm_ioctl_desc nouveau_ioctls[] = {
@@ -839,7 +876,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_channel.c linux-2.6.
int nouveau_max_ioctl = DRM_ARRAY_SIZE(nouveau_ioctls);
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_connector.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_connector.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_connector.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_connector.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_connector.c 2010-12-03 04:56:22.000000000 +0100
@@ -37,6 +37,8 @@
#include "nouveau_connector.h"
#include "nouveau_hw.h"
@@ -938,7 +975,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_connector.c linux-2.
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_display.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_display.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_display.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_display.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_display.c 2010-12-03 04:56:22.000000000 +0100
@@ -29,6 +29,9 @@
#include "nouveau_drv.h"
#include "nouveau_fb.h"
@@ -1157,9 +1194,32 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_display.c linux-2.6.
+ spin_unlock_irqrestore(&dev->event_lock, flags);
+ return 0;
+}
+diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_dma.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_dma.c
+--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_dma.c 2010-11-22 00:18:56.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_dma.c 2010-12-03 04:56:22.000000000 +0100
+@@ -59,17 +59,11 @@
+ {
+ struct drm_device *dev = chan->dev;
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
+- struct nouveau_gpuobj *obj = NULL;
+ int ret, i;
+
+ /* Create NV_MEMORY_TO_MEMORY_FORMAT for buffer moves */
+- ret = nouveau_gpuobj_gr_new(chan, dev_priv->card_type < NV_50 ?
+- 0x0039 : 0x5039, &obj);
+- if (ret)
+- return ret;
+-
+- ret = nouveau_ramht_insert(chan, NvM2MF, obj);
+- nouveau_gpuobj_ref(NULL, &obj);
++ ret = nouveau_gpuobj_gr_new(chan, NvM2MF, dev_priv->card_type < NV_50 ?
++ 0x0039 : 0x5039);
+ if (ret)
+ return ret;
+
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_dp.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_dp.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_dp.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_dp.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_dp.c 2010-12-03 04:56:22.000000000 +0100
@@ -279,7 +279,7 @@
struct bit_displayport_encoder_table *dpe;
int dpe_headerlen;
@@ -1189,7 +1249,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_dp.c linux-2.6.37-rc
}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.c 2010-12-03 04:56:22.000000000 +0100
@@ -115,6 +115,10 @@
int nouveau_perflvl_wr;
module_param_named(perflvl_wr, nouveau_perflvl_wr, int, 0400);
@@ -1314,7 +1374,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.c linux-2.6.37-r
}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.h
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.h 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_drv.h 2010-12-03 04:56:22.000000000 +0100
@@ -54,6 +54,7 @@
#include "nouveau_drm.h"
#include "nouveau_reg.h"
@@ -1640,7 +1700,20 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern int nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state);
extern int nouveau_pci_resume(struct pci_dev *pdev);
-@@ -775,13 +808,12 @@
+@@ -762,8 +795,10 @@
+ struct drm_file *);
+ extern int nouveau_ioctl_setparam(struct drm_device *, void *data,
+ struct drm_file *);
+-extern bool nouveau_wait_until(struct drm_device *, uint64_t timeout,
+- uint32_t reg, uint32_t mask, uint32_t val);
++extern bool nouveau_wait_eq(struct drm_device *, uint64_t timeout,
++ uint32_t reg, uint32_t mask, uint32_t val);
++extern bool nouveau_wait_ne(struct drm_device *, uint64_t timeout,
++ uint32_t reg, uint32_t mask, uint32_t val);
+ extern bool nouveau_wait_for_idle(struct drm_device *);
+ extern int nouveau_card_init(struct drm_device *);
+
+@@ -775,13 +810,12 @@
extern int nouveau_mem_init_agp(struct drm_device *);
extern int nouveau_mem_reset_agp(struct drm_device *);
extern void nouveau_mem_close(struct drm_device *);
@@ -1660,7 +1733,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern int nv50_mem_vm_bind_linear(struct drm_device *, uint64_t virt,
uint32_t size, uint32_t flags,
uint64_t phys);
-@@ -803,21 +835,44 @@
+@@ -803,21 +837,44 @@
extern struct drm_ioctl_desc nouveau_ioctls[];
extern int nouveau_max_ioctl;
extern void nouveau_channel_cleanup(struct drm_device *, struct drm_file *);
@@ -1709,7 +1782,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern int nouveau_gpuobj_channel_init(struct nouveau_channel *,
uint32_t vram_h, uint32_t tt_h);
extern void nouveau_gpuobj_channel_takedown(struct nouveau_channel *);
-@@ -832,21 +887,26 @@
+@@ -832,21 +889,25 @@
extern int nouveau_gpuobj_dma_new(struct nouveau_channel *, int class,
uint64_t offset, uint64_t size, int access,
int target, struct nouveau_gpuobj **);
@@ -1717,10 +1790,11 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
- uint64_t offset, uint64_t size,
- int access, struct nouveau_gpuobj **,
- uint32_t *o_ret);
- extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, int class,
- struct nouveau_gpuobj **);
+-extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, int class,
+- struct nouveau_gpuobj **);
-extern int nouveau_gpuobj_sw_new(struct nouveau_channel *, int class,
- struct nouveau_gpuobj **);
++extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, u32 handle, int class);
+extern int nv50_gpuobj_dma_new(struct nouveau_channel *, int class, u64 base,
+ u64 size, int target, int access, u32 type,
+ u32 comp, struct nouveau_gpuobj **pobj);
@@ -1742,7 +1816,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern void nouveau_irq_preinstall(struct drm_device *);
extern int nouveau_irq_postinstall(struct drm_device *);
extern void nouveau_irq_uninstall(struct drm_device *);
-@@ -966,18 +1026,25 @@
+@@ -966,18 +1027,25 @@
/* nv10_fb.c */
extern int nv10_fb_init(struct drm_device *);
extern void nv10_fb_takedown(struct drm_device *);
@@ -1772,7 +1846,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
/* nv50_fb.c */
extern int nv50_fb_init(struct drm_device *);
extern void nv50_fb_takedown(struct drm_device *);
-@@ -989,6 +1056,7 @@
+@@ -989,6 +1057,7 @@
/* nv04_fifo.c */
extern int nv04_fifo_init(struct drm_device *);
@@ -1780,7 +1854,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern void nv04_fifo_disable(struct drm_device *);
extern void nv04_fifo_enable(struct drm_device *);
extern bool nv04_fifo_reassign(struct drm_device *, bool);
-@@ -998,19 +1066,18 @@
+@@ -998,19 +1067,18 @@
extern void nv04_fifo_destroy_context(struct nouveau_channel *);
extern int nv04_fifo_load_context(struct nouveau_channel *);
extern int nv04_fifo_unload_context(struct drm_device *);
@@ -1801,7 +1875,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern int nv40_fifo_load_context(struct nouveau_channel *);
extern int nv40_fifo_unload_context(struct drm_device *);
-@@ -1038,7 +1105,6 @@
+@@ -1038,7 +1106,6 @@
extern int nvc0_fifo_unload_context(struct drm_device *);
/* nv04_graph.c */
@@ -1809,7 +1883,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern int nv04_graph_init(struct drm_device *);
extern void nv04_graph_takedown(struct drm_device *);
extern void nv04_graph_fifo_access(struct drm_device *, bool);
-@@ -1047,10 +1113,11 @@
+@@ -1047,10 +1114,11 @@
extern void nv04_graph_destroy_context(struct nouveau_channel *);
extern int nv04_graph_load_context(struct nouveau_channel *);
extern int nv04_graph_unload_context(struct drm_device *);
@@ -1823,7 +1897,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern int nv10_graph_init(struct drm_device *);
extern void nv10_graph_takedown(struct drm_device *);
extern struct nouveau_channel *nv10_graph_channel(struct drm_device *);
-@@ -1058,13 +1125,11 @@
+@@ -1058,13 +1126,11 @@
extern void nv10_graph_destroy_context(struct nouveau_channel *);
extern int nv10_graph_load_context(struct nouveau_channel *);
extern int nv10_graph_unload_context(struct drm_device *);
@@ -1840,7 +1914,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern int nv20_graph_create_context(struct nouveau_channel *);
extern void nv20_graph_destroy_context(struct nouveau_channel *);
extern int nv20_graph_load_context(struct nouveau_channel *);
-@@ -1072,11 +1137,9 @@
+@@ -1072,11 +1138,9 @@
extern int nv20_graph_init(struct drm_device *);
extern void nv20_graph_takedown(struct drm_device *);
extern int nv30_graph_init(struct drm_device *);
@@ -1853,7 +1927,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern int nv40_graph_init(struct drm_device *);
extern void nv40_graph_takedown(struct drm_device *);
extern struct nouveau_channel *nv40_graph_channel(struct drm_device *);
-@@ -1085,11 +1148,9 @@
+@@ -1085,11 +1149,9 @@
extern int nv40_graph_load_context(struct nouveau_channel *);
extern int nv40_graph_unload_context(struct drm_device *);
extern void nv40_grctx_init(struct nouveau_grctx *);
@@ -1866,7 +1940,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern int nv50_graph_init(struct drm_device *);
extern void nv50_graph_takedown(struct drm_device *);
extern void nv50_graph_fifo_access(struct drm_device *, bool);
-@@ -1098,7 +1159,6 @@
+@@ -1098,7 +1160,6 @@
extern void nv50_graph_destroy_context(struct nouveau_channel *);
extern int nv50_graph_load_context(struct nouveau_channel *);
extern int nv50_graph_unload_context(struct drm_device *);
@@ -1874,7 +1948,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern int nv50_grctx_init(struct nouveau_grctx *);
extern void nv50_graph_tlb_flush(struct drm_device *dev);
extern void nv86_graph_tlb_flush(struct drm_device *dev);
-@@ -1113,16 +1173,22 @@
+@@ -1113,16 +1174,22 @@
extern int nvc0_graph_load_context(struct nouveau_channel *);
extern int nvc0_graph_unload_context(struct drm_device *);
@@ -1902,7 +1976,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern void nv04_instmem_flush(struct drm_device *);
/* nv50_instmem.c */
-@@ -1130,11 +1196,10 @@
+@@ -1130,11 +1197,10 @@
extern void nv50_instmem_takedown(struct drm_device *);
extern int nv50_instmem_suspend(struct drm_device *);
extern void nv50_instmem_resume(struct drm_device *);
@@ -1918,7 +1992,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern void nv50_instmem_flush(struct drm_device *);
extern void nv84_instmem_flush(struct drm_device *);
extern void nv50_vm_flush(struct drm_device *, int engine);
-@@ -1144,11 +1209,10 @@
+@@ -1144,11 +1210,10 @@
extern void nvc0_instmem_takedown(struct drm_device *);
extern int nvc0_instmem_suspend(struct drm_device *);
extern void nvc0_instmem_resume(struct drm_device *);
@@ -1934,15 +2008,17 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
extern void nvc0_instmem_flush(struct drm_device *);
/* nv04_mc.c */
-@@ -1219,6 +1283,7 @@
+@@ -1219,6 +1284,9 @@
extern void nouveau_bo_wr16(struct nouveau_bo *nvbo, unsigned index, u16 val);
extern u32 nouveau_bo_rd32(struct nouveau_bo *nvbo, unsigned index);
extern void nouveau_bo_wr32(struct nouveau_bo *nvbo, unsigned index, u32 val);
+extern void nouveau_bo_fence(struct nouveau_bo *, struct nouveau_fence *);
++extern int nouveau_bo_validate(struct nouveau_bo *, bool interruptible,
++ bool no_wait_reserve, bool no_wait_gpu);
/* nouveau_fence.c */
struct nouveau_fence;
-@@ -1234,12 +1299,35 @@
+@@ -1234,12 +1302,35 @@
void (*work)(void *priv, bool signalled),
void *priv);
struct nouveau_channel *nouveau_fence_channel(struct nouveau_fence *);
@@ -1983,7 +2059,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
/* nouveau_gem.c */
extern int nouveau_gem_new(struct drm_device *, struct nouveau_channel *,
-@@ -1259,15 +1347,28 @@
+@@ -1259,15 +1350,28 @@
extern int nouveau_gem_ioctl_info(struct drm_device *, void *,
struct drm_file *);
@@ -2013,7 +2089,18 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
/* nv50_calc. */
int nv50_calc_pll(struct drm_device *, struct pll_lims *, int clk,
-@@ -1447,6 +1548,22 @@
+@@ -1334,7 +1438,9 @@
+ }
+
+ #define nv_wait(dev, reg, mask, val) \
+- nouveau_wait_until(dev, 2000000000ULL, (reg), (mask), (val))
++ nouveau_wait_eq(dev, 2000000000ULL, (reg), (mask), (val))
++#define nv_wait_ne(dev, reg, mask, val) \
++ nouveau_wait_ne(dev, 2000000000ULL, (reg), (mask), (val))
+
+ /* PRAMIN access */
+ static inline u32 nv_ri32(struct drm_device *dev, unsigned offset)
+@@ -1447,6 +1553,22 @@
dev->pdev->subsystem_device == sub_device;
}
@@ -2036,7 +2123,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
#define NV_SW 0x0000506e
#define NV_SW_DMA_SEMAPHORE 0x00000060
#define NV_SW_SEMAPHORE_OFFSET 0x00000064
-@@ -1457,5 +1574,6 @@
+@@ -1457,5 +1579,6 @@
#define NV_SW_VBLSEM_OFFSET 0x00000400
#define NV_SW_VBLSEM_RELEASE_VALUE 0x00000404
#define NV_SW_VBLSEM_RELEASE 0x00000408
@@ -2045,7 +2132,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_drv.h linux-2.6.37-r
#endif /* __NOUVEAU_DRV_H__ */
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fbcon.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fbcon.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.c 2010-12-03 04:56:22.000000000 +0100
@@ -49,6 +49,96 @@
#include "nouveau_fbcon.h"
#include "nouveau_dma.h"
@@ -2268,7 +2355,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fbcon.c linux-2.6.37
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fbcon.h linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.h
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fbcon.h 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.h 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_fbcon.h 2010-12-03 04:56:22.000000000 +0100
@@ -40,13 +40,13 @@
void nouveau_fbcon_restore(void);
@@ -2291,7 +2378,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fbcon.h linux-2.6.37
void nouveau_fbcon_gpu_lockup(struct fb_info *info);
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_fence.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fence.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_fence.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_fence.c 2010-12-03 04:56:22.000000000 +0100
@@ -64,6 +64,7 @@
struct nouveau_fence *fence =
container_of(ref, struct nouveau_fence, refcount);
@@ -2352,7 +2439,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-2.6.37
{
struct nouveau_fence *fence = nouveau_fence(sync_obj);
struct nouveau_channel *chan = fence->channel;
-@@ -214,13 +215,13 @@
+@@ -214,13 +215,14 @@
}
int
@@ -2360,6 +2447,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-2.6.37
+__nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
{
unsigned long timeout = jiffies + (3 * DRM_HZ);
++ unsigned long sleep_time = jiffies + 1;
int ret = 0;
while (1) {
@@ -2368,7 +2456,16 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-2.6.37
break;
if (time_after_eq(jiffies, timeout)) {
-@@ -368,7 +369,7 @@
+@@ -230,7 +232,7 @@
+
+ __set_current_state(intr ? TASK_INTERRUPTIBLE
+ : TASK_UNINTERRUPTIBLE);
+- if (lazy)
++ if (lazy && time_after_eq(jiffies, sleep_time))
+ schedule_timeout(1);
+
+ if (intr && signal_pending(current)) {
+@@ -368,7 +370,7 @@
kref_get(&sema->ref);
nouveau_fence_work(fence, semaphore_work, sema);
@@ -2377,7 +2474,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-2.6.37
return 0;
}
-@@ -380,33 +381,49 @@
+@@ -380,33 +382,49 @@
struct nouveau_channel *chan = nouveau_fence_channel(fence);
struct drm_device *dev = wchan->dev;
struct nouveau_semaphore *sema;
@@ -2435,27 +2532,38 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-2.6.37
{
return 0;
}
-@@ -420,7 +437,7 @@
+@@ -420,12 +438,7 @@
int ret;
/* Create an NV_SW object for various sync purposes */
- ret = nouveau_gpuobj_sw_new(chan, NV_SW, &obj);
-+ ret = nouveau_gpuobj_gr_new(chan, NV_SW, &obj);
+- if (ret)
+- return ret;
+-
+- ret = nouveau_ramht_insert(chan, NvSw, obj);
+- nouveau_gpuobj_ref(NULL, &obj);
++ ret = nouveau_gpuobj_gr_new(chan, NvSw, NV_SW);
if (ret)
return ret;
-@@ -442,8 +459,8 @@
+@@ -437,13 +450,12 @@
+
+ /* Create a DMA object for the shared cross-channel sync area. */
+ if (USE_SEMA(dev)) {
+- struct drm_mm_node *mem = dev_priv->fence.bo->bo.mem.mm_node;
++ struct ttm_mem_reg *mem = &dev_priv->fence.bo->bo.mem;
+
ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY,
mem->start << PAGE_SHIFT,
- mem->size << PAGE_SHIFT,
+- mem->size << PAGE_SHIFT,
- NV_DMA_ACCESS_RW,
- NV_DMA_TARGET_VIDMEM, &obj);
-+ NV_MEM_ACCESS_RW,
++ mem->size, NV_MEM_ACCESS_RW,
+ NV_MEM_TARGET_VRAM, &obj);
if (ret)
return ret;
-@@ -473,6 +490,8 @@
+@@ -473,6 +485,8 @@
{
struct nouveau_fence *tmp, *fence;
@@ -2464,7 +2572,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-2.6.37
list_for_each_entry_safe(fence, tmp, &chan->fence.pending, entry) {
fence->signalled = true;
list_del(&fence->entry);
-@@ -482,6 +501,8 @@
+@@ -482,6 +496,8 @@
kref_put(&fence->refcount, nouveau_fence_del);
}
@@ -2475,7 +2583,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_fence.c linux-2.6.37
int
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_gem.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_gem.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_gem.c 2010-12-03 04:56:22.000000000 +0100
@@ -48,9 +48,6 @@
return;
nvbo->gem = NULL;
@@ -2581,12 +2689,13 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
}
return 0;
-@@ -384,10 +359,11 @@
+@@ -383,11 +358,11 @@
+ }
nvbo->channel = (b->read_domains & (1 << 31)) ? NULL : chan;
- ret = ttm_bo_validate(&nvbo->bo, &nvbo->placement,
+- ret = ttm_bo_validate(&nvbo->bo, &nvbo->placement,
- false, false, false);
-+ true, false, false);
++ ret = nouveau_bo_validate(nvbo, true, false, false);
nvbo->channel = NULL;
if (unlikely(ret)) {
- NV_ERROR(dev, "fail ttm_validate\n");
@@ -2595,7 +2704,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
return ret;
}
-@@ -439,13 +415,15 @@
+@@ -439,13 +414,15 @@
ret = validate_init(chan, file_priv, pbbo, nr_buffers, op);
if (unlikely(ret)) {
@@ -2613,7 +2722,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
validate_fini(op, NULL);
return ret;
}
-@@ -453,7 +431,8 @@
+@@ -453,7 +430,8 @@
ret = validate_list(chan, &op->gart_list, pbbo, user_buffers);
if (unlikely(ret < 0)) {
@@ -2623,7 +2732,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
validate_fini(op, NULL);
return ret;
}
-@@ -461,7 +440,8 @@
+@@ -461,7 +439,8 @@
ret = validate_list(chan, &op->both_list, pbbo, user_buffers);
if (unlikely(ret < 0)) {
@@ -2633,7 +2742,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
validate_fini(op, NULL);
return ret;
}
-@@ -585,7 +565,9 @@
+@@ -585,7 +564,9 @@
struct nouveau_fence *fence = NULL;
int i, j, ret = 0, do_reloc = 0;
@@ -2644,7 +2753,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
req->vram_available = dev_priv->fb_aper_free;
req->gart_available = dev_priv->gart_info.aper_free;
-@@ -595,28 +577,34 @@
+@@ -595,28 +576,34 @@
if (unlikely(req->nr_push > NOUVEAU_GEM_MAX_PUSH)) {
NV_ERROR(dev, "pushbuf push count exceeds limit: %d max %d\n",
req->nr_push, NOUVEAU_GEM_MAX_PUSH);
@@ -2680,7 +2789,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
return PTR_ERR(bo);
}
-@@ -639,7 +627,8 @@
+@@ -639,7 +626,8 @@
ret = nouveau_gem_pushbuf_validate(chan, file_priv, bo, req->buffers,
req->nr_buffers, &op, &do_reloc);
if (ret) {
@@ -2690,7 +2799,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
goto out;
}
-@@ -732,7 +721,7 @@
+@@ -732,7 +720,7 @@
out:
validate_fini(&op, fence);
@@ -2699,7 +2808,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
kfree(bo);
kfree(push);
-@@ -750,6 +739,7 @@
+@@ -750,6 +738,7 @@
req->suffix1 = 0x00000000;
}
@@ -2707,7 +2816,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
return ret;
}
-@@ -781,26 +771,9 @@
+@@ -781,26 +770,9 @@
return -ENOENT;
nvbo = nouveau_gem_object(gem);
@@ -2737,7 +2846,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
drm_gem_object_unreference_unlocked(gem);
return ret;
}
-@@ -809,26 +782,7 @@
+@@ -809,26 +781,7 @@
nouveau_gem_ioctl_cpu_fini(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
@@ -2767,7 +2876,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_gem.c linux-2.6.37-r
int
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_hw.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_hw.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_hw.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_hw.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_hw.c 2010-12-03 04:56:22.000000000 +0100
@@ -953,7 +953,7 @@
NVWriteCRTC(dev, head, NV_PCRTC_850, regp->crtc_850);
@@ -2777,6 +2886,17 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_hw.c linux-2.6.37-rc
NVWriteRAMDAC(dev, head, NV_PRAMDAC_900, reg900 | 0x10000);
else
NVWriteRAMDAC(dev, head, NV_PRAMDAC_900, reg900 & ~0x10000);
+@@ -999,8 +999,8 @@
+ if (dev_priv->card_type == NV_10) {
+ /* Not waiting for vertical retrace before modifying
+ CRE_53/CRE_54 causes lockups. */
+- nouveau_wait_until(dev, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x8);
+- nouveau_wait_until(dev, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x0);
++ nouveau_wait_eq(dev, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x8);
++ nouveau_wait_eq(dev, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x0);
+ }
+
+ wr_cio_state(dev, head, regp, NV_CIO_CRE_53);
@@ -1017,8 +1017,9 @@
NVWriteCRTC(dev, head, NV_PCRTC_START, regp->fb_start);
@@ -2791,7 +2911,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_hw.c linux-2.6.37-rc
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_irq.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_irq.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_irq.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_irq.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_irq.c 2010-12-03 04:56:22.000000000 +0100
@@ -36,18 +36,7 @@
#include "nouveau_drv.h"
#include "nouveau_reg.h"
@@ -4064,7 +4184,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_irq.c linux-2.6.37-r
}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_mem.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_mem.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_mem.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_mem.c 2010-12-03 04:56:22.000000000 +0100
@@ -42,83 +42,104 @@
*/
@@ -4218,7 +4338,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_mem.c linux-2.6.37-r
/*
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_notifier.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_notifier.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_notifier.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_notifier.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_notifier.c 2010-12-03 04:56:22.000000000 +0100
@@ -99,7 +99,6 @@
int size, uint32_t *b_offset)
{
@@ -4284,7 +4404,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_notifier.c linux-2.6
}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_object.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_object.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_object.c 2010-12-03 04:56:22.000000000 +0100
@@ -36,6 +36,101 @@
#include "nouveau_drm.h"
#include "nouveau_ramht.h"
@@ -4444,11 +4564,11 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
- nouveau_gpuobj_ref(NULL, &gpuobj);
- return -ENOMEM;
- }
-
+-
- ramin = drm_mm_get_block_atomic(ramin, size, align);
- spin_unlock(&dev_priv->ramin_lock);
- } while (ramin == NULL);
--
+
- /* on nv50 it's ok to fail, we have a fallback path */
- if (!ramin && dev_priv->card_type < NV_50) {
- nouveau_gpuobj_ref(NULL, &gpuobj);
@@ -4595,7 +4715,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
gpuobj->vinst = vinst;
if (gpuobj->flags & NVOBJ_FLAG_ZERO_ALLOC) {
-@@ -335,113 +399,157 @@
+@@ -335,113 +399,154 @@
The method below creates a DMA object in instance RAM and returns a handle
to it that can be used to set up context objects.
*/
@@ -4713,8 +4833,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
+ int ret;
- instmem->flush(dev);
-+ ret = nouveau_gpuobj_new(dev, chan, 24, 16, NVOBJ_FLAG_ZERO_ALLOC |
-+ NVOBJ_FLAG_ZERO_FREE, pobj);
++ ret = nouveau_gpuobj_new(dev, chan, 24, 16, NVOBJ_FLAG_ZERO_FREE, pobj);
+ if (ret)
+ return ret;
@@ -4819,9 +4938,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
+ flags0 |= (base & 0x00000fff) << 20;
+ flags2 |= (base & 0xfffff000);
+
-+ ret = nouveau_gpuobj_new(dev, chan, (dev_priv->card_type >= NV_40) ?
-+ 32 : 16, 16, NVOBJ_FLAG_ZERO_ALLOC |
-+ NVOBJ_FLAG_ZERO_FREE, &obj);
++ ret = nouveau_gpuobj_new(dev, chan, 16, 16, NVOBJ_FLAG_ZERO_FREE, &obj);
+ if (ret)
+ return ret;
+
@@ -4837,7 +4954,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
}
/* Context objects in the instance RAM have the following structure.
-@@ -495,23 +603,86 @@
+@@ -495,82 +600,122 @@
entry[5]:
set to 0?
*/
@@ -4845,13 +4962,9 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
+nouveau_gpuobj_sw_new(struct nouveau_channel *chan, int class,
+ struct nouveau_gpuobj **gpuobj_ret)
+{
-+ struct drm_nouveau_private *dev_priv;
++ struct drm_nouveau_private *dev_priv = chan->dev->dev_private;
+ struct nouveau_gpuobj *gpuobj;
+
-+ if (!chan || !gpuobj_ret || *gpuobj_ret != NULL)
-+ return -EINVAL;
-+ dev_priv = chan->dev->dev_private;
-+
+ gpuobj = kzalloc(sizeof(*gpuobj), GFP_KERNEL);
+ if (!gpuobj)
+ return -ENOMEM;
@@ -4869,13 +4982,15 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
+}
+
int
- nouveau_gpuobj_gr_new(struct nouveau_channel *chan, int class,
- struct nouveau_gpuobj **gpuobj)
+-nouveau_gpuobj_gr_new(struct nouveau_channel *chan, int class,
+- struct nouveau_gpuobj **gpuobj)
++nouveau_gpuobj_gr_new(struct nouveau_channel *chan, u32 handle, int class)
{
+ struct drm_nouveau_private *dev_priv = chan->dev->dev_private;
struct drm_device *dev = chan->dev;
- struct drm_nouveau_private *dev_priv = dev->dev_private;
+ struct nouveau_gpuobj_class *oc;
++ struct nouveau_gpuobj *gpuobj;
int ret;
NV_DEBUG(dev, "ch%d class=0x%04x\n", chan->id, class);
@@ -4889,10 +5004,12 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
+ return -EINVAL;
+
+found:
-+ if (oc->engine == NVOBJ_ENGINE_SW)
-+ return nouveau_gpuobj_sw_new(chan, class, gpuobj);
-+
+ switch (oc->engine) {
++ case NVOBJ_ENGINE_SW:
++ ret = nouveau_gpuobj_sw_new(chan, class, &gpuobj);
++ if (ret)
++ return ret;
++ goto insert;
+ case NVOBJ_ENGINE_GR:
+ if (dev_priv->card_type >= NV_50 && !chan->ramin_grctx) {
+ struct nouveau_pgraph_engine *pgraph =
@@ -4919,14 +5036,45 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
nouveau_gpuobj_class_instmem_size(dev, class),
16,
NVOBJ_FLAG_ZERO_ALLOC | NVOBJ_FLAG_ZERO_FREE,
- gpuobj);
+- gpuobj);
++ &gpuobj);
if (ret) {
- NV_ERROR(dev, "Error creating gpuobj: %d\n", ret);
+ NV_ERROR(dev, "error creating gpuobj: %d\n", ret);
return ret;
}
-@@ -541,35 +712,8 @@
+ if (dev_priv->card_type >= NV_50) {
+- nv_wo32(*gpuobj, 0, class);
+- nv_wo32(*gpuobj, 20, 0x00010000);
++ nv_wo32(gpuobj, 0, class);
++ nv_wo32(gpuobj, 20, 0x00010000);
+ } else {
+ switch (class) {
+ case NV_CLASS_NULL:
+- nv_wo32(*gpuobj, 0, 0x00001030);
+- nv_wo32(*gpuobj, 4, 0xFFFFFFFF);
++ nv_wo32(gpuobj, 0, 0x00001030);
++ nv_wo32(gpuobj, 4, 0xFFFFFFFF);
+ break;
+ default:
+ if (dev_priv->card_type >= NV_40) {
+- nv_wo32(*gpuobj, 0, class);
++ nv_wo32(gpuobj, 0, class);
+ #ifdef __BIG_ENDIAN
+- nv_wo32(*gpuobj, 8, 0x01000000);
++ nv_wo32(gpuobj, 8, 0x01000000);
+ #endif
+ } else {
+ #ifdef __BIG_ENDIAN
+- nv_wo32(*gpuobj, 0, class | 0x00080000);
++ nv_wo32(gpuobj, 0, class | 0x00080000);
+ #else
+- nv_wo32(*gpuobj, 0, class);
++ nv_wo32(gpuobj, 0, class);
+ #endif
+ }
+ }
}
dev_priv->engine.instmem.flush(dev);
@@ -4945,7 +5093,9 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
- if (!chan || !gpuobj_ret || *gpuobj_ret != NULL)
- return -EINVAL;
- dev_priv = chan->dev->dev_private;
--
++ gpuobj->engine = oc->engine;
++ gpuobj->class = oc->id;
+
- gpuobj = kzalloc(sizeof(*gpuobj), GFP_KERNEL);
- if (!gpuobj)
- return -ENOMEM;
@@ -4959,12 +5109,17 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
- list_add_tail(&gpuobj->list, &dev_priv->gpuobj_list);
- spin_unlock(&dev_priv->ramin_lock);
- *gpuobj_ret = gpuobj;
-+ (*gpuobj)->engine = oc->engine;
-+ (*gpuobj)->class = oc->id;
- return 0;
+- return 0;
++insert:
++ ret = nouveau_ramht_insert(chan, handle, gpuobj);
++ if (ret)
++ NV_ERROR(dev, "error adding gpuobj to RAMHT: %d\n", ret);
++ nouveau_gpuobj_ref(NULL, &gpuobj);
++ return ret;
}
-@@ -585,7 +729,7 @@
+ static int
+@@ -585,7 +730,7 @@
NV_DEBUG(dev, "ch%d\n", chan->id);
/* Base amount for object storage (4KiB enough?) */
@@ -4973,7 +5128,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
base = 0;
/* PGRAPH context */
-@@ -701,8 +845,8 @@
+@@ -701,8 +846,8 @@
if (dev_priv->card_type >= NV_50) {
ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY,
0, dev_priv->vm_end,
@@ -4984,7 +5139,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
if (ret) {
NV_ERROR(dev, "Error creating VRAM ctxdma: %d\n", ret);
return ret;
-@@ -710,8 +854,8 @@
+@@ -710,8 +855,8 @@
} else {
ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY,
0, dev_priv->fb_available_size,
@@ -4995,7 +5150,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
if (ret) {
NV_ERROR(dev, "Error creating VRAM ctxdma: %d\n", ret);
return ret;
-@@ -729,20 +873,13 @@
+@@ -729,20 +874,13 @@
if (dev_priv->card_type >= NV_50) {
ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_IN_MEMORY,
0, dev_priv->vm_end,
@@ -5022,7 +5177,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
}
if (ret) {
-@@ -791,119 +928,69 @@
+@@ -791,147 +929,91 @@
struct nouveau_gpuobj *gpuobj;
int i;
@@ -5117,7 +5272,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
struct drm_nouveau_grobj_alloc *init = data;
- struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
- struct nouveau_pgraph_object_class *grc;
- struct nouveau_gpuobj *gr = NULL;
+- struct nouveau_gpuobj *gr = NULL;
struct nouveau_channel *chan;
int ret;
@@ -5151,19 +5306,18 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
- ret = nouveau_gpuobj_gr_new(chan, grc->id, &gr);
- else
- ret = nouveau_gpuobj_sw_new(chan, grc->id, &gr);
-+ ret = nouveau_gpuobj_gr_new(chan, init->class, &gr);
++ ret = nouveau_gpuobj_gr_new(chan, init->handle, init->class);
if (ret) {
NV_ERROR(dev, "Error creating object: %d (%d/0x%08x)\n",
ret, init->channel, init->handle);
- return ret;
-+ goto out;
- }
-
- ret = nouveau_ramht_insert(chan, init->handle, gr);
-@@ -911,27 +998,30 @@
- if (ret) {
- NV_ERROR(dev, "Error referencing object: %d (%d/0x%08x)\n",
- ret, init->channel, init->handle);
+- }
+-
+- ret = nouveau_ramht_insert(chan, init->handle, gr);
+- nouveau_gpuobj_ref(NULL, &gr);
+- if (ret) {
+- NV_ERROR(dev, "Error referencing object: %d (%d/0x%08x)\n",
+- ret, init->channel, init->handle);
- return ret;
}
@@ -5202,7 +5356,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_object.c linux-2.6.3
u32
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_pm.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_pm.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_pm.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_pm.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_pm.c 2010-12-03 04:56:22.000000000 +0100
@@ -27,6 +27,10 @@
#include "nouveau_drv.h"
#include "nouveau_pm.h"
@@ -5263,7 +5417,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_pm.c linux-2.6.37-rc
}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_ramht.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_ramht.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.c 2010-12-03 04:56:22.000000000 +0100
@@ -104,17 +104,17 @@
nouveau_gpuobj_ref(gpuobj, &entry->gpuobj);
@@ -5309,7 +5463,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_ramht.c linux-2.6.37
struct nouveau_gpuobj *
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_ramht.h linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.h
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_ramht.h 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.h 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_ramht.h 2010-12-03 04:56:22.000000000 +0100
@@ -48,7 +48,7 @@
extern int nouveau_ramht_insert(struct nouveau_channel *, u32 handle,
@@ -5321,7 +5475,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_ramht.h linux-2.6.37
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_reg.h linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_reg.h
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_reg.h 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_reg.h 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_reg.h 2010-12-03 04:56:22.000000000 +0100
@@ -45,6 +45,11 @@
# define NV04_PFB_REF_CMD_REFRESH (1 << 0)
#define NV04_PFB_PRE 0x001002d4
@@ -5445,7 +5599,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_reg.h linux-2.6.37-r
#define NV50_PDISPLAY_CRTC_C(i, r) (4 + (i) * 0x540 + NV50_PDISPLAY_CRTC_##r)
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_sgdma.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_sgdma.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_sgdma.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_sgdma.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_sgdma.c 2010-12-03 04:56:22.000000000 +0100
@@ -144,19 +144,15 @@
pte = nvbe->pte_start;
@@ -5540,7 +5694,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_sgdma.c linux-2.6.37
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_state.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_state.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_state.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_state.c 2010-12-03 04:56:22.000000000 +0100
@@ -53,10 +53,10 @@
engine->instmem.takedown = nv04_instmem_takedown;
engine->instmem.suspend = nv04_instmem_suspend;
@@ -6100,7 +6254,39 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.37
case NOUVEAU_GETPARAM_GRAPH_UNITS:
/* NV40 and NV50 versions are quite different, but register
* address is the same. User is supposed to know the card
-@@ -1105,7 +1144,13 @@
+@@ -1087,8 +1126,9 @@
+ }
+
+ /* Wait until (value(reg) & mask) == val, up until timeout has hit */
+-bool nouveau_wait_until(struct drm_device *dev, uint64_t timeout,
+- uint32_t reg, uint32_t mask, uint32_t val)
++bool
++nouveau_wait_eq(struct drm_device *dev, uint64_t timeout,
++ uint32_t reg, uint32_t mask, uint32_t val)
+ {
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
+ struct nouveau_timer_engine *ptimer = &dev_priv->engine.timer;
+@@ -1102,10 +1142,33 @@
+ return false;
+ }
+
++/* Wait until (value(reg) & mask) != val, up until timeout has hit */
++bool
++nouveau_wait_ne(struct drm_device *dev, uint64_t timeout,
++ uint32_t reg, uint32_t mask, uint32_t val)
++{
++ struct drm_nouveau_private *dev_priv = dev->dev_private;
++ struct nouveau_timer_engine *ptimer = &dev_priv->engine.timer;
++ uint64_t start = ptimer->read(dev);
++
++ do {
++ if ((nv_rd32(dev, reg) & mask) != val)
++ return true;
++ } while (ptimer->read(dev) - start < timeout);
++
++ return false;
++}
++
/* Waits for PGRAPH to go completely idle */
bool nouveau_wait_for_idle(struct drm_device *dev)
{
@@ -6117,7 +6303,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_state.c linux-2.6.37
return false;
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_util.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_util.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_util.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_util.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_util.c 2010-12-03 04:56:22.000000000 +0100
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 Nouveau Project
@@ -6190,7 +6376,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_util.c linux-2.6.37-
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_util.h linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_util.h
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_util.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_util.h 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nouveau_util.h 2010-12-03 04:56:22.000000000 +0100
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 Nouveau Project
@@ -6239,7 +6425,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nouveau_util.h linux-2.6.37-
+#endif
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_crtc.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_crtc.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_crtc.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_crtc.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_crtc.c 2010-12-03 04:56:22.000000000 +0100
@@ -551,7 +551,10 @@
if (dev_priv->card_type >= NV_30)
regp->gpio_ext = NVReadCRTC(dev, 0, NV_PCRTC_GPIO_EXT);
@@ -6276,9 +6462,33 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_crtc.c linux-2.6.37-rc3
.destroy = nv_crtc_destroy,
};
+diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_dac.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_dac.c
+--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_dac.c 2010-11-22 00:18:56.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_dac.c 2010-12-03 04:56:22.000000000 +0100
+@@ -74,14 +74,14 @@
+ * use a 10ms timeout (guards against crtc being inactive, in
+ * which case blank state would never change)
+ */
+- if (!nouveau_wait_until(dev, 10000000, NV_PRMCIO_INP0__COLOR,
+- 0x00000001, 0x00000000))
++ if (!nouveau_wait_eq(dev, 10000000, NV_PRMCIO_INP0__COLOR,
++ 0x00000001, 0x00000000))
+ return -EBUSY;
+- if (!nouveau_wait_until(dev, 10000000, NV_PRMCIO_INP0__COLOR,
+- 0x00000001, 0x00000001))
++ if (!nouveau_wait_eq(dev, 10000000, NV_PRMCIO_INP0__COLOR,
++ 0x00000001, 0x00000001))
+ return -EBUSY;
+- if (!nouveau_wait_until(dev, 10000000, NV_PRMCIO_INP0__COLOR,
+- 0x00000001, 0x00000000))
++ if (!nouveau_wait_eq(dev, 10000000, NV_PRMCIO_INP0__COLOR,
++ 0x00000001, 0x00000000))
+ return -EBUSY;
+
+ udelay(100);
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_display.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_display.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_display.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_display.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_display.c 2010-12-03 04:56:22.000000000 +0100
@@ -32,6 +32,9 @@
#include "nouveau_encoder.h"
#include "nouveau_connector.h"
@@ -6327,7 +6537,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_display.c linux-2.6.37-
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fbcon.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_fbcon.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fbcon.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_fbcon.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_fbcon.c 2010-12-03 04:56:22.000000000 +0100
@@ -28,52 +28,39 @@
#include "nouveau_ramht.h"
#include "nouveau_fbcon.h"
@@ -6449,17 +6659,73 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fbcon.c linux-2.6.37-rc
BEGIN_RING(chan, NvSubGdiRect, 0x0c00, iter_len);
OUT_RINGp(chan, data, iter_len);
-@@ -157,6 +134,7 @@
+@@ -157,22 +134,7 @@
}
FIRE_RING(chan);
+-}
+-
+-static int
+-nv04_fbcon_grobj_new(struct drm_device *dev, int class, uint32_t handle)
+-{
+- struct drm_nouveau_private *dev_priv = dev->dev_private;
+- struct nouveau_gpuobj *obj = NULL;
+- int ret;
+-
+- ret = nouveau_gpuobj_gr_new(dev_priv->channel, class, &obj);
+- if (ret)
+- return ret;
+-
+- ret = nouveau_ramht_insert(dev_priv->channel, handle, obj);
+- nouveau_gpuobj_ref(NULL, &obj);
+- return ret;
+ return 0;
}
- static int
+ int
+@@ -214,29 +176,31 @@
+ return -EINVAL;
+ }
+
+- ret = nv04_fbcon_grobj_new(dev, dev_priv->card_type >= NV_10 ?
+- 0x0062 : 0x0042, NvCtxSurf2D);
++ ret = nouveau_gpuobj_gr_new(chan, NvCtxSurf2D,
++ dev_priv->card_type >= NV_10 ?
++ 0x0062 : 0x0042);
+ if (ret)
+ return ret;
+
+- ret = nv04_fbcon_grobj_new(dev, 0x0019, NvClipRect);
++ ret = nouveau_gpuobj_gr_new(chan, NvClipRect, 0x0019);
+ if (ret)
+ return ret;
+
+- ret = nv04_fbcon_grobj_new(dev, 0x0043, NvRop);
++ ret = nouveau_gpuobj_gr_new(chan, NvRop, 0x0043);
+ if (ret)
+ return ret;
+
+- ret = nv04_fbcon_grobj_new(dev, 0x0044, NvImagePatt);
++ ret = nouveau_gpuobj_gr_new(chan, NvImagePatt, 0x0044);
+ if (ret)
+ return ret;
+
+- ret = nv04_fbcon_grobj_new(dev, 0x004a, NvGdiRect);
++ ret = nouveau_gpuobj_gr_new(chan, NvGdiRect, 0x004a);
+ if (ret)
+ return ret;
+
+- ret = nv04_fbcon_grobj_new(dev, dev_priv->chipset >= 0x11 ?
+- 0x009f : 0x005f, NvImageBlit);
++ ret = nouveau_gpuobj_gr_new(chan, NvImageBlit,
++ dev_priv->chipset >= 0x11 ?
++ 0x009f : 0x005f);
+ if (ret)
+ return ret;
+
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fifo.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_fifo.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fifo.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_fifo.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_fifo.c 2010-12-03 04:56:22.000000000 +0100
@@ -28,6 +28,7 @@
#include "drm.h"
#include "nouveau_drv.h"
@@ -6468,7 +6734,19 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fifo.c linux-2.6.37-rc3
#define NV04_RAMFC(c) (dev_priv->ramfc->pinst + ((c) * NV04_RAMFC__SIZE))
#define NV04_RAMFC__SIZE 32
-@@ -151,10 +152,27 @@
+@@ -128,6 +129,11 @@
+ if (ret)
+ return ret;
+
++ chan->user = ioremap(pci_resource_start(dev->pdev, 0) +
++ NV03_USER(chan->id), PAGE_SIZE);
++ if (!chan->user)
++ return -ENOMEM;
++
+ spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
+
+ /* Setup initial state */
+@@ -151,10 +157,31 @@
nv04_fifo_destroy_context(struct nouveau_channel *chan)
{
struct drm_device *dev = chan->dev;
@@ -6480,14 +6758,14 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fifo.c linux-2.6.37-rc3
- nv_rd32(dev, NV04_PFIFO_MODE) & ~(1 << chan->id));
+ spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
+ pfifo->reassign(dev, false);
-+
+
+ /* Unload the context if it's the currently active one */
+ if (pfifo->channel_id(dev) == chan->id) {
+ pfifo->disable(dev);
+ pfifo->unload_context(dev);
+ pfifo->enable(dev);
+ }
-
++
+ /* Keep it from being rescheduled */
+ nv_mask(dev, NV04_PFIFO_MODE, 1 << chan->id, 0);
+
@@ -6495,10 +6773,14 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fifo.c linux-2.6.37-rc3
+ spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
+
+ /* Free the channel resources */
++ if (chan->user) {
++ iounmap(chan->user);
++ chan->user = NULL;
++ }
nouveau_gpuobj_ref(NULL, &chan->ramfc);
}
-@@ -208,7 +226,7 @@
+@@ -208,7 +235,7 @@
if (chid < 0 || chid >= dev_priv->engine.fifo.channels)
return 0;
@@ -6507,7 +6789,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fifo.c linux-2.6.37-rc3
if (!chan) {
NV_ERROR(dev, "Inactive channel on PFIFO: %d\n", chid);
return -EINVAL;
-@@ -267,6 +285,7 @@
+@@ -267,6 +294,7 @@
static void
nv04_fifo_init_intr(struct drm_device *dev)
{
@@ -6515,7 +6797,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fifo.c linux-2.6.37-rc3
nv_wr32(dev, 0x002100, 0xffffffff);
nv_wr32(dev, 0x002140, 0xffffffff);
}
-@@ -289,7 +308,7 @@
+@@ -289,7 +317,7 @@
pfifo->reassign(dev, true);
for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
@@ -6524,7 +6806,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fifo.c linux-2.6.37-rc3
uint32_t mode = nv_rd32(dev, NV04_PFIFO_MODE);
nv_wr32(dev, NV04_PFIFO_MODE, mode | (1 << i));
}
-@@ -298,3 +317,207 @@
+@@ -298,3 +326,207 @@
return 0;
}
@@ -6734,7 +7016,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_fifo.c linux-2.6.37-rc3
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_graph.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_graph.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_graph.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_graph.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_graph.c 2010-12-03 04:56:22.000000000 +0100
@@ -26,6 +26,11 @@
#include "drm.h"
#include "nouveau_drm.h"
@@ -7605,7 +7887,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_graph.c linux-2.6.37-rc
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_instmem.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_instmem.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_instmem.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_instmem.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv04_instmem.c 2010-12-03 04:56:22.000000000 +0100
@@ -98,42 +98,66 @@
}
@@ -7687,7 +7969,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv04_instmem.c linux-2.6.37-
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_fb.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv10_fb.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_fb.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv10_fb.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv10_fb.c 2010-12-03 04:56:22.000000000 +0100
@@ -3,23 +3,109 @@
#include "nouveau_drv.h"
#include "nouveau_drm.h"
@@ -7841,8 +8123,20 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_fb.c linux-2.6.37-rc3.n
}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_fifo.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv10_fifo.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_fifo.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv10_fifo.c 2010-11-22 06:33:32.000000000 +0100
-@@ -73,17 +73,6 @@
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv10_fifo.c 2010-12-03 04:56:22.000000000 +0100
+@@ -53,6 +53,11 @@
+ if (ret)
+ return ret;
+
++ chan->user = ioremap(pci_resource_start(dev->pdev, 0) +
++ NV03_USER(chan->id), PAGE_SIZE);
++ if (!chan->user)
++ return -ENOMEM;
++
+ /* Fill entries that are seen filled in dumps of nvidia driver just
+ * after channel's is put into DMA mode
+ */
+@@ -73,17 +78,6 @@
return 0;
}
@@ -7860,7 +8154,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_fifo.c linux-2.6.37-rc3
static void
nv10_fifo_do_load_context(struct drm_device *dev, int chid)
{
-@@ -219,6 +208,7 @@
+@@ -219,6 +213,7 @@
static void
nv10_fifo_init_intr(struct drm_device *dev)
{
@@ -7868,7 +8162,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_fifo.c linux-2.6.37-rc3
nv_wr32(dev, 0x002100, 0xffffffff);
nv_wr32(dev, 0x002140, 0xffffffff);
}
-@@ -241,7 +231,7 @@
+@@ -241,7 +236,7 @@
pfifo->reassign(dev, true);
for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
@@ -7879,7 +8173,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_fifo.c linux-2.6.37-rc3
}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_graph.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv10_graph.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_graph.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv10_graph.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv10_graph.c 2010-12-03 04:56:22.000000000 +0100
@@ -26,6 +26,10 @@
#include "drm.h"
#include "nouveau_drm.h"
@@ -8196,7 +8490,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv10_graph.c linux-2.6.37-rc
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv20_graph.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv20_graph.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv20_graph.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv20_graph.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv20_graph.c 2010-12-03 04:56:22.000000000 +0100
@@ -32,6 +32,10 @@
#define NV34_GRCTX_SIZE (18140)
#define NV35_36_GRCTX_SIZE (22396)
@@ -8529,7 +8823,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv20_graph.c linux-2.6.37-rc
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv30_fb.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv30_fb.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv30_fb.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv30_fb.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv30_fb.c 2010-12-03 04:56:22.000000000 +0100
@@ -29,6 +29,27 @@
#include "nouveau_drv.h"
#include "nouveau_drm.h"
@@ -8569,7 +8863,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv30_fb.c linux-2.6.37-rc3.n
if (dev_priv->chipset == 0x30 ||
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_fb.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv40_fb.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_fb.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv40_fb.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv40_fb.c 2010-12-03 04:56:22.000000000 +0100
@@ -4,26 +4,22 @@
#include "nouveau_drm.h"
@@ -8616,8 +8910,20 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_fb.c linux-2.6.37-rc3.n
}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_fifo.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv40_fifo.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_fifo.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv40_fifo.c 2010-11-22 06:33:32.000000000 +0100
-@@ -70,17 +70,6 @@
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv40_fifo.c 2010-12-03 04:56:22.000000000 +0100
+@@ -47,6 +47,11 @@
+ if (ret)
+ return ret;
+
++ chan->user = ioremap(pci_resource_start(dev->pdev, 0) +
++ NV40_USER(chan->id), PAGE_SIZE);
++ if (!chan->user)
++ return -ENOMEM;
++
+ spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
+
+ nv_wi32(dev, fc + 0, chan->pushbuf_base);
+@@ -70,17 +75,6 @@
return 0;
}
@@ -8635,7 +8941,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_fifo.c linux-2.6.37-rc3
static void
nv40_fifo_do_load_context(struct drm_device *dev, int chid)
{
-@@ -279,6 +268,7 @@
+@@ -279,6 +273,7 @@
static void
nv40_fifo_init_intr(struct drm_device *dev)
{
@@ -8643,7 +8949,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_fifo.c linux-2.6.37-rc3
nv_wr32(dev, 0x002100, 0xffffffff);
nv_wr32(dev, 0x002140, 0xffffffff);
}
-@@ -301,7 +291,7 @@
+@@ -301,7 +296,7 @@
pfifo->reassign(dev, true);
for (i = 0; i < dev_priv->engine.fifo.channels; i++) {
@@ -8654,7 +8960,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_fifo.c linux-2.6.37-rc3
}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_graph.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv40_graph.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_graph.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv40_graph.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv40_graph.c 2010-12-03 04:56:22.000000000 +0100
@@ -29,6 +29,9 @@
#include "nouveau_drv.h"
#include "nouveau_grctx.h"
@@ -8925,7 +9231,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv40_graph.c linux-2.6.37-rc
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_crtc.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_crtc.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_crtc.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_crtc.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_crtc.c 2010-12-03 04:56:22.000000000 +0100
@@ -437,6 +437,7 @@
.cursor_move = nv50_crtc_cursor_move,
.gamma_set = nv50_crtc_gamma_set,
@@ -8952,7 +9258,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_crtc.c linux-2.6.37-rc3
if (ret) {
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_display.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_display.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_display.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_display.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_display.c 2010-12-03 04:56:22.000000000 +0100
@@ -33,6 +33,8 @@
#include "nouveau_ramht.h"
#include "drm_crtc_helper.h"
@@ -9552,7 +9858,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_display.c linux-2.6.37-
-
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_display.h linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_display.h
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_display.h 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_display.h 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_display.h 2010-12-03 04:56:22.000000000 +0100
@@ -35,9 +35,7 @@
#include "nouveau_crtc.h"
#include "nv50_evo.h"
@@ -9565,7 +9871,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_display.h linux-2.6.37-
int nv50_display_create(struct drm_device *dev);
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_evo.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_evo.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_evo.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_evo.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_evo.c 2010-12-03 04:56:22.000000000 +0100
@@ -0,0 +1,318 @@
+/*
+ * Copyright 2010 Red Hat Inc.
@@ -9887,7 +10193,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_evo.c linux-2.6.37-rc3.
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_evo.h linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_evo.h
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_evo.h 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_evo.h 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_evo.h 2010-12-03 04:56:22.000000000 +0100
@@ -24,6 +24,15 @@
*
*/
@@ -9911,7 +10217,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_evo.h linux-2.6.37-rc3.
+#endif
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fb.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_fb.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fb.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_fb.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_fb.c 2010-12-03 04:56:22.000000000 +0100
@@ -3,30 +3,75 @@
#include "nouveau_drv.h"
#include "nouveau_drm.h"
@@ -10040,7 +10346,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fb.c linux-2.6.37-rc3.n
"channel %d (0x%08x)\n",
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fbcon.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_fbcon.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fbcon.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_fbcon.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_fbcon.c 2010-12-03 04:56:22.000000000 +0100
@@ -4,26 +4,18 @@
#include "nouveau_ramht.h"
#include "nouveau_fbcon.h"
@@ -10127,7 +10433,9 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fbcon.c linux-2.6.37-rc
- if (info->state != FBINFO_STATE_RUNNING)
- return;
--
++ if (image->depth != 1)
++ return -ENODEV;
+
- if (image->depth != 1) {
- cfb_imageblit(info, image);
- return;
@@ -10136,9 +10444,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fbcon.c linux-2.6.37-rc
- if (!(info->flags & FBINFO_HWACCEL_DISABLED) && RING_SPACE(chan, 11)) {
- nouveau_fbcon_gpu_lockup(info);
- }
-+ if (image->depth != 1)
-+ return -ENODEV;
-
+-
- if (info->flags & FBINFO_HWACCEL_DISABLED) {
- cfb_imageblit(info, image);
- return;
@@ -10172,9 +10478,34 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fbcon.c linux-2.6.37-rc
}
int
+@@ -157,9 +134,8 @@
+ struct drm_device *dev = nfbdev->dev;
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
+ struct nouveau_channel *chan = dev_priv->channel;
+- struct nouveau_gpuobj *eng2d = NULL;
+- uint64_t fb;
+ int ret, format;
++ uint64_t fb;
+
+ fb = info->fix.smem_start - dev_priv->fb_phys + dev_priv->vm_vram_base;
+
+@@ -190,12 +166,7 @@
+ return -EINVAL;
+ }
+
+- ret = nouveau_gpuobj_gr_new(dev_priv->channel, 0x502d, &eng2d);
+- if (ret)
+- return ret;
+-
+- ret = nouveau_ramht_insert(dev_priv->channel, Nv2D, eng2d);
+- nouveau_gpuobj_ref(NULL, &eng2d);
++ ret = nouveau_gpuobj_gr_new(dev_priv->channel, Nv2D, 0x502d);
+ if (ret)
+ return ret;
+
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fifo.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_fifo.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fifo.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_fifo.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_fifo.c 2010-12-03 04:56:22.000000000 +0100
@@ -44,7 +44,8 @@
/* We never schedule channel 0 or 127 */
@@ -10221,7 +10552,19 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fifo.c linux-2.6.37-rc3
nouveau_gpuobj_ref(NULL, &pfifo->playlist[0]);
nouveau_gpuobj_ref(NULL, &pfifo->playlist[1]);
}
-@@ -291,10 +296,23 @@
+@@ -256,6 +261,11 @@
+ }
+ ramfc = chan->ramfc;
+
++ chan->user = ioremap(pci_resource_start(dev->pdev, 0) +
++ NV50_USER(chan->id), PAGE_SIZE);
++ if (!chan->user)
++ return -ENOMEM;
++
+ spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
+
+ nv_wo32(ramfc, 0x48, chan->pushbuf->cinst >> 4);
+@@ -291,10 +301,23 @@
nv50_fifo_destroy_context(struct nouveau_channel *chan)
{
struct drm_device *dev = chan->dev;
@@ -10245,7 +10588,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fifo.c linux-2.6.37-rc3
/* This will ensure the channel is seen as disabled. */
nouveau_gpuobj_ref(chan->ramfc, &ramfc);
nouveau_gpuobj_ref(NULL, &chan->ramfc);
-@@ -305,6 +323,10 @@
+@@ -305,6 +328,14 @@
nv50_fifo_channel_disable(dev, 127);
nv50_fifo_playlist_update(dev);
@@ -10253,10 +10596,14 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fifo.c linux-2.6.37-rc3
+ spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
+
+ /* Free the channel resources */
++ if (chan->user) {
++ iounmap(chan->user);
++ chan->user = NULL;
++ }
nouveau_gpuobj_ref(NULL, &ramfc);
nouveau_gpuobj_ref(NULL, &chan->cache);
}
-@@ -392,7 +414,7 @@
+@@ -392,7 +423,7 @@
if (chid < 1 || chid >= dev_priv->engine.fifo.channels - 1)
return 0;
@@ -10267,7 +10614,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_fifo.c linux-2.6.37-rc3
return -EINVAL;
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_gpio.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_gpio.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_gpio.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_gpio.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_gpio.c 2010-12-03 04:56:22.000000000 +0100
@@ -26,6 +26,28 @@
#include "nouveau_drv.h"
#include "nouveau_hw.h"
@@ -10506,7 +10853,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_gpio.c linux-2.6.37-rc3
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_graph.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_graph.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_graph.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_graph.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_graph.c 2010-12-03 04:56:22.000000000 +0100
@@ -29,6 +29,11 @@
#include "nouveau_drv.h"
#include "nouveau_ramht.h"
@@ -11259,7 +11606,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_graph.c linux-2.6.37-rc
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_instmem.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_instmem.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_instmem.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_instmem.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv50_instmem.c 2010-12-03 04:56:22.000000000 +0100
@@ -131,10 +131,10 @@
}
@@ -11540,7 +11887,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv50_instmem.c linux-2.6.37-
void
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv84_crypt.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv84_crypt.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv84_crypt.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv84_crypt.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nv84_crypt.c 2010-12-03 04:56:22.000000000 +0100
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2010 Red Hat Inc.
@@ -11681,7 +12028,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nv84_crypt.c linux-2.6.37-rc
+}
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nvc0_instmem.c linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nvc0_instmem.c
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nvc0_instmem.c 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nvc0_instmem.c 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nvc0_instmem.c 2010-12-03 04:56:22.000000000 +0100
@@ -26,67 +26,89 @@
#include "nouveau_drv.h"
@@ -11856,7 +12203,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nvc0_instmem.c linux-2.6.37-
void
diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nvreg.h linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nvreg.h
--- linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nvreg.h 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nvreg.h 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/drivers/gpu/drm/nouveau/nvreg.h 2010-12-03 04:56:22.000000000 +0100
@@ -153,7 +153,8 @@
#define NV_PCRTC_START 0x00600800
#define NV_PCRTC_CONFIG 0x00600804
@@ -11869,7 +12216,7 @@ diff -Naur linux-2.6.37-rc3/drivers/gpu/drm/nouveau/nvreg.h linux-2.6.37-rc3.nou
# define NV_PCRTC_CURSOR_CONFIG_DOUBLE_SCAN_ENABLE (1 << 4)
diff -Naur linux-2.6.37-rc3/include/drm/nouveau_drm.h linux-2.6.37-rc3.nouveau/include/drm/nouveau_drm.h
--- linux-2.6.37-rc3/include/drm/nouveau_drm.h 2010-11-22 00:18:56.000000000 +0100
-+++ linux-2.6.37-rc3.nouveau/include/drm/nouveau_drm.h 2010-11-22 06:33:32.000000000 +0100
++++ linux-2.6.37-rc3.nouveau/include/drm/nouveau_drm.h 2010-12-03 04:56:22.000000000 +0100
@@ -71,16 +71,15 @@
#define NOUVEAU_GETPARAM_PCI_VENDOR 3
#define NOUVEAU_GETPARAM_PCI_DEVICE 4
diff --git a/packages/mediacenter/xbmc-dharma-theme-Confluence/meta b/packages/mediacenter/xbmc-dharma-theme-Confluence/meta
index a2a33483ed..fe964d6a47 100644
--- a/packages/mediacenter/xbmc-dharma-theme-Confluence/meta
+++ b/packages/mediacenter/xbmc-dharma-theme-Confluence/meta
@@ -1,5 +1,5 @@
PKG_NAME="xbmc-dharma-theme-Confluence"
-PKG_VERSION="35492"
+PKG_VERSION="35615"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
diff --git a/packages/mediacenter/xbmc-dharma/build b/packages/mediacenter/xbmc-dharma/build
index 942516f84f..2a526d6c0a 100755
--- a/packages/mediacenter/xbmc-dharma/build
+++ b/packages/mediacenter/xbmc-dharma/build
@@ -64,6 +64,8 @@ fi
# xbmc (ffmpeg) fails to build with LTO optimization
strip_lto
+ strip_gold
+ strip_linker_plugin
# dont use some optimizations because of problems
# this fixes problems with faac implementation of ffmpeg
diff --git a/packages/mediacenter/xbmc-dharma/meta b/packages/mediacenter/xbmc-dharma/meta
index 0eded258ee..92776e5b52 100644
--- a/packages/mediacenter/xbmc-dharma/meta
+++ b/packages/mediacenter/xbmc-dharma/meta
@@ -1,5 +1,5 @@
PKG_NAME="xbmc-dharma"
-PKG_VERSION="35492"
+PKG_VERSION="35615"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-002-arm_remove_forced_python2.5-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-002-arm_remove_forced_python2.5-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-002-arm_remove_forced_python2.5-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-002-arm_remove_forced_python2.5-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-201-let_select_XBMCProjectM-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-201-let_select_XBMCProjectM-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-201-let_select_XBMCProjectM-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-201-let_select_XBMCProjectM-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-202-let_select_RSXS-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-202-let_select_RSXS-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-202-let_select_RSXS-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-202-let_select_RSXS-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-301-correct_lzo_include-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-301-correct_lzo_include-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-301-correct_lzo_include-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-301-correct_lzo_include-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-302-dont_hardcode_usr_include-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-302-dont_hardcode_usr_include-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-302-dont_hardcode_usr_include-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-302-dont_hardcode_usr_include-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-303-WiiRemote_crosscompiling-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-303-WiiRemote_crosscompiling-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-303-WiiRemote_crosscompiling-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-303-WiiRemote_crosscompiling-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-303-fix_libdvd_xFLAGS-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-303-fix_libdvd_xFLAGS-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-303-fix_libdvd_xFLAGS-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-303-fix_libdvd_xFLAGS-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-401-we_dont_need_libXinerama-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-401-we_dont_need_libXinerama-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-401-we_dont_need_libXinerama-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-401-we_dont_need_libXinerama-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-402-enable_yasm_in_ffmpeg-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-402-enable_yasm_in_ffmpeg-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-402-enable_yasm_in_ffmpeg-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-402-enable_yasm_in_ffmpeg-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-451-full_splash-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-451-full_splash-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-451-full_splash-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-451-full_splash-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-452-change_lcd_content-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-452-change_lcd_content-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-452-change_lcd_content-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-452-change_lcd_content-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-452-ps3_remote_be_more_quiet-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-452-ps3_remote_be_more_quiet-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-452-ps3_remote_be_more_quiet-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-452-ps3_remote_be_more_quiet-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-462-add_remote_irtrans_mediacenter-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-462-add_remote_irtrans_mediacenter-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-462-add_remote_irtrans_mediacenter-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-462-add_remote_irtrans_mediacenter-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-463-add_remote_devinput-0.1.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-463-add_remote_devinput-0.1.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-463-add_remote_devinput-0.1.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-463-add_remote_devinput-0.1.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-901-advancedsettings_alwaysextractflags.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-901-advancedsettings_alwaysextractflags.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-901-advancedsettings_alwaysextractflags.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-901-advancedsettings_alwaysextractflags.patch
diff --git a/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-902-advancedsettings_videolibrary.flattenmoviesets.patch b/packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-902-advancedsettings_videolibrary.flattenmoviesets.patch
similarity index 100%
rename from packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35492-902-advancedsettings_videolibrary.flattenmoviesets.patch
rename to packages/mediacenter/xbmc-dharma/patches/xbmc-dharma-35615-902-advancedsettings_videolibrary.flattenmoviesets.patch
diff --git a/packages/mediacenter/xbmc-dharma/splash/splash.png b/packages/mediacenter/xbmc-dharma/splash/splash.png
index 62590dfd6e..7a4fe389f0 100644
Binary files a/packages/mediacenter/xbmc-dharma/splash/splash.png and b/packages/mediacenter/xbmc-dharma/splash/splash.png differ
diff --git a/packages/mediacenter/xbmc-dharma/splash/splash4.png b/packages/mediacenter/xbmc-dharma/splash/splash4.png
new file mode 100644
index 0000000000..62590dfd6e
Binary files /dev/null and b/packages/mediacenter/xbmc-dharma/splash/splash4.png differ
diff --git a/packages/mediacenter/xbmc/splash/splash.png b/packages/mediacenter/xbmc/splash/splash.png
index 62590dfd6e..7a4fe389f0 100644
Binary files a/packages/mediacenter/xbmc/splash/splash.png and b/packages/mediacenter/xbmc/splash/splash.png differ
diff --git a/packages/mediacenter/xbmc/splash/splash4.png b/packages/mediacenter/xbmc/splash/splash4.png
new file mode 100644
index 0000000000..62590dfd6e
Binary files /dev/null and b/packages/mediacenter/xbmc/splash/splash4.png differ
diff --git a/packages/network/bluez/meta b/packages/network/bluez/meta
index 9ec10a916e..672ab6f9af 100644
--- a/packages/network/bluez/meta
+++ b/packages/network/bluez/meta
@@ -1,5 +1,5 @@
PKG_NAME="bluez"
-PKG_VERSION="4.80"
+PKG_VERSION="4.81"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
diff --git a/packages/network/bluez/patches/bluez-4.80-ps3remote.patch b/packages/network/bluez/patches/bluez-4.81-ps3remote.patch
similarity index 100%
rename from packages/network/bluez/patches/bluez-4.80-ps3remote.patch
rename to packages/network/bluez/patches/bluez-4.81-ps3remote.patch
diff --git a/packages/network/connman/meta b/packages/network/connman/meta
index c4f9375f12..9d3f1acdb8 100644
--- a/packages/network/connman/meta
+++ b/packages/network/connman/meta
@@ -1,10 +1,10 @@
PKG_NAME="connman"
-PKG_VERSION="20101116"
+PKG_VERSION="0.64"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.connman.net"
-PKG_URL="http://sources.openelec.tv/svn/$PKG_NAME-$PKG_VERSION.tar.bz2"
+PKG_URL="http://www.kernel.org/pub/linux/network/connman/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS="glib dbus udev iptables wpa_supplicant ntp siglaunchd"
PKG_BUILD_DEPENDS="toolchain glib dbus udev iptables"
PKG_PRIORITY="optional"
diff --git a/packages/network/connman/scripts/cmcc b/packages/network/connman/scripts/cmcc
index e68bca28ba..00a58df037 100755
--- a/packages/network/connman/scripts/cmcc
+++ b/packages/network/connman/scripts/cmcc
@@ -24,6 +24,14 @@ import dbus.mainloop.glib
import gobject
import time
+WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1"
+WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1"
+WPAS_DBUS_PATH = "/fi/w1/wpa_supplicant1"
+
+WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1.Interface"
+WPAS_DBUS_INTERFACES_OPATH = "/fi/w1/wpa_supplicant1/Interfaces"
+WPAS_DBUS_BSS_INTERFACE = "fi.w1.wpa_supplicant1.BSS"
+
stamp = False
class ArgumentException(Exception):
@@ -43,8 +51,8 @@ def get_manager(bus=None):
if bus == None:
bus = get_bus()
- return dbus.Interface(bus.get_object("org.moblin.connman", "/"),
- "org.moblin.connman.Manager")
+ return dbus.Interface(bus.get_object("net.connman", "/"),
+ "net.connman.Manager")
def usage(name):
print "Usage: %s " % (name)
@@ -66,6 +74,9 @@ def usage(name):
print " modem list"
print " modem pin "
print " modem puk "
+ print " wpas list"
+ print " wpas networks"
+ print " wpas bss"
print ""
print "Properties:"
print " apn "
@@ -78,13 +89,22 @@ def usage(name):
return
def is_connected(state):
- connected = [ "ready", "online"]
+ connected = [ "ready", "offline", "online"]
if state in connected:
return True
else:
return False
+def is_associating(state):
+ return state == "association"
+
+def is_configuration(state):
+ return state == "configuration"
+
+def is_failed(state):
+ return state == "failure"
+
def find_service(name):
bus = get_bus()
manager = get_manager(bus)
@@ -93,9 +113,9 @@ def find_service(name):
path = "/profile/default/" + name
if path in manager_properties["Services"]:
- service = dbus.Interface(bus.get_object("org.moblin.connman",
+ service = dbus.Interface(bus.get_object("net.connman",
path),
- "org.moblin.connman.Service")
+ "net.connman.Service")
return service
# service not found with the path, let's try find it with name
@@ -103,9 +123,9 @@ def find_service(name):
found = []
for path in manager_properties["Services"]:
- service = dbus.Interface(bus.get_object("org.moblin.connman",
+ service = dbus.Interface(bus.get_object("net.connman",
path),
- "org.moblin.connman.Service")
+ "net.connman.Service")
properties = service.GetProperties()
@@ -125,9 +145,9 @@ def get_service_name(path):
bus = get_bus()
try:
- service = dbus.Interface(bus.get_object("org.moblin.connman",
+ service = dbus.Interface(bus.get_object("net.connman",
path),
- "org.moblin.connman.Service")
+ "net.connman.Service")
properties = service.GetProperties()
name = properties["Name"]
if len(name) == 0:
@@ -141,6 +161,8 @@ def get_service_name(path):
def extract_dict(values):
s = ""
for k, v in values.items():
+ if type(v) is dbus.Array:
+ v = extract_list(v)
s += " %s=%s" % (k,v)
return "{ %s }" % s
@@ -174,15 +196,15 @@ def get_devices():
properties = manager.GetProperties()
for path in properties["Technologies"]:
- technology = dbus.Interface(bus.get_object("org.moblin.connman",
+ technology = dbus.Interface(bus.get_object("net.connman",
path),
- "org.moblin.connman.Technology")
+ "net.connman.Technology")
properties = technology.GetProperties()
for path in properties["Devices"]:
- d = dbus.Interface(bus.get_object("org.moblin.connman",
+ d = dbus.Interface(bus.get_object("net.connman",
path),
- "org.moblin.connman.Device")
+ "net.connman.Device")
result.append(d)
return result
@@ -215,16 +237,23 @@ def cmd_services():
manager_properties = manager.GetProperties()
for path in manager_properties["Services"]:
- service = dbus.Interface(bus.get_object("org.moblin.connman",
+ service = dbus.Interface(bus.get_object("net.connman",
path),
- "org.moblin.connman.Service")
+ "net.connman.Service")
properties = service.GetProperties()
identifier = path[path.rfind("/") + 1:]
+ state = properties["State"]
- if is_connected(properties["State"]):
+ if is_connected(state):
connected = "*"
+ elif is_configuration(state):
+ connected = "+"
+ elif is_associating(state):
+ connected = "-"
+ elif is_failed(state):
+ connected = "f"
else:
connected = " "
@@ -459,6 +488,7 @@ def cmd_show(argv):
order = [ "Name", "Type", "State", "Strength", "Mode", "Security",
"IPv4", "IPv4.Configuration",
+ "IPv6", "IPv6.Configuration",
"Ethernet",
"Nameservers", "Nameservers.Configuration",
"Domains", "Domains.Configuration",
@@ -469,16 +499,18 @@ def cmd_show(argv):
keys = properties.keys()
+ print "[ %s ]" % service.object_path
+
for key in order:
if key in keys:
keys.remove(key)
val = convert_dbus_value(properties[key])
- print "%s: %s" % (key, val)
+ print " %s = %s" % (key, val)
# print properties missing in the order
for key in keys:
val = convert_dbus_value(properties[key])
- print "%s: %s" % (key, val)
+ print " %s = %s" % (key, val)
def connman_property_changed(name, value, path, interface):
global stamp
@@ -488,11 +520,11 @@ def connman_property_changed(name, value, path, interface):
else:
timestamp = ""
- if interface == "org.moblin.connman.Service":
+ if interface == "net.connman.Service":
val = convert_dbus_value(value)
print "%s[%s] %s: %s" % (timestamp, get_service_name(path),
name, val)
- elif interface == "org.moblin.connman.Manager":
+ elif interface == "net.connman.Manager":
val = convert_dbus_value(value)
print "%s%s: %s" % (timestamp, name, val)
@@ -504,7 +536,7 @@ def cmd_event(argv):
bus = get_bus(async=True)
bus.add_signal_receiver(connman_property_changed,
- bus_name="org.moblin.connman",
+ bus_name="net.connman",
signal_name = "PropertyChanged",
path_keyword="path",
interface_keyword="interface")
@@ -525,22 +557,16 @@ def print_sms_manager(path):
value = convert_dbus_value(properties[key])
print " %s = %s" % (key, value)
-def print_context(path):
- bus = get_bus()
- interface = "org.ofono.PrimaryDataContext"
- manager = dbus.Interface(bus.get_object("org.ofono", path),
- interface)
-
+def print_context(path, properties):
print " [ %s ]" % path
- properties = manager.GetProperties()
for key in properties.keys():
value = convert_dbus_value(properties[key])
print " %s = %s" % (key, value)
def print_data_manager(path):
bus = get_bus()
- interface = "org.ofono.DataConnectionManager"
+ interface = "org.ofono.ConnectionManager"
manager = dbus.Interface(bus.get_object("org.ofono", path),
interface)
@@ -551,11 +577,10 @@ def print_data_manager(path):
value = convert_dbus_value(properties[key])
print " %s = %s" % (key, value)
- if "PrimaryContexts" not in properties:
- return
+ contexts = manager.GetContexts()
- for context in properties["PrimaryContexts"]:
- print_context(context)
+ for path, properties in contexts:
+ print_context(path, properties)
def print_cell_broadcast(path):
bus = get_bus()
@@ -609,14 +634,9 @@ def print_sim_manager(path):
value = convert_dbus_value(properties[key])
print " %s = %s" % (key, value)
-def print_modem(path):
- bus = get_bus()
- manager = dbus.Interface(bus.get_object("org.ofono", path),
- "org.ofono.Modem")
-
+def print_modem(path, properties):
print "[ %s ]" % path
- properties = manager.GetProperties()
for key in properties.keys():
value = convert_dbus_value(properties[key])
print " %s = %s" % (key, value)
@@ -627,7 +647,7 @@ def print_modem(path):
for interface in properties["Interfaces"]:
if interface == "org.ofono.SmsManager":
print_sms_manager(path)
- elif interface == "org.ofono.DataConnectionManager":
+ elif interface == "org.ofono.ConnectionManager":
print_data_manager(path)
elif interface == "org.ofono.CellBroadcast":
print_cell_broadcast(path)
@@ -642,16 +662,18 @@ def cmd_modem_list(argv):
bus = get_bus()
manager = dbus.Interface(bus.get_object("org.ofono", "/"),
"org.ofono.Manager")
- properties = manager.GetProperties()
- if "Modems" not in properties or len(properties["Modems"]) == 0:
+ try:
+ modems = manager.GetModems()
+ except dbus.exceptions.DBusException as e:
+ raise ArgumentException("Failed to contact ofonod:", e)
+
+ if len(modems) == 0:
print "No modems found"
return
- modems = properties["Modems"]
-
- for path in modems:
- print_modem(path)
+ for path, properties in modems:
+ print_modem(path, properties)
def cmd_modem_pin(pin_type, argv):
if len(argv) < 1:
@@ -662,13 +684,13 @@ def cmd_modem_pin(pin_type, argv):
bus = get_bus()
manager = dbus.Interface(bus.get_object("org.ofono", "/"),
"org.ofono.Manager")
- properties = manager.GetProperties()
+ modems = manager.GetModems()
- if "Modems" not in properties or len(properties["Modems"]) == 0:
+ if len(modems) == 0:
print "No modems found"
return
- modem = properties["Modems"][0]
+ (modem, properties) = modems[0]
print "Using modem %s" % modem
@@ -683,8 +705,9 @@ def cmd_modem_pin(pin_type, argv):
return
if properties["PinRequired"] != pin_type:
- print "pin type '%s' not required by modem (%s)" % (pin_type,
- properties["PinRequired"])
+ print "pin type '%s' not required by modem %s (%s)" % (pin_type,
+ modem,
+ properties["PinRequired"])
return
try:
sim_manager.EnterPin(pin_type, pin)
@@ -704,6 +727,124 @@ def cmd_modem(argv):
else:
raise ArgumentException("unknown modem commmand: %s" % cmd)
+def print_wpas_network_properties(properties):
+ print " Properties = {"
+
+ for p in properties:
+ print " %s = %s" % (p, convert_dbus_value(properties[p]))
+
+ print " }"
+
+def print_wpas_network(props):
+ for prop in props:
+ if prop == "Properties":
+ print_wpas_network_properties(props["Properties"])
+ else:
+ print " %s = %s" % (prop,
+ convert_dbus_value(props[prop]))
+
+def print_wpas_networks(networks):
+ bus = get_bus()
+
+ for path in networks:
+ print
+ network = bus.get_object("fi.w1.wpa_supplicant1", path)
+ props = network.GetAll("fi.w1.wpa_supplicant1.Network",
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ print "[ %s ]" % path
+ print_wpas_network(props)
+
+def print_wpas_bss(props):
+ for prop in props:
+ if prop in ["RSN", "IEs", "Rates"]:
+ pass
+ elif prop in ["SSID", "BSSID"]:
+ print " %s =" % prop,
+
+ for b in props[prop]:
+ print "%x" % b,
+
+ print
+ else:
+ print " %s = %s" % (prop,
+ convert_dbus_value(props[prop]))
+
+def print_wpas_bsss(bsss):
+ bus = get_bus()
+
+ for path in bsss:
+ print
+ bss = bus.get_object("fi.w1.wpa_supplicant1", path)
+ props = bss.GetAll("fi.w1.wpa_supplicant1.BSS",
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ print "[ %s ]" % path
+ print_wpas_bss(props)
+
+def print_wpas_interface(props):
+ for prop in props:
+ if prop == "Capabilities":
+ pass
+ else:
+ print " %s = %s" % (prop, convert_dbus_value(props[prop]))
+
+def print_wpas(props):
+ print "[ %s ]" % WPAS_DBUS_PATH
+
+ for prop in props:
+ print " %s = %s " % (prop, convert_dbus_value(props[prop]))
+
+def cmd_wpas_list(argv, show_bss=False, show_networks=False):
+ bus = get_bus()
+ wpas = bus.get_object(WPAS_DBUS_SERVICE, WPAS_DBUS_PATH)
+
+ try:
+ props = wpas.GetAll("fi.w1.wpa_supplicant1",
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ except dbus.exceptions.DBusException as e:
+ raise ArgumentException("Failed to contact wpasupplicant: %s"
+ "\nAre you root?" % e)
+
+
+ print_wpas(props)
+
+ if "Interfaces" not in props:
+ raise ArgumentException("No Interfaces in properties")
+
+ bsss = []
+ networks = []
+
+ for path in props["Interfaces"]:
+ print
+ print "[ %s ]" % path
+ interface = bus.get_object("fi.w1.wpa_supplicant1", path)
+ props = interface.GetAll("fi.w1.wpa_supplicant1.Interface",
+ dbus_interface=dbus.PROPERTIES_IFACE)
+ print_wpas_interface(props)
+
+ bsss = bsss + props["BSSs"]
+ networks = networks + props["Networks"]
+
+ if show_bss:
+ print_wpas_bsss(bsss)
+
+ if show_networks:
+ print_wpas_networks(networks)
+
+def cmd_wpas(argv):
+ if len(argv) < 1:
+ raise ArgumentException("wpas command missing")
+
+ cmd = argv.pop(0)
+
+ if cmd == "list":
+ cmd_wpas_list(argv)
+ elif cmd == "networks":
+ cmd_wpas_list(argv, show_networks=True)
+ elif cmd == "bss":
+ cmd_wpas_list(argv, show_bss=True, show_networks=True)
+ else:
+ raise ArgumentException("unknown wpas commmand: %s" % cmd)
+
def cmd_connect_hidden(argv):
if (len(argv) < 1):
@@ -762,6 +903,8 @@ def handle_cmd(cmd, argv, name):
cmd_event(argv)
elif cmd == "modem":
cmd_modem(argv)
+ elif cmd == "wpas":
+ cmd_wpas(argv)
elif cmd == "connect-hidden":
cmd_connect_hidden(argv)
else:
diff --git a/packages/network/install b/packages/network/install
index bce1ab933d..77f0aedc80 100755
--- a/packages/network/install
+++ b/packages/network/install
@@ -5,6 +5,9 @@
$SCRIPTS/install connman
$SCRIPTS/install dropbear
$SCRIPTS/install ethtool
-$SCRIPTS/install netmount
+
+if [ "$NETMOUNT" = "yes" ]; then
+ $SCRIPTS/install netmount
+fi
#[ "$PPP_DAEMON" = yes ] && $SCRIPTS/install ppp
diff --git a/packages/network/libnfsidmap/build b/packages/network/libnfsidmap/build
new file mode 100755
index 0000000000..40d9ca6eb8
--- /dev/null
+++ b/packages/network/libnfsidmap/build
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. config/options $1
+
+cd $PKG_BUILD
+./configure --host=$TARGET_NAME \
+ --build=$HOST_NAME \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --disable-static \
+ --enable-shared \
+
+make
+
+$MAKEINSTALL
diff --git a/packages/network/libnfsidmap/install b/packages/network/libnfsidmap/install
new file mode 100755
index 0000000000..6431db9959
--- /dev/null
+++ b/packages/network/libnfsidmap/install
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+. config/options $1
+
+mkdir -p $INSTALL/usr/lib
+ cp -P $PKG_BUILD/.libs/libnfsidmap.so* $INSTALL/usr/lib/
+
+mkdir -p $INSTALL/usr/lib/libnfsidmap
+ cp -P $PKG_BUILD/.libs/nsswitch.so $INSTALL/usr/lib/libnfsidmap/
+ cp -P $PKG_BUILD/.libs/static.so $INSTALL/usr/lib/libnfsidmap/
diff --git a/packages/network/libnfsidmap/meta b/packages/network/libnfsidmap/meta
new file mode 100644
index 0000000000..1dd58710b5
--- /dev/null
+++ b/packages/network/libnfsidmap/meta
@@ -0,0 +1,16 @@
+PKG_NAME="libnfsidmap"
+PKG_VERSION="0.23"
+PKG_REV="1"
+PKG_ARCH="any"
+PKG_LICENSE="OSS"
+PKG_SITE="http://www.citi.umich.edu/projects/nfsv4/linux/"
+PKG_URL="http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/$PKG_NAME-$PKG_VERSION.tar.gz"
+PKG_DEPENDS=""
+PKG_BUILD_DEPENDS="toolchain"
+PKG_PRIORITY="optional"
+PKG_SECTION="network"
+PKG_SHORTDESC="libnfsidmap: Library to help mapping id's, mainly for NFSv4"
+PKG_LONGDESC="Library to help mapping id's, mainly for NFSv4."
+PKG_IS_ADDON="no"
+
+PKG_AUTORECONF="yes"
diff --git a/packages/network/libnl/build b/packages/network/libnl/build
index f887f8ecc2..40d9ca6eb8 100755
--- a/packages/network/libnl/build
+++ b/packages/network/libnl/build
@@ -2,8 +2,6 @@
. config/options $1
-$SCRIPTS/build toolchain
-
cd $PKG_BUILD
./configure --host=$TARGET_NAME \
--build=$HOST_NAME \
diff --git a/packages/network/netmount/config/netmount.conf.sample b/packages/network/netmount/config/netmount.conf.sample
index 0fda4757a7..926e3b8f22 100644
--- a/packages/network/netmount/config/netmount.conf.sample
+++ b/packages/network/netmount/config/netmount.conf.sample
@@ -1,18 +1,22 @@
# netmount.conf
#
# This configuration file allows you to setup network mounts via
-# CIFS (Samba) while the system is booting
+# CIFS (Samba) or NFS while the system is booting
#
# This is an sample file, please rename or copy this file to
# netmount.conf in the samba share "Configfiles" (or /storage/.config/)
#
# Usage:
-# service | share on server | local mountpoint | mount options
+# service | share on server | local mountpoint <| mount options>
#
+# - "service" can be "nfs" for NFS mounts or "cifs" for CIFS (Samba) mounts
# - Please use an "|" as delimiter
# - Don't use spaces in usernames, passwords and options
+# - for NFS mounts there is no support for options
+# - be aware of the different syntax for NFS shares
# - Local mountpoints should only be on /storage
#
# Examples:
-# cifs | //192.168.1.44/videos | /storage/mount/videos | username=user,password=secret
-# cifs | //192.168.1.44/tv shows | /storage/mount/tvshows | username=user,password=secret
+# cifs | //192.168.1.44/videos | /storage/mount/videos | username=user,pass=secret
+# cifs | //192.168.1.44/tv shows | /storage/mount/tvshows | username=user,pass=secret
+# nfs | 192.168.1.44:/videos | /storage/mount/videos
diff --git a/packages/network/netmount/init.network/43_netmount b/packages/network/netmount/init.network/43_netmount
index 10c501b0fb..36033fcd69 100755
--- a/packages/network/netmount/init.network/43_netmount
+++ b/packages/network/netmount/init.network/43_netmount
@@ -30,31 +30,25 @@
if [ -f $NETMOUNT_USERCONF ]; then
- progress "Mounting Network shares"
-
- if [ -f /usr/bin/mount.cifs ]; then
-
IFS="
"
- for i in `cat $NETMOUNT_USERCONF |grep -v "^#"`; do
- SERVICE=`echo $i | awk -F\| '{print $1}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
- SHARE=`echo $i | awk -F\| '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
- MOUNTPOINT=`echo $i | awk -F\| '{print $3}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
- OPTIONS=`echo $i | awk -F\| '{print $4}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
+ for i in `cat $NETMOUNT_USERCONF |grep -v "^#"`; do
+ SERVICE=`echo $i | awk -F\| '{print $1}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
+ SHARE=`echo $i | awk -F\| '{print $2}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
+ MOUNTPOINT=`echo $i | awk -F\| '{print $3}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
+ OPTIONS=`echo $i | awk -F\| '{print $4}' | sed 's/^[ \t]*//;s/[ \t]*$//'`
+ progress "... mounting $SHARE to $MOUNTPOINT via $SERVICE ..."
- progress "... mounting $SHARE to $MOUNTPOINT ..."
+ mkdir -p $MOUNTPOINT
- mkdir -p $MOUNTPOINT
-
- case "$SERVICE" in
- cifs|smb|samba)
- mount.cifs "$SHARE" "$MOUNTPOINT" -o "$OPTIONS" > /dev/null 2>&1
- ;;
-# nfs)
-# mount.nfs $SHARE $MOUNTPOINT -o $OPTIONS
-# ;;
- esac
- done
- fi
+ case "$SERVICE" in
+ cifs|smb|samba)
+ mount.cifs "$SHARE" "$MOUNTPOINT" -o "$OPTIONS" > /dev/null 2>&1
+ ;;
+ nfs)
+ mount.nfs "$SHARE" "$MOUNTPOINT" > /dev/null 2>&1
+ ;;
+ esac
+ done
fi
diff --git a/packages/network/netmount/meta b/packages/network/netmount/meta
index 2f6528ccb8..449ae1b439 100644
--- a/packages/network/netmount/meta
+++ b/packages/network/netmount/meta
@@ -5,7 +5,7 @@ PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.openelec.tv"
PKG_URL=""
-PKG_DEPENDS="samba connman"
+PKG_DEPENDS="samba nfs-utils connman"
PKG_BUILD_DEPENDS="toolchain"
PKG_PRIORITY="optional"
PKG_SECTION="tools"
diff --git a/packages/network/nfs-utils/build b/packages/network/nfs-utils/build
new file mode 100755
index 0000000000..e4d8cb10fb
--- /dev/null
+++ b/packages/network/nfs-utils/build
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+. config/options $1
+
+CFLAGS_FOR_BUILD="$HOST_CFLAGS"
+CXXFLAGS_FOR_BUILD="$HOST_CXXFLAGS"
+CPPFLAGS_FOR_BUILD="$HOST_CPPFLAGS"
+LDFLAGS_FOR_BUILD="$HOST_LDFLAGS"
+
+cd $PKG_BUILD
+libblkid_is_recent="yes" \
+./configure --host=$TARGET_NAME \
+ --build=$HOST_NAME \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --disable-static \
+ --enable-shared \
+ --with-sysroot="$SYSROOT_PREFIX/usr" \
+ --enable-nfsv3 \
+ --enable-nfsv4 \
+ --disable-nfsv41 \
+ --disable-gss \
+ --disable-kprefix \
+ --enable-uuid \
+ --enable-mount \
+ --disable-tirpc \
+ --disable-ipv6 \
+ --enable-mountconfig \
+ --without-tcp-wrappers \
+ --without-krb5 \
+ --disable-caps \
+ --enable-largefile \
+ --with-mountfile=/etc/nfsmounts.conf \
+ --with-gnu-ld
+
+make
diff --git a/packages/network/nfs-utils/config/protocols b/packages/network/nfs-utils/config/protocols
new file mode 100644
index 0000000000..97f366d24a
--- /dev/null
+++ b/packages/network/nfs-utils/config/protocols
@@ -0,0 +1,154 @@
+# /etc/protocols:
+# $Id: protocols,v 1.5 2006/10/11 15:39:11 pknirsch Exp $
+#
+# Internet (IP) protocols
+#
+# from: @(#)protocols 5.1 (Berkeley) 4/17/89
+#
+# Updated for NetBSD based on RFC 1340, Assigned Numbers (July 1992).
+#
+# See also http://www.iana.org/assignments/protocol-numbers
+
+ip 0 IP # internet protocol, pseudo protocol number
+hopopt 0 HOPOPT # hop-by-hop options for ipv6
+icmp 1 ICMP # internet control message protocol
+igmp 2 IGMP # internet group management protocol
+ggp 3 GGP # gateway-gateway protocol
+ipencap 4 IP-ENCAP # IP encapsulated in IP (officially ``IP'')
+st 5 ST # ST datagram mode
+tcp 6 TCP # transmission control protocol
+cbt 7 CBT # CBT, Tony Ballardie
+egp 8 EGP # exterior gateway protocol
+igp 9 IGP # any private interior gateway (Cisco: for IGRP)
+bbn-rcc 10 BBN-RCC-MON # BBN RCC Monitoring
+nvp 11 NVP-II # Network Voice Protocol
+pup 12 PUP # PARC universal packet protocol
+argus 13 ARGUS # ARGUS
+emcon 14 EMCON # EMCON
+xnet 15 XNET # Cross Net Debugger
+chaos 16 CHAOS # Chaos
+udp 17 UDP # user datagram protocol
+mux 18 MUX # Multiplexing protocol
+dcn 19 DCN-MEAS # DCN Measurement Subsystems
+hmp 20 HMP # host monitoring protocol
+prm 21 PRM # packet radio measurement protocol
+xns-idp 22 XNS-IDP # Xerox NS IDP
+trunk-1 23 TRUNK-1 # Trunk-1
+trunk-2 24 TRUNK-2 # Trunk-2
+leaf-1 25 LEAF-1 # Leaf-1
+leaf-2 26 LEAF-2 # Leaf-2
+rdp 27 RDP # "reliable datagram" protocol
+irtp 28 IRTP # Internet Reliable Transaction Protocol
+iso-tp4 29 ISO-TP4 # ISO Transport Protocol Class 4
+netblt 30 NETBLT # Bulk Data Transfer Protocol
+mfe-nsp 31 MFE-NSP # MFE Network Services Protocol
+merit-inp 32 MERIT-INP # MERIT Internodal Protocol
+dccp 33 DCCP # Datagram Congestion Control Protocol
+3pc 34 3PC # Third Party Connect Protocol
+idpr 35 IDPR # Inter-Domain Policy Routing Protocol
+xtp 36 XTP # Xpress Tranfer Protocol
+ddp 37 DDP # Datagram Delivery Protocol
+idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport Proto
+tp++ 39 TP++ # TP++ Transport Protocol
+il 40 IL # IL Transport Protocol
+ipv6 41 IPv6 # IPv6
+sdrp 42 SDRP # Source Demand Routing Protocol
+ipv6-route 43 IPv6-Route # Routing Header for IPv6
+ipv6-frag 44 IPv6-Frag # Fragment Header for IPv6
+idrp 45 IDRP # Inter-Domain Routing Protocol
+rsvp 46 RSVP # Resource ReSerVation Protocol
+gre 47 GRE # Generic Routing Encapsulation
+dsr 48 DSR # Dynamic Source Routing Protocol
+bna 49 BNA # BNA
+esp 50 ESP # Encap Security Payload
+ah 51 AH # Authentication Header
+i-nlsp 52 I-NLSP # Integrated Net Layer Security TUBA
+swipe 53 SWIPE # IP with Encryption
+narp 54 NARP # NBMA Address Resolution Protocol
+mobile 55 MOBILE # IP Mobility
+tlsp 56 TLSP # Transport Layer Security Protocol
+skip 57 SKIP # SKIP
+ipv6-icmp 58 IPv6-ICMP # ICMP for IPv6
+ipv6-nonxt 59 IPv6-NoNxt # No Next Header for IPv6
+ipv6-opts 60 IPv6-Opts # Destination Options for IPv6
+# 61 # any host internal protocol
+cftp 62 CFTP # CFTP
+# 63 # any local network
+sat-expak 64 SAT-EXPAK # SATNET and Backroom EXPAK
+kryptolan 65 KRYPTOLAN # Kryptolan
+rvd 66 RVD # MIT Remote Virtual Disk Protocol
+ippc 67 IPPC # Internet Pluribus Packet Core
+# 68 # any distributed file system
+sat-mon 69 SAT-MON # SATNET Monitoring
+visa 70 VISA # VISA Protocol
+ipcv 71 IPCV # Internet Packet Core Utility
+cpnx 72 CPNX # Computer Protocol Network Executive
+cphb 73 CPHB # Computer Protocol Heart Beat
+wsn 74 WSN # Wang Span Network
+pvp 75 PVP # Packet Video Protocol
+br-sat-mon 76 BR-SAT-MON # Backroom SATNET Monitoring
+sun-nd 77 SUN-ND # SUN ND PROTOCOL-Temporary
+wb-mon 78 WB-MON # WIDEBAND Monitoring
+wb-expak 79 WB-EXPAK # WIDEBAND EXPAK
+iso-ip 80 ISO-IP # ISO Internet Protocol
+vmtp 81 VMTP # Versatile Message Transport
+secure-vmtp 82 SECURE-VMTP # SECURE-VMTP
+vines 83 VINES # VINES
+ttp 84 TTP # TTP
+nsfnet-igp 85 NSFNET-IGP # NSFNET-IGP
+dgp 86 DGP # Dissimilar Gateway Protocol
+tcf 87 TCF # TCF
+eigrp 88 EIGRP # Enhanced Interior Routing Protocol (Cisco)
+ospf 89 OSPFIGP # Open Shortest Path First IGP
+sprite-rpc 90 Sprite-RPC # Sprite RPC Protocol
+larp 91 LARP # Locus Address Resolution Protocol
+mtp 92 MTP # Multicast Transport Protocol
+ax.25 93 AX.25 # AX.25 Frames
+ipip 94 IPIP # Yet Another IP encapsulation
+micp 95 MICP # Mobile Internetworking Control Pro.
+scc-sp 96 SCC-SP # Semaphore Communications Sec. Pro.
+etherip 97 ETHERIP # Ethernet-within-IP Encapsulation
+encap 98 ENCAP # Yet Another IP encapsulation
+# 99 # any private encryption scheme
+gmtp 100 GMTP # GMTP
+ifmp 101 IFMP # Ipsilon Flow Management Protocol
+pnni 102 PNNI # PNNI over IP
+pim 103 PIM # Protocol Independent Multicast
+aris 104 ARIS # ARIS
+scps 105 SCPS # SCPS
+qnx 106 QNX # QNX
+a/n 107 A/N # Active Networks
+ipcomp 108 IPComp # IP Payload Compression Protocol
+snp 109 SNP # Sitara Networks Protocol
+compaq-peer 110 Compaq-Peer # Compaq Peer Protocol
+ipx-in-ip 111 IPX-in-IP # IPX in IP
+vrrp 112 VRRP # Virtual Router Redundancy Protocol
+pgm 113 PGM # PGM Reliable Transport Protocol
+# 114 # any 0-hop protocol
+l2tp 115 L2TP # Layer Two Tunneling Protocol
+ddx 116 DDX # D-II Data Exchange
+iatp 117 IATP # Interactive Agent Transfer Protocol
+stp 118 STP # Schedule Transfer
+srp 119 SRP # SpectraLink Radio Protocol
+uti 120 UTI # UTI
+smp 121 SMP # Simple Message Protocol
+sm 122 SM # SM
+ptp 123 PTP # Performance Transparency Protocol
+isis 124 ISIS # ISIS over IPv4
+fire 125 FIRE
+crtp 126 CRTP # Combat Radio Transport Protocol
+crdup 127 CRUDP # Combat Radio User Datagram
+sscopmce 128 SSCOPMCE
+iplt 129 IPLT
+sps 130 SPS # Secure Packet Shield
+pipe 131 PIPE # Private IP Encapsulation within IP
+sctp 132 SCTP # Stream Control Transmission Protocol
+fc 133 FC # Fibre Channel
+rsvp-e2e-ignore 134 RSVP-E2E-IGNORE
+# 135 # Mobility Header
+udplite 136 UDPLite
+mpls-in-ip 137 MPLS-in-IP
+# 138-252 Unassigned [IANA]
+# 253 Use for experimentation and testing [RFC3692]
+# 254 Use for experimentation and testing [RFC3692]
+# 255 Reserved [IANA]
diff --git a/packages/network/nfs-utils/init.d/25_nfsutils b/packages/network/nfs-utils/init.d/25_nfsutils
new file mode 100755
index 0000000000..d4283a8db1
--- /dev/null
+++ b/packages/network/nfs-utils/init.d/25_nfsutils
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+################################################################################
+# Copyright (C) 2009-2010 OpenELEC.tv
+# http://www.openelec.tv
+#
+# 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, 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenELEC.tv; see the file COPYING. If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+# http://www.gnu.org/copyleft/gpl.html
+################################################################################
+
+# create directories needed for nfs-utils
+#
+# runlevels: openelec, textmode
+
+. /etc/profile
+
+ progress "create directories needed for nfs-utils"
+
+ install -m 755 -o rpcuser -g rpcuser -d /var/lib/nfs
+ install -m 755 -o rpcuser -g rpcuser -d /var/lib/nfs/sm
+ install -m 755 -o rpcuser -g rpcuser -d /var/lib/nfs/sm.bak
+ touch /var/lib/nfs/etab && chown rpcuser:rpcuser /var/lib/nfs/etab
+ touch /var/lib/nfs/rmtab && chown rpcuser:rpcuser /var/lib/nfs/rmtab
+ touch /var/lib/nfs/state && chown rpcuser:rpcuser /var/lib/nfs/state
+ touch /var/lib/nfs/xtab && chown rpcuser:rpcuser /var/lib/nfs/xtab
diff --git a/packages/network/nfs-utils/install b/packages/network/nfs-utils/install
new file mode 100755
index 0000000000..e673ab3a9b
--- /dev/null
+++ b/packages/network/nfs-utils/install
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+. config/options $1
+
+add_user rpcuser x 29 29 "RPC Service User" "/var/lib/nfs" "/bin/sh"
+add_group rpcuser 29
+
+mkdir -p $INSTALL/sbin
+ cp $PKG_BUILD/utils/mount/mount.nfs $INSTALL/sbin/
+ ln -sf mount.nfs $INSTALL/sbin/mount.nfs4
+ ln -sf mount.nfs $INSTALL/sbin/umount.nfs
+ ln -sf mount.nfs $INSTALL/sbin/umount.nfs4
+
+mkdir -p $INSTALL/usr/sbin
+ cp $PKG_BUILD/utils/statd/statd $INSTALL/usr/sbin/rpc.statd
+ cp $PKG_BUILD/utils/statd/start-statd $INSTALL/usr/sbin/
+ chmod +x $INSTALL/usr/sbin/start-statd
+
+mkdir -p $INSTALL/etc
+ cp $PKG_DIR/config/protocols $INSTALL/etc
diff --git a/packages/network/nfs-utils/meta b/packages/network/nfs-utils/meta
new file mode 100644
index 0000000000..f889bb4c93
--- /dev/null
+++ b/packages/network/nfs-utils/meta
@@ -0,0 +1,16 @@
+PKG_NAME="nfs-utils"
+PKG_VERSION="1.2.3"
+PKG_REV="1"
+PKG_ARCH="any"
+PKG_LICENSE="OSS"
+PKG_SITE="http://nfs.sourceforge.net/"
+PKG_URL="https://downloads.sourceforge.net/project/nfs/nfs-utils/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.bz2"
+PKG_DEPENDS="libevent libnfsidmap portmap util-linux-ng"
+PKG_BUILD_DEPENDS="toolchain libevent libnfsidmap"
+PKG_PRIORITY="optional"
+PKG_SECTION="network"
+PKG_SHORTDESC="nfs-utils: Linux NFS client and server utilities"
+PKG_LONGDESC="The nfs-utils package provides a daemon for the kernel NFS server and related tools, which provides a much higher level of performance than the traditional Linux NFS server used by most users. This package also contains the showmount program. Showmount queries the mount daemon on a remote host for information about the NFS (Network File System) server on the remote host. For example, showmount can display the clients which are mounted on that host."
+PKG_IS_ADDON="no"
+
+PKG_AUTORECONF="yes"
diff --git a/packages/network/nfs-utils/patches/nfs-utils-1.2.3-cross.patch b/packages/network/nfs-utils/patches/nfs-utils-1.2.3-cross.patch
new file mode 100644
index 0000000000..57c2f035c1
--- /dev/null
+++ b/packages/network/nfs-utils/patches/nfs-utils-1.2.3-cross.patch
@@ -0,0 +1,46 @@
+diff -Naur nfs-utils-1.1.0-old/tools/locktest/Makefile.am nfs-utils-1.1.0-new/tools/locktest/Makefile.am
+--- nfs-utils-1.1.0-old/tools/locktest/Makefile.am 2007-05-10 20:40:57.000000000 -0700
++++ nfs-utils-1.1.0-new/tools/locktest/Makefile.am 2007-08-11 19:18:59.000000000 -0700
+@@ -5,8 +5,8 @@
+
+ noinst_PROGRAMS = testlk
+ testlk_SOURCES = testlk.c
+-testlk_CFLAGS=$(CFLAGS_FOR_BUILD)
+-testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
+-testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD)
++CFLAGS=$(CFLAGS_FOR_BUILD)
++CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
++LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ MAINTAINERCLEANFILES = Makefile.in
+diff -Naur nfs-utils-1.1.0-old/tools/rpcdebug/Makefile.am nfs-utils-1.1.0-new/tools/rpcdebug/Makefile.am
+--- nfs-utils-1.1.0-old/tools/rpcdebug/Makefile.am 2007-05-10 20:40:57.000000000 -0700
++++ nfs-utils-1.1.0-new/tools/rpcdebug/Makefile.am 2007-08-11 19:19:37.000000000 -0700
+@@ -8,8 +8,8 @@
+
+ sbin_PROGRAMS = rpcdebug
+ rpcdebug_SOURCES = rpcdebug.c
+-rpcdebug_CFLAGS=$(CFLAGS_FOR_BUILD)
+-rpcdebug_CPPFLAGS=$(CPPFLAGS_FOR_BUILD) -I$(top_srcdir)/support/include
+-rpcdebug_LDFLAGS=$(LDFLAGS_FOR_BUILD)
++CFLAGS=$(CFLAGS_FOR_BUILD)
++CPPFLAGS=$(CPPFLAGS_FOR_BUILD) -I$(top_srcdir)/support/include
++LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ MAINTAINERCLEANFILES = Makefile.in
+diff -Naur nfs-utils-1.1.0-old/tools/rpcgen/Makefile.am nfs-utils-1.1.0-new/tools/rpcgen/Makefile.am
+--- nfs-utils-1.1.0-old/tools/rpcgen/Makefile.am 2007-05-10 20:40:57.000000000 -0700
++++ nfs-utils-1.1.0-new/tools/rpcgen/Makefile.am 2007-08-11 19:19:57.000000000 -0700
+@@ -9,9 +9,9 @@
+ rpc_util.c rpc_sample.c rpc_output.h rpc_parse.h \
+ rpc_scan.h rpc_util.h
+
+-rpcgen_CFLAGS=$(CFLAGS_FOR_BUILD)
+-rpcgen_CPPLAGS=$(CPPFLAGS_FOR_BUILD)
+-rpcgen_LDFLAGS=$(LDFLAGS_FOR_BUILD)
++CFLAGS=$(CFLAGS_FOR_BUILD)
++CPPLAGS=$(CPPFLAGS_FOR_BUILD)
++LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ MAINTAINERCLEANFILES = Makefile.in
+
diff --git a/packages/network/portmap/build b/packages/network/portmap/build
new file mode 100755
index 0000000000..6f2be2285d
--- /dev/null
+++ b/packages/network/portmap/build
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+. config/options $1
+
+cd $PKG_BUILD
+make FACILITY=LOG_AUTH \
+ ZOMBIES='-DIGNORE_SIGCHLD -Dlint' \
+ LIBS="-lnsl" \
+ AUX="" \
+ HOSTS_ACCESS="" \
+
diff --git a/packages/network/portmap/init.d/26_portmap b/packages/network/portmap/init.d/26_portmap
new file mode 100755
index 0000000000..2ad78bd8eb
--- /dev/null
+++ b/packages/network/portmap/init.d/26_portmap
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+################################################################################
+# Copyright (C) 2009-2010 OpenELEC.tv
+# http://www.openelec.tv
+#
+# 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, 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenELEC.tv; see the file COPYING. If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+# http://www.gnu.org/copyleft/gpl.html
+################################################################################
+
+# starting portmap
+#
+# runlevels: openelec, textmode
+
+. /etc/profile
+
+ progress "starting portmap"
+ portmap
\ No newline at end of file
diff --git a/packages/network/portmap/install b/packages/network/portmap/install
new file mode 100755
index 0000000000..929b2124da
--- /dev/null
+++ b/packages/network/portmap/install
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+. config/options $1
+
+mkdir -p $INSTALL/sbin
+ cp $PKG_BUILD/portmap $INSTALL/sbin/
+
+mkdir -p $INSTALL/usr/sbin
+ cp $PKG_BUILD/pmap_set $INSTALL/usr/sbin/
+ cp $PKG_BUILD/pmap_dump $INSTALL/usr/sbin/
diff --git a/packages/network/portmap/meta b/packages/network/portmap/meta
new file mode 100644
index 0000000000..cdd0e607f9
--- /dev/null
+++ b/packages/network/portmap/meta
@@ -0,0 +1,16 @@
+PKG_NAME="portmap"
+PKG_VERSION="4"
+PKG_REV="1"
+PKG_ARCH="any"
+PKG_LICENSE="OSS"
+PKG_SITE="ftp://ftp.porcupine.org/pub/security/"
+PKG_URL="ftp://ftp.porcupine.org/pub/security/${PKG_NAME}_${PKG_VERSION}.tar.gz"
+PKG_DEPENDS=""
+PKG_BUILD_DEPENDS="toolchain"
+PKG_PRIORITY="optional"
+PKG_SECTION="network"
+PKG_SHORTDESC="portmap: RPC portmapper"
+PKG_LONGDESC="This is an RPC portmapper that prevents theft of NIS (YP), NFS, and other sensitive information via the portmapper. As an option, the program supports access control in the style of the tcp wrapper (log_tcp) package."
+PKG_IS_ADDON="no"
+
+PKG_AUTORECONF="no"
diff --git a/packages/network/portmap/patches/portmap-4-errno.patch b/packages/network/portmap/patches/portmap-4-errno.patch
new file mode 100644
index 0000000000..bd83ac863e
--- /dev/null
+++ b/packages/network/portmap/patches/portmap-4-errno.patch
@@ -0,0 +1,18 @@
+--- portmap_4/portmap.c.old 1996-05-31 09:52:59.000000000 -0400
++++ portmap_4/portmap.c 2002-12-13 11:44:16.000000000 -0500
+@@ -94,6 +94,7 @@
+ #ifdef SYSV40
+ #include
+ #endif
++#include
+
+ extern char *strerror();
+ #include
+@@ -124,7 +125,6 @@
+ static void callit();
+ struct pmaplist *pmaplist;
+ int debugging = 0;
+-extern int errno;
+
+ #include "pmap_check.h"
+
diff --git a/packages/network/portmap/patches/portmap-4-linux.patch b/packages/network/portmap/patches/portmap-4-linux.patch
new file mode 100644
index 0000000000..c29b3d570f
--- /dev/null
+++ b/packages/network/portmap/patches/portmap-4-linux.patch
@@ -0,0 +1,27 @@
+--- portmap_4/Makefile.orig Fri May 31 09:50:40 1996
++++ portmap_4/Makefile Fri Aug 9 17:40:43 1996
+@@ -67,9 +67,9 @@
+
+ SHELL = /bin/sh
+
+-COPT = -Dconst= -Dperror=xperror $(HOSTS_ACCESS) $(CHECK_PORT) \
++COPT = -Dconst= $(HOSTS_ACCESS) $(CHECK_PORT) \
+ $(SYS) -DFACILITY=$(FACILITY) $(ULONG) $(ZOMBIES) $(SA_LEN)
+-CFLAGS = $(COPT) -O $(NSARCHS) $(SETPGRP)
++CFLAGS = $(COPT) $(RPM_OPT_FLAGS) $(NSARCHS) $(SETPGRP)
+ OBJECTS = portmap.o pmap_check.o from_local.o $(AUX)
+
+ all: portmap pmap_dump pmap_set
+--- portmap_4/Makefile.bad 1996-05-31 09:50:40.000000000 -0400
++++ portmap_4/Makefile 2002-12-12 09:54:00.000000000 -0500
+@@ -74,8 +74,8 @@
+
+ all: portmap pmap_dump pmap_set
+
+-portmap: $(OBJECTS) $(WRAP_DIR)/libwrap.a
+- $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(WRAP_DIR)/libwrap.a $(LIBS)
++portmap: $(OBJECTS)
++ $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS)
+
+ pmap_dump: pmap_dump.c
+ $(CC) $(CFLAGS) -o $@ $? $(LIBS)
diff --git a/packages/network/portmap/patches/portmap-4-loopback.patch b/packages/network/portmap/patches/portmap-4-loopback.patch
new file mode 100644
index 0000000000..5234e7ef56
--- /dev/null
+++ b/packages/network/portmap/patches/portmap-4-loopback.patch
@@ -0,0 +1,51 @@
+--- portmap_4/portmap.c.orig 2004-08-12 10:48:13.405000000 -0400
++++ portmap_4/portmap.c 2004-08-12 10:58:13.666000000 -0400
+@@ -126,6 +126,7 @@
+ static void callit();
+ struct pmaplist *pmaplist;
+ int debugging = 0;
++int localhost_only = 0;
+
+ #include "pmap_check.h"
+
+@@ -140,13 +141,17 @@
+ int len = sizeof(struct sockaddr_in);
+ register struct pmaplist *pml;
+
+- while ((c = getopt(argc, argv, "dv")) != EOF) {
++ while ((c = getopt(argc, argv, "dlv")) != EOF) {
+ switch (c) {
+
+ case 'd':
+ debugging = 1;
+ break;
+
++ case 'l':
++ localhost_only = 1;
++ break;
++
+ case 'v':
+ verboselog = 1;
+ break;
+@@ -154,6 +159,7 @@
+ default:
+ (void) fprintf(stderr, "usage: %s [-dv]\n", argv[0]);
+ (void) fprintf(stderr, "-d: debugging mode\n");
++ (void) fprintf(stderr, "-l: listen on localhost only\n");
+ (void) fprintf(stderr, "-v: verbose logging\n");
+ exit(1);
+ }
+@@ -176,7 +182,12 @@
+ exit(1);
+ }
+
+- addr.sin_addr.s_addr = 0;
++ if (localhost_only) {
++ addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
++ syslog(LOG_NOTICE, "Only binding to LOOPBACK address!");
++ } else {
++ addr.sin_addr.s_addr = 0;
++ }
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(PMAPPORT);
+ if (bind(sock, (struct sockaddr *)&addr, len) != 0) {
diff --git a/packages/network/portmap/patches/portmap-4-pie.patch b/packages/network/portmap/patches/portmap-4-pie.patch
new file mode 100644
index 0000000000..ee22eb769e
--- /dev/null
+++ b/packages/network/portmap/patches/portmap-4-pie.patch
@@ -0,0 +1,42 @@
+--- portmap_4/Makefile.pie 2003-10-28 20:18:32.000000000 -0800
++++ portmap_4/Makefile 2003-10-28 20:18:32.000000000 -0800
+@@ -74,8 +74,11 @@
+
+ all: portmap pmap_dump pmap_set
+
++$(OBJECTS): %.o: %.c
++ $(CC) $(CFLAGS) -fpie -c $<
++
+ portmap: $(OBJECTS)
+- $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS)
++ $(CC) $(CFLAGS) -o $@ -pie $(OBJECTS) $(LIBS)
+
+ pmap_dump: pmap_dump.c
+ $(CC) $(CFLAGS) -o $@ $? $(LIBS)
+--- portmap_4/pmap_check.h.pie 2003-10-28 20:26:34.000000000 -0800
++++ portmap_4/pmap_check.h 2003-10-28 20:26:49.000000000 -0800
+@@ -6,6 +6,6 @@
+ extern int check_setunset();
+ extern int check_privileged_port();
+ extern int check_callit();
+-extern int verboselog;
+-extern int allow_severity;
+-extern int deny_severity;
++extern int verboselog __attribute__ ((visibility ("hidden")));
++extern int allow_severity __attribute__ ((visibility ("hidden")));
++extern int deny_severity __attribute__ ((visibility ("hidden")));
+--- portmap_4/pmap_check.c.pie 2003-10-28 20:27:38.000000000 -0800
++++ portmap_4/pmap_check.c 2003-10-28 20:27:40.000000000 -0800
+@@ -63,9 +63,9 @@
+
+ static void logit();
+ static void toggle_verboselog();
+-int verboselog = 0;
+-int allow_severity = LOG_INFO;
+-int deny_severity = LOG_WARNING;
++int verboselog __attribute ((visibility ("hidden"))) = 0;
++int allow_severity __attribute ((visibility ("hidden"))) = LOG_INFO;
++int deny_severity __attribute ((visibility ("hidden"))) = LOG_WARNING;
+
+ /* A handful of macros for "readability". */
+
diff --git a/packages/network/portmap/patches/portmap-4-sigpipe.patch b/packages/network/portmap/patches/portmap-4-sigpipe.patch
new file mode 100644
index 0000000000..dba7cf4bb1
--- /dev/null
+++ b/packages/network/portmap/patches/portmap-4-sigpipe.patch
@@ -0,0 +1,12 @@
+--- portmap_4/portmap.c.sigpipe Sun Feb 11 17:45:11 2001
++++ portmap_4/portmap.c Sun Feb 11 17:45:51 2001
+@@ -228,6 +228,9 @@
+ #else
+ (void)signal(SIGCHLD, reap);
+ #endif
++ /* Dying on SIGPIPE doesn't help anyone */
++ (void)signal(SIGPIPE, SIG_IGN);
++
+ svc_run();
+ syslog(LOG_ERR, "run_svc returned unexpectedly");
+ abort();
diff --git a/packages/network/samba/install b/packages/network/samba/install
index ccc69e94aa..e76d086d46 100755
--- a/packages/network/samba/install
+++ b/packages/network/samba/install
@@ -4,8 +4,11 @@
mkdir -p $INSTALL/usr/bin
cp $PKG_BUILD/source3/bin/smbtree $INSTALL/usr/bin
- cp $PKG_BUILD/source3/bin/mount.cifs $INSTALL/usr/bin
- cp $PKG_BUILD/source3/bin/umount.cifs $INSTALL/usr/bin
+
+ if [ $NETMOUNT = "yes" ]; then
+ cp $PKG_BUILD/source3/bin/mount.cifs $INSTALL/usr/bin
+ cp $PKG_BUILD/source3/bin/umount.cifs $INSTALL/usr/bin
+ fi
mkdir -p $INSTALL/usr/lib
cp -P $PKG_BUILD/source3/bin/libsmbclient.so* $INSTALL/usr/lib
diff --git a/packages/print/freetype/meta b/packages/print/freetype/meta
index d4a6a3b82d..631c7001ae 100644
--- a/packages/print/freetype/meta
+++ b/packages/print/freetype/meta
@@ -1,5 +1,5 @@
PKG_NAME="freetype"
-PKG_VERSION="2.4.3"
+PKG_VERSION="2.4.4"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
diff --git a/packages/security/openssl/meta b/packages/security/openssl/meta
index 7c233368ec..fa51201f33 100644
--- a/packages/security/openssl/meta
+++ b/packages/security/openssl/meta
@@ -1,5 +1,5 @@
PKG_NAME="openssl"
-PKG_VERSION="1.0.0b"
+PKG_VERSION="1.0.0c"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="OSS"
diff --git a/packages/sysutils/LVM2/meta b/packages/sysutils/LVM2/meta
index 0395712e75..bf3a9a2fcd 100644
--- a/packages/sysutils/LVM2/meta
+++ b/packages/sysutils/LVM2/meta
@@ -1,5 +1,5 @@
PKG_NAME="LVM2"
-PKG_VERSION="2.02.75"
+PKG_VERSION="2.02.77"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE=""
diff --git a/packages/sysutils/busybox-initramfs/scripts/init b/packages/sysutils/busybox-initramfs/scripts/init
index 82a9e744be..1b26d3181a 100755
--- a/packages/sysutils/busybox-initramfs/scripts/init
+++ b/packages/sysutils/busybox-initramfs/scripts/init
@@ -10,6 +10,9 @@ REBOOT=0
/bin/busybox mount -t devtmpfs none /dev
/bin/busybox mount -t proc none /proc
+# hide kernel log messages on console
+ echo '1 4 1 7' > /proc/sys/kernel/printk
+
# parse command line arguments
for arg in $(cat /proc/cmdline); do
case $arg in
diff --git a/packages/sysutils/busybox/install b/packages/sysutils/busybox/install
index 53fcb29726..a1fb1ae530 100755
--- a/packages/sysutils/busybox/install
+++ b/packages/sysutils/busybox/install
@@ -32,7 +32,7 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw $USER_PASSWORD`"
ln -sf /var/cache/resolv.conf $INSTALL/etc/resolv.conf
# /etc/mtab is needed by udisks etc...
- ln -sf /proc/mounts $INSTALL/etc/mtab
+ ln -sf /proc/self/mounts $INSTALL/etc/mtab
# create /etc/hostname
echo $HOSTNAME > $INSTALL/etc/hostname
@@ -46,3 +46,6 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw $USER_PASSWORD`"
mkdir -p $INSTALL/etc/modprobe.d
cp $PKG_DIR/modprobe.d/* $INSTALL/etc/modprobe.d
+
+ # add user modprobe.d dir
+ mkdir -p $INSTALL/usr/config/modprobe.d
diff --git a/packages/sysutils/busybox/patches/busybox-1.17.3-00_halt_no_init.patch b/packages/sysutils/busybox/patches/busybox-1.17.3-00_halt_no_init.patch
deleted file mode 100644
index ce454f4c07..0000000000
--- a/packages/sysutils/busybox/patches/busybox-1.17.3-00_halt_no_init.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur busybox-1.13.2/init/halt.c busybox-1.13.2a/init/halt.c
---- busybox-1.13.2/init/halt.c 2008-11-09 18:28:19.000000000 +0100
-+++ busybox-1.13.2a/init/halt.c 2009-02-01 16:38:37.000000000 +0100
-@@ -79,7 +79,7 @@
-
- /* Perform action. */
- rc = 1;
-- if (!(flags & 4)) { /* no -f */
-+ if (ENABLE_INIT && !(flags & 4)) { /* no -f */
- //TODO: I tend to think that signalling linuxrc is wrong
- // pity original author didn't comment on it...
- if (ENABLE_FEATURE_INITRD) {
diff --git a/packages/sysutils/busybox/patches/busybox-1.17.3-dnsd.patch b/packages/sysutils/busybox/patches/busybox-1.17.3-dnsd.patch
deleted file mode 100644
index b135c14637..0000000000
--- a/packages/sysutils/busybox/patches/busybox-1.17.3-dnsd.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urpN busybox-1.17.3/networking/dnsd.c busybox-1.17.3-dnsd/networking/dnsd.c
---- busybox-1.17.3/networking/dnsd.c 2010-10-09 21:57:14.000000000 +0200
-+++ busybox-1.17.3-dnsd/networking/dnsd.c 2010-10-29 00:37:43.066043841 +0200
-@@ -388,7 +388,7 @@ static int process_packet(struct dns_ent
- query_len = strlen(query_string) + 1;
- /* may be unaligned! */
- unaligned_type_class = (void *)(query_string + query_len);
-- query_len += sizeof(unaligned_type_class);
-+ query_len += sizeof(*unaligned_type_class);
- /* where to append answer block */
- answb = (void *)(unaligned_type_class + 1);
-
diff --git a/packages/sysutils/busybox/patches/busybox-1.17.3-sort.patch b/packages/sysutils/busybox/patches/busybox-1.17.3-sort.patch
deleted file mode 100644
index ebc9bf9f94..0000000000
--- a/packages/sysutils/busybox/patches/busybox-1.17.3-sort.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urpN busybox-1.17.3/coreutils/sort.c busybox-1.17.3-sort/coreutils/sort.c
---- busybox-1.17.3/coreutils/sort.c 2010-10-09 21:57:13.000000000 +0200
-+++ busybox-1.17.3-sort/coreutils/sort.c 2010-10-20 15:17:35.320293543 +0200
-@@ -412,7 +412,7 @@ int sort_main(int argc UNUSED_PARAM, cha
- #if ENABLE_FEATURE_SORT_BIG
- /* Open output file _after_ we read all input ones */
- if (option_mask32 & FLAG_o)
-- xmove_fd(xopen3(str_o, O_WRONLY, 0666), STDOUT_FILENO);
-+ xmove_fd(xopen3(str_o, O_WRONLY|O_CREAT|O_TRUNC, 0666), STDOUT_FILENO);
- #endif
- flag = (option_mask32 & FLAG_z) ? '\0' : '\n';
- for (i = 0; i < linecount; i++)
diff --git a/packages/sysutils/busybox/patches/busybox-1.17.3-unicode.patch b/packages/sysutils/busybox/patches/busybox-1.17.3-unicode.patch
deleted file mode 100644
index dc3b02e22d..0000000000
--- a/packages/sysutils/busybox/patches/busybox-1.17.3-unicode.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -urpN busybox-1.17.3/libbb/unicode.c busybox-1.17.3-unicode/libbb/unicode.c
---- busybox-1.17.3/libbb/unicode.c 2010-10-09 21:58:13.000000000 +0200
-+++ busybox-1.17.3-unicode/libbb/unicode.c 2010-10-29 00:48:36.951494079 +0200
-@@ -1006,7 +1006,7 @@ static char* FAST_FUNC unicode_conv_to_p
- }
- }
- if (stats)
-- stats->byte_count = stats->unicode_count = (d - dst);
-+ stats->byte_count = stats->unicode_count = stats->unicode_width = (d - dst);
- return dst;
- }
-
diff --git a/packages/sysutils/busybox/patches/busybox-1.18.0-02_user_modprobe.d_dir-0.1.patch b/packages/sysutils/busybox/patches/busybox-1.18.0-02_user_modprobe.d_dir-0.1.patch
new file mode 100644
index 0000000000..13d4588f17
--- /dev/null
+++ b/packages/sysutils/busybox/patches/busybox-1.18.0-02_user_modprobe.d_dir-0.1.patch
@@ -0,0 +1,11 @@
+diff -Naur busybox-1.18.0/modutils/modprobe.c busybox-1.18.0.patch/modutils/modprobe.c
+--- busybox-1.18.0/modutils/modprobe.c 2010-11-22 21:43:22.000000000 +0100
++++ busybox-1.18.0.patch/modutils/modprobe.c 2010-11-30 08:46:36.961605729 +0100
+@@ -560,6 +560,7 @@
+
+ read_config("/etc/modprobe.conf");
+ read_config("/etc/modprobe.d");
++ read_config("/storage/.config/modprobe.d");
+ if (ENABLE_FEATURE_MODUTILS_SYMBOLS && G.need_symbols)
+ read_config("modules.symbols");
+ load_modules_dep();
diff --git a/packages/sysutils/dbus/install b/packages/sysutils/dbus/install
index 3bbb59806d..032c6c8ad1 100755
--- a/packages/sysutils/dbus/install
+++ b/packages/sysutils/dbus/install
@@ -12,7 +12,10 @@ mkdir -p $INSTALL/usr/bin
cp $PKG_BUILD/.build-target/tools/.libs/dbus-monitor $INSTALL/usr/bin
cp $PKG_BUILD/.build-target/tools/.libs/dbus-uuidgen $INSTALL/usr/bin
cp $PKG_BUILD/.build-target/tools/dbus-launch $INSTALL/usr/bin
- cp $PKG_BUILD/.build-target/tools/.libs/dbus-send $INSTALL/usr/bin #DEVTOOLS only
+
+ if [ "$DEVTOOLS" = yes ]; then
+ cp $PKG_BUILD/.build-target/tools/.libs/dbus-send $INSTALL/usr/bin
+ fi
mkdir -p $INSTALL/usr/lib
cp -P $PKG_BUILD/.build-target/dbus/.libs/libdbus-1.so* $INSTALL/usr/lib
diff --git a/packages/sysutils/grep/install b/packages/sysutils/grep/install
index 8643d6793f..f37f802584 100755
--- a/packages/sysutils/grep/install
+++ b/packages/sysutils/grep/install
@@ -2,5 +2,5 @@
. config/options $1
-mkdir -p $INSTALL/usr/bin
- cp $PKG_BUILD/src/grep $INSTALL/usr/bin
+mkdir -p $INSTALL/bin
+ cp $PKG_BUILD/src/grep $INSTALL/bin
diff --git a/packages/sysutils/plymouth-lite/splash/splash.png b/packages/sysutils/plymouth-lite/splash/splash.png
index 62590dfd6e..7a4fe389f0 100644
Binary files a/packages/sysutils/plymouth-lite/splash/splash.png and b/packages/sysutils/plymouth-lite/splash/splash.png differ
diff --git a/packages/sysutils/plymouth-lite/splash/splash4.png b/packages/sysutils/plymouth-lite/splash/splash4.png
new file mode 100644
index 0000000000..62590dfd6e
Binary files /dev/null and b/packages/sysutils/plymouth-lite/splash/splash4.png differ
diff --git a/packages/sysutils/pm-utils/config.d/module b/packages/sysutils/pm-utils/config.d/module
new file mode 100644
index 0000000000..ad11851fb4
--- /dev/null
+++ b/packages/sysutils/pm-utils/config.d/module
@@ -0,0 +1 @@
+SUSPEND_MODULES="jme anysee nuvoton_cir"
diff --git a/packages/sysutils/pm-utils/install b/packages/sysutils/pm-utils/install
index cfa27b5ff8..2733ec63d6 100755
--- a/packages/sysutils/pm-utils/install
+++ b/packages/sysutils/pm-utils/install
@@ -3,8 +3,11 @@
. config/options $1
mkdir -p $INSTALL/etc/pm/config.d
+ cp $PKG_DIR/config.d/* $INSTALL/etc/pm/config.d || true
mkdir -p $INSTALL/etc/pm/power.d
+ cp $PKG_DIR/power.d/* $INSTALL/etc/pm/power.d || true
mkdir -p $INSTALL/etc/pm/sleep.d
+ cp $PKG_DIR/sleep.d/* $INSTALL/etc/pm/sleep.d || true
mkdir -p $INSTALL/usr/bin
cp $PKG_BUILD/src/on_ac_power $INSTALL/usr/bin
diff --git a/packages/sysutils/remote/eventlircd/config/evmap/03_0bc7_0006.evmap b/packages/sysutils/remote/eventlircd/config/evmap/03_0bc7_0006.evmap
index 65f4681e89..dea8fbfeb4 100644
--- a/packages/sysutils/remote/eventlircd/config/evmap/03_0bc7_0006.evmap
+++ b/packages/sysutils/remote/eventlircd/config/evmap/03_0bc7_0006.evmap
@@ -1,4 +1,5 @@
# X10 Remote
+ KEY_POWER = KEY_POWER # Power
KEY_0 = KEY_NUMERIC_0 # 0
KEY_1 = KEY_NUMERIC_1 # 1
@@ -11,11 +12,14 @@
KEY_8 = KEY_NUMERIC_8 # 8
KEY_9 = KEY_NUMERIC_9 # 9
- KEY_VOLUMEUP = KEY_VOLUMEUP # Volume Up
- KEY_VOLUMEDOWN = KEY_VOLUMEDOWN # Volume Down
- KEY_PAGEDOWN = KEY_CHANNELDOWN # Channel Up
- KEY_PAGEUP = KEY_CHANNELUP # Channel Down
-#KEY_0 = KEY_MUTE # Mute (also Button 0)
+ KEY_VOLUMEUP = KEY_VOLUMEDOWN # Volume Up # reverted with Volume Down
+ KEY_VOLUMEDOWN = KEY_VOLUMEUP # Volume Down # reverted with Volume Up
+ KEY_A = KEY_MUTE # Mute
+
+ KEY_PAGEUP = KEY_CHANNELUP # Channel Up
+ KEY_PAGEDOWN = KEY_CHANNELDOWN # Channel Down
+ KEY_CHANNELUP = KEY_CHANNELUP # Channel Up
+ KEY_CHANNELDOWN = KEY_CHANNELDOWN # Channel Down
KEY_OK = KEY_OK # Direction OK (also used for Enter)
KEY_UP = KEY_UP # Direction Up
@@ -25,16 +29,27 @@
KEY_PLAY = KEY_PLAY # Play (also used for Pause)
KEY_STOP = KEY_STOP # Stop
+ KEY_PAUSE = KEY_PAUSE # PAUSE
KEY_RECORD = KEY_RECORD # Record
+
KEY_FORWARD = KEY_FORWARD # Forward
KEY_REWIND = KEY_REWIND # Reverse
KEY_F = KEY_NEXT # Next track
KEY_E = KEY_PREVIOUS # Pre-track
KEY_INFO = KEY_VIDEO # My Videos
- KEY_DVD = KEY_CAMERA # My Pictures
+ KEY_DVD = KEY_DVD # DVD Menu
KEY_BOOKMARKS = KEY_AUDIO # My Music
+ KEY_KPENTER = KEY_CAMERA # My Pictures
+ KEY_SCREENLOCK = KEY_TUNER # My TV
+
+ KEY_END = KEY_INFO # Info
KEY_HOME = KEY_PROG1 # Start Key
+ KEY_D = KEY_PROG1 # Start Key (World)
KEY_MENU = KEY_EXIT # Back
+ KEY_BACK = KEY_EXIT # Back
KEY_END = KEY_DELETE # Button "RC"
+
+# keys left:
+# Rec TV = KEY_KPENTER # Record TV (push 3-5 times)
\ No newline at end of file
diff --git a/packages/sysutils/remote/eventlircd/config/rules/98-lircd.rules b/packages/sysutils/remote/eventlircd/config/rules/98-lircd.rules
index 1773a44ee5..dc3400f342 100644
--- a/packages/sysutils/remote/eventlircd/config/rules/98-lircd.rules
+++ b/packages/sysutils/remote/eventlircd/config/rules/98-lircd.rules
@@ -8,6 +8,7 @@ ACTION!="add|remove", GOTO="end"
KERNEL=="hiddev[0-9]*", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", GOTO="begin"
KERNEL=="lirc[0-9]*", SUBSYSTEM=="lirc", SUBSYSTEMS=="i2c", GOTO="begin"
KERNEL=="lirc[0-9]*", SUBSYSTEM=="lirc", SUBSYSTEMS=="usb", GOTO="begin"
+KERNEL=="lirc[0-9]*", SUBSYSTEM=="lirc", SUBSYSTEMS=="platform", GOTO="begin"
GOTO="end"
LABEL="begin"
diff --git a/packages/sysutils/remote/eventlircd/init.d/33_eventlircd b/packages/sysutils/remote/eventlircd/init.d/33_eventlircd
index 3855122ccc..d5de51e6a3 100755
--- a/packages/sysutils/remote/eventlircd/init.d/33_eventlircd
+++ b/packages/sysutils/remote/eventlircd/init.d/33_eventlircd
@@ -24,8 +24,20 @@
#
# runlevels: openelec, textmode
-. /etc/profile
+(
+ . /etc/profile
-progress "starting eventlircd"
- mkdir -p /var/run/lirc
- eventlircd --evmap=/etc/eventlircd.d --socket=/var/run/lirc/lircd --release=_UP
\ No newline at end of file
+ progress "starting eventlircd"
+ mkdir -p /var/run/lirc
+ eventlircd --evmap=/etc/eventlircd.d --socket=/var/run/lirc/lircd --release=_UP
+
+ progress "enable remote wakup support" #TODO
+ for i in `ls -d /sys/bus/usb/devices/*`; do
+ if test -e "$i/power/wakeup" ; then
+ STATE=`cat "$i/power/wakeup"`
+ if test "x$STATE" = "xdisabled" ; then
+ echo "enabled" > "$i/power/wakeup"
+ fi
+ fi
+ done
+)&
\ No newline at end of file
diff --git a/packages/sysutils/remote/eventlircd/meta b/packages/sysutils/remote/eventlircd/meta
index 02175a4907..29654d484b 100644
--- a/packages/sysutils/remote/eventlircd/meta
+++ b/packages/sysutils/remote/eventlircd/meta
@@ -1,5 +1,5 @@
PKG_NAME="eventlircd"
-PKG_VERSION="17"
+PKG_VERSION="40"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
diff --git a/packages/sysutils/remote/eventlircd/patches/eventlircd-17-fixes-0.1.patch b/packages/sysutils/remote/eventlircd/patches/eventlircd-17-fixes-0.1.patch
deleted file mode 100644
index b1da101c5e..0000000000
--- a/packages/sysutils/remote/eventlircd/patches/eventlircd-17-fixes-0.1.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff -Naur eventlircd-17/udev/lircd_helper.in eventlircd-17.patch/udev/lircd_helper.in
---- eventlircd-17/udev/lircd_helper.in 2010-10-17 22:18:18.000000000 +0200
-+++ eventlircd-17.patch/udev/lircd_helper.in 2010-10-17 22:23:51.144592363 +0200
-@@ -53,7 +53,7 @@
- remove)
- instance=`echo $DEVNAME | sed -e 's/\/\+/~/g' -e 's/^~dev~//'`
- if test -e "@localstatedir@/run/lirc/lircd-${instance}.pid" ; then
-- pid=`cat @localstate@/run/lirc/lircd-${instance}.pid`
-+ pid=`cat @localstatedir@/run/lirc/lircd-${instance}.pid`
- if test ! "x${pid}" = "x" ; then
- kill ${pid}
- fi
-diff -Naur eventlircd-17/udev/wakeup_enable.in eventlircd-17.patch/udev/wakeup_enable.in
---- eventlircd-17/udev/wakeup_enable.in 2010-10-17 22:18:18.000000000 +0200
-+++ eventlircd-17.patch/udev/wakeup_enable.in 2010-10-17 22:24:39.559156689 +0200
-@@ -5,13 +5,13 @@
-
- devpath=`readlink -f "/sys/${DEVPATH}"`
- while echo "${devpath}" | /bin/grep -q '^/sys/devices/' > /dev/null 2>&1 ; do
-- if test -e "${devpath}/power/wakeup" ; then
-- state=`cat "${devpath}/power/wakeup"`
-+ if test -e "${devpath}/power/wakeup" ; then
-+ state=`cat "${devpath}/power/wakeup"`
- if test "x${state}" = "xdisabled" ; then
- echo "enabled" > "${devpath}/power/wakeup"
-- fi
-- fi
-+ fi
-+ fi
- devpath=`dirname "${devpath}"`
--done
--
-+done
-+
- exit 0
diff --git a/packages/sysutils/remote/eventlircd/patches/eventlircd-17-repeat-0.1.patch b/packages/sysutils/remote/eventlircd/patches/eventlircd-17-repeat-0.1.patch
deleted file mode 100644
index eb626a1e14..0000000000
--- a/packages/sysutils/remote/eventlircd/patches/eventlircd-17-repeat-0.1.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -Naur eventlircd-17/src/input.c eventlircd-17.patch/src/input.c
---- eventlircd-17/src/input.c 2010-10-17 22:18:18.000000000 +0200
-+++ eventlircd-17.patch/src/input.c 2010-10-29 01:16:56.118197221 +0200
-@@ -1067,12 +1067,12 @@
- {
- time_delta = 1000000 * (device->current.event_out.time.tv_sec - previous->event_out.time.tv_sec ) +
- (device->current.event_out.time.tv_usec - previous->event_out.time.tv_usec);
-- if (((previous->repeat_count == 0) && (time_delta < 900000)) ||
-- ((previous->repeat_count == 1) && (time_delta < 500000)) ||
-- ((previous->repeat_count == 2) && (time_delta < 300000)) ||
-- ((previous->repeat_count == 3) && (time_delta < 200000)) ||
-- ((previous->repeat_count == 4) && (time_delta < 150000)) ||
-- ((previous->repeat_count >= 5) && (time_delta < 100000)))
-+ if (((previous->repeat_count == 0) && (time_delta < 180000)) ||
-+ ((previous->repeat_count == 1) && (time_delta < 125000)) ||
-+ ((previous->repeat_count == 2) && (time_delta < 75000)) ||
-+ ((previous->repeat_count == 3) && (time_delta < 50000)) ||
-+ ((previous->repeat_count == 4) && (time_delta < 35000)) ||
-+ ((previous->repeat_count >= 5) && (time_delta < 25000)))
- {
- memset(&(device->current.event_out), 0, sizeof(struct input_event));
- device->current.event_out.type = LIRCUDEVD_EV_NULL;
diff --git a/packages/sysutils/siglaunchd/config/siglaunchd.conf b/packages/sysutils/siglaunchd/config/siglaunchd.conf
index 9aa446b87b..13ff5ab7c7 100644
--- a/packages/sysutils/siglaunchd/config/siglaunchd.conf
+++ b/packages/sysutils/siglaunchd/config/siglaunchd.conf
@@ -1,4 +1,2 @@
#"/usr/sbin/startnetwork"=org.freedesktop.DBus;org.freedesktop.DBus;/org/freedesktop/DBus;NameOwnerChanged;arg[0]="org.moblin.connman"
-"/usr/sbin/startnetworkdaemons"=org.moblin.connman.Service;org.moblin.connman.Service;/profile/default/*;PropertyChanged;arg[0]="State",arg[1]="online"
-
-
+"/usr/sbin/startnetworkdaemons"=net.connman.Service;net.connman.Service;/profile/default/*;PropertyChanged;arg[0]="State",arg[1]="online"
diff --git a/packages/sysutils/udisks/meta b/packages/sysutils/udisks/meta
index 9415a19a2b..bd2fc77656 100644
--- a/packages/sysutils/udisks/meta
+++ b/packages/sysutils/udisks/meta
@@ -1,5 +1,5 @@
PKG_NAME="udisks"
-PKG_VERSION="1.0.1"
+PKG_VERSION="1.0.2"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
diff --git a/packages/toolchain/devel/binutils/build b/packages/toolchain/devel/binutils/build
index ba49bbd59d..c3c7ccdb8d 100755
--- a/packages/toolchain/devel/binutils/build
+++ b/packages/toolchain/devel/binutils/build
@@ -32,7 +32,8 @@ mkdir -p objdir && cd objdir
--enable-version-specific-runtime-libs \
$WITH_64B_BFD \
--enable-plugins \
- --enable-gold=both/ld \
+ --enable-gold \
+ --enable-ld=default \
--enable-lto \
--disable-nls
diff --git a/packages/toolchain/devel/binutils/meta b/packages/toolchain/devel/binutils/meta
index a225767dc3..822d31699c 100644
--- a/packages/toolchain/devel/binutils/meta
+++ b/packages/toolchain/devel/binutils/meta
@@ -1,10 +1,11 @@
PKG_NAME="binutils"
-PKG_VERSION="2.21.51.0.1"
+PKG_VERSION="2.21"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.gnu.org/software/binutils/binutils.html"
-PKG_URL="ftp://ftp.kernel.org/pub/linux/devel/binutils/$PKG_NAME-$PKG_VERSION.tar.bz2"
+PKG_URL="http://ftp.gnu.org/gnu/binutils/$PKG_NAME-$PKG_VERSION.tar.bz2"
+#PKG_URL="ftp://ftp.kernel.org/pub/linux/devel/binutils/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="ccache linux-headers gmp mpfr ppl cloog-ppl libelf"
PKG_PRIORITY="optional"
diff --git a/packages/toolchain/devel/binutils/patches/binutils-2.21.51.0.1-multi_os_directory.patch b/packages/toolchain/devel/binutils/patches/binutils-2.21-multi_os_directory.patch
similarity index 63%
rename from packages/toolchain/devel/binutils/patches/binutils-2.21.51.0.1-multi_os_directory.patch
rename to packages/toolchain/devel/binutils/patches/binutils-2.21-multi_os_directory.patch
index c9a428c9ab..852874d88a 100644
--- a/packages/toolchain/devel/binutils/patches/binutils-2.21.51.0.1-multi_os_directory.patch
+++ b/packages/toolchain/devel/binutils/patches/binutils-2.21-multi_os_directory.patch
@@ -1,7 +1,7 @@
-diff -Naur binutils-2.20.51.0.9-old/bfd/configure binutils-2.20.51.0.9-new/bfd/configure
---- binutils-2.20.51.0.9-old/bfd/configure 2010-05-27 11:22:20.000000000 -0700
-+++ binutils-2.20.51.0.9-new/bfd/configure 2010-05-27 16:15:59.000000000 -0700
-@@ -10320,7 +10320,7 @@
+diff -Naur binutils-2.21-old/bfd/configure binutils-2.21-new/bfd/configure
+--- binutils-2.21-old/bfd/configure 2010-12-08 07:11:15.000000000 -0800
++++ binutils-2.21-new/bfd/configure 2010-12-08 07:12:23.000000000 -0800
+@@ -10326,7 +10326,7 @@
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
@@ -10,10 +10,10 @@ diff -Naur binutils-2.20.51.0.9-old/bfd/configure binutils-2.20.51.0.9-new/bfd/c
for lt_sys_path in $lt_search_path_spec; do
if test -d "$lt_sys_path/$lt_multi_os_dir"; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-diff -Naur binutils-2.20.51.0.9-old/binutils/configure binutils-2.20.51.0.9-new/binutils/configure
---- binutils-2.20.51.0.9-old/binutils/configure 2010-05-27 11:22:22.000000000 -0700
-+++ binutils-2.20.51.0.9-new/binutils/configure 2010-05-27 16:15:59.000000000 -0700
-@@ -10114,7 +10114,7 @@
+diff -Naur binutils-2.21-old/binutils/configure binutils-2.21-new/binutils/configure
+--- binutils-2.21-old/binutils/configure 2010-12-08 07:11:15.000000000 -0800
++++ binutils-2.21-new/binutils/configure 2010-12-08 07:12:23.000000000 -0800
+@@ -10120,7 +10120,7 @@
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
@@ -22,10 +22,10 @@ diff -Naur binutils-2.20.51.0.9-old/binutils/configure binutils-2.20.51.0.9-new/
for lt_sys_path in $lt_search_path_spec; do
if test -d "$lt_sys_path/$lt_multi_os_dir"; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-diff -Naur binutils-2.20.51.0.9-old/gas/configure binutils-2.20.51.0.9-new/gas/configure
---- binutils-2.20.51.0.9-old/gas/configure 2010-04-13 06:26:42.000000000 -0700
-+++ binutils-2.20.51.0.9-new/gas/configure 2010-05-27 16:15:59.000000000 -0700
-@@ -10101,7 +10101,7 @@
+diff -Naur binutils-2.21-old/gas/configure binutils-2.21-new/gas/configure
+--- binutils-2.21-old/gas/configure 2010-12-08 07:11:15.000000000 -0800
++++ binutils-2.21-new/gas/configure 2010-12-08 07:12:23.000000000 -0800
+@@ -10109,7 +10109,7 @@
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
@@ -34,9 +34,9 @@ diff -Naur binutils-2.20.51.0.9-old/gas/configure binutils-2.20.51.0.9-new/gas/c
for lt_sys_path in $lt_search_path_spec; do
if test -d "$lt_sys_path/$lt_multi_os_dir"; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-diff -Naur binutils-2.20.51.0.9-old/gprof/configure binutils-2.20.51.0.9-new/gprof/configure
---- binutils-2.20.51.0.9-old/gprof/configure 2010-04-13 06:26:45.000000000 -0700
-+++ binutils-2.20.51.0.9-new/gprof/configure 2010-05-27 16:15:59.000000000 -0700
+diff -Naur binutils-2.21-old/gprof/configure binutils-2.21-new/gprof/configure
+--- binutils-2.21-old/gprof/configure 2010-12-08 07:11:15.000000000 -0800
++++ binutils-2.21-new/gprof/configure 2010-12-08 07:12:23.000000000 -0800
@@ -10039,7 +10039,7 @@
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
@@ -46,10 +46,10 @@ diff -Naur binutils-2.20.51.0.9-old/gprof/configure binutils-2.20.51.0.9-new/gpr
for lt_sys_path in $lt_search_path_spec; do
if test -d "$lt_sys_path/$lt_multi_os_dir"; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-diff -Naur binutils-2.20.51.0.9-old/ld/configure binutils-2.20.51.0.9-new/ld/configure
---- binutils-2.20.51.0.9-old/ld/configure 2010-05-27 11:22:31.000000000 -0700
-+++ binutils-2.20.51.0.9-new/ld/configure 2010-05-27 16:15:59.000000000 -0700
-@@ -10528,7 +10528,7 @@
+diff -Naur binutils-2.21-old/ld/configure binutils-2.21-new/ld/configure
+--- binutils-2.21-old/ld/configure 2010-12-08 07:11:15.000000000 -0800
++++ binutils-2.21-new/ld/configure 2010-12-08 07:12:23.000000000 -0800
+@@ -10536,7 +10536,7 @@
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
@@ -58,10 +58,10 @@ diff -Naur binutils-2.20.51.0.9-old/ld/configure binutils-2.20.51.0.9-new/ld/con
for lt_sys_path in $lt_search_path_spec; do
if test -d "$lt_sys_path/$lt_multi_os_dir"; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-diff -Naur binutils-2.20.51.0.9-old/libiberty/Makefile.in binutils-2.20.51.0.9-new/libiberty/Makefile.in
---- binutils-2.20.51.0.9-old/libiberty/Makefile.in 2010-05-27 11:22:33.000000000 -0700
-+++ binutils-2.20.51.0.9-new/libiberty/Makefile.in 2010-05-27 16:15:59.000000000 -0700
-@@ -327,7 +327,7 @@
+diff -Naur binutils-2.21-old/libiberty/Makefile.in binutils-2.21-new/libiberty/Makefile.in
+--- binutils-2.21-old/libiberty/Makefile.in 2010-12-08 07:11:15.000000000 -0800
++++ binutils-2.21-new/libiberty/Makefile.in 2010-12-08 07:12:23.000000000 -0800
+@@ -346,7 +346,7 @@
# multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
# default multilib, so we have to take CFLAGS into account as well,
# since it will be passed the multilib flags.
@@ -70,9 +70,9 @@ diff -Naur binutils-2.20.51.0.9-old/libiberty/Makefile.in binutils-2.20.51.0.9-n
install_to_libdir: all
${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
-diff -Naur binutils-2.20.51.0.9-old/libtool.m4 binutils-2.20.51.0.9-new/libtool.m4
---- binutils-2.20.51.0.9-old/libtool.m4 2010-01-15 09:05:56.000000000 -0800
-+++ binutils-2.20.51.0.9-new/libtool.m4 2010-05-27 16:15:59.000000000 -0700
+diff -Naur binutils-2.21-old/libtool.m4 binutils-2.21-new/libtool.m4
+--- binutils-2.21-old/libtool.m4 2010-12-08 07:11:15.000000000 -0800
++++ binutils-2.21-new/libtool.m4 2010-12-08 07:12:23.000000000 -0800
@@ -2043,7 +2043,7 @@
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
@@ -82,10 +82,10 @@ diff -Naur binutils-2.20.51.0.9-old/libtool.m4 binutils-2.20.51.0.9-new/libtool.
for lt_sys_path in $lt_search_path_spec; do
if test -d "$lt_sys_path/$lt_multi_os_dir"; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-diff -Naur binutils-2.20.51.0.9-old/opcodes/configure binutils-2.20.51.0.9-new/opcodes/configure
---- binutils-2.20.51.0.9-old/opcodes/configure 2010-04-13 06:26:47.000000000 -0700
-+++ binutils-2.20.51.0.9-new/opcodes/configure 2010-05-27 16:15:59.000000000 -0700
-@@ -10050,7 +10050,7 @@
+diff -Naur binutils-2.21-old/opcodes/configure binutils-2.21-new/opcodes/configure
+--- binutils-2.21-old/opcodes/configure 2010-12-08 07:11:15.000000000 -0800
++++ binutils-2.21-new/opcodes/configure 2010-12-08 07:12:23.000000000 -0800
+@@ -10056,7 +10056,7 @@
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
diff --git a/packages/toolchain/devel/binutils/patches/binutils-2.21.51.0.1-visibility.patch b/packages/toolchain/devel/binutils/patches/binutils-2.21-visibility.patch
similarity index 87%
rename from packages/toolchain/devel/binutils/patches/binutils-2.21.51.0.1-visibility.patch
rename to packages/toolchain/devel/binutils/patches/binutils-2.21-visibility.patch
index 58067c1e86..b58aa75087 100644
--- a/packages/toolchain/devel/binutils/patches/binutils-2.21.51.0.1-visibility.patch
+++ b/packages/toolchain/devel/binutils/patches/binutils-2.21-visibility.patch
@@ -1,6 +1,6 @@
-diff -Naur binutils-2.20.51.0.12-old/gold/plugin.cc binutils-2.20.51.0.12-new/gold/plugin.cc
---- binutils-2.20.51.0.12-old/gold/plugin.cc 2010-10-22 06:41:04.000000000 -0700
-+++ binutils-2.20.51.0.12-new/gold/plugin.cc 2010-10-23 06:03:56.000000000 -0700
+diff -Naur binutils-2.21-old/gold/plugin.cc binutils-2.21-new/gold/plugin.cc
+--- binutils-2.21-old/gold/plugin.cc 2010-10-14 15:10:22.000000000 -0700
++++ binutils-2.21-new/gold/plugin.cc 2010-12-08 07:11:30.000000000 -0800
@@ -668,28 +668,50 @@
break;
}
diff --git a/packages/toolchain/devel/ccache/meta b/packages/toolchain/devel/ccache/meta
index 3408f0f47d..360c46b18e 100644
--- a/packages/toolchain/devel/ccache/meta
+++ b/packages/toolchain/devel/ccache/meta
@@ -1,5 +1,5 @@
PKG_NAME="ccache"
-PKG_VERSION="3.1"
+PKG_VERSION="3.1.3"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
diff --git a/packages/toolchain/devel/ccache/patches/ccache-3.1-fix_configure-0.1.patch b/packages/toolchain/devel/ccache/patches/ccache-3.1-fix_configure-0.1.patch
deleted file mode 100644
index ee74f00c1c..0000000000
--- a/packages/toolchain/devel/ccache/patches/ccache-3.1-fix_configure-0.1.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- ccache-3.1.orig/configure 2010-09-17 15:14:42.000000000 +0200
-+++ ccache-3.1/configure 2010-09-17 15:15:08.000000000 +0200
-@@ -3347,7 +3347,7 @@
- AR="$ac_cv_prog_AR"
- fi
-
--if test -z "$ac_ct_AR"; then
-+if test -z "$AR"; then
- as_fn_error "cannot find ar" "$LINENO" 5
- fi
-
diff --git a/packages/toolchain/devel/fakeroot/build b/packages/toolchain/devel/fakeroot/build
index 245acc67c5..4053870088 100755
--- a/packages/toolchain/devel/fakeroot/build
+++ b/packages/toolchain/devel/fakeroot/build
@@ -4,10 +4,12 @@
setup_toolchain host
-cd $BUILD/$1*
-
+cd $PKG_BUILD
./configure --host=$HOST_NAME \
--build=$HOST_NAME \
--prefix=$ROOT/$TOOLCHAIN \
+ --enable-shared \
+ --disable-static \
+ --with-gnu-ld
make install
diff --git a/packages/toolchain/devel/fakeroot/meta b/packages/toolchain/devel/fakeroot/meta
index 12f8b73e45..74b6e4abe5 100644
--- a/packages/toolchain/devel/fakeroot/meta
+++ b/packages/toolchain/devel/fakeroot/meta
@@ -1,10 +1,10 @@
PKG_NAME="fakeroot"
-PKG_VERSION="1.9.5"
+PKG_VERSION="1.14.5"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://fakeroot.alioth.debian.org/"
-PKG_URL="http://snapshot.debian.net/archive/2008/04/27/debian/pool/main/f/fakeroot/${PKG_NAME}_${PKG_VERSION}.tar.gz"
+PKG_URL="http://ftp.debian.org/debian/pool/main/f/fakeroot/${PKG_NAME}_${PKG_VERSION}.orig.tar.bz2"
PKG_DEPENDS=""
PKG_BUILD_DEPENDS="ccache"
PKG_PRIORITY="optional"
diff --git a/packages/toolchain/lang/gcc-core/build b/packages/toolchain/lang/gcc-core/build
index b5da7f54b2..c789588280 100755
--- a/packages/toolchain/lang/gcc-core/build
+++ b/packages/toolchain/lang/gcc-core/build
@@ -20,6 +20,7 @@ mkdir -p objdir-$1 && cd objdir-$1
--with-mpfr=$ROOT/$TOOLCHAIN \
--with-mpc=$ROOT/$TOOLCHAIN \
--with-ppl=$ROOT/$TOOLCHAIN \
+ --disable-ppl-version-check \
--with-cloog=$ROOT/$TOOLCHAIN \
--with-libelf=$ROOT/$TOOLCHAIN \
--with-gnu-as \
diff --git a/packages/toolchain/lang/gcc-final/build b/packages/toolchain/lang/gcc-final/build
index 2d71d86cc4..1b72a24de2 100755
--- a/packages/toolchain/lang/gcc-final/build
+++ b/packages/toolchain/lang/gcc-final/build
@@ -17,6 +17,7 @@ mkdir -p objdir-$1 && cd objdir-$1
--with-mpfr=$ROOT/$TOOLCHAIN \
--with-mpc=$ROOT/$TOOLCHAIN \
--with-ppl=$ROOT/$TOOLCHAIN \
+ --disable-ppl-version-check \
--with-cloog=$ROOT/$TOOLCHAIN \
--with-libelf=$ROOT/$TOOLCHAIN \
--enable-languages=${TOOLCHAIN_LANGUAGES} \
diff --git a/packages/toolchain/lang/gcc/meta b/packages/toolchain/lang/gcc/meta
index 60423732b6..848c40e41c 100644
--- a/packages/toolchain/lang/gcc/meta
+++ b/packages/toolchain/lang/gcc/meta
@@ -1,5 +1,5 @@
PKG_NAME="gcc"
-PKG_VERSION="4.5-20101125"
+PKG_VERSION="4.5.2-RC-20101208"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-ppl-0.11-0.1.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-ppl-0.11-0.1.patch
deleted file mode 100644
index 946e23454b..0000000000
--- a/packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-ppl-0.11-0.1.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Naur gcc-4.5.1/configure gcc-4.5.1.patch/configure
---- gcc-4.5.1/configure 2010-06-24 23:06:37.000000000 +0200
-+++ gcc-4.5.1.patch/configure 2010-09-02 17:12:08.807742278 +0200
-@@ -5781,7 +5781,7 @@
-
- # Check for PPL
- ppl_major_version=0
--ppl_minor_version=10
-+ppl_minor_version=11
- ppllibs=" -lppl_c -lppl -lgmpxx"
- pplinc=
-
-diff -Naur gcc-4.5.1/configure.ac gcc-4.5.1.patch/configure.ac
---- gcc-4.5.1/configure.ac 2010-06-24 23:06:37.000000000 +0200
-+++ gcc-4.5.1.patch/configure.ac 2010-09-02 17:12:22.748618664 +0200
-@@ -1511,7 +1511,7 @@
-
- # Check for PPL
- ppl_major_version=0
--ppl_minor_version=10
-+ppl_minor_version=11
- ppllibs=" -lppl_c -lppl -lgmpxx"
- pplinc=
-
diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-050_fix_undefined_references_with_lto-0.1.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5.2-RC-20101208-050_fix_undefined_references_with_lto-0.1.patch
similarity index 100%
rename from packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-050_fix_undefined_references_with_lto-0.1.patch
rename to packages/toolchain/lang/gcc/patches/gcc-4.5.2-RC-20101208-050_fix_undefined_references_with_lto-0.1.patch
diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-bfd_and_gold.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5.2-RC-20101208-bfd_and_gold.patch
similarity index 100%
rename from packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-bfd_and_gold.patch
rename to packages/toolchain/lang/gcc/patches/gcc-4.5.2-RC-20101208-bfd_and_gold.patch
diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-disable_multilib_i386_linux64.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5.2-RC-20101208-disable_multilib_i386_linux64.patch
similarity index 100%
rename from packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-disable_multilib_i386_linux64.patch
rename to packages/toolchain/lang/gcc/patches/gcc-4.5.2-RC-20101208-disable_multilib_i386_linux64.patch
diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-dynamic_linker.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5.2-RC-20101208-dynamic_linker.patch
similarity index 100%
rename from packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-dynamic_linker.patch
rename to packages/toolchain/lang/gcc/patches/gcc-4.5.2-RC-20101208-dynamic_linker.patch
diff --git a/packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-libstdc++-v3_config.patch b/packages/toolchain/lang/gcc/patches/gcc-4.5.2-RC-20101208-libstdc++-v3_config.patch
similarity index 100%
rename from packages/toolchain/lang/gcc/patches/gcc-4.5-20101125-libstdc++-v3_config.patch
rename to packages/toolchain/lang/gcc/patches/gcc-4.5.2-RC-20101208-libstdc++-v3_config.patch
diff --git a/packages/x11/driver/xf86-video-nouveau/meta b/packages/x11/driver/xf86-video-nouveau/meta
index 619e85a946..f4e47d71db 100644
--- a/packages/x11/driver/xf86-video-nouveau/meta
+++ b/packages/x11/driver/xf86-video-nouveau/meta
@@ -1,5 +1,5 @@
PKG_NAME="xf86-video-nouveau"
-PKG_VERSION="20101030"
+PKG_VERSION="20101205"
PKG_REV="1"
PKG_ARCH="i386 x86_64"
PKG_LICENSE="OSS"
diff --git a/packages/x11/driver/xf86-video-nvidia/config/xorg-nvidia.conf b/packages/x11/driver/xf86-video-nvidia/config/xorg-nvidia.conf
index a95cbf5472..fb0dd782c8 100644
--- a/packages/x11/driver/xf86-video-nvidia/config/xorg-nvidia.conf
+++ b/packages/x11/driver/xf86-video-nvidia/config/xorg-nvidia.conf
@@ -1,39 +1,28 @@
-Section "ServerLayout"
- Identifier "Layout0"
- Screen 0 "Screen0"
-EndSection
-
-Section "Monitor"
- Identifier "Monitor0"
- VendorName "Unknown"
- ModelName "Unknown"
- HorizSync 28.0 - 33.0
- VertRefresh 43.0 - 72.0
- Option "DPMS"
-EndSection
-
Section "Device"
- Identifier "Device0"
+ Identifier "nvidia"
Driver "nvidia"
- VendorName "NVIDIA Corporation"
- Option "ConnectToAcpid" "0"
Option "DynamicTwinView" "False"
+ Option "NoFlip" "false"
+ Option "NoLogo" "true"
+ Option "DynamicTwinView" "false"
+ Option "ConnectToAcpid" "0"
+ Option "FlatPanelProperties" "Scaling = Native"
+ Option "ModeValidation" "NoVesaModes, NoXServerModes"
+ Option "HWCursor" "false"
EndSection
Section "Screen"
- Identifier "Screen0"
- Device "Device0"
- Monitor "Monitor0"
+ Identifier "screen"
+ Device "nvidia"
DefaultDepth 24
- Option "NoLogo" "True"
- Option "FlatPanelProperties" "Scaling = Native"
- Option "HWCursor" "Off"
+ Option "ColorRange" "Full"
+# Option "ColorRange" "Limited"
+ Option "ColorSpace" "RGB"
SubSection "Display"
Depth 24
EndSubSection
EndSection
Section "Extensions"
- Option "Composite" "Disable"
+ Option "Composite" "false"
EndSection
-
diff --git a/packages/x11/lib/xtrans/meta b/packages/x11/lib/xtrans/meta
index 26b63e8bb2..83a7c31b9b 100644
--- a/packages/x11/lib/xtrans/meta
+++ b/packages/x11/lib/xtrans/meta
@@ -1,5 +1,5 @@
PKG_NAME="xtrans"
-PKG_VERSION="1.2.5"
+PKG_VERSION="1.2.6"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="OSS"
diff --git a/packages/x11/proto/xproto/meta b/packages/x11/proto/xproto/meta
index 6b165a34bb..ada1b7f1eb 100644
--- a/packages/x11/proto/xproto/meta
+++ b/packages/x11/proto/xproto/meta
@@ -1,5 +1,5 @@
PKG_NAME="xproto"
-PKG_VERSION="7.0.19"
+PKG_VERSION="7.0.20"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="OSS"
diff --git a/packages/x11/xserver/xorg-server/meta b/packages/x11/xserver/xorg-server/meta
index a638143e2a..1291c700b1 100644
--- a/packages/x11/xserver/xorg-server/meta
+++ b/packages/x11/xserver/xorg-server/meta
@@ -1,5 +1,5 @@
PKG_NAME="xorg-server"
-PKG_VERSION="1.9.2"
+PKG_VERSION="1.9.2.902"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="OSS"
diff --git a/packages/x11/xserver/xorg-server/patches/rename.sh b/packages/x11/xserver/xorg-server/patches/rename.sh
new file mode 100755
index 0000000000..ae756ed299
--- /dev/null
+++ b/packages/x11/xserver/xorg-server/patches/rename.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+for i in `ls xorg-server-*.patch`; do
+ cp $i `echo $i | sed "s,$1,$2,g"`
+done
diff --git a/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-05_pkg_config.patch b/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-05_pkg_config.patch
similarity index 100%
rename from packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-05_pkg_config.patch
rename to packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-05_pkg_config.patch
diff --git a/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-10_cache_xkbcomp_output_for_fast_start_up.patch b/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-10_cache_xkbcomp_output_for_fast_start_up.patch
similarity index 100%
rename from packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-10_cache_xkbcomp_output_for_fast_start_up.patch
rename to packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-10_cache_xkbcomp_output_for_fast_start_up.patch
diff --git a/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-11_use_sloppy_heuristic_first_for_initial_mode.patch b/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-11_use_sloppy_heuristic_first_for_initial_mode.patch
similarity index 100%
rename from packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-11_use_sloppy_heuristic_first_for_initial_mode.patch
rename to packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-11_use_sloppy_heuristic_first_for_initial_mode.patch
diff --git a/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-12_nouveau.patch b/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-12_nouveau.patch
similarity index 100%
rename from packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-12_nouveau.patch
rename to packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-12_nouveau.patch
diff --git a/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-20_extra_modelines_fromxorg.patch b/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-20_extra_modelines_fromxorg.patch
similarity index 100%
rename from packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-20_extra_modelines_fromxorg.patch
rename to packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-20_extra_modelines_fromxorg.patch
diff --git a/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-21_x11_nonroot-vesa.patch b/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-21_x11_nonroot-vesa.patch
similarity index 100%
rename from packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-21_x11_nonroot-vesa.patch
rename to packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-21_x11_nonroot-vesa.patch
diff --git a/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-22_bg_none_root.patch b/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-22_bg_none_root.patch
similarity index 100%
rename from packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-22_bg_none_root.patch
rename to packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-22_bg_none_root.patch
diff --git a/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-22_do_not_zap_xserver.patch b/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-22_do_not_zap_xserver.patch
similarity index 100%
rename from packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-22_do_not_zap_xserver.patch
rename to packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-22_do_not_zap_xserver.patch
diff --git a/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-25_less_acpi_brokenness.patch b/packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-25_less_acpi_brokenness.patch
similarity index 100%
rename from packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2-25_less_acpi_brokenness.patch
rename to packages/x11/xserver/xorg-server/patches/xorg-server-1.9.2.902-25_less_acpi_brokenness.patch
diff --git a/projects/ATV/linux/linux.i386.conf b/projects/ATV/linux/linux.i386.conf
index 02b396ffe8..595aec5f18 100644
--- a/projects/ATV/linux/linux.i386.conf
+++ b/projects/ATV/linux/linux.i386.conf
@@ -170,9 +170,9 @@ CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set
CONFIG_PCI_QUIRKS=y
# CONFIG_COMPAT_BRK is not set
-# CONFIG_SLAB is not set
+CONFIG_SLAB=y
# CONFIG_SLUB is not set
-CONFIG_SLOB=y
+# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
@@ -196,6 +196,7 @@ CONFIG_HAVE_ARCH_JUMP_LABEL=y
# GCOV-based kernel profiling
#
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
diff --git a/projects/ATV/options b/projects/ATV/options
index 9acedb7c39..f12b8e57ac 100644
--- a/projects/ATV/options
+++ b/projects/ATV/options
@@ -1,3 +1,6 @@
+# Name of the Distro to build (full name, without special charcters)
+ DISTRONAME="OpenELEC"
+
# Welcome Message for e.g. SSH Server (up to 5 Lines)
GREATING0="#######################################################"
GREATING1="# Welcome to OpenELEC - the powerful Mediacenter4you #"
@@ -45,7 +48,7 @@
esac
# Build optimizations (size/speed)
- OPTIMIZATIONS="size"
+ OPTIMIZATIONS="speed"
# Project CFLAGS
PROJECT_CFLAGS=""
@@ -93,6 +96,9 @@
# build with network support (yes / no)
NETWORK="yes"
+# build with netmount (mounting network drives on boot) support (yes / no)
+ NETMOUNT="yes"
+
# build ppp daemon (for configuring adsl etc...) (yes / no)
PPP_DAEMON="no"
diff --git a/projects/ION/linux/linux.i386.conf b/projects/ION/linux/linux.i386.conf
index 1b0754d775..bc98ff2735 100644
--- a/projects/ION/linux/linux.i386.conf
+++ b/projects/ION/linux/linux.i386.conf
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.36
+# Linux kernel version: 2.6.36.1
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
@@ -153,9 +153,9 @@ CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set
CONFIG_PCI_QUIRKS=y
# CONFIG_COMPAT_BRK is not set
-# CONFIG_SLAB is not set
+CONFIG_SLAB=y
# CONFIG_SLUB is not set
-CONFIG_SLOB=y
+# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
@@ -177,6 +177,7 @@ CONFIG_HAVE_PERF_EVENTS_NMI=y
# GCOV-based kernel profiling
#
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
diff --git a/projects/ION/linux/linux.x86_64.conf b/projects/ION/linux/linux.x86_64.conf
index 23fb8cb4d4..44a6323f2a 100644
--- a/projects/ION/linux/linux.x86_64.conf
+++ b/projects/ION/linux/linux.x86_64.conf
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.36
+# Linux kernel version: 2.6.36.1
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
@@ -152,9 +152,9 @@ CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set
CONFIG_PCI_QUIRKS=y
# CONFIG_COMPAT_BRK is not set
-# CONFIG_SLAB is not set
+CONFIG_SLAB=y
# CONFIG_SLUB is not set
-CONFIG_SLOB=y
+# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
@@ -176,6 +176,7 @@ CONFIG_HAVE_PERF_EVENTS_NMI=y
# GCOV-based kernel profiling
#
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
diff --git a/projects/ION/options b/projects/ION/options
index 32d7b18d01..163b09cd57 100644
--- a/projects/ION/options
+++ b/projects/ION/options
@@ -1,3 +1,6 @@
+# Name of the Distro to build (full name, without special charcters)
+ DISTRONAME="OpenELEC"
+
# Welcome Message for e.g. SSH Server (up to 5 Lines)
GREATING0="#######################################################"
GREATING1="# Welcome to OpenELEC - the powerful Mediacenter4you #"
@@ -45,7 +48,7 @@
esac
# Build optimizations (size/normal/speed)
- OPTIMIZATIONS="size"
+ OPTIMIZATIONS="speed"
# Project CFLAGS
PROJECT_CFLAGS="-mfpmath=sse -ftree-vectorize -mmovbe"
@@ -92,6 +95,9 @@
# build with network support (yes / no)
NETWORK="yes"
+# build with netmount (mounting network drives on boot) support (yes / no)
+ NETMOUNT="yes"
+
# build ppp daemon (for configuring adsl etc...) (yes / no)
PPP_DAEMON="no"
diff --git a/projects/generic/linux/linux.i386.conf b/projects/generic/linux/linux.i386.conf
index f85dbe149e..69cf8e7a4d 100644
--- a/projects/generic/linux/linux.i386.conf
+++ b/projects/generic/linux/linux.i386.conf
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.36
+# Linux kernel version: 2.6.36.1
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
@@ -153,9 +153,9 @@ CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set
CONFIG_PCI_QUIRKS=y
# CONFIG_COMPAT_BRK is not set
-# CONFIG_SLAB is not set
+CONFIG_SLAB=y
# CONFIG_SLUB is not set
-CONFIG_SLOB=y
+# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
@@ -177,6 +177,7 @@ CONFIG_HAVE_PERF_EVENTS_NMI=y
# GCOV-based kernel profiling
#
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
diff --git a/projects/generic/options b/projects/generic/options
index ab1118ddeb..1158f80f96 100644
--- a/projects/generic/options
+++ b/projects/generic/options
@@ -1,3 +1,6 @@
+# Name of the Distro to build (full name, without special charcters)
+ DISTRONAME="OpenELEC"
+
# Welcome Message for e.g. SSH Server (up to 5 Lines)
GREATING0="#######################################################"
GREATING1="# Welcome to OpenELEC - the powerful Mediacenter4you #"
@@ -92,6 +95,9 @@
# build with network support (yes / no)
NETWORK="yes"
+# build with netmount (mounting network drives on boot) support (yes / no)
+ NETMOUNT="yes"
+
# build ppp daemon (for configuring adsl etc...) (yes / no)
PPP_DAEMON="no"
diff --git a/projects/intel/linux/linux.i386.conf b/projects/intel/linux/linux.i386.conf
index aefaac51e0..dc2ee97153 100644
--- a/projects/intel/linux/linux.i386.conf
+++ b/projects/intel/linux/linux.i386.conf
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.36
+# Linux kernel version: 2.6.36.1
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
@@ -153,9 +153,9 @@ CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set
CONFIG_PCI_QUIRKS=y
# CONFIG_COMPAT_BRK is not set
-# CONFIG_SLAB is not set
+CONFIG_SLAB=y
# CONFIG_SLUB is not set
-CONFIG_SLOB=y
+# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
@@ -177,6 +177,7 @@ CONFIG_HAVE_PERF_EVENTS_NMI=y
# GCOV-based kernel profiling
#
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
diff --git a/projects/intel/linux/linux.x86_64.conf b/projects/intel/linux/linux.x86_64.conf
index 09599c1c03..a11b47298f 100644
--- a/projects/intel/linux/linux.x86_64.conf
+++ b/projects/intel/linux/linux.x86_64.conf
@@ -1,6 +1,6 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.36
+# Linux kernel version: 2.6.36.1
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
@@ -152,9 +152,9 @@ CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set
CONFIG_PCI_QUIRKS=y
# CONFIG_COMPAT_BRK is not set
-# CONFIG_SLAB is not set
+CONFIG_SLAB=y
# CONFIG_SLUB is not set
-CONFIG_SLOB=y
+# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
# CONFIG_KPROBES is not set
@@ -176,6 +176,7 @@ CONFIG_HAVE_PERF_EVENTS_NMI=y
# GCOV-based kernel profiling
#
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
diff --git a/projects/intel/options b/projects/intel/options
index 2a260d052c..628c876c6e 100644
--- a/projects/intel/options
+++ b/projects/intel/options
@@ -1,3 +1,6 @@
+# Name of the Distro to build (full name, without special charcters)
+ DISTRONAME="OpenELEC"
+
# Welcome Message for e.g. SSH Server (up to 5 Lines)
GREATING0="#######################################################"
GREATING1="# Welcome to OpenELEC - the powerful Mediacenter4you #"
@@ -92,6 +95,9 @@
# build with network support (yes / no)
NETWORK="yes"
+# build with netmount (mounting network drives on boot) support (yes / no)
+ NETMOUNT="yes"
+
# build ppp daemon (for configuring adsl etc...) (yes / no)
PPP_DAEMON="no"
diff --git a/scripts/checkdeps b/scripts/checkdeps
index 74242b80b8..cabfd98f0a 100755
--- a/scripts/checkdeps
+++ b/scripts/checkdeps
@@ -43,7 +43,7 @@ while file=`getarg $i $files` && [ -n "$file" ]; do
done
if [ -n "$need" ]; then
- echo "**** Your system lacks the following tools needed to $1 OpenELEC.tv ****"
+ echo "**** Your system lacks the following tools needed to $1 $DISTRONAME ****"
echo $need
[ -f /etc/lsb-release ] && . /etc/lsb-release
diff --git a/scripts/get b/scripts/get
index 7b86b16670..475af7211e 100755
--- a/scripts/get
+++ b/scripts/get
@@ -36,7 +36,7 @@ if [ -n "$PKG_URL" ]; then
[ "$VERBOSE" != yes ] && WGET_OPT=-q
NBWGET=1
- until [ -f $STAMP ] || wget --passive-ftp -c $WGET_OPT -P $SOURCES/$1 $i; do
+ until [ -f $STAMP ] || wget --passive-ftp --no-check-certificate -c $WGET_OPT -P $SOURCES/$1 $i; do
NBWGET=$(($NBWGET+1))
if [ $NBWGET -gt 10 ]; then
echo -e "\nCant't get $1 sources : $i\n Try later !!"
diff --git a/scripts/image b/scripts/image
index e91d522b52..76c40e530a 100755
--- a/scripts/image
+++ b/scripts/image
@@ -39,10 +39,10 @@ mkdir -p $INSTALL
ln -s lib $INSTALL/usr/lib64
fi
- echo "OpenELEC" > $INSTALL/etc/distribution
+ echo "$DISTRONAME" > $INSTALL/etc/distribution
echo "$PROJECT.$TARGET_ARCH" > $INSTALL/etc/arch
echo "$OPENELEC_VERSION" > $INSTALL/etc/version
- echo "OpenELEC.tv - Date of build: $BUILD_DATE Build: $GIT_BUILD" > $INSTALL/etc/openelec-release
+ echo "$DISTRONAME - Date of build: $BUILD_DATE Build: $GIT_BUILD" > $INSTALL/etc/openelec-release
echo "$TARGET_VERSION" > $INSTALL/etc/release
# copy project related files to filesystem
diff --git a/scripts/image_release b/scripts/image_release
index 24e5697e62..6f4e23c3b4 100755
--- a/scripts/image_release
+++ b/scripts/image_release
@@ -6,7 +6,7 @@ $SCRIPTS/image_squashfs
get_version
-RELEASE_DIR="target/OpenELEC-$TARGET_VERSION"
+RELEASE_DIR="target/$DISTRONAME-$TARGET_VERSION"
# cleanup
rm -rf $RELEASE_DIR
@@ -23,8 +23,8 @@ RELEASE_DIR="target/OpenELEC-$TARGET_VERSION"
cp $ROOT/licenses/* $RELEASE_DIR/licenses
mkdir -p $RELEASE_DIR/target
- cp $TARGET_IMG/OpenELEC-$TARGET_VERSION.system $RELEASE_DIR/target/SYSTEM
- cp $TARGET_IMG/OpenELEC-$TARGET_VERSION.kernel $RELEASE_DIR/target/KERNEL
+ cp $TARGET_IMG/$DISTRONAME-$TARGET_VERSION.system $RELEASE_DIR/target/SYSTEM
+ cp $TARGET_IMG/$DISTRONAME-$TARGET_VERSION.kernel $RELEASE_DIR/target/KERNEL
# create md5sum's
pushd $RELEASE_DIR > /dev/null 2>&1
@@ -36,10 +36,10 @@ RELEASE_DIR="target/OpenELEC-$TARGET_VERSION"
mkdir -p $TARGET_IMG
# remove an previous created release tarball
- rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION.tar.bz2
+ rm -rf $TARGET_IMG/$DISTRONAME-$TARGET_VERSION.tar.bz2
# create release tarball
- tar cjf $TARGET_IMG/OpenELEC-$TARGET_VERSION.tar.bz2 -C target OpenELEC-$TARGET_VERSION
+ tar cjf $TARGET_IMG/$DISTRONAME-$TARGET_VERSION.tar.bz2 -C target $DISTRONAME-$TARGET_VERSION
# cleanup release dir
rm -rf $RELEASE_DIR
diff --git a/scripts/image_squashfs b/scripts/image_squashfs
index 0a18bc4566..7ec943b523 100755
--- a/scripts/image_squashfs
+++ b/scripts/image_squashfs
@@ -13,12 +13,12 @@ $SCRIPTS/build fakeroot
get_version
mkdir -p $TARGET_IMG
- rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION.kernel
- cp -PR $BUILD/linux-*/arch/x86/boot/bzImage $TARGET_IMG/OpenELEC-$TARGET_VERSION.kernel
+ rm -rf $TARGET_IMG/$DISTRONAME-$TARGET_VERSION.kernel
+ cp -PR $BUILD/linux-*/arch/x86/boot/bzImage $TARGET_IMG/$DISTRONAME-$TARGET_VERSION.kernel
- echo "rm -rf $TARGET_IMG/OpenELEC-$TARGET_VERSION.system" >> $FAKEROOT_SCRIPT
-# echo "$ROOT/$TOOLCHAIN/bin/mksquashfs $BUILD/image/system $TARGET_IMG/OpenELEC-$TARGET_VERSION.system -noappend -comp lzma" >> $FAKEROOT_SCRIPT
- echo "$ROOT/$TOOLCHAIN/bin/mksquashfs $BUILD/image/system $TARGET_IMG/OpenELEC-$TARGET_VERSION.system -noappend" >> $FAKEROOT_SCRIPT
+ echo "rm -rf $TARGET_IMG/$DISTRONAME-$TARGET_VERSION.system" >> $FAKEROOT_SCRIPT
+# echo "$ROOT/$TOOLCHAIN/bin/mksquashfs $BUILD/image/system $TARGET_IMG/$DISTRONAME-$TARGET_VERSION.system -noappend -comp lzma" >> $FAKEROOT_SCRIPT
+ echo "$ROOT/$TOOLCHAIN/bin/mksquashfs $BUILD/image/system $TARGET_IMG/$DISTRONAME-$TARGET_VERSION.system -noappend" >> $FAKEROOT_SCRIPT
$ROOT/$TOOLCHAIN/bin/fakeroot -- $FAKEROOT_SCRIPT
- chmod 0644 $TARGET_IMG/OpenELEC-$TARGET_VERSION.system
+ chmod 0644 $TARGET_IMG/$DISTRONAME-$TARGET_VERSION.system
rm -rf $FAKEROOT_SCRIPT