netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 2/4] sky2: remove check for PCI wakeup setting from BIOS
Date: Thu, 10 Jan 2008 16:14:13 -0800	[thread overview]
Message-ID: <20080111001550.839028510@linux-foundation.org> (raw)
In-Reply-To: 20080111001411.158113585@linux-foundation.org

[-- Attachment #1: sky2-remove-pci-check.patch --]
[-- Type: text/plain, Size: 2641 bytes --]

The driver checks status of PCI power management to mark 
default setting of Wake On Lan. On some systems this works, but often
it reports a that WOL is disabled when it isn't.

This patch gets rid of that check and just reports the wake on
lan status based on the hardware capablity.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
Please apply for 2.6.24.

--- a/drivers/net/sky2.c	2008-01-10 15:49:12.000000000 -0800
+++ b/drivers/net/sky2.c	2008-01-10 15:49:20.000000000 -0800
@@ -3946,7 +3946,7 @@ static __exit void sky2_debug_cleanup(vo
 /* Initialize network device */
 static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
 						     unsigned port,
-						     int highmem, int wol)
+						     int highmem)
 {
 	struct sky2_port *sky2;
 	struct net_device *dev = alloc_etherdev(sizeof(*sky2));
@@ -3986,7 +3986,7 @@ static __devinit struct net_device *sky2
 	sky2->speed = -1;
 	sky2->advertising = sky2_supported_modes(hw);
 	sky2->rx_csum = (hw->chip_id != CHIP_ID_YUKON_XL);
-	sky2->wol = wol;
+	sky2->wol = sky2_wol_supported(hw) & WAKE_MAGIC;
 
 	spin_lock_init(&sky2->phy_lock);
 	sky2->tx_pending = TX_DEF_PENDING;
@@ -4083,24 +4083,12 @@ static int __devinit sky2_test_msi(struc
 	return err;
 }
 
-static int __devinit pci_wake_enabled(struct pci_dev *dev)
-{
-	int pm  = pci_find_capability(dev, PCI_CAP_ID_PM);
-	u16 value;
-
-	if (!pm)
-		return 0;
-	if (pci_read_config_word(dev, pm + PCI_PM_CTRL, &value))
-		return 0;
-	return value & PCI_PM_CTRL_PME_ENABLE;
-}
-
 static int __devinit sky2_probe(struct pci_dev *pdev,
 				const struct pci_device_id *ent)
 {
 	struct net_device *dev;
 	struct sky2_hw *hw;
-	int err, using_dac = 0, wol_default;
+	int err, using_dac = 0;
 
 	err = pci_enable_device(pdev);
 	if (err) {
@@ -4133,8 +4121,6 @@ static int __devinit sky2_probe(struct p
 		}
 	}
 
-	wol_default = pci_wake_enabled(pdev) ? WAKE_MAGIC : 0;
-
 	err = -ENOMEM;
 	hw = kzalloc(sizeof(*hw), GFP_KERNEL);
 	if (!hw) {
@@ -4178,7 +4164,7 @@ static int __devinit sky2_probe(struct p
 
 	sky2_reset(hw);
 
-	dev = sky2_init_netdev(hw, 0, using_dac, wol_default);
+	dev = sky2_init_netdev(hw, 0, using_dac);
 	if (!dev) {
 		err = -ENOMEM;
 		goto err_out_free_pci;
@@ -4215,7 +4201,7 @@ static int __devinit sky2_probe(struct p
 	if (hw->ports > 1) {
 		struct net_device *dev1;
 
-		dev1 = sky2_init_netdev(hw, 1, using_dac, wol_default);
+		dev1 = sky2_init_netdev(hw, 1, using_dac);
 		if (!dev1)
 			dev_warn(&pdev->dev, "allocation for second device failed\n");
 		else if ((err = register_netdev(dev1))) {

-- 
Stephen Hemminger <stephen.hemminger@vyatta.com>


  parent reply	other threads:[~2008-01-11  3:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11  0:14 [PATCH 0/4] sky2: version 1.21 Stephen Hemminger
2008-01-11  0:14 ` [PATCH 1/4] sky2: large memory workaround Stephen Hemminger
2008-01-12 22:49   ` Jeff Garzik
2008-01-11  0:14 ` Stephen Hemminger [this message]
2008-01-11  0:14 ` [PATCH 3/4] sky2: support for Yukon Supreme Stephen Hemminger
2008-01-18 20:02   ` Jeff Garzik
2008-01-11  0:14 ` [PATCH 4/4] sky2: version 1.21 Stephen Hemminger

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=20080111001550.839028510@linux-foundation.org \
    --to=shemminger@linux-foundation.org \
    --cc=jgarzik@pobox.com \
    --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).