public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded•com>
To: Mugunthan V N <mugunthanvnm@ti•com>, netdev@vger•kernel.org
Cc: davem@davemloft•net
Subject: Re: [net-next PATCH 1/1] drivers: net: cpsw: Add support for pause frames
Date: Fri, 29 Aug 2014 16:53:22 +0400	[thread overview]
Message-ID: <540077C2.2020403@cogentembedded.com> (raw)
In-Reply-To: <1409302581-25290-1-git-send-email-mugunthanvnm@ti.com>

Hello.

On 8/29/2014 12:56 PM, Mugunthan V N wrote:

> CPSW supports both rx and tx pause frames for flow control.

> Signed-off-by: Mugunthan V N <mugunthanvnm@ti•com>
> ---
>   drivers/net/ethernet/ti/cpsw.c | 37 +++++++++++++++++++++++++++++++++++++
>   1 file changed, 37 insertions(+)

> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 999fb72..81325d4 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -397,6 +397,8 @@ struct cpsw_priv {
>   	struct cpdma_ctlr		*dma;
>   	struct cpdma_chan		*txch, *rxch;
>   	struct cpsw_ale			*ale;
> +	bool				rx_pause;
> +	bool				tx_pause;
>   	/* snapshot of IRQ numbers */
>   	u32 irqs_table[4];
>   	u32 num_irqs;
[...]
> @@ -1784,6 +1795,30 @@ static int cpsw_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
>   		return -EOPNOTSUPP;
>   }
>
> +static void cpsw_get_pauseparam(struct net_device *ndev,
> +				struct ethtool_pauseparam *pause)
> +{
> +	struct cpsw_priv *priv = netdev_priv(ndev);
> +
> +	pause->autoneg = AUTONEG_DISABLE;
> +	pause->rx_pause = (priv->rx_pause) ? true : false;
> +	pause->tx_pause = (priv->tx_pause) ? true : false;

    Aren't 'priv->[rt]x_queue' already *bool*? And the parens are not needed 
anyway.

> +}
> +
> +static int cpsw_set_pauseparam(struct net_device *ndev,
> +			       struct ethtool_pauseparam *pause)
> +{
> +	struct cpsw_priv *priv = netdev_priv(ndev);
> +	bool link;
> +
> +	priv->rx_pause = (pause->rx_pause) ? true : false;
> +	priv->tx_pause = (pause->tx_pause) ? true : false;

    Same here...

WBR, Sergei

      reply	other threads:[~2014-08-29 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29  8:56 [net-next PATCH 1/1] drivers: net: cpsw: Add support for pause frames Mugunthan V N
2014-08-29 12:53 ` Sergei Shtylyov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=540077C2.2020403@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=mugunthanvnm@ti$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox