diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2013-12-19 19:21:14 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-27 12:44:55 -0500 |
commit | 69317a5351022e1b207131e7cccc78f261ace9ac (patch) | |
tree | c6741a0209ddee000b4afacd8302df92625711fd /drivers/net/ethernet/tile/tilegx.c | |
parent | fcf93a0a2f9d317c0bffc430ddf8950041d13265 (diff) | |
download | linux-69317a5351022e1b207131e7cccc78f261ace9ac.tar.gz linux-69317a5351022e1b207131e7cccc78f261ace9ac.tar.bz2 linux-69317a5351022e1b207131e7cccc78f261ace9ac.zip |
tile_net: Always enable PTP clock support on TILE-Gx
All other net drivers with PTP support enable it unconditionally.
Make tile_net consistent with this.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/tile/tilegx.c')
-rw-r--r-- | drivers/net/ethernet/tile/tilegx.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c index 858f9a786b8c..570495be77f3 100644 --- a/drivers/net/ethernet/tile/tilegx.c +++ b/drivers/net/ethernet/tile/tilegx.c @@ -187,10 +187,8 @@ struct tile_net_priv { int echannel; /* mPIPE instance, 0 or 1. */ int instance; -#ifdef CONFIG_PTP_1588_CLOCK_TILEGX /* The timestamp config. */ struct hwtstamp_config stamp_cfg; -#endif }; static struct mpipe_data { @@ -229,14 +227,12 @@ static struct mpipe_data { int first_bucket; int num_buckets; -#ifdef CONFIG_PTP_1588_CLOCK_TILEGX /* PTP-specific data. */ struct ptp_clock *ptp_clock; struct ptp_clock_info caps; /* Lock for ptp accessors. */ struct mutex ptp_lock; -#endif } mpipe_data[NR_MPIPE_MAX] = { [0 ... (NR_MPIPE_MAX - 1)] { @@ -451,20 +447,17 @@ static void tile_net_provide_needed_buffers(void) static void tile_rx_timestamp(struct tile_net_priv *priv, struct sk_buff *skb, gxio_mpipe_idesc_t *idesc) { -#ifdef CONFIG_PTP_1588_CLOCK_TILEGX if (unlikely(priv->stamp_cfg.rx_filter != HWTSTAMP_FILTER_NONE)) { struct skb_shared_hwtstamps *shhwtstamps = skb_hwtstamps(skb); memset(shhwtstamps, 0, sizeof(*shhwtstamps)); shhwtstamps->hwtstamp = ktime_set(idesc->time_stamp_sec, idesc->time_stamp_ns); } -#endif } /* Get TX timestamp, and store it in the skb. */ static void tile_tx_timestamp(struct sk_buff *skb, int instance) { -#ifdef CONFIG_PTP_1588_CLOCK_TILEGX struct skb_shared_info *shtx = skb_shinfo(skb); if (unlikely((shtx->tx_flags & SKBTX_HW_TSTAMP) != 0)) { struct mpipe_data *md = &mpipe_data[instance]; @@ -477,13 +470,11 @@ static void tile_tx_timestamp(struct sk_buff *skb, int instance) shhwtstamps.hwtstamp = ktime_set(ts.tv_sec, ts.tv_nsec); skb_tstamp_tx(skb, &shhwtstamps); } -#endif } /* Use ioctl() to enable or disable TX or RX timestamping. */ static int tile_hwtstamp_set(struct net_device *dev, struct ifreq *rq) { -#ifdef CONFIG_PTP_1588_CLOCK_TILEGX struct hwtstamp_config config; struct tile_net_priv *priv = netdev_priv(dev); @@ -529,14 +520,10 @@ static int tile_hwtstamp_set(struct net_device *dev, struct ifreq *rq) priv->stamp_cfg = config; return 0; -#else - return -EOPNOTSUPP; -#endif } static int tile_hwtstamp_get(struct net_device *dev, struct ifreq *rq) { -#ifdef CONFIG_PTP_1588_CLOCK_TILEGX struct tile_net_priv *priv = netdev_priv(dev); if (copy_to_user(rq->ifr_data, &priv->stamp_cfg, @@ -544,9 +531,6 @@ static int tile_hwtstamp_get(struct net_device *dev, struct ifreq *rq) return -EFAULT; return 0; -#else - return -EOPNOTSUPP; -#endif } static inline bool filter_packet(struct net_device *dev, void *buf) @@ -828,8 +812,6 @@ static enum hrtimer_restart tile_net_handle_egress_timer(struct hrtimer *t) return HRTIMER_NORESTART; } -#ifdef CONFIG_PTP_1588_CLOCK_TILEGX - /* PTP clock operations. */ static int ptp_mpipe_adjfreq(struct ptp_clock_info *ptp, s32 ppb) @@ -896,12 +878,9 @@ static struct ptp_clock_info ptp_mpipe_caps = { .enable = ptp_mpipe_enable, }; -#endif /* CONFIG_PTP_1588_CLOCK_TILEGX */ - /* Sync mPIPE's timestamp up with Linux system time and register PTP clock. */ static void register_ptp_clock(struct net_device *dev, struct mpipe_data *md) { -#ifdef CONFIG_PTP_1588_CLOCK_TILEGX struct timespec ts; getnstimeofday(&ts); @@ -913,16 +892,13 @@ static void register_ptp_clock(struct net_device *dev, struct mpipe_data *md) if (IS_ERR(md->ptp_clock)) netdev_err(dev, "ptp_clock_register failed %ld\n", PTR_ERR(md->ptp_clock)); -#endif } /* Initialize PTP fields in a new device. */ static void init_ptp_dev(struct tile_net_priv *priv) { -#ifdef CONFIG_PTP_1588_CLOCK_TILEGX priv->stamp_cfg.rx_filter = HWTSTAMP_FILTER_NONE; priv->stamp_cfg.tx_type = HWTSTAMP_TX_OFF; -#endif } /* Helper functions for "tile_net_update()". */ |