All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxim Levitsky <maximlevitsky@gmail.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Maxim Levitsky <maximlevitsky@gmail.com>
Subject: [PATCH 6/6] DMFE: don't reinitialize the hardware if device wasn't open
Date: Sat,  6 Feb 2010 22:19:02 +0200	[thread overview]
Message-ID: <1265487542-4447-7-git-send-email-maximlevitsky@gmail.com> (raw)
In-Reply-To: <1265487542-4447-1-git-send-email-maximlevitsky@gmail.com>

This cleans the .suspend/.resume functions and makes sure
we don't enable the device if it was down before the suspend
or disable it again if it was down in .suspend

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
 drivers/net/tulip/dmfe.c |   21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 9cd6179..cf164de 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -1959,21 +1959,13 @@ static void __devexit dmfe_remove(struct pci_dev *pdev)
 static int dmfe_suspend(struct pci_dev *pci_dev, pm_message_t state)
 {
 	struct net_device *dev = pci_get_drvdata(pci_dev);
-	struct dmfe_board_info *db = netdev_priv(dev);
 
 	/* Disable upper layer interface */
 	netif_device_detach(dev);
 
-	/* Disable Tx/Rx */
-	db->cr6_data &= ~(CR6_RXSC | CR6_TXSC);
-	dmfe_update_cr6(db->cr6_data, dev->base_addr);
-
-	/* Disable Interrupt */
-	outl(0, dev->base_addr + DCR7);
-	outl(inl(dev->base_addr + DCR5), dev->base_addr + DCR5);
-
-	/* Fre RX buffers */
-	dmfe_free_rxbuffer(db);
+	/* Stop the hardware */
+	if (netif_running(dev))
+		dmfe_stop(dev);
 
 	/* Enable WOL */
 	dmfe_set_wol(dev, 1);
@@ -1992,12 +1984,13 @@ static int dmfe_resume(struct pci_dev *pci_dev)
 	pci_back_from_sleep(pci_dev);
 	pci_restore_state(pci_dev);
 
-	/* Re-initilize DM910X board */
-	dmfe_hardware_init(dev);
-
 	/* Disable WOL */
 	dmfe_set_wol(dev, 0);
 
+	/* Start the interace back */
+	if (netif_running(dev))
+		dmfe_open(dev);
+
 	/* Restart upper layer interface */
 	netif_device_attach(dev);
 
-- 
1.6.3.3


      parent reply	other threads:[~2010-02-06 20:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-06 20:18 Some fixes and cleanups for DMFE nework driver Maxim Levitsky
2010-02-06 20:18 ` [PATCH 1/6] dmfe: trivial cleanups: Maxim Levitsky
2010-02-06 20:18 ` [PATCH 2/6] DMFE: move pci ID definitions into pci_ids.h and clean up the code Maxim Levitsky
2010-02-10 21:18   ` David Miller
2010-02-10 21:22     ` David Miller
2010-02-11 17:25       ` Maxim Levitsky
2010-02-06 20:18 ` [PATCH 3/6] dmfe: workaround chipset bug Maxim Levitsky
2010-02-06 20:19 ` [PATCH 4/6] DMFE: WOL fixes: Maxim Levitsky
2010-02-06 20:19 ` [PATCH 5/6] DMFE: add .shutdown Maxim Levitsky
2010-02-06 20:19 ` Maxim Levitsky [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=1265487542-4447-7-git-send-email-maximlevitsky@gmail.com \
    --to=maximlevitsky@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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.