lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <540077C2.2020403@cogentembedded.com>
Date:	Fri, 29 Aug 2014 16:53:22 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Mugunthan V N <mugunthanvnm@...com>, netdev@...r.kernel.org
CC:	davem@...emloft.net
Subject: Re: [net-next PATCH 1/1] drivers: net: cpsw: Add support for pause
 frames

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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ