aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAyaz Abdulla <aabdulla@nvidia.com>2008-02-04 15:14:04 -0500
committerJeff Garzik <jeff@garzik.org>2008-02-06 06:41:45 -0500
commiteb79842838b6a3860d70be404fbb6e3b8f2a65de (patch)
tree4441f807846a047d2db0669cbb20ad5ab8aca91e /drivers/net
parentb2976d23a15aac11e8e77a496108b9f4040fac4d (diff)
forcedeth: phy status fix
The driver needs to ack only the phy status bits that it is currently handling and preserve the other bits for the other handlers. For example, when reading/writing from the phy, it should not clear the link change interrupt bit. This will cause a missing link change interrupt. Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/forcedeth.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 6e47b1103cd2..6d5cd94f33ae 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -323,8 +323,8 @@ enum {
323 NvRegMIIStatus = 0x180, 323 NvRegMIIStatus = 0x180,
324#define NVREG_MIISTAT_ERROR 0x0001 324#define NVREG_MIISTAT_ERROR 0x0001
325#define NVREG_MIISTAT_LINKCHANGE 0x0008 325#define NVREG_MIISTAT_LINKCHANGE 0x0008
326#define NVREG_MIISTAT_MASK 0x000f 326#define NVREG_MIISTAT_MASK_RW 0x0007
327#define NVREG_MIISTAT_MASK2 0x000f 327#define NVREG_MIISTAT_MASK_ALL 0x000f
328 NvRegMIIMask = 0x184, 328 NvRegMIIMask = 0x184,
329#define NVREG_MII_LINKCHANGE 0x0008 329#define NVREG_MII_LINKCHANGE 0x0008
330 330
@@ -1064,7 +1064,7 @@ static int mii_rw(struct net_device *dev, int addr, int miireg, int value)
1064 u32 reg; 1064 u32 reg;
1065 int retval; 1065 int retval;
1066 1066
1067 writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus); 1067 writel(NVREG_MIISTAT_MASK_RW, base + NvRegMIIStatus);
1068 1068
1069 reg = readl(base + NvRegMIIControl); 1069 reg = readl(base + NvRegMIIControl);
1070 if (reg & NVREG_MIICTL_INUSE) { 1070 if (reg & NVREG_MIICTL_INUSE) {
@@ -2995,7 +2995,7 @@ static void nv_link_irq(struct net_device *dev)
2995 u32 miistat; 2995 u32 miistat;
2996 2996
2997 miistat = readl(base + NvRegMIIStatus); 2997 miistat = readl(base + NvRegMIIStatus);
2998 writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus); 2998 writel(NVREG_MIISTAT_LINKCHANGE, base + NvRegMIIStatus);
2999 dprintk(KERN_INFO "%s: link change irq, status 0x%x.\n", dev->name, miistat); 2999 dprintk(KERN_INFO "%s: link change irq, status 0x%x.\n", dev->name, miistat);
3000 3000
3001 if (miistat & (NVREG_MIISTAT_LINKCHANGE)) 3001 if (miistat & (NVREG_MIISTAT_LINKCHANGE))
@@ -4870,7 +4870,7 @@ static int nv_open(struct net_device *dev)
4870 4870
4871 writel(0, base + NvRegMIIMask); 4871 writel(0, base + NvRegMIIMask);
4872 writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus); 4872 writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
4873 writel(NVREG_MIISTAT_MASK2, base + NvRegMIIStatus); 4873 writel(NVREG_MIISTAT_MASK_ALL, base + NvRegMIIStatus);
4874 4874
4875 writel(NVREG_MISC1_FORCE | NVREG_MISC1_HD, base + NvRegMisc1); 4875 writel(NVREG_MISC1_FORCE | NVREG_MISC1_HD, base + NvRegMisc1);
4876 writel(readl(base + NvRegTransmitterStatus), base + NvRegTransmitterStatus); 4876 writel(readl(base + NvRegTransmitterStatus), base + NvRegTransmitterStatus);
@@ -4908,7 +4908,7 @@ static int nv_open(struct net_device *dev)
4908 4908
4909 nv_disable_hw_interrupts(dev, np->irqmask); 4909 nv_disable_hw_interrupts(dev, np->irqmask);
4910 pci_push(base); 4910 pci_push(base);
4911 writel(NVREG_MIISTAT_MASK2, base + NvRegMIIStatus); 4911 writel(NVREG_MIISTAT_MASK_ALL, base + NvRegMIIStatus);
4912 writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus); 4912 writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
4913 pci_push(base); 4913 pci_push(base);
4914 4914
@@ -4931,7 +4931,7 @@ static int nv_open(struct net_device *dev)
4931 { 4931 {
4932 u32 miistat; 4932 u32 miistat;
4933 miistat = readl(base + NvRegMIIStatus); 4933 miistat = readl(base + NvRegMIIStatus);
4934 writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus); 4934 writel(NVREG_MIISTAT_MASK_ALL, base + NvRegMIIStatus);
4935 dprintk(KERN_INFO "startup: got 0x%08x.\n", miistat); 4935 dprintk(KERN_INFO "startup: got 0x%08x.\n", miistat);
4936 } 4936 }
4937 /* set linkspeed to invalid value, thus force nv_update_linkspeed 4937 /* set linkspeed to invalid value, thus force nv_update_linkspeed
@@ -5299,7 +5299,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5299 phystate &= ~NVREG_ADAPTCTL_RUNNING; 5299 phystate &= ~NVREG_ADAPTCTL_RUNNING;
5300 writel(phystate, base + NvRegAdapterControl); 5300 writel(phystate, base + NvRegAdapterControl);
5301 } 5301 }
5302 writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus); 5302 writel(NVREG_MIISTAT_MASK_ALL, base + NvRegMIIStatus);
5303 5303
5304 if (id->driver_data & DEV_HAS_MGMT_UNIT) { 5304 if (id->driver_data & DEV_HAS_MGMT_UNIT) {
5305 /* management unit running on the mac? */ 5305 /* management unit running on the mac? */