netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tg3: shows HW time stamping support only if ptp_capable is present
@ 2013-04-29 17:08 Flavio Leitner
  2013-04-29 18:09 ` Nithin Nayak Sujir
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Flavio Leitner @ 2013-04-29 17:08 UTC (permalink / raw)
  To: netdev; +Cc: Jiri Benc, Nithin Nayak Sujir, Michael Chan, Flavio Leitner

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>
---
 drivers/net/ethernet/broadcom/tg3.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index ac83c87..ef0b8a6 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -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);
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] tg3: shows HW time stamping support only if ptp_capable is present
  2013-04-29 17:08 [PATCH net-next] tg3: shows HW time stamping support only if ptp_capable is present Flavio Leitner
@ 2013-04-29 18:09 ` Nithin Nayak Sujir
  2013-04-29 19:16 ` David Miller
  2013-04-30  8:50 ` Jiri Benc
  2 siblings, 0 replies; 5+ messages in thread
From: Nithin Nayak Sujir @ 2013-04-29 18:09 UTC (permalink / raw)
  To: Flavio Leitner; +Cc: netdev, Jiri Benc, Michael Chan



On 04/29/2013 10:08 AM, Flavio Leitner wrote:
> 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>
> ---
>   drivers/net/ethernet/broadcom/tg3.c | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index ac83c87..ef0b8a6 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -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);
>

Thanks Flavio.

Acked-by: Nithin Nayak Sujir <nsujir@broadcom.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] tg3: shows HW time stamping support only if ptp_capable is present
  2013-04-29 17:08 [PATCH net-next] tg3: shows HW time stamping support only if ptp_capable is present Flavio Leitner
  2013-04-29 18:09 ` Nithin Nayak Sujir
@ 2013-04-29 19:16 ` David Miller
  2013-04-30  8:50 ` Jiri Benc
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-04-29 19:16 UTC (permalink / raw)
  To: fbl; +Cc: netdev, jbenc, nsujir, mchan

From: Flavio Leitner <fbl@redhat.com>
Date: Mon, 29 Apr 2013 14:08:07 -0300

> 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>

Applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] tg3: shows HW time stamping support only if ptp_capable is present
  2013-04-29 17:08 [PATCH net-next] tg3: shows HW time stamping support only if ptp_capable is present Flavio Leitner
  2013-04-29 18:09 ` Nithin Nayak Sujir
  2013-04-29 19:16 ` David Miller
@ 2013-04-30  8:50 ` Jiri Benc
  2013-04-30 13:10   ` Flavio Leitner
  2 siblings, 1 reply; 5+ messages in thread
From: Jiri Benc @ 2013-04-30  8:50 UTC (permalink / raw)
  To: Flavio Leitner; +Cc: netdev, Nithin Nayak Sujir, Michael Chan

On Mon, 29 Apr 2013 14:08:07 -0300, Flavio Leitner wrote:
> 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>
> ---
>  drivers/net/ethernet/broadcom/tg3.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index ac83c87..ef0b8a6 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -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 |
                                     ^^^^
                         You need |= here.

> +					SOF_TIMESTAMPING_RX_HARDWARE |
> +					SOF_TIMESTAMPING_RAW_HARDWARE;
> +	}
>  
>  	if (tp->ptp_clock)
>  		info->phc_index = ptp_clock_index(tp->ptp_clock);

 Jiri

-- 
Jiri Benc

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] tg3: shows HW time stamping support only if ptp_capable is present
  2013-04-30  8:50 ` Jiri Benc
@ 2013-04-30 13:10   ` Flavio Leitner
  0 siblings, 0 replies; 5+ messages in thread
From: Flavio Leitner @ 2013-04-30 13:10 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, Nithin Nayak Sujir, Michael Chan

On Tue, Apr 30, 2013 at 10:50:15AM +0200, Jiri Benc wrote:
> On Mon, 29 Apr 2013 14:08:07 -0300, Flavio Leitner wrote:
> > 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>
> > ---
> >  drivers/net/ethernet/broadcom/tg3.c | 11 +++++++----
> >  1 file changed, 7 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> > index ac83c87..ef0b8a6 100644
> > --- a/drivers/net/ethernet/broadcom/tg3.c
> > +++ b/drivers/net/ethernet/broadcom/tg3.c
> > @@ -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 |
>                                      ^^^^
>                          You need |= here.

Of course, I will send a follow up patch.
Thanks for reviewing it.
-- 
fbl

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-30 13:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-29 17:08 [PATCH net-next] tg3: shows HW time stamping support only if ptp_capable is present Flavio Leitner
2013-04-29 18:09 ` Nithin Nayak Sujir
2013-04-29 19:16 ` David Miller
2013-04-30  8:50 ` Jiri Benc
2013-04-30 13:10   ` Flavio Leitner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).