diff options
Diffstat (limited to 'drivers/net/ethernet/freescale/fec_main.c')
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 50bb71c663e2..03a351300013 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/ioport.h> | 29 | #include <linux/ioport.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/interrupt.h> | 31 | #include <linux/interrupt.h> |
32 | #include <linux/init.h> | ||
33 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
34 | #include <linux/netdevice.h> | 33 | #include <linux/netdevice.h> |
35 | #include <linux/etherdevice.h> | 34 | #include <linux/etherdevice.h> |
@@ -390,12 +389,6 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
390 | netdev_err(ndev, "Tx DMA memory map failed\n"); | 389 | netdev_err(ndev, "Tx DMA memory map failed\n"); |
391 | return NETDEV_TX_OK; | 390 | return NETDEV_TX_OK; |
392 | } | 391 | } |
393 | /* Send it on its way. Tell FEC it's ready, interrupt when done, | ||
394 | * it's the last BD of the frame, and to put the CRC on the end. | ||
395 | */ | ||
396 | status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR | ||
397 | | BD_ENET_TX_LAST | BD_ENET_TX_TC); | ||
398 | bdp->cbd_sc = status; | ||
399 | 392 | ||
400 | if (fep->bufdesc_ex) { | 393 | if (fep->bufdesc_ex) { |
401 | 394 | ||
@@ -417,6 +410,13 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
417 | } | 410 | } |
418 | } | 411 | } |
419 | 412 | ||
413 | /* Send it on its way. Tell FEC it's ready, interrupt when done, | ||
414 | * it's the last BD of the frame, and to put the CRC on the end. | ||
415 | */ | ||
416 | status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR | ||
417 | | BD_ENET_TX_LAST | BD_ENET_TX_TC); | ||
418 | bdp->cbd_sc = status; | ||
419 | |||
420 | bdp_pre = fec_enet_get_prevdesc(bdp, fep); | 420 | bdp_pre = fec_enet_get_prevdesc(bdp, fep); |
421 | if ((id_entry->driver_data & FEC_QUIRK_ERR006358) && | 421 | if ((id_entry->driver_data & FEC_QUIRK_ERR006358) && |
422 | !(bdp_pre->cbd_sc & BD_ENET_TX_READY)) { | 422 | !(bdp_pre->cbd_sc & BD_ENET_TX_READY)) { |
@@ -528,13 +528,6 @@ fec_restart(struct net_device *ndev, int duplex) | |||
528 | /* Clear any outstanding interrupt. */ | 528 | /* Clear any outstanding interrupt. */ |
529 | writel(0xffc00000, fep->hwp + FEC_IEVENT); | 529 | writel(0xffc00000, fep->hwp + FEC_IEVENT); |
530 | 530 | ||
531 | /* Setup multicast filter. */ | ||
532 | set_multicast_list(ndev); | ||
533 | #ifndef CONFIG_M5272 | ||
534 | writel(0, fep->hwp + FEC_HASH_TABLE_HIGH); | ||
535 | writel(0, fep->hwp + FEC_HASH_TABLE_LOW); | ||
536 | #endif | ||
537 | |||
538 | /* Set maximum receive buffer size. */ | 531 | /* Set maximum receive buffer size. */ |
539 | writel(PKT_MAXBLR_SIZE, fep->hwp + FEC_R_BUFF_SIZE); | 532 | writel(PKT_MAXBLR_SIZE, fep->hwp + FEC_R_BUFF_SIZE); |
540 | 533 | ||
@@ -655,6 +648,13 @@ fec_restart(struct net_device *ndev, int duplex) | |||
655 | 648 | ||
656 | writel(rcntl, fep->hwp + FEC_R_CNTRL); | 649 | writel(rcntl, fep->hwp + FEC_R_CNTRL); |
657 | 650 | ||
651 | /* Setup multicast filter. */ | ||
652 | set_multicast_list(ndev); | ||
653 | #ifndef CONFIG_M5272 | ||
654 | writel(0, fep->hwp + FEC_HASH_TABLE_HIGH); | ||
655 | writel(0, fep->hwp + FEC_HASH_TABLE_LOW); | ||
656 | #endif | ||
657 | |||
658 | if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) { | 658 | if (id_entry->driver_data & FEC_QUIRK_ENET_MAC) { |
659 | /* enable ENET endian swap */ | 659 | /* enable ENET endian swap */ |
660 | ecntl |= (1 << 8); | 660 | ecntl |= (1 << 8); |
@@ -1679,8 +1679,12 @@ static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) | |||
1679 | if (!phydev) | 1679 | if (!phydev) |
1680 | return -ENODEV; | 1680 | return -ENODEV; |
1681 | 1681 | ||
1682 | if (cmd == SIOCSHWTSTAMP && fep->bufdesc_ex) | 1682 | if (fep->bufdesc_ex) { |
1683 | return fec_ptp_ioctl(ndev, rq, cmd); | 1683 | if (cmd == SIOCSHWTSTAMP) |
1684 | return fec_ptp_set(ndev, rq); | ||
1685 | if (cmd == SIOCGHWTSTAMP) | ||
1686 | return fec_ptp_get(ndev, rq); | ||
1687 | } | ||
1684 | 1688 | ||
1685 | return phy_mii_ioctl(phydev, rq, cmd); | 1689 | return phy_mii_ioctl(phydev, rq, cmd); |
1686 | } | 1690 | } |
@@ -1775,8 +1779,6 @@ fec_enet_open(struct net_device *ndev) | |||
1775 | struct fec_enet_private *fep = netdev_priv(ndev); | 1779 | struct fec_enet_private *fep = netdev_priv(ndev); |
1776 | int ret; | 1780 | int ret; |
1777 | 1781 | ||
1778 | napi_enable(&fep->napi); | ||
1779 | |||
1780 | /* I should reset the ring buffers here, but I don't yet know | 1782 | /* I should reset the ring buffers here, but I don't yet know |
1781 | * a simple way to do that. | 1783 | * a simple way to do that. |
1782 | */ | 1784 | */ |
@@ -1791,6 +1793,8 @@ fec_enet_open(struct net_device *ndev) | |||
1791 | fec_enet_free_buffers(ndev); | 1793 | fec_enet_free_buffers(ndev); |
1792 | return ret; | 1794 | return ret; |
1793 | } | 1795 | } |
1796 | |||
1797 | napi_enable(&fep->napi); | ||
1794 | phy_start(fep->phy_dev); | 1798 | phy_start(fep->phy_dev); |
1795 | netif_start_queue(ndev); | 1799 | netif_start_queue(ndev); |
1796 | fep->opened = 1; | 1800 | fep->opened = 1; |