From: "Matt Carlson" <mcarlson@broadcom.com>
To: "Mahesh Bandewar" <maheshb@google.com>
Cc: "David Miller" <davem@davemloft.net>,
"Matthew Carlson" <mcarlson@broadcom.com>,
netdev <netdev@vger.kernel.org>,
"Michael Chan" <mchan@broadcom.com>,
"Ben Hutchings" <bhutchings@solarflare.com>,
"Micha? Miros?aw" <mirq-linux@rere.qmqm.pl>
Subject: Re: [PATCH 2/2] tg3: Add code to allow ethtool to enable/disable loopback.
Date: Thu, 28 Apr 2011 19:23:37 -0700 [thread overview]
Message-ID: <20110429022337.GA20805@mcarlson.broadcom.com> (raw)
In-Reply-To: <1304033599-8395-3-git-send-email-maheshb@google.com>
On Thu, Apr 28, 2011 at 04:33:19PM -0700, Mahesh Bandewar wrote:
> ---
> drivers/net/tg3.c | 32 ++++++++++++++++++++++++++++++++
> 1 files changed, 32 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
> index fa57e3d..208884d 100644
> --- a/drivers/net/tg3.c
> +++ b/drivers/net/tg3.c
> @@ -6319,6 +6319,33 @@ static u32 tg3_fix_features(struct net_device *dev, u32 features)
> return features;
> }
>
> +static int tg3_set_features(struct net_device *dev, u32 features)
> +{
> + struct tg3 *tp = netdev_priv(dev);
> + u32 cur_mode = 0;
> + int err = 0;
> +
> + spin_lock_bh(&tp->lock);
> + cur_mode = tr32(MAC_MODE);
> +
> + if (features & NETIF_F_LOOPBACK) {
> + /* Enable internal MAC loopback mode */
> + tw32(MAC_MODE, cur_mode | MAC_MODE_PORT_INT_LPBACK);
I didn't notice this before, but you will want to clear
MAC_MODE_HALF_DUPLEX when going into loopback mode. You won't get
packets back if you happen to negotiate to HD.
next prev parent reply other threads:[~2011-04-29 2:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 23:33 [PATCH 0/2] Loopback Mahesh Bandewar
2011-04-28 23:33 ` [PATCH 1/2] net: Allow ethtool to set interface in loopback mode Mahesh Bandewar
2011-04-28 23:33 ` [PATCH 2/2] tg3: Add code to allow ethtool to enable/disable loopback Mahesh Bandewar
2011-04-29 0:28 ` Matt Carlson
2011-04-29 1:42 ` Mahesh Bandewar
2011-04-29 2:46 ` Matt Carlson
2011-04-29 17:45 ` Mahesh Bandewar
2011-04-29 2:23 ` Matt Carlson [this message]
2011-04-30 1:03 ` [PATCHv2 " Mahesh Bandewar
2011-05-02 6:29 ` Joe Perches
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=20110429022337.GA20805@mcarlson.broadcom.com \
--to=mcarlson@broadcom.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=maheshb@google.com \
--cc=mchan@broadcom.com \
--cc=mirq-linux@rere.qmqm.pl \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.