Changeset 919 for trunk/patches/2.6.22

Show
Ignore:
Timestamp:
10/11/07 05:24:05 (3 years ago)
Author:
gordon
Message:

Update IXP4XX network drivers to Krzysztof's latest version from git
(41068c53d4f18fbcec81739998ebb5955ac22cf9)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/patches/2.6.22/41-ixp4xx-net-drivers.patch

    r917 r919  
    4747+obj-$(CONFIG_IXP4XX_NPE)       += ixp4xx_npe.o 
    4848diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c 
    49 index c03adda..a1917bd 100644 
     49index ec4f079..aa58669 100644 
    5050--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c 
    5151+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c 
     
    834834diff --git a/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c b/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c 
    835835new file mode 100644 
    836 index 0000000..b9e9bd6 
     836index 0000000..4c6b36d 
    837837--- /dev/null 
    838838+++ b/arch/arm/mach-ixp4xx/ixp4xx_qmgr.c 
    839 @@ -0,0 +1,273 @@ 
     839@@ -0,0 +1,274 @@ 
    840840+/* 
    841841+ * Intel IXP4xx Queue Manager driver for Linux 
     
    848848+ */ 
    849849+ 
     850+#include <linux/ioport.h> 
    850851+#include <linux/interrupt.h> 
    851852+#include <linux/kernel.h> 
    852 +#include <asm/io.h> 
     853+#include <linux/module.h> 
    853854+#include <asm/arch/qmgr.h> 
    854855+ 
     
    11401141diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c 
    11411142new file mode 100644 
    1142 index 0000000..ed8c150 
     1143index 0000000..6ce609f 
    11431144--- /dev/null 
    11441145+++ b/drivers/net/arm/ixp4xx_eth.c 
    1145 @@ -0,0 +1,1217 @@ 
     1146@@ -0,0 +1,1258 @@ 
    11461147+/* 
    11471148+ * Intel IXP4xx Ethernet driver for Linux 
     
    12021203+#define MDIO_INTERVAL          (3 * HZ) 
    12031204+#define MAX_MDIO_RETRIES       100 /* microseconds, typically 30 cycles */ 
     1205+#define MAX_MII_RESET_RETRIES  100 /* mdio_read() cycles, typically 4 */ 
    12041206+#define MAX_CLOSE_WAIT         1000 /* microseconds, typically 2-3 cycles */ 
    12051207+ 
     
    13131315+       u32 desc_tab_phys; 
    13141316+       int id;                 /* logical port ID */ 
     1317+       u16 mii_bmcr; 
    13151318+}; 
    13161319+ 
     
    14561459+} 
    14571460+ 
     1461+static void phy_reset(struct net_device *dev, int phy_id) 
     1462+{ 
     1463+       struct port *port = netdev_priv(dev); 
     1464+       int cycles = 0; 
     1465+ 
     1466+       mdio_write(dev, phy_id, MII_BMCR, port->mii_bmcr | BMCR_RESET); 
     1467+        
     1468+       while (cycles < MAX_MII_RESET_RETRIES) { 
     1469+               if (!(mdio_read(dev, phy_id, MII_BMCR) & BMCR_RESET)) { 
     1470+#if DEBUG_MDIO 
     1471+                       printk(KERN_DEBUG "%s: phy_reset() took %i cycles\n", 
     1472+                              dev->name, cycles); 
     1473+#endif 
     1474+                       return; 
     1475+               } 
     1476+               udelay(1); 
     1477+               cycles++; 
     1478+       } 
     1479+ 
     1480+       printk(KERN_ERR "%s: MII reset failed\n", dev->name); 
     1481+} 
     1482+ 
    14581483+static void eth_set_duplex(struct port *port) 
    14591484+{ 
     
    14671492+ 
    14681493+ 
    1469 +static void mdio_thread(struct work_struct *work) 
    1470 +{ 
    1471 +       struct port *port = container_of(work, struct port, mdio_thread.work); 
    1472 + 
    1473 +       if (mii_check_media(&port->mii, 1, 0)) 
     1494+static void phy_check_media(struct port *port, int init) 
     1495+{ 
     1496+       if (mii_check_media(&port->mii, 1, init)) 
    14741497+               eth_set_duplex(port); 
    14751498+       if (port->mii.force_media) { /* mii_check_media() doesn't work */ 
     
    14781501+               int prev_link = netif_carrier_ok(dev); 
    14791502+ 
    1480 +               if (cur_link && !prev_link) { 
     1503+               if (!prev_link && cur_link) { 
    14811504+                       printk(KERN_INFO "%s: link up\n", dev->name); 
    14821505+                       netif_carrier_on(dev); 
     
    14861509+               } 
    14871510+       } 
     1511+} 
     1512+ 
     1513+ 
     1514+static void mdio_thread(struct work_struct *work) 
     1515+{ 
     1516+       struct port *port = container_of(work, struct port, mdio_thread.work); 
     1517+ 
     1518+       phy_check_media(port, 0); 
    14881519+       schedule_delayed_work(&port->mdio_thread, MDIO_INTERVAL); 
    14891520+} 
     
    20592090+       } 
    20602091+ 
     2092+       mdio_write(dev, port->plat->phy, MII_BMCR, port->mii_bmcr); 
     2093+ 
    20612094+       memset(&msg, 0, sizeof(msg)); 
    20622095+       msg.cmd = NPE_VLAN_SETRXQOSENTRY; 
     
    21222155+       __raw_writel(DEFAULT_RX_CNTRL0, &port->regs->rx_control[0]); 
    21232156+ 
    2124 +       if (mii_check_media(&port->mii, 1, 1)) 
    2125 +               eth_set_duplex(port); 
     2157+       phy_check_media(port, 1); 
    21262158+       eth_set_mcast_list(dev); 
    21272159+       netif_start_queue(dev); 
     
    22152247+                      dev->name); 
    22162248+ 
     2249+       port->mii_bmcr = mdio_read(dev, port->plat->phy, MII_BMCR) & 
     2250+               ~(BMCR_RESET | BMCR_PDOWN); /* may have been altered */ 
     2251+       mdio_write(dev, port->plat->phy, MII_BMCR, 
     2252+                  port->mii_bmcr | BMCR_PDOWN); 
     2253+ 
    22172254+       if (!ports_open) 
    22182255+               qmgr_disable_irq(TXDONE_QUEUE); 
     
    23032340+       port->mii.reg_num_mask = 0x1F; 
    23042341+ 
    2305 +       INIT_DELAYED_WORK(&port->mdio_thread, mdio_thread); 
    2306 + 
    23072342+       printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, 
    23082343+              npe_name(port->npe)); 
     2344+ 
     2345+       phy_reset(dev, plat->phy); 
     2346+       port->mii_bmcr = mdio_read(dev, plat->phy, MII_BMCR) & 
     2347+               ~(BMCR_RESET | BMCR_PDOWN); 
     2348+       mdio_write(dev, plat->phy, MII_BMCR, port->mii_bmcr | BMCR_PDOWN); 
     2349+ 
     2350+       INIT_DELAYED_WORK(&port->mdio_thread, mdio_thread); 
    23092351+       return 0; 
    23102352+