From 07c8d2aad7db8c649a49a22f713f83e6f24b8edd Mon Sep 17 00:00:00 2001 From: Guo-Fu Tseng Date: Fri, 27 Feb 2009 17:54:07 +0000 Subject: jme: Modifies messages to display correct hardware version This patch modifies messages to display correct hardware version. Signed-off-by: Guo-Fu Tseng Signed-off-by: David S. Miller --- drivers/net/jme.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/net/jme.c') diff --git a/drivers/net/jme.c b/drivers/net/jme.c index 08b34051c64..60cb99744d0 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c @@ -2856,7 +2856,11 @@ jme_init_one(struct pci_dev *pdev, goto err_out_free_shadow; } - msg_probe(jme, "JMC250 gigabit%s ver:%x rev:%x macaddr:%pM\n", + msg_probe(jme, "%s%s ver:%x rev:%x macaddr:%pM\n", + (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC250) ? + "JMC250 Gigabit Ethernet" : + (jme->pdev->device == PCI_DEVICE_ID_JMICRON_JMC260) ? + "JMC260 Fast Ethernet" : "Unknown", (jme->fpgaver != 0) ? " (FPGA)" : "", (jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev, jme->rev, netdev->dev_addr); @@ -3002,7 +3006,7 @@ static struct pci_driver jme_driver = { static int __init jme_init_module(void) { - printk(KERN_INFO PFX "JMicron JMC250 gigabit ethernet " + printk(KERN_INFO PFX "JMicron JMC2XX ethernet " "driver version %s\n", DRV_VERSION); return pci_register_driver(&jme_driver); } -- cgit v1.2.3 From 7f7fd2da92b4ce20f55d3b7615089cf8e04cfffc Mon Sep 17 00:00:00 2001 From: Guo-Fu Tseng Date: Fri, 27 Feb 2009 17:57:01 +0000 Subject: jme: Fix pci sync We should sync ring descriptor to pci device after modifying it. Signed-off-by: Guo-Fu Tseng Signed-off-by: David S. Miller --- drivers/net/jme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/net/jme.c') diff --git a/drivers/net/jme.c b/drivers/net/jme.c index 60cb99744d0..f65a09c363e 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c @@ -1833,7 +1833,7 @@ jme_tx_vlan(struct sk_buff *skb, __le16 *vlan, u8 *flags) } static int -jme_fill_first_tx_desc(struct jme_adapter *jme, struct sk_buff *skb, int idx) +jme_fill_tx_desc(struct jme_adapter *jme, struct sk_buff *skb, int idx) { struct jme_ring *txring = jme->txring; struct txdesc *txdesc; @@ -1863,6 +1863,7 @@ jme_fill_first_tx_desc(struct jme_adapter *jme, struct sk_buff *skb, int idx) if (jme_tx_tso(skb, &txdesc->desc1.mss, &flags)) jme_tx_csum(jme, skb, &flags); jme_tx_vlan(skb, &txdesc->desc1.vlan, &flags); + jme_map_tx_skb(jme, skb, idx); txdesc->desc1.flags = flags; /* * Set tx buffer info after telling NIC to send @@ -1932,8 +1933,7 @@ jme_start_xmit(struct sk_buff *skb, struct net_device *netdev) return NETDEV_TX_BUSY; } - jme_map_tx_skb(jme, skb, idx); - jme_fill_first_tx_desc(jme, skb, idx); + jme_fill_tx_desc(jme, skb, idx); jwrite32(jme, JME_TXCS, jme->reg_txcs | TXCS_SELECT_QUEUE0 | -- cgit v1.2.3 From eb352b838d42e66f0267c40249798ffda3c63037 Mon Sep 17 00:00:00 2001 From: Guo-Fu Tseng Date: Fri, 27 Feb 2009 17:58:16 +0000 Subject: jme: Clear all modified GHC register flags Clear all modified GHC register flags. Fixed-by: Ethan Hsiao Signed-off-by: Guo-Fu Tseng Signed-off-by: David S. Miller --- drivers/net/jme.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/net/jme.c') diff --git a/drivers/net/jme.c b/drivers/net/jme.c index f65a09c363e..47dd47fd0ac 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c @@ -429,10 +429,9 @@ jme_check_link(struct net_device *netdev, int testonly) jme->phylink = phylink; - ghc = jme->reg_ghc & ~(GHC_SPEED_10M | - GHC_SPEED_100M | - GHC_SPEED_1000M | - GHC_DPX); + ghc = jme->reg_ghc & ~(GHC_SPEED | GHC_DPX | + GHC_TO_CLK_PCIE | GHC_TXMAC_CLK_PCIE | + GHC_TO_CLK_GPHY | GHC_TXMAC_CLK_GPHY); switch (phylink & PHY_LINK_SPEED_MASK) { case PHY_LINK_SPEED_10M: ghc |= GHC_SPEED_10M | -- cgit v1.2.3 From 814c01dc7c533033b4e99981a2e24a6195bfb43c Mon Sep 17 00:00:00 2001 From: Guo-Fu Tseng Date: Fri, 27 Feb 2009 17:59:44 +0000 Subject: jme: Adding {64,40}bits DMA mask back All JMC250 chips have no problem with higher bits support. Adding it back. Found-by: Ethan Hsiao Signed-off-by: Guo-Fu Tseng Signed-off-by: David S. Miller --- drivers/net/jme.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/net/jme.c') diff --git a/drivers/net/jme.c b/drivers/net/jme.c index 47dd47fd0ac..4da81a3602d 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c @@ -2589,6 +2589,16 @@ static const struct ethtool_ops jme_ethtool_ops = { static int jme_pci_dma64(struct pci_dev *pdev) { + if (pdev->device == PCI_DEVICE_ID_JMICRON_JMC250 && + !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) + if (!pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK)) + return 1; + + if (pdev->device == PCI_DEVICE_ID_JMICRON_JMC250 && + !pci_set_dma_mask(pdev, DMA_40BIT_MASK)) + if (!pci_set_consistent_dma_mask(pdev, DMA_40BIT_MASK)) + return 1; + if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) if (!pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK)) return 0; -- cgit v1.2.3 From 858b9ced6e73a0f087294c398a1ae70a7eeed94f Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Wed, 4 Mar 2009 00:11:42 -0800 Subject: net: more timeouts that reach -1 with while (timeout-- > 0); timeout reaches -1 after the loop, so the tests below are off by one. also don't do an '< 0' test on an unsigned. Signed-off-by: Roel Kluin Signed-off-by: David S. Miller --- drivers/net/jme.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/net/jme.c') diff --git a/drivers/net/jme.c b/drivers/net/jme.c index 08b34051c64..a6e1a35a13c 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c @@ -957,13 +957,14 @@ jme_process_receive(struct jme_adapter *jme, int limit) goto out_inc; i = atomic_read(&rxring->next_to_clean); - while (limit-- > 0) { + while (limit > 0) { rxdesc = rxring->desc; rxdesc += i; if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) || !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) goto out; + --limit; desccnt = rxdesc->descwb.desccnt & RXWBDCNT_DCNT; -- cgit v1.2.3