linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Lamparter <chunkeey@web.de>
To: "linux-wireless" <linux-wireless@vger.kernel.org>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Larry Finger <Larry.Finger@lwfinger.net>
Subject: [PATCH] p54usb: fix conflict with recent usb changes
Date: Fri, 16 Jan 2009 20:24:31 +0100	[thread overview]
Message-ID: <200901162024.31636.chunkeey@web.de> (raw)

A recent change in the usb core "USB: change interface to usb_lock_device_for_reset()" 
conflicts with "p54usb: utilize usb_reset_device for 3887".

Sadly, we have to call usb_reset_device before we can upload the firmware on 3887.
Unless someone figures out how to reliably stop the 3887 so the hardware is still usable
next time we want to start it.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
---
John,

I guess this patch should be in the next wireless-2.6 pull.
And it would be nice, if you can put "[PATCH] p54: fix p54_set_key's return code" in there too. 
---
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 4d54826..3bfee58 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -435,14 +435,16 @@ static const char p54u_firmware_upload_3887[] = "<\r";
 static int p54u_device_reset_3887(struct ieee80211_hw *dev)
 {
 	struct p54u_priv *priv = dev->priv;
-	int ret, lock;
+	int ret, lock = (priv->intf->condition != USB_INTERFACE_BINDING);
 	u8 buf[4];
 
-	ret = lock = usb_lock_device_for_reset(priv->udev, priv->intf);
-	if (ret < 0) {
-		dev_err(&priv->udev->dev, "(p54usb) unable to lock device for "
-			"reset: %d\n", ret);
-		return ret;
+	if (lock) {
+		ret = usb_lock_device_for_reset(priv->udev, priv->intf);
+		if (ret < 0) {
+			dev_err(&priv->udev->dev, "(p54usb) unable to lock "
+				" device for reset: %d\n", ret);
+			return ret;
+		}
 	}
 
 	ret = usb_reset_device(priv->udev);

             reply	other threads:[~2009-01-16 19:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 19:24 Christian Lamparter [this message]
2009-01-16 21:13 ` [PATCH] p54usb: fix conflict with recent usb changes John W. Linville
2009-01-16 22:06   ` Christian Lamparter

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=200901162024.31636.chunkeey@web.de \
    --to=chunkeey@web.de \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).