aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/io_ti.c10
-rw-r--r--drivers/usb/serial/mos7720.c5
-rw-r--r--drivers/usb/serial/mos7840.c19
-rw-r--r--drivers/usb/serial/sierra.c119
4 files changed, 99 insertions, 54 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 0d3903691e8c..b8670905bc3a 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2794,16 +2794,14 @@ static void edge_shutdown (struct usb_serial *serial)
2794 2794
2795 dbg ("%s", __FUNCTION__); 2795 dbg ("%s", __FUNCTION__);
2796 2796
2797 for (i=0; i < serial->num_ports; ++i) { 2797 for (i = 0; i < serial->num_ports; ++i) {
2798 edge_port = usb_get_serial_port_data(serial->port[i]); 2798 edge_port = usb_get_serial_port_data(serial->port[i]);
2799 edge_remove_sysfs_attrs(edge_port->port); 2799 edge_remove_sysfs_attrs(edge_port->port);
2800 if (edge_port) { 2800 edge_buf_free(edge_port->ep_out_buf);
2801 edge_buf_free(edge_port->ep_out_buf); 2801 kfree(edge_port);
2802 kfree(edge_port);
2803 }
2804 usb_set_serial_port_data(serial->port[i], NULL); 2802 usb_set_serial_port_data(serial->port[i], NULL);
2805 } 2803 }
2806 kfree (usb_get_serial_data(serial)); 2804 kfree(usb_get_serial_data(serial));
2807 usb_set_serial_data(serial, NULL); 2805 usb_set_serial_data(serial, NULL);
2808} 2806}
2809 2807
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 231b584f6d0f..01e811becec4 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -110,11 +110,6 @@ static void mos7720_interrupt_callback(struct urb *urb)
110 110
111 dbg("%s"," : Entering\n"); 111 dbg("%s"," : Entering\n");
112 112
113 if (!urb) {
114 dbg("%s","Invalid Pointer !!!!:\n");
115 return;
116 }
117
118 switch (status) { 113 switch (status) {
119 case 0: 114 case 0:
120 /* success */ 115 /* success */
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 37f41f576d3d..f76480f1455d 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -436,11 +436,6 @@ static void mos7840_control_callback(struct urb *urb)
436 int result = 0; 436 int result = 0;
437 int status = urb->status; 437 int status = urb->status;
438 438
439 if (!urb) {
440 dbg("%s", "Invalid Pointer !!!!:\n");
441 return;
442 }
443
444 mos7840_port = (struct moschip_port *)urb->context; 439 mos7840_port = (struct moschip_port *)urb->context;
445 440
446 switch (status) { 441 switch (status) {
@@ -525,10 +520,6 @@ static void mos7840_interrupt_callback(struct urb *urb)
525 int status = urb->status; 520 int status = urb->status;
526 521
527 dbg("%s", " : Entering\n"); 522 dbg("%s", " : Entering\n");
528 if (!urb) {
529 dbg("%s", "Invalid Pointer !!!!:\n");
530 return;
531 }
532 523
533 switch (status) { 524 switch (status) {
534 case 0: 525 case 0:
@@ -676,11 +667,6 @@ static void mos7840_bulk_in_callback(struct urb *urb)
676 struct tty_struct *tty; 667 struct tty_struct *tty;
677 int status = urb->status; 668 int status = urb->status;
678 669
679 if (!urb) {
680 dbg("%s", "Invalid Pointer !!!!:\n");
681 return;
682 }
683
684 if (status) { 670 if (status) {
685 dbg("nonzero read bulk status received: %d", status); 671 dbg("nonzero read bulk status received: %d", status);
686 return; 672 return;
@@ -753,11 +739,6 @@ static void mos7840_bulk_out_data_callback(struct urb *urb)
753 int status = urb->status; 739 int status = urb->status;
754 int i; 740 int i;
755 741
756 if (!urb) {
757 dbg("%s", "Invalid Pointer !!!!:\n");
758 return;
759 }
760
761 mos7840_port = (struct moschip_port *)urb->context; 742 mos7840_port = (struct moschip_port *)urb->context;
762 spin_lock(&mos7840_port->pool_lock); 743 spin_lock(&mos7840_port->pool_lock);
763 for (i = 0; i < NUM_URBS; i++) { 744 for (i = 0; i < NUM_URBS; i++) {
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index e7db20343d1a..0794ccdebfd4 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -1,7 +1,7 @@
1/* 1/*
2 USB Driver for Sierra Wireless 2 USB Driver for Sierra Wireless
3 3
4 Copyright (C) 2006 Kevin Lloyd <linux@sierrawireless.com> 4 Copyright (C) 2006, 2007 Kevin Lloyd <linux@sierrawireless.com>
5 5
6 IMPORTANT DISCLAIMER: This driver is not commercially supported by 6 IMPORTANT DISCLAIMER: This driver is not commercially supported by
7 Sierra Wireless. Use at your own risk. 7 Sierra Wireless. Use at your own risk.
@@ -12,10 +12,9 @@
12 12
13 Portions based on the option driver by Matthias Urlichs <smurf@smurf.noris.de> 13 Portions based on the option driver by Matthias Urlichs <smurf@smurf.noris.de>
14 Whom based his on the Keyspan driver by Hugh Blemings <hugh@blemings.org> 14 Whom based his on the Keyspan driver by Hugh Blemings <hugh@blemings.org>
15
16*/ 15*/
17 16
18#define DRIVER_VERSION "v.1.0.6" 17#define DRIVER_VERSION "v.1.2.5b"
19#define DRIVER_AUTHOR "Kevin Lloyd <linux@sierrawireless.com>" 18#define DRIVER_AUTHOR "Kevin Lloyd <linux@sierrawireless.com>"
20#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems" 19#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
21 20
@@ -28,23 +27,98 @@
28#include <linux/usb.h> 27#include <linux/usb.h>
29#include <linux/usb/serial.h> 28#include <linux/usb/serial.h>
30 29
30#define SWIMS_USB_REQUEST_SetMode 0x0B
31#define SWIMS_USB_REQUEST_TYPE_SetMode 0x40
32#define SWIMS_USB_INDEX_SetMode 0x0000
33#define SWIMS_SET_MODE_Modem 0x0001
34
35/* per port private data */
36#define N_IN_URB 4
37#define N_OUT_URB 4
38#define IN_BUFLEN 4096
39
40static int debug;
41
42enum devicetype {
43 DEVICE_3_PORT = 0,
44 DEVICE_1_PORT = 1,
45 DEVICE_INSTALLER = 2,
46};
47
48int sierra_set_power_state(struct usb_device *udev, __u16 swiState)
49{
50 int result;
51 dev_dbg(&udev->dev, "%s", "SET POWER STATE");
52 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
53 0x00, /* __u8 request */
54 0x40, /* __u8 request type */
55 swiState, /* __u16 value */
56 0, /* __u16 index */
57 NULL, /* void *data */
58 0, /* __u16 size */
59 USB_CTRL_SET_TIMEOUT); /* int timeout */
60 return result;
61}
62
63int sierra_set_ms_mode(struct usb_device *udev, __u16 eSocMode)
64{
65 int result;
66 dev_dbg(&udev->dev, "%s", "DEVICE MODE SWITCH");
67 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
68 SWIMS_USB_REQUEST_SetMode, /* __u8 request */
69 SWIMS_USB_REQUEST_TYPE_SetMode, /* __u8 request type */
70 eSocMode, /* __u16 value */
71 SWIMS_USB_INDEX_SetMode, /* __u16 index */
72 NULL, /* void *data */
73 0, /* __u16 size */
74 USB_CTRL_SET_TIMEOUT); /* int timeout */
75 return result;
76}
77
78int sierra_probe(struct usb_interface *iface, const struct usb_device_id *id)
79{
80 int result;
81 struct usb_device *udev;
82
83 udev = usb_get_dev(interface_to_usbdev(iface));
84
85 /* Check if in installer mode */
86 if (id->driver_info == DEVICE_INSTALLER) {
87 dev_dbg(&udev->dev, "%s", "FOUND DEVICE(SW)\n");
88 result = sierra_set_ms_mode(udev, SWIMS_SET_MODE_Modem);
89 /*We do not want to bind to the device when in installer mode*/
90 return -EIO;
91 }
92
93 return usb_serial_probe(iface, id);
94}
31 95
32static struct usb_device_id id_table [] = { 96static struct usb_device_id id_table [] = {
33 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ 97 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
34 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */ 98 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
35 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ 99 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
100 { USB_DEVICE(0x0f30, 0x1b1d) }, /* Sierra Wireless MC5720 */
36 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ 101 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
37 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ 102 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
38 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless AirCard 595U */
39 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ 103 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
104 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */
105
40 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ 106 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
41 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ 107 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
42 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */ 108 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
43 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */ 109 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */
44 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ 110 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
111 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/
112 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/
113 { USB_DEVICE(0x1199, 0x6850) }, /* Sierra Wireless AirCard 880 */
114 { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */
115 { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880 E */
116 { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881 E */
45 117
46 { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */ 118 { USB_DEVICE(0x1199, 0x0112), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 580 */
47 { USB_DEVICE(0x0F3D, 0x0112) }, /* AirPrime/Sierra PC 5220 */ 119 { USB_DEVICE(0x0F3D, 0x0112), .driver_info = DEVICE_1_PORT }, /* Airprime/Sierra PC 5220 */
120
121 { USB_DEVICE(0x1199, 0x0FFF), .driver_info = DEVICE_INSTALLER},
48 { } 122 { }
49}; 123};
50MODULE_DEVICE_TABLE(usb, id_table); 124MODULE_DEVICE_TABLE(usb, id_table);
@@ -58,35 +132,36 @@ static struct usb_device_id id_table_1port [] = {
58static struct usb_device_id id_table_3port [] = { 132static struct usb_device_id id_table_3port [] = {
59 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ 133 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
60 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */ 134 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
135 { USB_DEVICE(0x0f30, 0x1b1d) }, /* Sierra Wireless MC5720 */
61 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ 136 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
62 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ 137 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
63 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ 138 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
64 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless AirCard 595U */
65 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ 139 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
140 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U*/
141
66 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ 142 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
67 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ 143 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
68 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */ 144 { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
69 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */ 145 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */
70 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ 146 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
147 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/
148 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/
149 { USB_DEVICE(0x1199, 0x6850) }, /* Sierra Wireless AirCard 880 */
150 { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */
151 { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880E */
152 { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881E */
71 { } 153 { }
72}; 154};
73 155
74static struct usb_driver sierra_driver = { 156static struct usb_driver sierra_driver = {
75 .name = "sierra", 157 .name = "sierra",
76 .probe = usb_serial_probe, 158 .probe = sierra_probe,
77 .disconnect = usb_serial_disconnect, 159 .disconnect = usb_serial_disconnect,
78 .id_table = id_table, 160 .id_table = id_table,
79 .no_dynamic_id = 1, 161 .no_dynamic_id = 1,
80}; 162};
81 163
82 164
83static int debug;
84
85/* per port private data */
86#define N_IN_URB 4
87#define N_OUT_URB 4
88#define IN_BUFLEN 4096
89
90struct sierra_port_private { 165struct sierra_port_private {
91 spinlock_t lock; /* lock the structure */ 166 spinlock_t lock; /* lock the structure */
92 int outstanding_urbs; /* number of out urbs in flight */ 167 int outstanding_urbs; /* number of out urbs in flight */
@@ -421,7 +496,6 @@ static int sierra_open(struct usb_serial_port *port, struct file *filp)
421 int i; 496 int i;
422 struct urb *urb; 497 struct urb *urb;
423 int result; 498 int result;
424 __u16 set_mode_dzero = 0x0000;
425 499
426 portdata = usb_get_serial_port_data(port); 500 portdata = usb_get_serial_port_data(port);
427 501
@@ -457,12 +531,6 @@ static int sierra_open(struct usb_serial_port *port, struct file *filp)
457 531
458 port->tty->low_latency = 1; 532 port->tty->low_latency = 1;
459 533
460 /* set mode to D0 */
461 result = usb_control_msg(serial->dev,
462 usb_rcvctrlpipe(serial->dev, 0),
463 0x00, 0x40, set_mode_dzero, 0, NULL,
464 0, USB_CTRL_SET_TIMEOUT);
465
466 sierra_send_setup(port); 534 sierra_send_setup(port);
467 535
468 /* start up the interrupt endpoint if we have one */ 536 /* start up the interrupt endpoint if we have one */
@@ -510,6 +578,9 @@ static int sierra_startup(struct usb_serial *serial)
510 578
511 dbg("%s", __FUNCTION__); 579 dbg("%s", __FUNCTION__);
512 580
581 /*Set Device mode to D0 */
582 sierra_set_power_state(serial->dev, 0x0000);
583
513 /* Now setup per port private data */ 584 /* Now setup per port private data */
514 for (i = 0; i < serial->num_ports; i++) { 585 for (i = 0; i < serial->num_ports; i++) {
515 port = serial->port[i]; 586 port = serial->port[i];