From: Stefan Seyfried <stefan.seyfried@googlemail.com>
To: linux-wireless@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Stefan Seyfried <seife@sphairon.com>
Subject: [PATCH 2/2] zd1211rw: improve ejecting of fake CDROM
Date: Tue, 8 Dec 2009 15:21:35 +0100 [thread overview]
Message-ID: <1260282095-17042-3-git-send-email-stefan.seyfried@googlemail.com> (raw)
In-Reply-To: <1260282095-17042-2-git-send-email-stefan.seyfried@googlemail.com>
From: Stefan Seyfried <seife@sphairon.com>
The zd1211rw always assumed that the storage device is at endpoint 1,
but there are devices (Spairon Homelink 1202) that are at endpoint 0.
Try both, starting with 1 to make sure to not break existing setups.
Signed-off-by: Stefan Seyfried <seife@sphairon.com>
---
drivers/net/wireless/zd1211rw/zd_usb.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index ac19ecd..4daf1c9 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -1078,11 +1078,15 @@ static int eject_installer(struct usb_interface *intf)
int r;
/* Find bulk out endpoint */
- endpoint = &iface_desc->endpoint[1].desc;
- if (usb_endpoint_dir_out(endpoint) &&
- usb_endpoint_xfer_bulk(endpoint)) {
- bulk_out_ep = endpoint->bEndpointAddress;
- } else {
+ for (r = 1; r >= 0; r--) {
+ endpoint = &iface_desc->endpoint[r].desc;
+ if (usb_endpoint_dir_out(endpoint) &&
+ usb_endpoint_xfer_bulk(endpoint)) {
+ bulk_out_ep = endpoint->bEndpointAddress;
+ break;
+ }
+ }
+ if (r == -1) {
dev_err(&udev->dev,
"zd1211rw: Could not find bulk out endpoint\n");
return -ENODEV;
--
1.6.5.3
next prev parent reply other threads:[~2009-12-08 14:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-08 14:21 [PATCH 0/2] Add support for Sphairon Homelink 1202 USB WLAN Stefan Seyfried
2009-12-08 14:21 ` [PATCH 1/2] ar9170usb: add Sphairon Homelink 1202 USB ID Stefan Seyfried
2009-12-08 14:21 ` Stefan Seyfried [this message]
2009-12-11 12:36 ` [PATCH 0/2] Add support for Sphairon Homelink 1202 USB WLAN Stefan Seyfried
2009-12-11 14:42 ` John W. Linville
2009-12-11 14:55 ` Johannes Berg
2009-12-11 15:05 ` Stefan Seyfried
2009-12-11 15:01 ` Stefan Seyfried
2009-12-11 19:21 ` Dan Williams
2009-12-11 22:37 ` Stefan Seyfried
2009-12-15 12:17 ` Stefan Seyfried
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=1260282095-17042-3-git-send-email-stefan.seyfried@googlemail.com \
--to=stefan.seyfried@googlemail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=seife@sphairon.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
all inboxes | Powered by JetHome®