tg3: shows HW time stamping support only if ptp_capable is present
authorFlavio Leitner <fbl@redhat.com>
Mon, 29 Apr 2013 07:08:07 +0000 (07:08 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Apr 2013 19:14:02 +0000 (15:14 -0400)
Current tg3 shows hardware timestamping support for all devices
when that is true only for the hardware with PTP_CAPABLE flag
present.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c

index ac83c87e0b1b3af379beff49782a66a1e155d61e..ef0b8a6531550eec87c4489668c84014b4d69ebb 100644 (file)
@@ -5992,10 +5992,13 @@ static int tg3_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
 
        info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
                                SOF_TIMESTAMPING_RX_SOFTWARE |
-                               SOF_TIMESTAMPING_SOFTWARE    |
-                               SOF_TIMESTAMPING_TX_HARDWARE |
-                               SOF_TIMESTAMPING_RX_HARDWARE |
-                               SOF_TIMESTAMPING_RAW_HARDWARE;
+                               SOF_TIMESTAMPING_SOFTWARE;
+
+       if (tg3_flag(tp, PTP_CAPABLE)) {
+               info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE |
+                                       SOF_TIMESTAMPING_RX_HARDWARE |
+                                       SOF_TIMESTAMPING_RAW_HARDWARE;
+       }
 
        if (tp->ptp_clock)
                info->phc_index = ptp_clock_index(tp->ptp_clock);