netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: bphilips@suse.de, netdev@vger.kernel.org
Subject: Re: [PATCH] sky2: set carrier off in probe
Date: Fri, 30 Oct 2009 08:34:52 -0700	[thread overview]
Message-ID: <20091030083452.68ca227e@nehalam> (raw)
In-Reply-To: <20091029.213816.35637194.davem@davemloft.net>

Why not fix the problem in a generic way?


---
Subject: ethtool: link is only up if device is running


Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>


--- a/net/core/ethtool.c	2009-10-30 08:32:52.584728610 -0700
+++ b/net/core/ethtool.c	2009-10-30 08:33:31.806667877 -0700
@@ -27,7 +27,7 @@
 
 u32 ethtool_op_get_link(struct net_device *dev)
 {
-	return netif_carrier_ok(dev) ? 1 : 0;
+	return netif_running(dev) && netif_carrier_ok(dev);
 }
 
 u32 ethtool_op_get_rx_csum(struct net_device *dev)

  reply	other threads:[~2009-10-30 15:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-29 23:58 [PATCH] sky2: set carrier off in probe Brandon Philips
2009-10-30  3:09 ` Stephen Hemminger
2009-10-30  3:51   ` Brandon Philips
2009-10-30  4:12     ` David Miller
2009-10-30  4:30       ` Brandon Philips
2009-10-30  4:38         ` David Miller
2009-10-30 15:34           ` Stephen Hemminger [this message]
2009-10-30 18:11             ` David Miller
2009-10-30 15:54           ` Herbert Xu
2009-10-30 18:10             ` David Miller
2009-10-30 18:16               ` Herbert Xu
2009-10-30 18:20                 ` David Miller
2009-10-30 19:13                   ` Herbert Xu
2009-10-30 19:28 ` David Miller

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=20091030083452.68ca227e@nehalam \
    --to=shemminger@linux-foundation.org \
    --cc=bphilips@suse.de \
    --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).