All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Kilroy <kilroyd@googlemail.com>
To: linux-wireless@vger.kernel.org, orinoco-devel@lists.sourceforge.net
Cc: arvidjaar@mail.ru, linux-pm@lists.linux-foundation.org,
	David Kilroy <kilroyd@googlemail.com>
Subject: [RFC PATCH 2/2] orinoco: Resume spectrum_cs in the same way as orinoco_cs
Date: Fri, 31 Oct 2008 01:15:43 +0000	[thread overview]
Message-ID: <1225415743-28209-3-git-send-email-kilroyd@googlemail.com> (raw)
In-Reply-To: <1225415743-28209-2-git-send-email-kilroyd@googlemail.com>

Retrieval of external firmware has been resolved, and should work with
the standard orinoco resume algorithm.

This fixes an issue where priv->hw_unavailable indicates the card is
ready when firmware has not been loaded.

Signed-off by: David Kilroy <kilroyd@googlemail.com>
---
I don't have a spectrum_cs card, so this patch really needs testing to
check resume works properly.
---
 drivers/net/wireless/spectrum_cs.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/spectrum_cs.c b/drivers/net/wireless/spectrum_cs.c
index 852789a..c6c6d12 100644
--- a/drivers/net/wireless/spectrum_cs.c
+++ b/drivers/net/wireless/spectrum_cs.c
@@ -450,10 +450,29 @@ spectrum_cs_resume(struct pcmcia_device *link)
 {
 	struct net_device *dev = link->priv;
 	struct orinoco_private *priv = netdev_priv(dev);
+	unsigned long flags;
+	int err;
+
+	err = orinoco_reinit_firmware(dev);
+	if (err) {
+		printk(KERN_ERR "%s: Error %d re-initializing firmware\n",
+		       dev->name, err);
+		return -EIO;
+	}
+
+	spin_lock_irqsave(&priv->lock, flags);
 
 	netif_device_attach(dev);
 	priv->hw_unavailable--;
-	schedule_work(&priv->reset_work);
+
+	if (priv->open && !priv->hw_unavailable) {
+		err = __orinoco_up(dev);
+		if (err)
+			printk(KERN_ERR "%s: Error %d restarting card\n",
+			       dev->name, err);
+	}
+
+	spin_unlock_irqrestore(&priv->lock, flags);
 
 	return 0;
 }
-- 
1.5.6.4


  reply	other threads:[~2008-10-31  1:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-31  1:15 [RFC PATCH 0/2] orinoco: Don't keep cached firmware around permanently David Kilroy
2008-10-31  1:15 ` [RFC PATCH 1/2] orinoco: Use PM notifier to cache firmware for use during resume David Kilroy
2008-10-31  1:15   ` David Kilroy [this message]
2008-10-31  1:15   ` [RFC PATCH 2/2] orinoco: Resume spectrum_cs in the same way as orinoco_cs David Kilroy
2008-10-31 17:36   ` [RFC PATCH 1/2] orinoco: Use PM notifier to cache firmware for use during resume Andrey Borzenkov
2008-10-31 21:27     ` [linux-pm] " Rafael J. Wysocki
2008-10-31 21:27     ` Rafael J. Wysocki
2008-10-31 17:36   ` Andrey Borzenkov
2008-10-31  1:15 ` David Kilroy
2008-11-02 10:35 ` [RFC PATCH 0/2] orinoco: Don't keep cached firmware around permanently Andrey Borzenkov
2008-11-02 10:35 ` Andrey Borzenkov
2008-11-02 12:29   ` Dave
2008-11-02 12:29   ` Dave

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=1225415743-28209-3-git-send-email-kilroyd@googlemail.com \
    --to=kilroyd@googlemail.com \
    --cc=arvidjaar@mail.ru \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=orinoco-devel@lists.sourceforge.net \
    /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.