From: "Matt Carlson" <mcarlson@broadcom.com>
To: "Ben Hutchings" <bhutchings@solarflare.com>
Cc: "Matthew Carlson" <mcarlson@broadcom.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 4/6] tg3: Track LP advertising
Date: Thu, 8 Dec 2011 16:14:53 -0800 [thread overview]
Message-ID: <20111209001453.GA31557@mcarlson.broadcom.com> (raw)
In-Reply-To: <1323385565.3094.3.camel@bwh-desktop>
On Thu, Dec 08, 2011 at 03:06:05PM -0800, Ben Hutchings wrote:
> On Thu, 2011-12-08 at 13:50 -0800, Matt Carlson wrote:
> > This patch adds code to track the autonegotiation advertisements of the
> > link partner and report them through ethtool.
> >
> > Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
> > Reviewed-by: Michael Chan <mchan@broadcom.com>
> > ---
> > drivers/net/ethernet/broadcom/tg3.c | 41 ++++++++++++++++++++++++++++++++--
> > drivers/net/ethernet/broadcom/tg3.h | 1 +
> > 2 files changed, 39 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> > index d1681db..ae1e838 100644
> > --- a/drivers/net/ethernet/broadcom/tg3.c
> > +++ b/drivers/net/ethernet/broadcom/tg3.c
> > @@ -3803,6 +3803,29 @@ static bool tg3_phy_copper_an_config_ok(struct tg3 *tp, u32 *lcladv)
> > return true;
> > }
> >
> > +static bool tg3_phy_copper_fetch_rmtadv(struct tg3 *tp, u32 *rmtadv)
> > +{
> > + u32 val, lpeth = 0;
> > +
> > + if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
> > + if (tg3_readphy(tp, MII_STAT1000, &val))
> > + return false;
> > +
> > + lpeth = mii_stat1000_to_ethtool_lpa_t(val);
> > + }
> > +
> > + if (tg3_readphy(tp, MII_LPA, &val))
> > + return false;
> > +
> > + lpeth |= mii_lpa_to_ethtool_lpa_t(val);
> > + tp->link_config.rmt_adv = lpeth;
> > +
> > + if (tg3_flag(tp, PAUSE_AUTONEG))
> > + *rmtadv = val;
>
> I assume that the caller only needs this information if pause autoneg is
> enabled, but it's still very strange to put the condition here.
I see your point. I'm being overly cautious. I'll respin this patch.
> Ben.
>
> > + return true;
> > +}
> [...]
>
> --
> Ben Hutchings, Staff Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
prev parent reply other threads:[~2011-12-09 0:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-08 21:50 [PATCH net-next 4/6] tg3: Track LP advertising Matt Carlson
2011-12-08 23:06 ` Ben Hutchings
2011-12-09 0:14 ` Matt Carlson [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=20111209001453.GA31557@mcarlson.broadcom.com \
--to=mcarlson@broadcom.com \
--cc=bhutchings@solarflare.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).