aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r--drivers/net/ethernet/freescale/fec.c1
-rw-r--r--drivers/net/ethernet/freescale/fec_mpc52xx.c1
-rw-r--r--drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c1
-rw-r--r--drivers/net/ethernet/freescale/gianfar.c13
-rw-r--r--drivers/net/ethernet/freescale/gianfar.h3
-rw-r--r--drivers/net/ethernet/freescale/gianfar_ethtool.c30
-rw-r--r--drivers/net/ethernet/freescale/gianfar_ptp.c2
-rw-r--r--drivers/net/ethernet/freescale/ucc_geth.c6
-rw-r--r--drivers/net/ethernet/freescale/ucc_geth.h2
-rw-r--r--drivers/net/ethernet/freescale/ucc_geth_ethtool.c1
10 files changed, 50 insertions, 10 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 500c106af86e..8f2cf8c09e2d 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1162,6 +1162,7 @@ static const struct ethtool_ops fec_enet_ethtool_ops = {
1162 .set_settings = fec_enet_set_settings, 1162 .set_settings = fec_enet_set_settings,
1163 .get_drvinfo = fec_enet_get_drvinfo, 1163 .get_drvinfo = fec_enet_get_drvinfo,
1164 .get_link = ethtool_op_get_link, 1164 .get_link = ethtool_op_get_link,
1165 .get_ts_info = ethtool_op_get_ts_info,
1165}; 1166};
1166 1167
1167static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) 1168static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx.c b/drivers/net/ethernet/freescale/fec_mpc52xx.c
index 7b34d8c698da..97f947b3d94a 100644
--- a/drivers/net/ethernet/freescale/fec_mpc52xx.c
+++ b/drivers/net/ethernet/freescale/fec_mpc52xx.c
@@ -811,6 +811,7 @@ static const struct ethtool_ops mpc52xx_fec_ethtool_ops = {
811 .get_link = ethtool_op_get_link, 811 .get_link = ethtool_op_get_link,
812 .get_msglevel = mpc52xx_fec_get_msglevel, 812 .get_msglevel = mpc52xx_fec_get_msglevel,
813 .set_msglevel = mpc52xx_fec_set_msglevel, 813 .set_msglevel = mpc52xx_fec_set_msglevel,
814 .get_ts_info = ethtool_op_get_ts_info,
814}; 815};
815 816
816 817
diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
index e4e6cd2c5f82..2b7633f766d9 100644
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -963,6 +963,7 @@ static const struct ethtool_ops fs_ethtool_ops = {
963 .get_msglevel = fs_get_msglevel, 963 .get_msglevel = fs_get_msglevel,
964 .set_msglevel = fs_set_msglevel, 964 .set_msglevel = fs_set_msglevel,
965 .get_regs = fs_get_regs, 965 .get_regs = fs_get_regs,
966 .get_ts_info = ethtool_op_get_ts_info,
966}; 967};
967 968
968static int fs_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 969static int fs_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index e7bed5303997..1adb0245b9dd 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -136,7 +136,7 @@ static void gfar_netpoll(struct net_device *dev);
136int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit); 136int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit);
137static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue); 137static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue);
138static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, 138static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb,
139 int amount_pull); 139 int amount_pull, struct napi_struct *napi);
140void gfar_halt(struct net_device *dev); 140void gfar_halt(struct net_device *dev);
141static void gfar_halt_nodisable(struct net_device *dev); 141static void gfar_halt_nodisable(struct net_device *dev);
142void gfar_start(struct net_device *dev); 142void gfar_start(struct net_device *dev);
@@ -2675,12 +2675,12 @@ static inline void gfar_rx_checksum(struct sk_buff *skb, struct rxfcb *fcb)
2675/* gfar_process_frame() -- handle one incoming packet if skb 2675/* gfar_process_frame() -- handle one incoming packet if skb
2676 * isn't NULL. */ 2676 * isn't NULL. */
2677static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, 2677static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb,
2678 int amount_pull) 2678 int amount_pull, struct napi_struct *napi)
2679{ 2679{
2680 struct gfar_private *priv = netdev_priv(dev); 2680 struct gfar_private *priv = netdev_priv(dev);
2681 struct rxfcb *fcb = NULL; 2681 struct rxfcb *fcb = NULL;
2682 2682
2683 int ret; 2683 gro_result_t ret;
2684 2684
2685 /* fcb is at the beginning if exists */ 2685 /* fcb is at the beginning if exists */
2686 fcb = (struct rxfcb *)skb->data; 2686 fcb = (struct rxfcb *)skb->data;
@@ -2719,9 +2719,9 @@ static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb,
2719 __vlan_hwaccel_put_tag(skb, fcb->vlctl); 2719 __vlan_hwaccel_put_tag(skb, fcb->vlctl);
2720 2720
2721 /* Send the packet up the stack */ 2721 /* Send the packet up the stack */
2722 ret = netif_receive_skb(skb); 2722 ret = napi_gro_receive(napi, skb);
2723 2723
2724 if (NET_RX_DROP == ret) 2724 if (GRO_DROP == ret)
2725 priv->extra_stats.kernel_dropped++; 2725 priv->extra_stats.kernel_dropped++;
2726 2726
2727 return 0; 2727 return 0;
@@ -2783,7 +2783,8 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
2783 skb_put(skb, pkt_len); 2783 skb_put(skb, pkt_len);
2784 rx_queue->stats.rx_bytes += pkt_len; 2784 rx_queue->stats.rx_bytes += pkt_len;
2785 skb_record_rx_queue(skb, rx_queue->qindex); 2785 skb_record_rx_queue(skb, rx_queue->qindex);
2786 gfar_process_frame(dev, skb, amount_pull); 2786 gfar_process_frame(dev, skb, amount_pull,
2787 &rx_queue->grp->napi);
2787 2788
2788 } else { 2789 } else {
2789 netif_warn(priv, rx_err, dev, "Missing skb!\n"); 2790 netif_warn(priv, rx_err, dev, "Missing skb!\n");
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 4c9f8d487dbb..2136c7ff5e6d 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -1210,4 +1210,7 @@ struct filer_table {
1210 struct gfar_filer_entry fe[MAX_FILER_CACHE_IDX + 20]; 1210 struct gfar_filer_entry fe[MAX_FILER_CACHE_IDX + 20];
1211}; 1211};
1212 1212
1213/* The gianfar_ptp module will set this variable */
1214extern int gfar_phc_index;
1215
1213#endif /* __GIANFAR_H */ 1216#endif /* __GIANFAR_H */
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 8d74efd04bb9..8a025570d97e 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -26,6 +26,7 @@
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/netdevice.h> 27#include <linux/netdevice.h>
28#include <linux/etherdevice.h> 28#include <linux/etherdevice.h>
29#include <linux/net_tstamp.h>
29#include <linux/skbuff.h> 30#include <linux/skbuff.h>
30#include <linux/spinlock.h> 31#include <linux/spinlock.h>
31#include <linux/mm.h> 32#include <linux/mm.h>
@@ -1739,6 +1740,34 @@ static int gfar_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
1739 return ret; 1740 return ret;
1740} 1741}
1741 1742
1743int gfar_phc_index = -1;
1744
1745static int gfar_get_ts_info(struct net_device *dev,
1746 struct ethtool_ts_info *info)
1747{
1748 struct gfar_private *priv = netdev_priv(dev);
1749
1750 if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER)) {
1751 info->so_timestamping =
1752 SOF_TIMESTAMPING_RX_SOFTWARE |
1753 SOF_TIMESTAMPING_SOFTWARE;
1754 info->phc_index = -1;
1755 return 0;
1756 }
1757 info->so_timestamping =
1758 SOF_TIMESTAMPING_TX_HARDWARE |
1759 SOF_TIMESTAMPING_RX_HARDWARE |
1760 SOF_TIMESTAMPING_RAW_HARDWARE;
1761 info->phc_index = gfar_phc_index;
1762 info->tx_types =
1763 (1 << HWTSTAMP_TX_OFF) |
1764 (1 << HWTSTAMP_TX_ON);
1765 info->rx_filters =
1766 (1 << HWTSTAMP_FILTER_NONE) |
1767 (1 << HWTSTAMP_FILTER_ALL);
1768 return 0;
1769}
1770
1742const struct ethtool_ops gfar_ethtool_ops = { 1771const struct ethtool_ops gfar_ethtool_ops = {
1743 .get_settings = gfar_gsettings, 1772 .get_settings = gfar_gsettings,
1744 .set_settings = gfar_ssettings, 1773 .set_settings = gfar_ssettings,
@@ -1761,4 +1790,5 @@ const struct ethtool_ops gfar_ethtool_ops = {
1761#endif 1790#endif
1762 .set_rxnfc = gfar_set_nfc, 1791 .set_rxnfc = gfar_set_nfc,
1763 .get_rxnfc = gfar_get_nfc, 1792 .get_rxnfc = gfar_get_nfc,
1793 .get_ts_info = gfar_get_ts_info,
1764}; 1794};
diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c
index 5fd620bec15c..c08e5d40fecb 100644
--- a/drivers/net/ethernet/freescale/gianfar_ptp.c
+++ b/drivers/net/ethernet/freescale/gianfar_ptp.c
@@ -515,6 +515,7 @@ static int gianfar_ptp_probe(struct platform_device *dev)
515 err = PTR_ERR(etsects->clock); 515 err = PTR_ERR(etsects->clock);
516 goto no_clock; 516 goto no_clock;
517 } 517 }
518 gfar_phc_clock = ptp_clock_index(etsects->clock);
518 519
519 dev_set_drvdata(&dev->dev, etsects); 520 dev_set_drvdata(&dev->dev, etsects);
520 521
@@ -538,6 +539,7 @@ static int gianfar_ptp_remove(struct platform_device *dev)
538 gfar_write(&etsects->regs->tmr_temask, 0); 539 gfar_write(&etsects->regs->tmr_temask, 0);
539 gfar_write(&etsects->regs->tmr_ctrl, 0); 540 gfar_write(&etsects->regs->tmr_ctrl, 0);
540 541
542 gfar_phc_clock = -1;
541 ptp_clock_unregister(etsects->clock); 543 ptp_clock_unregister(etsects->clock);
542 iounmap(etsects->regs); 544 iounmap(etsects->regs);
543 release_resource(etsects->rsrc); 545 release_resource(etsects->rsrc);
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index 17a46e76123f..9ac14f804851 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -116,10 +116,10 @@ static struct ucc_geth_info ugeth_primary_info = {
116 .maxGroupAddrInHash = 4, 116 .maxGroupAddrInHash = 4,
117 .maxIndAddrInHash = 4, 117 .maxIndAddrInHash = 4,
118 .prel = 7, 118 .prel = 7,
119 .maxFrameLength = 1518, 119 .maxFrameLength = 1518+16, /* Add extra bytes for VLANs etc. */
120 .minFrameLength = 64, 120 .minFrameLength = 64,
121 .maxD1Length = 1520, 121 .maxD1Length = 1520+16, /* Add extra bytes for VLANs etc. */
122 .maxD2Length = 1520, 122 .maxD2Length = 1520+16, /* Add extra bytes for VLANs etc. */
123 .vlantype = 0x8100, 123 .vlantype = 0x8100,
124 .ecamptr = ((uint32_t) NULL), 124 .ecamptr = ((uint32_t) NULL),
125 .eventRegMask = UCCE_OTHER, 125 .eventRegMask = UCCE_OTHER,
diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h
index 2e395a2566b8..f71b3e7b12de 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.h
+++ b/drivers/net/ethernet/freescale/ucc_geth.h
@@ -877,7 +877,7 @@ struct ucc_geth_hardware_statistics {
877 877
878/* Driver definitions */ 878/* Driver definitions */
879#define TX_BD_RING_LEN 0x10 879#define TX_BD_RING_LEN 0x10
880#define RX_BD_RING_LEN 0x10 880#define RX_BD_RING_LEN 0x20
881 881
882#define TX_RING_MOD_MASK(size) (size-1) 882#define TX_RING_MOD_MASK(size) (size-1)
883#define RX_RING_MOD_MASK(size) (size-1) 883#define RX_RING_MOD_MASK(size) (size-1)
diff --git a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
index a97257f91a3d..37b035306013 100644
--- a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
+++ b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
@@ -415,6 +415,7 @@ static const struct ethtool_ops uec_ethtool_ops = {
415 .get_ethtool_stats = uec_get_ethtool_stats, 415 .get_ethtool_stats = uec_get_ethtool_stats,
416 .get_wol = uec_get_wol, 416 .get_wol = uec_get_wol,
417 .set_wol = uec_set_wol, 417 .set_wol = uec_set_wol,
418 .get_ts_info = ethtool_op_get_ts_info,
418}; 419};
419 420
420void uec_set_ethtool_ops(struct net_device *netdev) 421void uec_set_ethtool_ops(struct net_device *netdev)