]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
stmmac: Correctly report PTP capabilities.
authorPhil Reid <preid@electromag.com.au>
Fri, 30 Oct 2015 08:43:55 +0000 (16:43 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Nov 2015 22:05:43 +0000 (17:05 -0500)
priv->hwts_*_en indicate if timestamping is enabled/disabled at run
time. But  priv->dma_cap.time_stamp  and priv->dma_cap.atime_stamp
indicates HW is support for PTPv1/PTPv2.

Signed-off-by: Phil Reid <preid@electromag.com.au>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

index 771cda2a48b2a932daa17600446e29a0bb26823a..2e51b816a7e819268be678a49881b700b75c74a1 100644 (file)
@@ -721,10 +721,13 @@ static int stmmac_get_ts_info(struct net_device *dev,
 {
        struct stmmac_priv *priv = netdev_priv(dev);
 
-       if ((priv->hwts_tx_en) && (priv->hwts_rx_en)) {
+       if ((priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp)) {
 
-               info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE |
+               info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
+                                       SOF_TIMESTAMPING_TX_HARDWARE |
+                                       SOF_TIMESTAMPING_RX_SOFTWARE |
                                        SOF_TIMESTAMPING_RX_HARDWARE |
+                                       SOF_TIMESTAMPING_SOFTWARE |
                                        SOF_TIMESTAMPING_RAW_HARDWARE;
 
                if (priv->ptp_clock)