summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/.mtn2git_empty0
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/2.6.14.patch28
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/2.6.15.patch18
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/Makefile.patch36
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/continue-if-qmgr-init-fails.patch22
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/debug.patch131
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/device-name.patch49
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/int-random.patch16
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/le.patch41
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/mac-address.patch123
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/modprobe.conf4
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/module-param.patch62
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/netdev_max_backlog.patch54
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/params.patch75
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/poll-controller.patch50
-rw-r--r--packages/ixp425-eth/ixp400-eth-1.5.1/stop-on-rmmod.patch29
-rw-r--r--packages/ixp425-eth/ixp400-eth_1.5.1.bb87
17 files changed, 825 insertions, 0 deletions
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/.mtn2git_empty b/packages/ixp425-eth/ixp400-eth-1.5.1/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/.mtn2git_empty
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/2.6.14.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/2.6.14.patch
new file mode 100644
index 0000000000..fb55f92868
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/2.6.14.patch
@@ -0,0 +1,28 @@
+ ixp400_eth.c | 6 +++++-
+ 1 files changed, 5 insertions(+), 1 deletion(-)
+
+Index: ixp400-eth-1.5.1-r0/ixp400_eth.c
+===================================================================
+--- ixp400-eth-1.5.1-r0.orig/ixp400_eth.c
++++ ixp400-eth-1.5.1-r0/ixp400_eth.c
+@@ -1848,7 +1848,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;
+@@ -3040,7 +3044,7 @@
+ }
+
+ /* set port MAC addr and update the dev struct if successfull */
+-int ixp400_dev_set_mac_address(struct net_device *dev, void *addr)
++static int ixp400_dev_set_mac_address(struct net_device *dev, void *addr)
+ {
+ int res;
+ IxEthAccMacAddr npeMacAddr;
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/2.6.15.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/2.6.15.patch
new file mode 100644
index 0000000000..83115d8efa
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/2.6.15.patch
@@ -0,0 +1,18 @@
+2.6.15 needs platform_device.h
+
+ ixp400_eth.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
++++ ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
+@@ -65,6 +65,10 @@
+ #include <linux/sysctl.h>
+ #include <linux/unistd.h>
+
++#ifndef to_platform_device
++#include <linux/platform_device.h>
++#endif
++
+ /*
+ * Intel IXP400 Software specific header files
+ */
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/Makefile.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/Makefile.patch
new file mode 100644
index 0000000000..3bc51f0b66
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/Makefile.patch
@@ -0,0 +1,36 @@
+This is an OpenEmbedded only patch to make the code buildable in
+the OpenEmbedded environment.
+
+--- ixp400-eth/Makefile 1970-01-01 00:00:00.000000000 +0000
++++ ixp400-eth/Makefile 1970-01-01 00:00:00.000000000 +0000
+@@ -0,0 +1,30 @@
++obj-m := ixp400_eth.o
++
++CFLAGS_ixp400_eth.o = -DWall \
++ -I$(IXP4XX_CSR_DIR) \
++ -I$(OSAL_DIR)/ \
++ -I$(OSAL_DIR)/os/linux/include/ \
++ -I$(OSAL_DIR)/os/linux/include/modules/ \
++ -I$(OSAL_DIR)/os/linux/include/modules/ioMem/ \
++ -I$(OSAL_DIR)/os/linux/include/modules/core/ \
++ -I$(OSAL_DIR)/os/linux/include/modules/bufferMgt/ \
++ -I$(OSAL_DIR)/os/linux/include/core/ \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ \
++ -I$(OSAL_DIR)/os/linux/include/core/ \
++ -I$(OSAL_DIR)/include/ \
++ -I$(OSAL_DIR)/include/modules/ \
++ -I$(OSAL_DIR)/include/modules/bufferMgt/ \
++ -I$(OSAL_DIR)/include/modules/ioMem/ \
++ -I$(OSAL_DIR)/include/modules/core/ \
++ -I$(OSAL_DIR)/include/platforms/ \
++ -I$(OSAL_DIR)/include/platforms/ixp400/ \
++ -I$(OSAL_DIR)/include/platforms/ixp400/xp425/ \
++ -I$(OSAL_DIR)/os/linux/include/platforms/ixp400/ixp425/ \
++ $(IX_CFLAGS)
++
++default:
++ $(MAKE) ARCH=arm CROSS_COMPILE=$(LINUX_CROSS_COMPILE) $(KERNEL_VERBOSE) symverfile=$(IXP4XX_CSR_SYMVERS) -C $(LINUX_SRC) SUBDIRS=$(PWD) modules
++
++clean:
++ rm -f ixp400_eth.ko
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/continue-if-qmgr-init-fails.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/continue-if-qmgr-init-fails.patch
new file mode 100644
index 0000000000..8508790fa5
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/continue-if-qmgr-init-fails.patch
@@ -0,0 +1,22 @@
+tries to go on even if queue manager initialization
+fails. this is hand because you'll be allowed to
+insert ixp400_eth immediately after you have removed
+it, without re-inserting ixp400.
+
+ ixp400_eth.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+--- ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
++++ ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
+@@ -2850,10 +2850,7 @@ static int qmgr_init(void)
+ /* Initialise Queue Manager */
+ P_VERBOSE("Initialising Queue Manager...\n");
+ if ((res = ixQMgrInit()))
+- {
+- P_ERROR("Error initialising queue manager!\n");
+- return -1;
+- }
++ P_ERROR("Error initialising queue manager, trying to continue!\n");
+
+ TRACE;
+
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/debug.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/debug.patch
new file mode 100644
index 0000000000..c684c078d2
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/debug.patch
@@ -0,0 +1,131 @@
+This patch is not necessary but helps when debugging the build
+
+--- ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
++++ ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
+@@ -1350,9 +1350,10 @@ static int dev_media_check_thread (void*
+
+ if (res != IX_ETH_ACC_SUCCESS)
+ {
+- P_WARN("ixEthMiiLinkStatus failed on PHY%d.\n"
++ P_WARN("%s: ixEthMiiLinkStatus failed on PHY%d.\n"
+ "\tCan't determine\nthe auto negotiated parameters. "
+ "Using default values.\n",
++ dev->name,
+ phyNum);
+ /* something is bad, gracefully stops the loop */
+ priv->maintenanceCheckStopped = TRUE;
+@@ -2213,7 +2214,8 @@ static int port_enable(struct net_device
+ IX_IEEE803_MAC_ADDRESS_SIZE);
+ if ((res = ixEthAccPortUnicastMacAddressSet(priv->port_id, &npeMacAddr)))
+ {
+- P_VERBOSE("Failed to set MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x for port %d\n",
++ P_VERBOSE("%s: Failed to set MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x for port %d\n",
++ dev->name,
+ (unsigned)npeMacAddr.macAddress[0],
+ (unsigned)npeMacAddr.macAddress[1],
+ (unsigned)npeMacAddr.macAddress[2],
+@@ -2707,8 +2709,8 @@ static int do_dev_ioctl(struct net_devic
+ down (miiAccessMutex); /* lock the MII register access mutex */
+ if ((res = ixEthAccMiiReadRtn (data->phy_id, data->reg_num, &data->val_out)))
+ {
+- P_ERROR("Error reading MII reg %d on phy %d\n",
+- data->reg_num, data->phy_id);
++ P_ERROR("%s: Error reading MII reg %d on phy %d\n",
++ dev->name, data->reg_num, data->phy_id);
+ res = -1;
+ }
+ up (miiAccessMutex); /* release the MII register access mutex */
+@@ -2720,8 +2722,8 @@ static int do_dev_ioctl(struct net_devic
+ down (miiAccessMutex); /* lock the MII register access mutex */
+ if ((res = ixEthAccMiiWriteRtn (data->phy_id, data->reg_num, data->val_in)))
+ {
+- P_ERROR("Error writing MII reg %d on phy %d\n",
+- data->reg_num, data->phy_id);
++ P_ERROR("%s: Error writing MII reg %d on phy %d\n",
++ dev->name, data->reg_num, data->phy_id);
+ res = -1;
+ }
+ up (miiAccessMutex); /* release the MII register access mutex */
+@@ -3049,7 +3051,8 @@ static int set_mac_address(struct net_de
+ /* Set MAC addr in h/w (ethAcc checks for MAC address to be valid) */
+ if ((res = ixEthAccPortUnicastMacAddressSet(priv->port_id, &npeMacAddr)))
+ {
+- P_VERBOSE("Failed to set MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x for port %d\n",
++ P_VERBOSE("%s: Failed to set MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x for port %d\n",
++ dev->name,
+ (unsigned)npeMacAddr.macAddress[0],
+ (unsigned)npeMacAddr.macAddress[1],
+ (unsigned)npeMacAddr.macAddress[2],
+@@ -3267,6 +3270,8 @@ static int __devinit dev_eth_probe(struc
+ kmalloc(sizeof(struct semaphore), GFP_KERNEL);
+ if (!priv->maintenanceCheckThreadComplete)
+ {
++ P_ERROR("%s: Failed to allocate maintenance semaphore %d\n",
++ ndev->name, priv->port_id);
+ goto error;
+ }
+ priv->lock = SPIN_LOCK_UNLOCKED;
+@@ -3360,7 +3365,11 @@ static int __devinit dev_eth_probe(struc
+
+ #if IS_KERNEL26
+ if (register_netdev(ndev))
++ {
++ P_ERROR("%s: Failed to register netdevice %d\n",
++ ndev->name, priv->port_id);
+ goto error;
++ }
+ #else
+ found_devices++;
+ #endif /* IS_KERNEL26 */
+@@ -3370,6 +3379,8 @@ static int __devinit dev_eth_probe(struc
+ /* register EthAcc callbacks for this port */
+ if (dev_rxtxcallback_register(portId, (UINT32)ndev))
+ {
++ P_ERROR("%s: Failed to register callback %d\n",
++ ndev->name, priv->port_id);
+ goto error;
+ }
+
+@@ -3393,6 +3404,7 @@ static int __devinit dev_eth_probe(struc
+
+ /* Error handling: enter here whenever error detected */
+ error:
++ P_ERROR("%s: dev_eth_probe fails\n", ndev->name);
+ TRACE;
+
+ #ifdef CONFIG_IXP400_ETH_QDISC_ENABLED
+@@ -3465,21 +3477,21 @@ static int __devexit dev_eth_remove(int
+ {
+ if (IX_SUCCESS != ixNpeDlNpeStopAndReset(IX_NPEDL_NPEID_NPEA))
+ {
+- P_NOTICE("Error Halting NPE for Ethernet port %d!\n", portId);
++ P_NOTICE("%s: Error Halting NPE for Ethernet port %d!\n", ndev->name, portId);
+ }
+ }
+ if (default_npeImageId[portId] == IX_ETH_NPE_B_IMAGE_ID)
+ {
+ if (IX_SUCCESS != ixNpeDlNpeStopAndReset(IX_NPEDL_NPEID_NPEB))
+ {
+- P_NOTICE("Error Halting NPE for Ethernet port %d!\n", portId);
++ P_NOTICE("%s: Error Halting NPE for Ethernet port %d!\n", ndev->name, portId);
+ }
+ }
+ if (default_npeImageId[portId] == IX_ETH_NPE_C_IMAGE_ID)
+ {
+ if (IX_SUCCESS != ixNpeDlNpeStopAndReset(IX_NPEDL_NPEID_NPEC))
+ {
+- P_NOTICE("Error Halting NPE for Ethernet port %d!\n", portId);
++ P_NOTICE("%s: Error Halting NPE for Ethernet port %d!\n", ndev->name, portId);
+ }
+ }
+
+@@ -3528,6 +3540,9 @@ static int __init ixp400_eth_init(void)
+ TRACE;
+
+ P_INFO("Initializing IXP400 NPE Ethernet driver software v. " MOD_VERSION " \n");
++#ifdef IX_OSAL_ENSURE_ON
++ ixOsalLogLevelSet(IX_OSAL_LOG_LVL_ALL);
++#endif
+
+ TRACE;
+
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/device-name.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/device-name.patch
new file mode 100644
index 0000000000..492c9274fd
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/device-name.patch
@@ -0,0 +1,49 @@
+ register the ethernet devices as ethX
+
+ ixp400_eth.c | 12 +++---------
+ 1 files changed, 3 insertions(+), 9 deletions(-)
+
+Index: ixp400-eth-1.5.1-r0/ixp400_eth.c
+===================================================================
+--- ixp400-eth-1.5.1-r0.orig/ixp400_eth.c
++++ ixp400-eth-1.5.1-r0/ixp400_eth.c
+@@ -160,9 +160,6 @@
+ MODULE_PARM(dev_max_count, "i");
+ MODULE_PARM_DESC(dev_max_count, "Number of devices to initialize");
+
+-/* devices will be called ixp0 and ixp1 */
+-#define DEVICE_NAME "ixp"
+-
+ /* boolean values for PHY link speed, duplex, and autonegotiation */
+ #define PHY_SPEED_10 0
+ #define PHY_SPEED_100 1
+@@ -1579,7 +1576,7 @@
+ if (request_irq(IX_OSAL_IXP400_XSCALE_PMU_IRQ_LVL,
+ dev_pmu_timer_os_isr,
+ SA_SHIRQ,
+- DEVICE_NAME,
++ MODULE_NAME,
+ (void *)IRQ_ANY_PARAMETER))
+ {
+ P_ERROR("Failed to reassign irq to PMU timer interrupt!\n");
+@@ -3035,8 +3032,8 @@
+ if (port_id == IX_ETH_PORT_2) npe_id = "C";
+ if (port_id == IX_ETH_PORT_3) npe_id = "A";
+
+- P_INFO("%s%d is using NPE%s and the PHY at address %d\n",
+- DEVICE_NAME, port_id, npe_id, phyAddresses[port_id]);
++ P_INFO("ethernet %d is using NPE%s and the PHY at address %d\n",
++ dev_count, npe_id, phyAddresses[port_id]);
+
+ /* Set the MAC to the same duplex mode as the phy */
+ ixEthAccPortDuplexModeSet(port_id,
+@@ -3244,9 +3241,6 @@
+ /* set the private port ID */
+ priv->port_id = portId;
+
+- /* set device name */
+- sprintf(ndev->name, DEVICE_NAME"%d", priv->port_id);
+-
+ TRACE;
+
+ /* initialize RX pool */
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/int-random.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/int-random.patch
new file mode 100644
index 0000000000..fede9daf90
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/int-random.patch
@@ -0,0 +1,16 @@
+use the ethernet device interrupts to gather entropy
+
+ ixp400_eth.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
++++ ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
+@@ -2864,7 +2864,7 @@ static int qmgr_init(void)
+
+ if (request_irq(IX_OSAL_IXP400_QM1_IRQ_LVL,
+ dev_qmgr_os_isr,
+- SA_SHIRQ,
++ SA_SHIRQ | SA_SAMPLE_RANDOM,
+ MODULE_NAME,
+ (void *)IRQ_ANY_PARAMETER))
+ {
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/le.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/le.patch
new file mode 100644
index 0000000000..3d569015e6
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/le.patch
@@ -0,0 +1,41 @@
+little endian support
+
+ ixp400_eth.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+--- ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
++++ ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
+@@ -2040,6 +2040,16 @@ static void rx_cb(UINT32 callbackTag, IX
+ skb->tail = skb->data + len;
+ skb->len = len;
+
++#ifndef __ARMEB__
++ {
++ /* Byte swap all words containing data from the buffer. */
++ unsigned long *p = (unsigned long*)((unsigned)skb->data & ~0x3);
++ unsigned long *e = (unsigned long*)(((unsigned)skb->data + skb->len + 3) & ~0x3);
++ while (p < e)
++ *p = ntohl(*p), ++p;
++ }
++#endif
++
+ #ifdef DEBUG_DUMP
+ skb_dump("rx", skb);
+ #endif
+@@ -2431,6 +2441,16 @@ static int dev_hard_start_xmit(struct sk
+ return 0;
+ }
+
++#ifndef __ARMEB__
++ {
++ /* Byte swap all words containing data from the buffer. */
++ unsigned long *p = (unsigned long*)((unsigned)skb->data & ~0x3);
++ unsigned long *e = (unsigned long*)(((unsigned)skb->data + skb->len + 3) & ~0x3);
++ while (p < e)
++ *p = ntohl(*p), ++p;
++ }
++#endif
++
+ #ifdef DEBUG_DUMP
+ skb_dump("tx", skb);
+ #endif
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/mac-address.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/mac-address.patch
new file mode 100644
index 0000000000..e23eaf5f2b
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/mac-address.patch
@@ -0,0 +1,123 @@
+Patch to use maclist - get the MAC to use from the board level
+MAC repository based on the device portId.
+
+Signed-off-by: John Bowler <jbowler@acm.org>
+
+--- ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
++++ ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
+@@ -23,10 +23,10 @@
+ * This driver is written and optimized for Intel Xscale technology.
+ *
+ * SETUP NOTES:
+- * By default, this driver uses predefined MAC addresses.
+- * These are set in global var 'default_mac_addr' in this file.
+- * If required, these can be changed at run-time using
+- * the 'ifconfig' tool.
++ * By default, this driver uses MAC addresses from maclist, if
++ * these are not available the kernel api to randomly generate
++ * a locally assigned MAC address is used. The MAC can be
++ * overridden with ifconfig if absolutely necessary.
+ *
+ * Example - to set ixp0 MAC address to 00:02:B3:66:88:AA,
+ * run ifconfig with the following arguments:
+@@ -64,6 +64,7 @@
+ #include <linux/sysctl.h>
+ #include <linux/unistd.h>
+ #include <linux/version.h>
++#include <net/maclist.h>
+
+ #if KERNEL_VERSION(2,6,0) <= LINUX_VERSION_CODE
+ #include <linux/workqueue.h>
+@@ -130,6 +131,8 @@ static int dev_max_count = 1; /* only NP
+ static int dev_max_count = 2; /* only NPEB and NPEC */
+ #elif defined (CONFIG_ARCH_IXDP465) || defined(CONFIG_MACH_IXDP465)
+ static int dev_max_count = 3; /* all NPEs are used */
++#else
++static int dev_max_count = -1;/* use maclist_count */
+ #endif
+
+ #ifndef CONFIG_IXP400_NAPI
+@@ -614,21 +617,6 @@ static phy_cfg_t default_phy_cfg[] =
+ #endif
+ };
+
+-/* Default MAC addresses for EthAcc Ports 1 and 2 (using Intel MAC prefix)
+- * Default is
+- * IX_ETH_PORT_1 -> MAC 00:02:b3:01:01:01
+- * IX_ETH_PORT_2 -> MAC 00:02:b3:02:02:02
+- * IX_ETH_PORT_3 -> MAC 00:02:b3:03:03:03
+-*/
+-static IxEthAccMacAddr default_mac_addr[] =
+-{
+- {{0x00, 0x02, 0xB3, 0x01, 0x01, 0x01}} /* EthAcc Port 0 */
+- ,{{0x00, 0x02, 0xB3, 0x02, 0x02, 0x02}} /* EthAcc Port 1 */
+-#if defined (CONFIG_ARCH_IXDP465) || defined(CONFIG_MACH_IXDP465)
+- ,{{0x00, 0x02, 0xB3, 0x03, 0x03, 0x03}} /* EthAcc Port 2 */
+-#endif
+-};
+-
+ /* Default mapping of NpeImageIds for EthAcc Ports
+ * Default is
+ * IX_ETH_PORT_1 -> IX_ETH_NPE_B
+@@ -3325,28 +3313,10 @@ static int __devinit dev_eth_probe(struc
+
+ /* Defines the unicast MAC address
+ *
+- * Here is a good place to read a board-specific MAC address
+- * from a non-volatile memory, e.g. an external eeprom.
+- *
+- * This memcpy uses a default MAC address from this
+- * source code.
+- *
+- * This can be overriden later by the (optional) command
+- *
+- * ifconfig ixp0 ether 0002b3010101
+- *
++ * The code reads from the maclist API.
+ */
+-
+- memcpy(ndev->dev_addr,
+- &default_mac_addr[priv->port_id].macAddress,
+- IX_IEEE803_MAC_ADDRESS_SIZE);
+-
+- /* possibly remove this test and the message when a valid MAC address
+- * is not hardcoded in the driver source code.
+- */
+- if (is_valid_ether_addr(ndev->dev_addr))
+- {
+- P_WARN("Use default MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x for port %d\n",
++ maclist_read((u8(*)[6])&ndev->dev_addr, priv->port_id);
++ P_INFO("Use MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x for port %d\n",
+ (unsigned)ndev->dev_addr[0],
+ (unsigned)ndev->dev_addr[1],
+ (unsigned)ndev->dev_addr[2],
+@@ -3354,7 +3324,6 @@ static int __devinit dev_eth_probe(struc
+ (unsigned)ndev->dev_addr[4],
+ (unsigned)ndev->dev_addr[5],
+ priv->port_id);
+- }
+
+ /* Set/update the internal packet size
+ * This can be overriden later by the command
+@@ -3562,12 +3531,15 @@ static int __init ixp400_eth_init(void)
+
+ TRACE;
+
+- /* check module parameter range */
+- if (dev_max_count == 0 || dev_max_count > IX_ETH_ACC_NUMBER_OF_PORTS)
+- {
+- P_ERROR("Number of ports supported is dev_max_count <= %d\n", IX_ETH_ACC_NUMBER_OF_PORTS);
+- return -1;
+- }
++ /* fix dev_max_count to maclist_count - the actual number of
++ * available MACs
++ */
++ if (dev_max_count <= 0 || (dev_max_count > maclist_count() && maclist_count() > 0))
++ dev_max_count = maclist_count();
++ if (dev_max_count <= 0)
++ dev_max_count = 1;
++ else if (dev_max_count > IX_ETH_ACC_NUMBER_OF_PORTS)
++ dev_max_count = IX_ETH_ACC_NUMBER_OF_PORTS;
+
+ TRACE;
+
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/modprobe.conf b/packages/ixp425-eth/ixp400-eth-1.5.1/modprobe.conf
new file mode 100644
index 0000000000..f08b9a404c
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/modprobe.conf
@@ -0,0 +1,4 @@
+# Add an alias for eth0 to ixp400_eth to cause the S40networking
+# init script to load the ixp400_eth driver on the first boot
+alias eth0 ixp400_eth
+options ixp400_eth dev_max_count=1 \ No newline at end of file
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/module-param.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/module-param.patch
new file mode 100644
index 0000000000..c54c45d716
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/module-param.patch
@@ -0,0 +1,62 @@
+ ixp400_eth.c | 32 ++++++++++++++++++++++++++++++++
+ 1 files changed, 32 insertions(+)
+
+Index: ixp400_eth/ixp400_eth.c
+===================================================================
+--- ixp400_eth.orig/ixp400_eth.c
++++ ixp400_eth/ixp400_eth.c
+@@ -142,22 +142,54 @@
+
+ static int datapath_poll = 1; /* default : rx/tx polling, not interrupt driven*/
+
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
+ MODULE_PARM(ixp400_netdev_max_backlog, "i");
++#else
++module_param(ixp400_netdev_max_backlog, int, 0644);
++#endif
+ MODULE_PARM_DESC(ixp400_netdev_max_backlog, "Should be set to the value of /proc/sys/net/core/netdev_max_backlog (perf affecting)");
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
+ MODULE_PARM(datapath_poll, "i");
++#else
++module_param(datapath_poll, int, 0644);
++#endif
+ MODULE_PARM_DESC(datapath_poll, "If non-zero, use polling method for datapath instead of interrupts");
+ #endif /* CONFIG_IXP400_NAPI */
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
+ MODULE_PARM(npe_learning, "i");
++#else
++module_param(npe_learning, int, 0644);
++#endif
+ MODULE_PARM_DESC(npe_learning, "If non-zero, NPE MAC Address Learning & Filtering feature will be enabled");
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
+ MODULE_PARM(log_level, "i");
++#else
++module_param(log_level, int, 0644);
++#endif
+ MODULE_PARM_DESC(log_level, "Set log level: 0 - None, 1 - Verbose, 2 - Debug");
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
+ MODULE_PARM(no_ixp400_sw_init, "i");
++#else
++module_param(no_ixp400_sw_init, int, 0644);
++#endif
+ MODULE_PARM_DESC(no_ixp400_sw_init, "If non-zero, do not initialise Intel IXP400 Software Release core components");
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
+ MODULE_PARM(no_phy_scan, "i");
++#else
++module_param(no_phy_scan, int, 0644);
++#endif
+ MODULE_PARM_DESC(no_phy_scan, "If non-zero, use hard-coded phy addresses");
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
+ MODULE_PARM(phy_reset, "i");
++#else
++module_param(phy_reset, int, 0644);
++#endif
+ MODULE_PARM_DESC(phy_reset, "If non-zero, reset the phys");
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
+ MODULE_PARM(dev_max_count, "i");
++#else
++module_param(dev_max_count, int, 0644);
++#endif
+ MODULE_PARM_DESC(dev_max_count, "Number of devices to initialize");
+
+ /* boolean values for PHY link speed, duplex, and autonegotiation */
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/netdev_max_backlog.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/netdev_max_backlog.patch
new file mode 100644
index 0000000000..6891b6b4a9
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/netdev_max_backlog.patch
@@ -0,0 +1,54 @@
+--- ixp400_eth/ixp400_eth.c~ 2006-01-09 01:03:11.000000000 +1030
++++ ixp400_eth/ixp400_eth.c 2006-01-09 01:05:27.000000000 +1030
+@@ -139,12 +139,12 @@
+ * skbuf to push into the linux stack, and avoid the performance degradations
+ * during overflow.
+ */
+-static int netdev_max_backlog = 290;
++static int ixp400_netdev_max_backlog = 290;
+
+ static int datapath_poll = 1; /* default : rx/tx polling, not interrupt driven*/
+
+-MODULE_PARM(netdev_max_backlog, "i");
+-MODULE_PARM_DESC(netdev_max_backlog, "Should be set to the value of /proc/sys/net/core/netdev_max_backlog (perf affecting)");
++MODULE_PARM(ixp400_netdev_max_backlog, "i");
++MODULE_PARM_DESC(ixp400_netdev_max_backlog, "Should be set to the value of /proc/sys/net/core/netdev_max_backlog (perf affecting)");
+ MODULE_PARM(datapath_poll, "i");
+ MODULE_PARM_DESC(datapath_poll, "If non-zero, use polling method for datapath instead of interrupts");
+ #endif /* CONFIG_IXP400_NAPI */
+@@ -213,7 +213,7 @@
+ * high traffic rates. To measure the maximum throughput between the
+ * ports of the driver,
+ * - Modify /proc/sys/net/core/netdev_max_backlog value in the kernel
+- * - Adjust netdev_max_backlog=n in the driver's command line
++ * - Adjust ixp400_netdev_max_backlog=n in the driver's command line
+ * in order to get the best rates depending on the testing tool
+ * and the OS load.
+ *
+@@ -1997,7 +1997,7 @@
+ /* check if the system accepts more traffic and
+ * against chained mbufs
+ */
+- if ((qlevel < netdev_max_backlog)
++ if ((qlevel < ixp400_netdev_max_backlog)
+ && (IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR(mbuf) == NULL))
+ #else
+ /* check against chained mbufs
+@@ -3776,13 +3776,13 @@
+ #ifndef CONFIG_IXP400_NAPI
+ /* set the softirq rx queue thresholds
+ * (These numbers are based on tuning experiments)
+- * maxbacklog = (netdev_max_backlog * 10) / 63;
++ * maxbacklog = (ixp400_netdev_max_backlog * 10) / 63;
+ */
+- if (netdev_max_backlog == 0)
++ if (ixp400_netdev_max_backlog == 0)
+ {
+- netdev_max_backlog = 290; /* system default */
++ ixp400_netdev_max_backlog = 290; /* system default */
+ }
+- netdev_max_backlog /= BACKLOG_TUNE;
++ ixp400_netdev_max_backlog /= BACKLOG_TUNE;
+
+ TRACE;
+ #endif
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/params.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/params.patch
new file mode 100644
index 0000000000..86011deaaa
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/params.patch
@@ -0,0 +1,75 @@
+*** ixp/ixp400_eth.c.orig Wed Jun 7 21:31:59 2006
+--- ixp/ixp400_eth.c Fri Jun 9 14:55:18 2006
+***************
+*** 112,135 ****
+ #define MOD_VERSION "1.5"
+
+ /* Module parameters */
+! static int npe_learning = 1; /* default : NPE learning & filtering enable */
+! static int log_level = 0; /* default : no log */
+! static int no_ixp400_sw_init = 0; /* default : init core components of the IXP400 Software */
+! static int no_phy_scan = 0; /* default : do phy discovery */
+! static int phy_reset = 0; /* default : mo phy reset */
+
+ /* maximum number of ports supported by this driver ixp0, ixp1 ....
+ * The default is to configure all ports defined in EthAcc component
+ */
+ #ifdef CONFIG_IXP400_ETH_NPEC_ONLY
+! static int dev_max_count = 1; /* only NPEC is used */
+! #elif defined (CONFIG_IXP400_ETH_NPEB_ONLY)
+! static int dev_max_count = 1; /* only NPEB is used */
+ #elif defined (CONFIG_ARCH_IXDP425) || defined(CONFIG_ARCH_IXDPG425)\
+ || defined (CONFIG_ARCH_ADI_COYOTE)
+! static int dev_max_count = 2; /* only NPEB and NPEC */
+ #elif defined (CONFIG_ARCH_IXDP465) || defined(CONFIG_MACH_IXDP465)
+! static int dev_max_count = 3; /* all NPEs are used */
+ #endif
+
+ #ifndef CONFIG_IXP400_NAPI
+--- 112,136 ----
+ #define MOD_VERSION "1.5"
+
+ /* Module parameters */
+! /* gcc 4.1.1+kernel2.6.16 do not like it if these are static! */
+! int npe_learning = 1; /* default : NPE learning & filtering enable */
+! int log_level = 0; /* default : no log */
+! int no_ixp400_sw_init = 0; /* default : init core components of the IXP400 Software */
+! int no_phy_scan = 0; /* default : do phy discovery */
+! int phy_reset = 0; /* default : mo phy reset */
+
+ /* maximum number of ports supported by this driver ixp0, ixp1 ....
+ * The default is to configure all ports defined in EthAcc component
+ */
+ #ifdef CONFIG_IXP400_ETH_NPEC_ONLY
+! int dev_max_count = 1; /* only NPEC is used */
+! #elif defined (CONFIG_IXP400_ETH_NPEB_ONLY)
+! int dev_max_count = 1; /* only NPEB is used */
+ #elif defined (CONFIG_ARCH_IXDP425) || defined(CONFIG_ARCH_IXDPG425)\
+ || defined (CONFIG_ARCH_ADI_COYOTE)
+! int dev_max_count = 2; /* only NPEB and NPEC */
+ #elif defined (CONFIG_ARCH_IXDP465) || defined(CONFIG_MACH_IXDP465)
+! int dev_max_count = 3; /* all NPEs are used */
+ #endif
+
+ #ifndef CONFIG_IXP400_NAPI
+***************
+*** 138,146 ****
+ * skbuf to push into the linux stack, and avoid the performance degradations
+ * during overflow.
+ */
+! static int ixp400_netdev_max_backlog = 290;
+
+! static int datapath_poll = 1; /* default : rx/tx polling, not interrupt driven*/
+
+ MODULE_PARM(ixp400_netdev_max_backlog, "i");
+ MODULE_PARM_DESC(ixp400_netdev_max_backlog, "Should be set to the value of /proc/sys/net/core/netdev_max_backlog (perf affecting)");
+--- 139,147 ----
+ * skbuf to push into the linux stack, and avoid the performance degradations
+ * during overflow.
+ */
+! int ixp400_netdev_max_backlog = 290;
+
+! int datapath_poll = 1; /* default : rx/tx polling, not interrupt driven*/
+
+ MODULE_PARM(ixp400_netdev_max_backlog, "i");
+ MODULE_PARM_DESC(ixp400_netdev_max_backlog, "Should be set to the value of /proc/sys/net/core/netdev_max_backlog (perf affecting)");
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/poll-controller.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/poll-controller.patch
new file mode 100644
index 0000000000..64fb310ee5
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/poll-controller.patch
@@ -0,0 +1,50 @@
+poll controller support
+
+ ixp400_eth.c | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+--- ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
++++ ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
+@@ -348,6 +348,12 @@ static int dev_pmu_timer_init(void);
+ extern void
+ ixEthTxFrameDoneQMCallback(IxQMgrQId qId, IxQMgrCallbackId callbackId);
+
++#ifdef CONFIG_NET_POLL_CONTROLLER
++/* poll controller (needed for netconsole et al) */
++static void
++ixp425eth_poll_controller(struct net_device *dev);
++#endif
++
+ /* Private device data */
+ typedef struct {
+ spinlock_t lock; /* multicast management lock */
+@@ -3060,6 +3066,19 @@ static int set_mac_address(struct net_de
+ return 0;
+ }
+
++#ifdef CONFIG_NET_POLL_CONTROLLER
++/*
++ * Polling receive - used by netconsole and other diagnostic tools
++ * to allow network i/o with interrupts disabled.
++ * (stolen from 8139too.c by siddy)
++ */
++static void ixp425eth_poll_controller(struct net_device *dev)
++{
++ disable_irq(dev->irq);
++ dev_qmgr_os_isr(dev->irq, dev, NULL);
++ enable_irq(dev->irq);
++}
++#endif
+
+ /*
+ * TX QDISC
+@@ -3270,6 +3289,9 @@ static int __devinit dev_eth_probe(struc
+ ndev->get_stats = dev_get_stats;
+ ndev->set_multicast_list = dev_set_multicast_list;
+ ndev->flags |= IFF_MULTICAST;
++#ifdef CONFIG_NET_POLL_CONTROLLER
++ ndev->poll_controller = ixp425eth_poll_controller;
++#endif
+
+ ndev->set_mac_address = set_mac_address;
+
diff --git a/packages/ixp425-eth/ixp400-eth-1.5.1/stop-on-rmmod.patch b/packages/ixp425-eth/ixp400-eth-1.5.1/stop-on-rmmod.patch
new file mode 100644
index 0000000000..2ddc98938a
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth-1.5.1/stop-on-rmmod.patch
@@ -0,0 +1,29 @@
+devices must be explicitely stopped when
+the driver is going do be removed, otherwise
+it will simply hang.
+
+ ixp400_eth.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+--- ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
++++ ixp400-eth/ixp400_eth.c 1970-01-01 00:00:00.000000000 +0000
+@@ -3800,9 +3800,16 @@ void __exit ixp400_eth_exit(void)
+
+ TRACE;
+
+- /* We can only get here when the module use count is 0,
+- * so there's no need to stop devices.
+- */
++ /* stop devices */
++
++#if IS_KERNEL26
++ for (dev_count = 0;
++ dev_count < dev_max_count; /* module parameter */
++ dev_count++)
++ {
++ do_dev_stop(platform_get_drvdata(&ixp400_eth_devices[dev_count]));
++ }
++#endif
+
+ if (no_ixp400_sw_init == 0) /* module parameter */
+ {
diff --git a/packages/ixp425-eth/ixp400-eth_1.5.1.bb b/packages/ixp425-eth/ixp400-eth_1.5.1.bb
new file mode 100644
index 0000000000..fe9b166ded
--- /dev/null
+++ b/packages/ixp425-eth/ixp400-eth_1.5.1.bb
@@ -0,0 +1,87 @@
+DEFAULT_PREFERENCE = "-1"
+# This is the Intel GPL IXP4XX ethernet driver (Linux) plus patches
+# to make it work on 2.6 kernels.
+#
+MAINTAINER = "NSLU2 Linux <nslu2-linux@yahoogroups.com>"
+HOMEPAGE = "http://www.intel.com/design/network/products/npfamily/ixp420.htm"
+LICENSE = "GPL"
+PR = "r0"
+
+DEPENDS = "ixp-osal"
+DEPENDS = "ixp4xx-csr"
+RDEPENDS = "ixp4xx-csr"
+
+SRC_URI = "ftp://aiedownload.intel.com/df-support/9519/eng/GPL_ixp400LinuxEthernetDriverPatch-1_5_1.zip"
+SRC_URI += "file://2.6.14.patch;patch=1"
+SRC_URI += "file://2.6.15.patch;patch=1"
+SRC_URI += "file://device-name.patch;patch=1"
+SRC_URI += "file://poll-controller.patch;patch=1"
+SRC_URI += "file://le.patch;patch=1"
+SRC_URI += "file://int-random.patch;patch=1"
+SRC_URI += "file://stop-on-rmmod.patch;patch=1"
+SRC_URI += "file://continue-if-qmgr-init-fails.patch;patch=1"
+SRC_URI += "file://netdev_max_backlog.patch;patch=1"
+SRC_URI += "file://debug.patch;patch=1"
+SRC_URI += "file://Makefile.patch;patch=1"
+SRC_URI += "file://params.patch;patch=1"
+SRC_URI += "file://module-param.patch;patch=1"
+SRC_URI += "file://modprobe.conf"
+
+S = "${WORKDIR}"
+
+COMPATIBLE_HOST = "^arm.*-linux.*"
+
+PROVIDES = "virtual/ixp-eth"
+RPROVIDES = "ixp-eth"
+
+inherit module
+
+# This is a somewhat arbitrary choice:
+OSAL_DIR = "${STAGING_KERNEL_DIR}/ixp_osal"
+
+IX_TARGET = "linux${ARCH_BYTE_SEX}"
+IX_ENSURE = ""
+#IX_ENSURE = "-DIX_OSAL_ENSURE_ON=1"
+# The following controls the name of the ethernet devices which get
+# registered, the default (if this is empty) is ixp0, ixp1, otherwise
+# it is eth0, eth1
+DEVICE_NAME = "-DIX_DEVICE_NAME_ETH=1"
+
+IXP4XX_CSR_SYMVERS = "${STAGING_KERNEL_DIR}/ixp400-csr.symvers"
+
+EXTRA_OEMAKE = "'PWD=${S}' \
+ 'IX_TARGET=${IX_TARGET}' \
+ 'IXP4XX_CSR_DIR=${STAGING_INCDIR}/linux/ixp4xx-csr' \
+ 'IXP4XX_CSR_SYMVERS=${IXP4XX_CSR_SYMVERS}' \
+ 'OSAL_DIR=${OSAL_DIR}' \
+ 'IX_CFLAGS=-DIX_UTOPIAMODE=0 -DIX_MPHYSINGLEPORT=1 ${IX_ENSURE} ${DEVICE_NAME} -DIX_COMPONENT_NAME=-1' \
+ 'LINUX_SRC=${STAGING_KERNEL_DIR}' \
+ 'LINUX_CROSS_COMPILE=${HOST_PREFIX}' \
+ "
+
+# This is to check for unresolved symbol errors and ensure the build
+# fails, an error here probably means too much as been deconfigured
+# out of ixp4xx-csr.
+KCONFIG_FILE = "${STAGING_KERNEL_DIR}/kernel-config"
+do_compile_append () {
+ . '${KCONFIG_FILE}'
+ echo "MODPOST: checking that all symbols are resolved"
+ if '${STAGING_KERNEL_DIR}/scripts/mod/modpost' \
+ ${CONFIG_MODVERSIONS:+-m} \
+ ${CONFIG_MODULE_SRCVERSION_ALL:+-a} \
+ -i '${STAGING_KERNEL_DIR}/ixp400-csr.symvers' \
+ ixp400_eth.o 2>&1 | egrep .
+ then
+ echo "MODPOST errors - see above"
+ return 1
+ else
+ return 0
+ fi
+}
+
+do_install () {
+ install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net
+ install -m 0644 ixp400_eth.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net/
+ install -d ${D}${sysconfdir}/modprobe.d
+ install -m 0644 modprobe.conf ${D}${sysconfdir}/modprobe.d/eth0
+}