From: Pete Zaitcev <zaitcev@redhat.com>
To: linux-usb@vger.kernel.org
Cc: zaitcev@redhat.com, <preining@logic.at>,
<kristoffer.ericson@gmail.com>, <drussell@redhat.com>,
<johann.wilhelm@student.tugraz.at>,
linux-kernel@vger.kernel.org
Subject: Add the infamous Huawei E220 to option.c
Date: Wed, 28 Nov 2007 16:13:05 -0800 [thread overview]
Message-ID: <20071128161305.b01167b3.zaitcev@redhat.com> (raw)
Hi, All:
It looks like the Huawei E220 saga is not over yet. A collegue of mine,
David Russll, reported that the modem does not work reliably on Fedora 8,
which does have the initializer in usb-storage.
The problem stems from the fact that both option and usb-storage can bind
to the modem when in storage mode: the former binds because of the storage
class, the latter binds because of VID/PID match. The modprobe loads both,
it's random which wins. If usb-storage wins, everything is fine. If option
wins, it binds to modem still in storage mode and does not work.
I propose we add the same initializer that usb-storage has to the option.
This way no matter which driver wins the modem gets initialized. The
patch is tested on David's modem, but I would like someone give it more
testing.
I dunno, do we want some kind of code sharing between storage and option?
They both could use the normal usb_control_msg, I think.
Also, from archives it looks like Johann may need PID 0x1004 added.
Since we're on topic, David's modem has exactly same IDs as Norbert's,
but works fine with the length of 1. Although it's possible that the
firmware is different without different firmware reported in USB desc-
riptors. Does anyone know a magic AT command? ATI or something?
Norbert, please try my patch, maybe it'll work this time.
And finally, pleas stop using that script from the polish website and
above all quit using the generic serial subdriver. The option must
work now with the patch. Please let me know if it fails.
Thanks in advance,
-- Pete
diff -urp -X dontdiff linux-2.6.23.1-42.fc8/drivers/usb/serial/option.c linux-2.6.23.1-42.fc8.e220.1/drivers/usb/serial/option.c
--- linux-2.6.23.1-42.fc8/drivers/usb/serial/option.c 2007-10-09 13:31:38.000000000 -0700
+++ linux-2.6.23.1-42.fc8.e220.1/drivers/usb/serial/option.c 2007-11-27 21:36:11.000000000 -0800
@@ -448,7 +448,7 @@ static void option_indat_callback(struct
err = usb_submit_urb(urb, GFP_ATOMIC);
if (err)
printk(KERN_ERR "%s: resubmit read urb failed. "
- "(%d)", __FUNCTION__, err);
+ "(%d)\n", __FUNCTION__, err);
}
}
return;
@@ -728,6 +728,35 @@ static int option_send_setup(struct usb_
return 0;
}
+static void option_start_huawei(struct usb_serial *serial)
+{
+ struct usb_device *dev = serial->dev;
+ char *buf;
+ int rc;
+
+ if (!(le16_to_cpu(dev->descriptor.idVendor) == HUAWEI_VENDOR_ID &&
+ le16_to_cpu(dev->descriptor.idProduct) == HUAWEI_PRODUCT_E220))
+ return;
+
+ if ((buf = kmalloc(1, GFP_KERNEL)) == 0)
+ goto err_buf;
+
+ buf[0] = 0x1;
+ rc = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
+ USB_REQ_SET_FEATURE, USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+ 0x01, 0x0, buf, 1, 1000);
+ if (rc) {
+ printk(KERN_ERR "%s: HUAWEI E220 setup failed (%d)\n",
+ __FUNCTION__, rc);
+ }
+
+ kfree(buf);
+ return;
+
+err_buf:
+ ;
+}
+
static int option_startup(struct usb_serial *serial)
{
int i, err;
@@ -736,6 +765,8 @@ static int option_startup(struct usb_ser
dbg("%s", __FUNCTION__);
+ option_start_huawei(serial);
+
/* Now setup per port private data */
for (i = 0; i < serial->num_ports; i++) {
port = serial->port[i];
next reply other threads:[~2007-11-29 0:13 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 0:13 Pete Zaitcev [this message]
2007-11-29 6:33 ` Add the infamous Huawei E220 to option.c Johann Wilhelm
2007-11-29 7:44 ` Oliver Neukum
2007-11-29 8:01 ` Pete Zaitcev
2007-11-29 8:14 ` Oliver Neukum
2007-11-29 9:09 ` Matthew Dharm
2007-11-29 10:01 ` Rui Santos
2007-11-29 10:49 ` Oliver Neukum
2007-11-29 11:07 ` Rui Santos
2007-11-29 11:55 ` Oliver Neukum
2007-11-29 14:05 ` Johann Wilhelm
2007-11-29 14:36 ` Kristoffer Ericson
2007-11-29 14:41 ` Oliver Neukum
2007-11-29 18:53 ` Jaime Velasco Juan
2007-11-29 23:23 ` Oliver Neukum
2007-11-30 16:30 ` [PATCH] USB: option: Bind to the correct interface of the Huawei E220 Jaime Velasco Juan
2007-12-01 8:07 ` Norbert Preining
2007-12-01 8:34 ` Pete Zaitcev
2007-12-01 10:04 ` Norbert Preining
2007-12-01 18:36 ` Borislav Petkov
2007-12-05 16:34 ` Pete Zaitcev
2007-12-05 18:23 ` Oliver Neukum
2007-12-05 19:14 ` Pete Zaitcev
2007-11-29 19:12 ` Add the infamous Huawei E220 to option.c Rui Santos
2007-11-29 17:08 ` Greg KH
2007-11-29 7:38 ` Oliver Neukum
2007-11-29 7:52 ` Pete Zaitcev
2007-11-29 8:04 ` Oliver Neukum
2007-11-29 8:10 ` Pete Zaitcev
2007-11-29 14:14 ` Norbert Preining
2007-11-29 14:16 ` Norbert Preining
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=20071128161305.b01167b3.zaitcev@redhat.com \
--to=zaitcev@redhat.com \
--cc=drussell@redhat.com \
--cc=johann.wilhelm@student.tugraz.at \
--cc=kristoffer.ericson@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=preining@logic.at \
/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