All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
To: netdev@vger.kernel.org
Cc: David Miller <davem@davemloft.net>,
	Amit Kumar Salecha <amit.salecha@qlogic.com>
Subject: [PATCH net-next 5/7] qlcnic: fix default operating state of interface
Date: Thu, 16 Jun 2011 13:37:36 -0700	[thread overview]
Message-ID: <1308256659-19895-5-git-send-email-anirban.chakraborty@qlogic.com> (raw)
In-Reply-To: <1308256659-19895-1-git-send-email-anirban.chakraborty@qlogic.com>

From: Amit Kumar Salecha <amit.salecha@qlogic.com>

Currently interface shows status as RUNNING, even if there is no link.
To fix this, netif_carrier_off should be called after register_netdev().

netif_carrier_off calls linkwatch_fire_event(dev); only if netdev is registered,
otherwise it skips. linkwatch_fire_event set default state of nic interface.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
 drivers/net/qlcnic/qlcnic_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 8c07c4e..5348dba 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -1485,14 +1485,14 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
 
 	netdev->irq = adapter->msix_entries[0].vector;
 
-	netif_carrier_off(netdev);
-
 	err = register_netdev(netdev);
 	if (err) {
 		dev_err(&pdev->dev, "failed to register net device\n");
 		return err;
 	}
 
+	netif_carrier_off(netdev);
+
 	return 0;
 }
 
-- 
1.7.4.1


  parent reply	other threads:[~2011-06-16 20:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16 20:37 [PATCH net-next 1/7] qlcnic: Add capability to take FW dump deterministically Anirban Chakraborty
2011-06-16 20:37 ` [PATCH net-next 2/7] qlcnic: Remove holding api lock while taking the dump Anirban Chakraborty
2011-06-16 20:37 ` [PATCH net-next 3/7] qlcnic: Add code to tune FW dump Anirban Chakraborty
2011-06-16 20:37 ` [PATCH net-next 4/7] qlcnic: fix initial number of msix entries in adapter Anirban Chakraborty
2011-06-16 20:37 ` Anirban Chakraborty [this message]
2011-06-17  4:10   ` [PATCH net-next 5/7] qlcnic: fix default operating state of interface David Miller
2011-06-17 19:00     ` Stephen Hemminger
2011-06-22  7:01       ` Amit Salecha
2011-06-20  4:14     ` Anirban Chakraborty
2011-06-16 20:37 ` [PATCH net-next 6/7] qlcnic: Add support to enable/disable FW dump capability Anirban Chakraborty
2011-06-16 20:37 ` [PATCH net-next 7/7] qlcnic: multi protocol internal loopback support added Anirban Chakraborty
2011-06-16 20:37 ` [PATCH net-next 0/7] qlcnic: Misc. fixes and loopback support Anirban Chakraborty

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=1308256659-19895-5-git-send-email-anirban.chakraborty@qlogic.com \
    --to=anirban.chakraborty@qlogic.com \
    --cc=amit.salecha@qlogic.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 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.