usb: Sierra Wireless auto set D0
Subsystems (2)
PATCH 1/1 usb: Sierra Wireless auto set D0
from: Kevin Lloyd <[email protected]>
This patch ensures that the device is turned on when inserted into the system (which mostly affects the EM5725 and MC5720. It also adds more VID/PIDs and matches the N_OUT_URB with the airprime driver.
---
drivers/usb/serial/sierra.c renamed from drivers/usb/serial/sierra.c.orig +20 -0
@@ -14,9 +14,31 @@ Whom based his on the Keyspan driver by Hugh Blemings <[email protected]> History: +v.1.0.6: + klloyd + Added more devices and added Vendor Specific USB message to make sure + that devices are in D0 state when they start. This is very important for + MC5720 and EM5625 modules that go between Windows and Non-Windows + machines. +v.1.0.5: + Greg KH + This saves over 30 lines and fixes a warning from sparse and allows + debugging to work dynamically like all other usb-serial drivers. + klloyd + Changed versioning to v.x.y.z +v.1.04: + klloyd + Adds significant throughput increase to the Sierra driver (uses multiple + urgs for download link). This patch also updates the current sierra.c + driver so that it supports both 3-port Sierra devices and 1-port legacy + devices and removes Sierra's references in other related files (Kconfig + and airprime.c). +v.1.03 + klloyd + Adds DTR line control support and impliments urb control.
*/
-#define DRIVER_VERSION "v.1.0.5"
+#define DRIVER_VERSION "v.1.0.6"
#define DRIVER_AUTHOR "Kevin Lloyd <[email protected]>" #define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
@@ -31,14 +53,14 @@
static struct usb_device_id id_table [] = {
+ { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
{ USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
{ USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
- { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
{ USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
- { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
+ { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
{ USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
+ { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
{ USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
- { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 for Europe */
{ USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */
{ USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */@@ -55,14 +77,14 @@ static struct usb_device_id id_table_1po };
static struct usb_device_id id_table_3port [] = {
+ { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
{ USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
{ USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
- { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
{ USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
- { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
+ { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
{ USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
+ { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
{ USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
- { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 for Europe */
{ USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */
{ USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
{ }@@ -81,7 +103,7 @@ static int debug;
/* per port private data */
#define N_IN_URB 4
-#define N_OUT_URB 1
+#define N_OUT_URB 4
#define IN_BUFLEN 4096
#define OUT_BUFLEN 128
@@ -123,6 +145,7 @@ static int sierra_send_setup(struct usb_
return usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 0x22,0x21,val,0,NULL,0,USB_CTRL_SET_TIMEOUT); + } return 0; @@ -396,6 +419,8 @@ static int sierra_open(struct usb_serial struct usb_serial *serial = port->serial; int i, err; struct urb *urb;
+ int result;
+ __u16 set_mode_dzero = 0x0000; //Set mode to D0
portdata = usb_get_serial_port_data(port);
@@ -442,6 +467,11 @@ static int sierra_open(struct usb_serial
port->tty->low_latency = 1;
+ //set mode to D0
+ result = usb_control_msg(serial->dev,
+ usb_rcvctrlpipe(serial->dev, 0),
+ 0x00,0x40,set_mode_dzero,0,NULL,0,USB_CTRL_SET_TIMEOUT);
+
sierra_send_setup(port); return (0);
Quoted 30 lines · Kevin Lloyd
from: Kevin Lloyd <[email protected]>
This patch ensures that the device is turned on when inserted into the system (which mostly affects the EM5725 and MC5720. It also adds more VID/PIDs and matches the
N_OUT_URBwith the airprime driver.Signed-off-by Kevin Lloyd <[email protected]>---
--- linux-2.6.20-rc5/drivers/usb/serial/sierra.c.orig 2007-01-15
15:17:15.000000000 -0800
+++linux-2.6.20-rc5/drivers/usb/serial/sierra.c2007-01-15
15:41:56.000000000 -0800drivers/usb/serial/sierra.c renamed from drivers/usb/serial/sierra.c.orig +12
-0@@ -14,9 +14,31 @@ Whom based his on the Keyspan driver by Hugh Blemings <[email protected]> History: +v.1.0.6: + klloyd + Added more devices and added Vendor Specific USB message to make sure + that devices are in D0 state when they start. This is very important for + MC5720 and EM5625 modules that go between Windows and Non-Windows + machines. +v.1.0.5: + Greg KH + This saves over 30 lines and fixes a warning from sparse and allows + debugging to work dynamically like all other usb-serial drivers. + klloyd + Changed versioning to v.x.y.z
drivers/usb/serial/sierra.c line 38
Quoted 10 lines
drivers/usb/serial/sierra.c renamed from drivers/usb/serial/sierra.c.orig +10
-0+v.1.04: + klloyd + Adds significant throughput increase to the Sierra driver (uses multiple + urgs for download link). This patch also updates the current sierra.c + driver so that it supports both 3-port Sierra devices and 1-port legacy + devices and removes Sierra's references in other related files (Kconfig + and airprime.c). +v.1.03 + klloyd + Adds DTR line control support and impliments urb control.
This is not needed, nor recommended. The changelog information in the kernel provides this information.
Quoted 7 lines
(quoted diff) +1
-1-#define DRIVER_VERSION "v.1.0.5" +#define DRIVER_VERSION "v.1.0.6" #define DRIVER_AUTHOR "Kevin Lloyd <[email protected]>" #define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
Review line 38
Quoted 9 lines
(quoted diff) +1
-2@@ -31,14 +53,14 @@ static struct usb_device_id id_table [] = { + { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */ { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ - { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ - { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
You are dropping support for this device id. Is that correct? Are you sure?
It was reported to me by Peter Kucmeroski and Jason Ganovsky, and you were CCed when the patch went into the kernel that added this id.
Review static int sierra_send_setup(struct usb_ · line 151
Quoted 8 lines
(quoted diff) +1
-0@@ -123,6 +145,7 @@ static int sierra_send_setup(struct usb_ return usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), 0x22,0x21,val,0,NULL,0,USB_CTRL_SET_TIMEOUT); + } return 0;
Is this change really needed? :)
Review static int sierra_open(struct usb_serial · line 423
Quoted 6 lines
(quoted diff) +2
-0@@ -396,6 +419,8 @@ static int sierra_open(struct usb_serial struct usb_serial *serial = port->serial; int i, err; struct urb *urb; + int result; + __u16 set_mode_dzero = 0x0000; //Set mode to D0
// comments are not recommended in the kernel, especially for something as trivial as a variable name.
Review static int sierra_open(struct usb_serial · line 470
Quoted 7 lines
(quoted diff) +1
-0portdata = usb_get_serial_port_data(port);@@ -442,6 +467,11 @@ static int sierra_open(struct usb_serial port->tty->low_latency = 1; + //set mode to D0
Use /* */ please.
Care to resubmit this?
thanks,
greg k-h
PATCH 1/1 usb: Sierra Wireless auto set D0
from: Kevin Lloyd <[email protected]>
This patch ensures that the device is turned on when inserted into the system. It also adds more VID/PIDs and matches the N_OUT_URB with the airprime driver.
---
drivers/usb/serial/sierra.c renamed from drivers/usb/serial/sierra.c.orig +0 -1
@@ -13,10 +13,9 @@ Portions based on the option driver by Matthias Urlichs <[email protected]> Whom based his on the Keyspan driver by Hugh Blemings <[email protected]> - History:
*/
-#define DRIVER_VERSION "v.1.0.5"
+#define DRIVER_VERSION "v.1.0.6"
#define DRIVER_AUTHOR "Kevin Lloyd <[email protected]>" #define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
@@ -31,14 +30,15 @@
static struct usb_device_id id_table [] = {
+ { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
{ USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
+ { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
{ USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
- { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
{ USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
- { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
+ { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
{ USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
+ { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
{ USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
- { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 for Europe */
{ USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */
{ USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */@@ -55,14 +55,15 @@ static struct usb_device_id id_table_1po };
static struct usb_device_id id_table_3port [] = {
+ { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
{ USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
+ { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
{ USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
- { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
{ USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
- { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
+ { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
{ USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
+ { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
{ USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
- { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 for Europe */
{ USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */
{ USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
{ }@@ -81,7 +82,7 @@ static int debug;
/* per port private data */
#define N_IN_URB 4
-#define N_OUT_URB 1
+#define N_OUT_URB 4
#define IN_BUFLEN 4096
#define OUT_BUFLEN 128
@@ -396,6 +397,8 @@ static int sierra_open(struct usb_serial
struct usb_serial *serial = port->serial; int i, err; struct urb *urb;
+ int result;
+ __u16 set_mode_dzero = 0x0000;
portdata = usb_get_serial_port_data(port);
@@ -442,6 +445,11 @@ static int sierra_open(struct usb_serial
port->tty->low_latency = 1;
+ /*set mode to D0 */
+ result = usb_control_msg(serial->dev,
+ usb_rcvctrlpipe(serial->dev, 0),
+ 0x00,0x40,set_mode_dzero,0,NULL,0,USB_CTRL_SET_TIMEOUT);
+
sierra_send_setup(port); return (0);