netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matei Pavaluca <matei.pavaluca@freescale.com>
To: <netdev@vger.kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	Claudiu Manoil <claudiu.manoil@freescale.com>,
	Pavaluca Matei <matei.pavaluca@freescale.com>
Subject: [PATCH net-next 2/3] gianfar: Fix the way the local advertising flow options are determined
Date: Thu, 23 Oct 2014 10:57:56 +0300	[thread overview]
Message-ID: <1414051077-4330-2-git-send-email-matei.pavaluca@freescale.com> (raw)
In-Reply-To: <1414051077-4330-1-git-send-email-matei.pavaluca@freescale.com>

From: Pavaluca Matei <matei.pavaluca@freescale.com>

Local flow control options needed in order to resolve the negotiation
are incorrectly calculated.

Previously 'mii_advertise_flowctrl' was called to determine the local advertising
options, but these were determined based on FLOW_CTRL_RX/TX flags which are
never set through ethtool.
The patch simply translates from ethtool flow options to mii flow options.

Signed-off-by: Pavaluca Matei <matei.pavaluca@freescale.com>
---
 drivers/net/ethernet/freescale/gianfar.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 2485b74..329efca 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -3373,7 +3373,11 @@ static u32 gfar_get_flowctrl_cfg(struct gfar_private *priv)
 		if (phydev->asym_pause)
 			rmt_adv |= LPA_PAUSE_ASYM;
 
-		lcl_adv = mii_advertise_flowctrl(phydev->advertising);
+		lcl_adv = 0;
+		if (phydev->advertising & ADVERTISED_Pause)
+			lcl_adv |= ADVERTISE_PAUSE_CAP;
+		if (phydev->advertising & ADVERTISED_Asym_Pause)
+			lcl_adv |= ADVERTISE_PAUSE_ASYM;
 
 		flowctrl = mii_resolve_flowctrl_fdx(lcl_adv, rmt_adv);
 		if (flowctrl & FLOW_CTRL_TX)
-- 
1.7.11.7

  reply	other threads:[~2014-10-23  8:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23  7:57 [PATCH net-next 1/3] gianfar: Add flow control support flags Matei Pavaluca
2014-10-23  7:57 ` Matei Pavaluca [this message]
2014-10-23  9:36   ` [PATCH net-next 2/3] gianfar: Fix the way the local advertising flow options are determined Claudiu Manoil
2014-10-23  7:57 ` [PATCH net-next 3/3] gianfar: Implement PAUSE frame generation support Matei Pavaluca
2014-10-23  9:36 ` [PATCH net-next 1/3] gianfar: Add flow control support flags Claudiu Manoil

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=1414051077-4330-2-git-send-email-matei.pavaluca@freescale.com \
    --to=matei.pavaluca@freescale.com \
    --cc=claudiu.manoil@freescale.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).