summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOyvind Repvik <nail@nslu2-linux.org>2005-10-03 22:09:41 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-10-03 22:09:41 +0000
commit06c5c42e2da68e95c6cdf39606150865e36b1f71 (patch)
tree00dd72a25f7f589d9ff0aca0f9404c54dae71374
parent8fa2c7ab4cc24fa723885661fa5be14c48b363ea (diff)
parent6b5075fa761e23d7e4e6550dcbcf3eb5fafdf7d2 (diff)
merge of 2786b01c941e932325ebd3fc61a3a60664dc3b48
and 29da97548b6f79e801e68f41b3a37862a7577bfa
-rw-r--r--conf/machine/h2200.conf22
-rw-r--r--packages/avahi/avahi-0.5.1/.mtn2git_empty0
-rw-r--r--packages/avahi/avahi-0.5.1/alignment-fix.patch96
-rw-r--r--packages/avahi/avahi_0.5.1.bb53
-rw-r--r--packages/freeze/files/freeze2
-rw-r--r--packages/freeze/files/unfreeze2
-rw-r--r--packages/gomunicator/gomunicator_cvs.bb4
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.4/.mtn2git_empty0
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.4/2.6.13.patch39
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.4/2.6.14.patch24
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.4/ixp400-le-be.patch943
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.4/makefile.patch33
-rw-r--r--packages/ixp425-eth/ixp400-eth_1.4.bb47
-rw-r--r--packages/ixp4xx/ixp-osal-2.0/.mtn2git_empty0
-rw-r--r--packages/ixp4xx/ixp-osal-2.0/2.6.patch363
-rw-r--r--packages/ixp4xx/ixp-osal-2.0/Makefile.patch27
-rw-r--r--packages/ixp4xx/ixp-osal_2.0.bb81
-rw-r--r--packages/ixp4xx/ixp4xx-csr-2.0/.mtn2git_empty0
-rw-r--r--packages/ixp4xx/ixp4xx-csr-2.0/2.6.14.patch20
-rw-r--r--packages/ixp4xx/ixp4xx-csr-2.0/2.6.patch148
-rw-r--r--packages/ixp4xx/ixp4xx-csr-2.0/Makefile.patch81
-rw-r--r--packages/ixp4xx/ixp4xx-csr_2.0.bb78
-rw-r--r--packages/linux/opensimpad_2.4.25-vrs2-pxa1-jpm1.bb2
-rw-r--r--packages/linux/opensimpad_2.4.27-vrs1-pxa1-jpm1.bb2
-rw-r--r--packages/monotone/files/txt2c-cross-post-0.22.patch11
-rw-r--r--packages/monotone/monotone-5_0.23.bb15
-rw-r--r--packages/tslib/tslib/simpad/tslib.sh14
-rw-r--r--packages/tslib/tslib/ts.conf-simpad (renamed from packages/tslib/tslib/simpad/ts.conf)0
-rw-r--r--packages/tslib/tslib/ts.conf-simpad-2.45
-rw-r--r--packages/tslib/tslib_cvs.bb8
30 files changed, 2108 insertions, 12 deletions
diff --git a/conf/machine/h2200.conf b/conf/machine/h2200.conf
index bb65f151a2..47e7bdbc28 100644
--- a/conf/machine/h2200.conf
+++ b/conf/machine/h2200.conf
@@ -9,7 +9,7 @@ IPKG_ARCHS = "all arm armv4 armv4t armv5e armv5te ipaqpxa h2200"
PREFERRED_PROVIDER_xserver = "xserver-kdrive"
PREFERRED_PROVIDER_virtual/kernel = "handhelds-pxa-2.6"
-EXTRA_IMAGECMD_h2200_jffs2 = "-e 0x40000 -p"
+EXTRA_IMAGECMD_h2200_jffs2 = "--pad --no-cleanmarkers --pagesize=512 --eraseblock=16384"
ROOT_FLASH_SIZE = "32"
@@ -18,8 +18,23 @@ BOOTSTRAP_EXTRA_DEPENDS_append = " handhelds-pxa-2.6 udev module-init-tools"
BOOTSTRAP_EXTRA_RDEPENDS = "kernel ipaq-boot-params ${@linux_module_packages('${H2200_MODULES}', d)}"
BOOTSTRAP_EXTRA_RDEPENDS_append = " udev module-init-tools"
-H2200_MODULES = "g_ether g_serial g_file_storage sa1100-rtc pm pcmcia-core snd-pxa-i2sound-h2200 pxa2xx_h2200 h2200_pm h2200_lcd h2200_kbd h2200_battery mq11xx_base mq1100fb samcop_adcts w1_ds2760 w1_samcop "
-# pxa2xx_udc is built in to the kernel
+#ship in rootfs:
+H2200_MODULES = "g_ether g_serial g_file_storage sa1100-rtc apm pcmcia-core snd-pxa-i2sound-h2200 pxa2xx_h2200 h2200_pm h2200_lcd h2200_kbd h2200_battery mq11xx_base mq1100fb samcop_adcts w1_ds2760 w1_samcop "
+
+#autoload on boot:
+module_autoload_h2200_pm = "h2200_pm"
+module_autoload_h2200_kbd = "h2200_kbd"
+module_autoload_h2200_lcd = "h2200_lcd"
+module_autoload_mq11xx_base = "mq11xx_base"
+module_autoload_mq1100fb = "mq1100fb"
+module_autoload_samcop_adcts = "samcop_adcts"
+module_autoload_samcop_sdi = "samcop_sdi"
+module_autoload_w1_ds2760 = "w1_ds2760"
+module_autoload_h2200_battery = "h2200_battery"
+module_autoload_hamcop_nand = "hamcop_nand"
+module_autoload_pxa2xx_h2200 = "pxa2xx_h2200"
+module_autoload_snd_pxa_i2sound_h2200 = "snd-pxa-i2sound-h2200"
+
SERIAL_CONSOLE = "115200 tts/0 vt100"
@@ -30,5 +45,4 @@ include conf/machine/handheld-common.conf
GUI_MACHINE_CLASS = "smallscreen"
-# not using tune-xscale so as to retain backwards compatibility
include conf/machine/tune-xscale.conf
diff --git a/packages/avahi/avahi-0.5.1/.mtn2git_empty b/packages/avahi/avahi-0.5.1/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/avahi/avahi-0.5.1/.mtn2git_empty
diff --git a/packages/avahi/avahi-0.5.1/alignment-fix.patch b/packages/avahi/avahi-0.5.1/alignment-fix.patch
new file mode 100644
index 0000000000..fc23f23756
--- /dev/null
+++ b/packages/avahi/avahi-0.5.1/alignment-fix.patch
@@ -0,0 +1,96 @@
+--- avahi-0.5/avahi-core/dns.c.orig 2005-09-23 16:35:02 +0200
++++ avahi-0.5/avahi-core/dns.c 2005-09-23 16:35:07 +0200
+@@ -177,11 +177,13 @@
+ assert(idx < p->size);
+
+ if (idx < 0x4000) {
+- uint16_t *t;
+- if (!(t = (uint16_t*) avahi_dns_packet_extend(p, sizeof(uint16_t))))
++ uint8_t *t;
++
++ if (!(t = (uint8_t*) avahi_dns_packet_extend(p, sizeof(uint16_t))))
+ return NULL;
+
+- *t = htons((0xC000 | idx));
++ t[0] = (uint8_t) ((0xC000 | idx) >> 8);
++ t[1] = (uint8_t) idx;
+ return saved_ptr;
+ }
+ }
+@@ -223,7 +225,8 @@
+ if (!(d = avahi_dns_packet_extend(p, sizeof(uint16_t))))
+ return NULL;
+
+- *((uint16_t*) d) = htons(v);
++ d[0] = (uint8_t) (v >> 8);
++ d[1] = (uint8_t) v;
+ return d;
+ }
+
+@@ -234,7 +237,10 @@
+ if (!(d = avahi_dns_packet_extend(p, sizeof(uint32_t))))
+ return NULL;
+
+- *((uint32_t*) d) = htonl(v);
++ d[0] = (uint8_t) (v >> 24);
++ d[1] = (uint8_t) (v >> 16);
++ d[2] = (uint8_t) (v >> 8);
++ d[3] = (uint8_t) v;
+
+ return d;
+ }
+@@ -385,26 +391,42 @@
+ }
+
+ int avahi_dns_packet_consume_uint16(AvahiDnsPacket *p, uint16_t *ret_v) {
++ uint8_t *d;
++ uint16_t tmp_v;
++
+ assert(p);
+ assert(ret_v);
+
+ if (p->rindex + sizeof(uint16_t) > p->size)
+ return -1;
+
+- *ret_v = ntohs(*((uint16_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex)));
++ d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex);
++ tmp_v = (d[0] << 8) | d[1];
++ d = (uint8_t*) ret_v;
++ d[0] = ((uint8_t*)(&tmp_v))[0];
++ d[1] = ((uint8_t*)(&tmp_v))[1];
+ p->rindex += sizeof(uint16_t);
+
+ return 0;
+ }
+
+ int avahi_dns_packet_consume_uint32(AvahiDnsPacket *p, uint32_t *ret_v) {
++ uint8_t* d;
++ uint32_t tmp_v;
++
+ assert(p);
+ assert(ret_v);
+
+ if (p->rindex + sizeof(uint32_t) > p->size)
+ return -1;
+
+- *ret_v = ntohl(*((uint32_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex)));
++ d = (uint8_t*) (AVAHI_DNS_PACKET_DATA(p) + p->rindex);
++ tmp_v = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | d[3];
++ d = (uint8_t*) ret_v;
++ d[0] = ((uint8_t*)(&tmp_v))[0];
++ d[1] = ((uint8_t*)(&tmp_v))[1];
++ d[2] = ((uint8_t*)(&tmp_v))[2];
++ d[3] = ((uint8_t*)(&tmp_v))[3];
+ p->rindex += sizeof(uint32_t);
+
+ return 0;
+@@ -733,7 +755,8 @@
+
+ /* avahi_log_debug("appended %u", size); */
+
+- * (uint16_t*) l = htons((uint16_t) size);
++ l[0] = (uint8_t) ((uint16_t) size >> 8);
++ l[1] = (uint8_t) ((uint16_t) size);
+
+ return t;
+
diff --git a/packages/avahi/avahi_0.5.1.bb b/packages/avahi/avahi_0.5.1.bb
new file mode 100644
index 0000000000..6a1a393e19
--- /dev/null
+++ b/packages/avahi/avahi_0.5.1.bb
@@ -0,0 +1,53 @@
+DESCRIPTION = "Avahi implements the DNS-SD over Multicast DNS"
+HOMEPAGE = "http://www.freedesktop.org/Software/Avahi"
+LICENCE= "GPL"
+DEPENDS = "expat libdaemon dbus-0.50"
+RRECOMMENDS = "libnss-mdns"
+SECTION = "net"
+PRIORITY = "optional"
+PR = "r0"
+
+SRC_URI = "http://www.freedesktop.org/~lennart/avahi-${PV}.tar.gz \
+ file://alignment-fix.patch;patch=1"
+
+PACKAGES = "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib avahi-dev avahi-doc"
+
+FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
+FILES_libavahi-core= "${libdir}/libavahi-core.so.*"
+FILES_avahi-daemon = "${sbindir}/avahi-daemon \
+ ${sysconfdir}/avahi/avahi-daemon.conf \
+ ${sysconfdir}/avahi/services \
+ ${sysconfdir}/dbus-1 \
+ ${sysconfdir}/init.d/avahi-daemon \
+ ${datadir}/avahi/introspection/*.introspect \
+ ${datadir}/avahi/avahi-service.dtd \
+ ${datadir}/avahi/service-types"
+FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
+FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
+ ${sysconfdir}/avahi/avahi-dnsconfd.action \
+ ${sysconfdir}/init.d/avahi-dnsconfd"
+FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
+
+CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
+
+EXTRA_OECONF = "--with-distro=debian --disable-mono --disable-mono-docs --disable-gtk --disable-qt3 --disable-qt4 --disable-python"
+inherit autotools
+inherit update-rc.d
+
+INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
+INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
+INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
+INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
+INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
+
+pkg_postinst_avahi-daemon () {
+ grep avahi /etc/group || addgroup avahi
+ grep avahi /etc/passwd || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
+ /etc/init.d/dbus-1 force-reload
+}
+
+pkg_postrm_avahi-daemon () {
+ deluser avahi || true
+ delgroup avahi || true
+}
+
diff --git a/packages/freeze/files/freeze b/packages/freeze/files/freeze
index 5305af7191..b92c66054e 100644
--- a/packages/freeze/files/freeze
+++ b/packages/freeze/files/freeze
@@ -41,7 +41,7 @@ else
FROZEN_DIR=""
for d in ${BBPATH//:/ }
do
- if test -r "$d/conf/local.conf"
+ if test -r "$d/conf/local.conf" -o -r "$d/conf/auto.conf"
then
FROZEN_DIR="$d/conf"
break
diff --git a/packages/freeze/files/unfreeze b/packages/freeze/files/unfreeze
index 2aaa2ac2fc..5be1459c3c 100644
--- a/packages/freeze/files/unfreeze
+++ b/packages/freeze/files/unfreeze
@@ -31,7 +31,7 @@ else
FROZEN_DIR=""
for d in ${BBPATH//:/ }
do
- if test -r "$d/conf/local.conf"
+ if test -r "$d/conf/local.conf" -o -r "$d/conf/auto.conf"
then
FROZEN_DIR="$d/conf"
break
diff --git a/packages/gomunicator/gomunicator_cvs.bb b/packages/gomunicator/gomunicator_cvs.bb
index 77a281f599..312b9fbd56 100644
--- a/packages/gomunicator/gomunicator_cvs.bb
+++ b/packages/gomunicator/gomunicator_cvs.bb
@@ -4,10 +4,10 @@ LICENSE = "GPLv2"
AUTHOR = "Robert Woerle"
MAINTAINER = "Koen Kooi <koen@handhelds.org>"
DEPENDS = "libgpewidget gtk+ glib-2.0"
-PV = "0.1.3+cvs${CVSDATE}"
+PV = "0.1.3+cvs-${CVSDATE}"
-inherit autotools
+inherit autotools pkgconfig
SRC_URI = "cvs://anonymous@cvs.sourceforge.net/cvsroot/xanadux;module=gomunicator"
S = "${WORKDIR}/${PN}"
diff --git a/packages/ixp425-eth/ixp400-eth-1.4/.mtn2git_empty b/packages/ixp425-eth/ixp400-eth-1.4/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.4/.mtn2git_empty
diff --git a/packages/ixp425-eth/ixp400-eth-1.4/2.6.13.patch b/packages/ixp425-eth/ixp400-eth-1.4/2.6.13.patch
new file mode 100644
index 0000000000..376bb3b03b
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.4/2.6.13.patch
@@ -0,0 +1,39 @@
+--- ./ixp400_eth.c.orig 2005-10-02 18:55:03.998477844 -0700
++++ ./ixp400_eth.c 2005-10-02 19:00:43.187821684 -0700
+@@ -848,7 +848,9 @@
+ skb->pkt_type = PACKET_HOST; /* Default type */
+ skb->ip_summed = 0;
+ skb->priority = 0;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
+ skb->security = 0;
++#endif
+ #ifdef CONFIG_NET_SCHED
+ skb->tc_index = 0;
+ #endif
+@@ -2922,8 +2924,14 @@
+ }
+
+ /* set port MAC addr and update the dev struct if successfull */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
+ int dev_set_mac_address(struct net_device *dev, struct sockaddr *saddr)
+ {
++#else
++static int set_mac_address(struct net_device *dev, void *saddrIn)
++{
++ struct sockaddr *saddr = saddrIn;
++#endif
+ int res;
+ priv_data_t *priv = dev->priv;
+ IxEthAccMacAddr npeMacAddr;
+@@ -3073,7 +3081,11 @@
+ ndev->get_stats = dev_get_stats;
+ ndev->set_multicast_list = dev_set_multicast_list;
+ ndev->flags |= IFF_MULTICAST;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
+ ndev->set_mac_address = dev_set_mac_address;
++#else
++ ndev->set_mac_address = set_mac_address;
++#endif
+
+ TRACE;
+
diff --git a/packages/ixp425-eth/ixp400-eth-1.4/2.6.14.patch b/packages/ixp425-eth/ixp400-eth-1.4/2.6.14.patch
new file mode 100644
index 0000000000..c4c19db795
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.4/2.6.14.patch
@@ -0,0 +1,24 @@
+--- ./ixp400_eth.c 2005-10-01 00:50:45.179775259 -0700
++++ ./ixp400_eth.c 2005-10-01 00:54:10.976725245 -0700
+@@ -777,7 +777,9 @@
+ * before re-using it on the Rx-path
+ */
+ skb->nfmark = 0;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
+ skb->nfcache = 0;
++#endif
+ nf_conntrack_put(skb->nfct);
+ skb->nfct = NULL;
+ #ifdef CONFIG_NETFILTER_DEBUG
+@@ -1451,7 +1453,11 @@
+ skb->len -= header_len;
+
+ /* fill the pkt arrival time (set at the irq callback entry) */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
+ skb->stamp = irq_stamp;
++#else
++ skb_set_timestamp(skb, &irq_stamp);
++#endif
+
+ /* fill the input device field */
+ skb->dev = dev;
diff --git a/packages/ixp425-eth/ixp400-eth-1.4/ixp400-le-be.patch b/packages/ixp425-eth/ixp400-eth-1.4/ixp400-le-be.patch
new file mode 100644
index 0000000000..a1909dfe82
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.4/ixp400-le-be.patch
@@ -0,0 +1,943 @@
+--- ./ixp400_eth.c.orig 2005-10-02 18:38:46.472966042 -0700
++++ ./ixp400_eth.c 2005-10-02 18:39:33.271910913 -0700
+@@ -57,6 +57,7 @@
+ #include <linux/mii.h>
+ #include <linux/socket.h>
+ #include <linux/cache.h>
++#include <linux/interrupt.h>
+ #include <asm/io.h>
+ #include <asm/errno.h>
+ #include <net/pkt_sched.h>
+@@ -94,8 +95,10 @@
+ MODULE_DESCRIPTION("IXP400 NPE Ethernet driver");
+ MODULE_LICENSE("GPL");
+ MODULE_AUTHOR("Intel Corporation");
+-#define MODULE_NAME "ixp400_eth"
+-#define MODULE_VERSION "1.4"
++#define MODULE_NAME "ixp400_eth"
++#define MODULE_VERSION_IXP400_ETH "1.4B"
++
++#define CONFIG_ARCH_IXDP425
+
+ /* Module parameters */
+ static int npe_learning = 1; /* default : NPE learning & filtering enable */
+@@ -358,8 +361,13 @@
+ /* Used to stop the kernel thread for link monitoring. */
+ volatile BOOL maintenanceCheckStopped;
+
++ struct work_struct mii_job;
++
++
+ /* used for tx timeout */
+- struct tq_struct tq_timeout;
++ struct work_struct tx_timeout_job;
++
++
+
+ /* used to control the message output */
+ UINT32 devFlags;
+@@ -557,6 +565,8 @@
+ #endif
+ };
+
++static struct workqueue_struct *npe_eth_workqueue;
++
+ /* Mutex lock used to coordinate access to IxEthAcc functions
+ * which manipulate the MII registers on the PHYs
+ */
+@@ -565,6 +575,11 @@
+ /* mutex locked when maintenance is being performed */
+ static struct semaphore *maintenance_mutex;
+
++/* Flags which is set when corresponding NPE is running,
++ * cleared when NPE is stopped
++ */
++static int npeRunning[IX_ETH_ACC_NUMBER_OF_PORTS];
++
+ /* Flags which is set when the corresponding IRQ is running,
+ */
+ static int irq_pmu_used = 0;
+@@ -1070,6 +1085,117 @@
+ return 0;
+ }
+
++/*
++ * WORKQUEUE JOBS
++ */
++
++/* This workqueue job will check the PHY for the link duplex and
++ * update the MAC accordingly. It also executes some buffer
++ * maintenance to release mbuf in excess or replenish after
++ * a severe starvation
++ *
++ * This function loops and wake up every 3 seconds.
++ */
++static void dev_media_check_work(void* arg)
++{
++ struct net_device *dev = (struct net_device *) arg;
++ priv_data_t *priv = dev->priv;
++
++ TRACE;
++
++ /*
++ * Determine the link status
++ */
++
++ if (default_phy_cfg[priv->port_id].linkMonitor)
++ {
++ int linkUp;
++ int speed100;
++ int fullDuplex = -1; /* unknown duplex mode */
++ int newDuplex;
++ int autonegotiate;
++ unsigned phyNum = phyAddresses[priv->port_id];
++ int res;
++
++ TRACE;
++
++ /* lock the MII register access mutex */
++ down(miiAccessMutex);
++
++ res = ixEthMiiLinkStatus(phyNum,
++ &linkUp,
++ &speed100,
++ &newDuplex,
++ &autonegotiate);
++ /* release the MII register access mutex */
++ up(miiAccessMutex);
++
++ if (res != IX_ETH_ACC_SUCCESS)
++ {
++ P_WARN("ixEthMiiLinkStatus failed on PHY%d.\n"
++ "\tCan't determine\nthe auto negotiated parameters. "
++ "Using default values.\n",
++ phyNum);
++
++ /* this shouldn't happen. exit the thread if it does */
++ goto out;
++ }
++
++ if (linkUp)
++ {
++ if (! netif_carrier_ok(dev))
++ {
++ /* inform the kernel of a change in link state */
++ netif_carrier_on(dev);
++ }
++
++ /*
++ * Update the MAC mode to match the PHY mode if
++ * there is a phy mode change.
++ */
++ if (newDuplex != fullDuplex)
++ {
++ fullDuplex = newDuplex;
++ if (fullDuplex)
++ {
++ ixEthAccPortDuplexModeSet(priv->port_id,
++ IX_ETH_ACC_FULL_DUPLEX);
++ }
++ else
++ {
++ ixEthAccPortDuplexModeSet(priv->port_id,
++ IX_ETH_ACC_HALF_DUPLEX);
++ }
++ }
++ }
++ else
++ {
++ fullDuplex = -1;
++ if (netif_carrier_ok(dev))
++ {
++ /* inform the kernel of a change in link state */
++ netif_carrier_off(dev);
++ }
++ }
++ }
++
++ TRACE;
++
++ /* this is to prevent the rx pool from emptying when
++ * there's not enough memory for a long time
++ * It prevents also from holding the memory for too
++ * long
++ */
++ dev_buff_maintenance(dev);
++
++ /* reschedule to run in 3 seconds */
++ queue_delayed_work(npe_eth_workqueue, &priv->mii_job, 3*HZ);
++ out:
++ return;
++}
++
++
++#define sigmask_lock sighand->siglock
+
+ /*
+ * KERNEL THREADS
+@@ -1122,11 +1248,11 @@
+ */
+ down (priv->maintenanceCheckThreadComplete);
+
+- daemonize();
+- reparent_to_init();
++ daemonize("dev_media");
++ // reparent_to_init();
+ spin_lock_irq(&current->sigmask_lock);
+ sigemptyset(&current->blocked);
+- recalc_sigpending(current);
++ recalc_sigpending();
+ spin_unlock_irq(&current->sigmask_lock);
+
+ snprintf(current->comm, sizeof(current->comm), "ixp400 %s", dev->name);
+@@ -1285,7 +1411,7 @@
+ static void dev_pmu_timer_restart(void)
+ {
+ unsigned long flags;
+- save_flags_cli(flags);
++ local_irq_save(flags);
+ __asm__(" mcr p14,0,%0,c1,c1,0\n" /* write current counter */
+ : : "r" (timer_countup_ticks));
+
+@@ -1294,13 +1420,13 @@
+ " mcr p14,0,r1,c5,c1,0; " /* clear overflow */
+ " mcr p14,0,r1,c4,c1,0\n" /* enable interrupts */
+ : : : "r1");
+- restore_flags(flags);
++ local_irq_restore(flags);
+ }
+
+ /* Internal ISR : run a few thousand times per second and calls
+ * the queue manager dispatcher entry point.
+ */
+-static void dev_qmgr_os_isr(int irg, void *dev_id, struct pt_regs *regs)
++static irqreturn_t dev_qmgr_os_isr(int irg, void *dev_id, struct pt_regs *regs)
+ {
+ /* get the time of this interrupt : all buffers received during this
+ * interrupt will be assigned the same time */
+@@ -1308,22 +1434,32 @@
+
+ /* call the queue manager entry point */
+ dispatcherFunc(IX_QMGR_QUELOW_GROUP);
++ return IRQ_HANDLED;
+ }
+
+ /* Internal ISR : run a few thousand times per second and calls
+ * the ethernet entry point.
+ */
+-static void dev_poll_os_isr(int irg, void *dev_id, struct pt_regs *regs)
++int icount = 2;
++static irqreturn_t dev_poll_os_isr(int irg, void *dev_id, struct pt_regs *regs)
+ {
+- dev_pmu_timer_restart(); /* set up the timer for the next interrupt */
++ if (icount > 0) {
++ icount--;
++ TRACE;
++ }
+
+ /* get the time of this interrupt : all buffers received during this
+ * interrupt will be assigned the same time */
+ do_gettimeofday(&irq_stamp);
+-
++ if (icount) TRACE;
+ ixEthRxFrameQMCallback(rx_queue_id,0);
++ if (icount) TRACE;
+ ixEthTxFrameDoneQMCallback(0,0);
+-
++ if (icount) TRACE;
++ /* here surely */
++ dev_pmu_timer_restart(); /* set up the timer for the next interrupt */
++ return IRQ_HANDLED;
++
+ }
+
+ /* initialize the PMU timer */
+@@ -1370,17 +1506,18 @@
+ static void dev_pmu_timer_disable(void)
+ {
+ unsigned long flags;
+- save_flags_cli(flags);
++ local_irq_save(flags);
+ __asm__(" mrc p14,0,r1,c4,c1,0; " /* get int enable register */
+ " and r1,r1,#0x1e; "
+ " mcr p14,0,r1,c4,c1,0\n" /* disable interrupts */
+ : : : "r1");
+- restore_flags(flags);
++ local_irq_restore(flags);
+ }
+
+ /* This timer will call ixEthDBDatabaseMaintenance every
+ * IX_ETH_DB_MAINTENANCE_TIME jiffies
+ */
++#if 0
+ static void maintenance_timer_cb(unsigned long data);
+
+ static struct timer_list maintenance_timer = {
+@@ -1418,6 +1555,34 @@
+
+ maintenance_timer_set();
+ }
++#endif
++static void db_maintenance_code(void *data);
++static DECLARE_WORK(db_maintenance_job, db_maintenance_code, NULL);
++
++static inline
++void schedule_db_maintenance(void)
++{
++ TRACE;
++ queue_delayed_work(npe_eth_workqueue, &db_maintenance_job,
++ DB_MAINTENANCE_TIME);
++}
++
++static inline
++void cancel_db_maintenance(void)
++{
++ TRACE;
++ cancel_delayed_work(&db_maintenance_job);
++}
++
++static void db_maintenance_code(void *data)
++{
++ TRACE;
++ down(maintenance_mutex);
++ ixEthDBDatabaseMaintenance();
++ up(maintenance_mutex);
++ schedule_db_maintenance();
++}
++
+
+ /*
+ * DATAPLANE
+@@ -1531,7 +1696,7 @@
+ * and its constants are taken from the eth_type_trans()
+ * function.
+ */
+- struct ethhdr *eth = skb->mac.ethernet;
++ struct ethhdr *eth = eth_hdr(skb);
+ unsigned short hproto = ntohs(eth->h_proto);
+
+ if (hproto >= 1536)
+@@ -1573,7 +1738,7 @@
+ * mode is set This costs
+ * a lookup inside the packet payload.
+ */
+- struct ethhdr *eth = skb->mac.ethernet;
++ struct ethhdr *eth = eth_hdr(skb);
+ unsigned char *hdest = eth->h_dest;
+
+ if (memcmp(hdest, dev->dev_addr, ETH_ALEN)!=0)
+@@ -1632,7 +1797,7 @@
+ dev = (struct net_device *)callbackTag;
+ priv = dev->priv;
+
+- qlevel = softnet_data[0].input_pkt_queue.qlen;
++ qlevel = __get_cpu_var(softnet_data).input_pkt_queue.qlen;
+ /* check if the system accepts more traffic and
+ * against chained mbufs
+ */
+@@ -1674,10 +1839,21 @@
+ /* set the length of the received skb from the mbuf length */
+ skb->tail = skb->data + len;
+ skb->len = len;
++
++ {
++ int l = (skb->len+3) >> 2;
++ unsigned *p = (unsigned*)((unsigned)skb->data & ~0x3);
++ int i;
++ for (i = 0; i < l; i++) {
++ *p = ntohl(*p);
++ p++;
++ }
++ }
+
+ #ifdef DEBUG_DUMP
+ skb_dump("rx", skb);
+ #endif
++
+ /* Set the skb protocol and set mcast/bcast flags */
+ dev_eth_type_trans(mcastFlags, skb, dev);
+
+@@ -1821,6 +1997,39 @@
+ spin_unlock_irq(&priv->lock);
+ }
+
++/* start the NPEs */
++static int npe_start(IxEthAccPortId port_id)
++{
++ int res;
++ UINT32 npeImageId;
++
++ switch (port_id)
++ {
++ case IX_ETH_PORT_1:
++ npeImageId = IX_ETH_NPE_B_IMAGE_ID;
++ break;
++ case IX_ETH_PORT_2:
++ npeImageId = IX_ETH_NPE_C_IMAGE_ID;
++ break;
++ default:
++ P_ERROR("Invalid port specified. IXP Ethernet NPE not started\n");
++ return -ENODEV;
++ }
++
++ /* Initialise and Start NPEs */
++ if ((res = ixNpeDlNpeInitAndStart(npeImageId)))
++ {
++ P_ERROR("Error starting NPE for Ethernet port %d!\n", port_id);
++ return -1;
++ }
++
++ /* set this flag to indicate that NPE is running */
++ npeRunning[port_id] = 1;
++
++ return 0;
++}
++
++
+ /* The QMgr dispatch entry point can be called from the
+ * IX_OSAL_IXP400_QM1_IRQ_LVL irq (which will trigger
+ * an interrupt for every packet) or a timer (which will
+@@ -1906,7 +2115,16 @@
+ IxEthAccMacAddr npeMacAddr;
+ priv_data_t *priv = dev->priv;
+
+- P_DEBUG("port_enable(%s)\n", dev->name);
++ P_DEBUG("port_enable(%s) %d\n", dev->name, priv->port_id);
++
++ if (!npeRunning[priv->port_id])
++ {
++ if ((res = npe_start(priv->port_id)))
++ {
++ TRACE;
++ return res;
++ }
++ }
+
+ /* Set MAC addr in h/w (ethAcc checks for MAC address to be valid) */
+ memcpy(&npeMacAddr.macAddress,
+@@ -2084,6 +2302,15 @@
+ }
+ return 0;
+ }
++ {
++ int l = (skb->len+3) >> 2;
++ unsigned *p = (unsigned*)((unsigned)skb->data & ~0x3);
++ int i;
++ for (i = 0; i < l; i++) {
++ *p = ntohl(*p);
++ p++;
++ }
++ }
+
+ #ifdef DEBUG_DUMP
+ skb_dump("tx", skb);
+@@ -2120,6 +2347,7 @@
+ static int do_dev_open(struct net_device *dev)
+ {
+ int res;
++ TRACE;
+
+ /* prevent the maintenance task from running while bringing up port */
+ down(maintenance_mutex);
+@@ -2151,6 +2379,27 @@
+ }
+
+ static void
++dev_tx_timeout_work(void* arg)
++{
++ struct net_device *dev = (struct net_device *)arg;
++ priv_data_t *priv = dev->priv;
++
++ P_ERROR("%s: Tx Timeout for port %d\n", dev->name, priv->port_id);
++
++ down(maintenance_mutex);
++ port_disable(dev);
++
++ /* Note to user: Consider performing other reset operations here (such as
++ * PHY reset), if it is known to help the Tx Flow to become "unstuck"
++ */
++
++ port_enable(dev);
++ up(maintenance_mutex);
++}
++
++
++
++static void
+ dev_tx_timeout_task(void *dev_id)
+ {
+ struct net_device *dev = (struct net_device *)dev_id;
+@@ -2191,7 +2440,7 @@
+ priv_data_t *priv = dev->priv;
+
+ TRACE;
+- schedule_task(&priv->tq_timeout);
++ queue_work(npe_eth_workqueue, &priv->tx_timeout_job);
+
+ }
+
+@@ -2352,7 +2601,8 @@
+
+ TRACE;
+
+- invalidate_dcache_range((unsigned int)&ethStats, sizeof(ethStats));
++ // invalidate_dcache_range((unsigned int)&ethStats, sizeof(ethStats));
++ IX_ACC_DATA_CACHE_INVALIDATE((unsigned int)&ethStats, sizeof(ethStats));
+ if ((res = ixEthAccMibIIStatsGetClear(priv->port_id, &ethStats)))
+ {
+ P_ERROR("%s: ixEthAccMibIIStatsGet failed for port %d, res = %d\n",
+@@ -2565,7 +2815,6 @@
+ miiAccessMutex = (struct semaphore *) kmalloc(sizeof(struct semaphore), GFP_KERNEL);
+ if (!miiAccessMutex)
+ return -ENOMEM;
+-
+ init_MUTEX(miiAccessMutex);
+
+ TRACE;
+@@ -2673,12 +2922,12 @@
+ }
+
+ /* set port MAC addr and update the dev struct if successfull */
+