aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-03-20 12:46:26 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-20 12:46:26 -0400
commit61816596d1c9026d0ecb20c44f90452c41596ffe (patch)
tree3027ed6dc62f71e14b9d525405747fa0eb8f074d /drivers/net/ethernet
parent23a9072e3af0d9538e25837fb2b56bb94e4a8e67 (diff)
parentda2191e31409d1058dcbed44e8f53e39a40e86b3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull in the 'net' tree to get Daniel Borkmann's flow dissector infrastructure change. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c1
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h3
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c8
-rw-r--r--drivers/net/ethernet/dec/tulip/Kconfig1
-rw-r--r--drivers/net/ethernet/freescale/fec.c33
-rw-r--r--drivers/net/ethernet/freescale/fec.h1
-rw-r--r--drivers/net/ethernet/nxp/lpc_eth.c3
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c10
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.h1
-rw-r--r--drivers/net/ethernet/sfc/nic.c3
-rw-r--r--drivers/net/ethernet/ti/cpsw.c2
-rw-r--r--drivers/net/ethernet/ti/davinci_emac.c2
12 files changed, 49 insertions, 19 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 8091de70a539..db6912b09997 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2761,6 +2761,7 @@ load_error2:
2761 bp->port.pmf = 0; 2761 bp->port.pmf = 0;
2762load_error1: 2762load_error1:
2763 bnx2x_napi_disable(bp); 2763 bnx2x_napi_disable(bp);
2764 bnx2x_del_all_napi(bp);
2764 2765
2765 /* clear pf_load status, as it was already set */ 2766 /* clear pf_load status, as it was already set */
2766 if (IS_PF(bp)) 2767 if (IS_PF(bp))
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
index 364e37ecbc5c..198f6f1c9ad5 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h
@@ -459,8 +459,9 @@ struct bnx2x_fw_port_stats_old {
459 459
460#define UPDATE_QSTAT(s, t) \ 460#define UPDATE_QSTAT(s, t) \
461 do { \ 461 do { \
462 qstats->t##_hi = qstats_old->t##_hi + le32_to_cpu(s.hi); \
463 qstats->t##_lo = qstats_old->t##_lo + le32_to_cpu(s.lo); \ 462 qstats->t##_lo = qstats_old->t##_lo + le32_to_cpu(s.lo); \
463 qstats->t##_hi = qstats_old->t##_hi + le32_to_cpu(s.hi) \
464 + ((qstats->t##_lo < qstats_old->t##_lo) ? 1 : 0); \
464 } while (0) 465 } while (0)
465 466
466#define UPDATE_QSTAT_OLD(f) \ 467#define UPDATE_QSTAT_OLD(f) \
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 7794883f5973..dea7d7d1f730 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -4271,6 +4271,14 @@ static void tg3_phy_copper_begin(struct tg3 *tp)
4271 tp->link_config.active_speed = tp->link_config.speed; 4271 tp->link_config.active_speed = tp->link_config.speed;
4272 tp->link_config.active_duplex = tp->link_config.duplex; 4272 tp->link_config.active_duplex = tp->link_config.duplex;
4273 4273
4274 if (tg3_asic_rev(tp) == ASIC_REV_5714) {
4275 /* With autoneg disabled, 5715 only links up when the
4276 * advertisement register has the configured speed
4277 * enabled.
4278 */
4279 tg3_writephy(tp, MII_ADVERTISE, ADVERTISE_ALL);
4280 }
4281
4274 bmcr = 0; 4282 bmcr = 0;
4275 switch (tp->link_config.speed) { 4283 switch (tp->link_config.speed) {
4276 default: 4284 default:
diff --git a/drivers/net/ethernet/dec/tulip/Kconfig b/drivers/net/ethernet/dec/tulip/Kconfig
index 0c37fb2cc867..1df33c799c00 100644
--- a/drivers/net/ethernet/dec/tulip/Kconfig
+++ b/drivers/net/ethernet/dec/tulip/Kconfig
@@ -108,6 +108,7 @@ config TULIP_DM910X
108config DE4X5 108config DE4X5
109 tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA" 109 tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA"
110 depends on (PCI || EISA) 110 depends on (PCI || EISA)
111 depends on VIRT_TO_BUS || ALPHA || PPC || SPARC
111 select CRC32 112 select CRC32
112 ---help--- 113 ---help---
113 This is support for the DIGITAL series of PCI/EISA Ethernet cards. 114 This is support for the DIGITAL series of PCI/EISA Ethernet cards.
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 69a4adedad83..186222ef1012 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -931,24 +931,28 @@ static void fec_enet_adjust_link(struct net_device *ndev)
931 goto spin_unlock; 931 goto spin_unlock;
932 } 932 }
933 933
934 /* Duplex link change */
935 if (phy_dev->link) { 934 if (phy_dev->link) {
936 if (fep->full_duplex != phy_dev->duplex) { 935 if (!fep->link) {
937 fec_restart(ndev, phy_dev->duplex);
938 /* prevent unnecessary second fec_restart() below */
939 fep->link = phy_dev->link; 936 fep->link = phy_dev->link;
940 status_change = 1; 937 status_change = 1;
941 } 938 }
942 }
943 939
944 /* Link on or off change */ 940 if (fep->full_duplex != phy_dev->duplex)
945 if (phy_dev->link != fep->link) { 941 status_change = 1;
946 fep->link = phy_dev->link; 942
947 if (phy_dev->link) 943 if (phy_dev->speed != fep->speed) {
944 fep->speed = phy_dev->speed;
945 status_change = 1;
946 }
947
948 /* if any of the above changed restart the FEC */
949 if (status_change)
948 fec_restart(ndev, phy_dev->duplex); 950 fec_restart(ndev, phy_dev->duplex);
949 else 951 } else {
952 if (fep->link) {
950 fec_stop(ndev); 953 fec_stop(ndev);
951 status_change = 1; 954 status_change = 1;
955 }
952 } 956 }
953 957
954spin_unlock: 958spin_unlock:
@@ -1325,7 +1329,7 @@ static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
1325static void fec_enet_free_buffers(struct net_device *ndev) 1329static void fec_enet_free_buffers(struct net_device *ndev)
1326{ 1330{
1327 struct fec_enet_private *fep = netdev_priv(ndev); 1331 struct fec_enet_private *fep = netdev_priv(ndev);
1328 int i; 1332 unsigned int i;
1329 struct sk_buff *skb; 1333 struct sk_buff *skb;
1330 struct bufdesc *bdp; 1334 struct bufdesc *bdp;
1331 1335
@@ -1349,7 +1353,7 @@ static void fec_enet_free_buffers(struct net_device *ndev)
1349static int fec_enet_alloc_buffers(struct net_device *ndev) 1353static int fec_enet_alloc_buffers(struct net_device *ndev)
1350{ 1354{
1351 struct fec_enet_private *fep = netdev_priv(ndev); 1355 struct fec_enet_private *fep = netdev_priv(ndev);
1352 int i; 1356 unsigned int i;
1353 struct sk_buff *skb; 1357 struct sk_buff *skb;
1354 struct bufdesc *bdp; 1358 struct bufdesc *bdp;
1355 1359
@@ -1434,6 +1438,7 @@ fec_enet_close(struct net_device *ndev)
1434 struct fec_enet_private *fep = netdev_priv(ndev); 1438 struct fec_enet_private *fep = netdev_priv(ndev);
1435 1439
1436 /* Don't know what to do yet. */ 1440 /* Don't know what to do yet. */
1441 napi_disable(&fep->napi);
1437 fep->opened = 0; 1442 fep->opened = 0;
1438 netif_stop_queue(ndev); 1443 netif_stop_queue(ndev);
1439 fec_stop(ndev); 1444 fec_stop(ndev);
@@ -1590,7 +1595,7 @@ static int fec_enet_init(struct net_device *ndev)
1590 struct fec_enet_private *fep = netdev_priv(ndev); 1595 struct fec_enet_private *fep = netdev_priv(ndev);
1591 struct bufdesc *cbd_base; 1596 struct bufdesc *cbd_base;
1592 struct bufdesc *bdp; 1597 struct bufdesc *bdp;
1593 int i; 1598 unsigned int i;
1594 1599
1595 /* Allocate memory for buffer descriptors. */ 1600 /* Allocate memory for buffer descriptors. */
1596 cbd_base = dma_alloc_coherent(NULL, PAGE_SIZE, &fep->bd_dma, 1601 cbd_base = dma_alloc_coherent(NULL, PAGE_SIZE, &fep->bd_dma,
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index f5390071efd0..eb4372962839 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -240,6 +240,7 @@ struct fec_enet_private {
240 phy_interface_t phy_interface; 240 phy_interface_t phy_interface;
241 int link; 241 int link;
242 int full_duplex; 242 int full_duplex;
243 int speed;
243 struct completion mdio_done; 244 struct completion mdio_done;
244 int irq[FEC_IRQ_NUM]; 245 int irq[FEC_IRQ_NUM];
245 int bufdesc_ex; 246 int bufdesc_ex;
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index 9c88c00c0a42..89d1b0eadf3c 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1470,7 +1470,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
1470 } 1470 }
1471 platform_set_drvdata(pdev, ndev); 1471 platform_set_drvdata(pdev, ndev);
1472 1472
1473 if (lpc_mii_init(pldat) != 0) 1473 ret = lpc_mii_init(pldat);
1474 if (ret)
1474 goto err_out_unregister_netdev; 1475 goto err_out_unregister_netdev;
1475 1476
1476 netdev_info(ndev, "LPC mac at 0x%08x irq %d\n", 1477 netdev_info(ndev, "LPC mac at 0x%08x irq %d\n",
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 7a6471d87300..56884c4cd90b 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2215,6 +2215,7 @@ static void sh_eth_tsu_init(struct sh_eth_private *mdp)
2215/* MDIO bus release function */ 2215/* MDIO bus release function */
2216static int sh_mdio_release(struct net_device *ndev) 2216static int sh_mdio_release(struct net_device *ndev)
2217{ 2217{
2218 struct sh_eth_private *mdp = netdev_priv(ndev);
2218 struct mii_bus *bus = dev_get_drvdata(&ndev->dev); 2219 struct mii_bus *bus = dev_get_drvdata(&ndev->dev);
2219 2220
2220 /* unregister mdio bus */ 2221 /* unregister mdio bus */
@@ -2229,6 +2230,9 @@ static int sh_mdio_release(struct net_device *ndev)
2229 /* free bitbang info */ 2230 /* free bitbang info */
2230 free_mdio_bitbang(bus); 2231 free_mdio_bitbang(bus);
2231 2232
2233 /* free bitbang memory */
2234 kfree(mdp->bitbang);
2235
2232 return 0; 2236 return 0;
2233} 2237}
2234 2238
@@ -2257,6 +2261,7 @@ static int sh_mdio_init(struct net_device *ndev, int id,
2257 bitbang->ctrl.ops = &bb_ops; 2261 bitbang->ctrl.ops = &bb_ops;
2258 2262
2259 /* MII controller setting */ 2263 /* MII controller setting */
2264 mdp->bitbang = bitbang;
2260 mdp->mii_bus = alloc_mdio_bitbang(&bitbang->ctrl); 2265 mdp->mii_bus = alloc_mdio_bitbang(&bitbang->ctrl);
2261 if (!mdp->mii_bus) { 2266 if (!mdp->mii_bus) {
2262 ret = -ENOMEM; 2267 ret = -ENOMEM;
@@ -2436,6 +2441,11 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
2436 } 2441 }
2437 mdp->tsu_addr = ioremap(rtsu->start, 2442 mdp->tsu_addr = ioremap(rtsu->start,
2438 resource_size(rtsu)); 2443 resource_size(rtsu));
2444 if (mdp->tsu_addr == NULL) {
2445 ret = -ENOMEM;
2446 dev_err(&pdev->dev, "TSU ioremap failed.\n");
2447 goto out_release;
2448 }
2439 mdp->port = devno % 2; 2449 mdp->port = devno % 2;
2440 ndev->features = NETIF_F_HW_VLAN_FILTER; 2450 ndev->features = NETIF_F_HW_VLAN_FILTER;
2441 } 2451 }
diff --git a/drivers/net/ethernet/renesas/sh_eth.h b/drivers/net/ethernet/renesas/sh_eth.h
index bae84fd2e73a..e6655678458e 100644
--- a/drivers/net/ethernet/renesas/sh_eth.h
+++ b/drivers/net/ethernet/renesas/sh_eth.h
@@ -705,6 +705,7 @@ struct sh_eth_private {
705 const u16 *reg_offset; 705 const u16 *reg_offset;
706 void __iomem *addr; 706 void __iomem *addr;
707 void __iomem *tsu_addr; 707 void __iomem *tsu_addr;
708 struct bb_info *bitbang;
708 u32 num_rx_ring; 709 u32 num_rx_ring;
709 u32 num_tx_ring; 710 u32 num_tx_ring;
710 dma_addr_t rx_desc_dma; 711 dma_addr_t rx_desc_dma;
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c
index 7b87798409cc..b0503cd8c2a0 100644
--- a/drivers/net/ethernet/sfc/nic.c
+++ b/drivers/net/ethernet/sfc/nic.c
@@ -376,7 +376,8 @@ efx_may_push_tx_desc(struct efx_tx_queue *tx_queue, unsigned int write_count)
376 return false; 376 return false;
377 377
378 tx_queue->empty_read_count = 0; 378 tx_queue->empty_read_count = 0;
379 return ((empty_read_count ^ write_count) & ~EFX_EMPTY_COUNT_VALID) == 0; 379 return ((empty_read_count ^ write_count) & ~EFX_EMPTY_COUNT_VALID) == 0
380 && tx_queue->write_count - write_count == 1;
380} 381}
381 382
382/* For each entry inserted into the software descriptor ring, create a 383/* For each entry inserted into the software descriptor ring, create a
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 8ff1d3dde778..5ceaa4c3cfa5 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1006,7 +1006,7 @@ static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb,
1006 /* If there is no more tx desc left free then we need to 1006 /* If there is no more tx desc left free then we need to
1007 * tell the kernel to stop sending us tx frames. 1007 * tell the kernel to stop sending us tx frames.
1008 */ 1008 */
1009 if (unlikely(cpdma_check_free_tx_desc(priv->txch))) 1009 if (unlikely(!cpdma_check_free_tx_desc(priv->txch)))
1010 netif_stop_queue(ndev); 1010 netif_stop_queue(ndev);
1011 1011
1012 return NETDEV_TX_OK; 1012 return NETDEV_TX_OK;
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 52c05366599a..ae1b77aa199f 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1102,7 +1102,7 @@ static int emac_dev_xmit(struct sk_buff *skb, struct net_device *ndev)
1102 /* If there is no more tx desc left free then we need to 1102 /* If there is no more tx desc left free then we need to
1103 * tell the kernel to stop sending us tx frames. 1103 * tell the kernel to stop sending us tx frames.
1104 */ 1104 */
1105 if (unlikely(cpdma_check_free_tx_desc(priv->txchan))) 1105 if (unlikely(!cpdma_check_free_tx_desc(priv->txchan)))
1106 netif_stop_queue(ndev); 1106 netif_stop_queue(ndev);
1107 1107
1108 return NETDEV_TX_OK; 1108 return NETDEV_TX_OK;