aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/sierra.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/sierra.c')
-rw-r--r--drivers/usb/serial/sierra.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 706033753adb..8b9eaf383679 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -14,7 +14,7 @@
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*/ 15*/
16 16
17#define DRIVER_VERSION "v.1.2.13a" 17#define DRIVER_VERSION "v.1.3.2"
18#define DRIVER_AUTHOR "Kevin Lloyd <klloyd@sierrawireless.com>" 18#define DRIVER_AUTHOR "Kevin Lloyd <klloyd@sierrawireless.com>"
19#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems" 19#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
20 20
@@ -30,9 +30,6 @@
30 30
31#define SWIMS_USB_REQUEST_SetPower 0x00 31#define SWIMS_USB_REQUEST_SetPower 0x00
32#define SWIMS_USB_REQUEST_SetNmea 0x07 32#define SWIMS_USB_REQUEST_SetNmea 0x07
33#define SWIMS_USB_REQUEST_SetMode 0x0B
34#define SWIMS_USB_REQUEST_GetSwocInfo 0x0A
35#define SWIMS_SET_MODE_Modem 0x0001
36 33
37/* per port private data */ 34/* per port private data */
38#define N_IN_URB 4 35#define N_IN_URB 4
@@ -163,7 +160,7 @@ static struct usb_device_id id_table [] = {
163 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ 160 { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */
164 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */ 161 { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */
165 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */ 162 { USB_DEVICE(0x1199, 0x0218) }, /* Sierra Wireless MC5720 */
166 { USB_DEVICE(0x0f30, 0x1b1d) }, /* Sierra Wireless MC5720 */ 163 { USB_DEVICE(0x03f0, 0x1b1d) }, /* HP ev2200 a.k.a MC5720 */
167 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ 164 { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */
168 { USB_DEVICE(0x1199, 0x0024) }, /* Sierra Wireless MC5727 */ 165 { USB_DEVICE(0x1199, 0x0024) }, /* Sierra Wireless MC5727 */
169 { USB_DEVICE(0x1199, 0x0220) }, /* Sierra Wireless MC5725 */ 166 { USB_DEVICE(0x1199, 0x0220) }, /* Sierra Wireless MC5725 */
@@ -175,6 +172,8 @@ static struct usb_device_id id_table [] = {
175 /* Sierra Wireless Device */ 172 /* Sierra Wireless Device */
176 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0025, 0xFF, 0xFF, 0xFF) }, 173 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0025, 0xFF, 0xFF, 0xFF) },
177 { USB_DEVICE(0x1199, 0x0026) }, /* Sierra Wireless Device */ 174 { USB_DEVICE(0x1199, 0x0026) }, /* Sierra Wireless Device */
175 { USB_DEVICE(0x1199, 0x0027) }, /* Sierra Wireless Device */
176 { USB_DEVICE(0x1199, 0x0028) }, /* Sierra Wireless Device */
178 177
179 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ 178 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
180 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ 179 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
@@ -187,6 +186,7 @@ static struct usb_device_id id_table [] = {
187 { USB_DEVICE(0x1199, 0x6821) }, /* Sierra Wireless AirCard 875U */ 186 { USB_DEVICE(0x1199, 0x6821) }, /* Sierra Wireless AirCard 875U */
188 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780 */ 187 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780 */
189 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781 */ 188 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781 */
189 { USB_DEVICE(0x1199, 0x683A) }, /* Sierra Wireless MC8785 */
190 { USB_DEVICE(0x1199, 0x683B) }, /* Sierra Wireless MC8785 Composite */ 190 { USB_DEVICE(0x1199, 0x683B) }, /* Sierra Wireless MC8785 Composite */
191 { USB_DEVICE(0x1199, 0x683C) }, /* Sierra Wireless MC8790 */ 191 { USB_DEVICE(0x1199, 0x683C) }, /* Sierra Wireless MC8790 */
192 { USB_DEVICE(0x1199, 0x683D) }, /* Sierra Wireless MC8790 */ 192 { USB_DEVICE(0x1199, 0x683D) }, /* Sierra Wireless MC8790 */
@@ -204,6 +204,8 @@ static struct usb_device_id id_table [] = {
204 /* Sierra Wireless Device */ 204 /* Sierra Wireless Device */
205 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6890, 0xFF, 0xFF, 0xFF)}, 205 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6890, 0xFF, 0xFF, 0xFF)},
206 /* Sierra Wireless Device */ 206 /* Sierra Wireless Device */
207 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6891, 0xFF, 0xFF, 0xFF)},
208 /* Sierra Wireless Device */
207 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)}, 209 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)},
208 210
209 { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */ 211 { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */
@@ -438,14 +440,14 @@ static void sierra_indat_callback(struct urb *urb)
438 dbg("%s: nonzero status: %d on endpoint %02x.", 440 dbg("%s: nonzero status: %d on endpoint %02x.",
439 __func__, status, endpoint); 441 __func__, status, endpoint);
440 } else { 442 } else {
441 tty = port->port.tty;
442 if (urb->actual_length) { 443 if (urb->actual_length) {
444 tty = tty_port_tty_get(&port->port);
443 tty_buffer_request_room(tty, urb->actual_length); 445 tty_buffer_request_room(tty, urb->actual_length);
444 tty_insert_flip_string(tty, data, urb->actual_length); 446 tty_insert_flip_string(tty, data, urb->actual_length);
445 tty_flip_buffer_push(tty); 447 tty_flip_buffer_push(tty);
446 } else { 448 tty_kref_put(tty);
449 } else
447 dbg("%s: empty read urb received", __func__); 450 dbg("%s: empty read urb received", __func__);
448 }
449 451
450 /* Resubmit urb so we continue receiving */ 452 /* Resubmit urb so we continue receiving */
451 if (port->port.count && status != -ESHUTDOWN) { 453 if (port->port.count && status != -ESHUTDOWN) {
@@ -483,6 +485,7 @@ static void sierra_instat_callback(struct urb *urb)
483 unsigned char signals = *((unsigned char *) 485 unsigned char signals = *((unsigned char *)
484 urb->transfer_buffer + 486 urb->transfer_buffer +
485 sizeof(struct usb_ctrlrequest)); 487 sizeof(struct usb_ctrlrequest));
488 struct tty_struct *tty;
486 489
487 dbg("%s: signal x%x", __func__, signals); 490 dbg("%s: signal x%x", __func__, signals);
488 491
@@ -492,9 +495,11 @@ static void sierra_instat_callback(struct urb *urb)
492 portdata->dsr_state = ((signals & 0x02) ? 1 : 0); 495 portdata->dsr_state = ((signals & 0x02) ? 1 : 0);
493 portdata->ri_state = ((signals & 0x08) ? 1 : 0); 496 portdata->ri_state = ((signals & 0x08) ? 1 : 0);
494 497
495 if (port->port.tty && !C_CLOCAL(port->port.tty) && 498 tty = tty_port_tty_get(&port->port);
499 if (tty && !C_CLOCAL(tty) &&
496 old_dcd_state && !portdata->dcd_state) 500 old_dcd_state && !portdata->dcd_state)
497 tty_hangup(port->port.tty); 501 tty_hangup(tty);
502 tty_kref_put(tty);
498 } else { 503 } else {
499 dbg("%s: type %x req %x", __func__, 504 dbg("%s: type %x req %x", __func__,
500 req_pkt->bRequestType, req_pkt->bRequest); 505 req_pkt->bRequestType, req_pkt->bRequest);
@@ -614,8 +619,7 @@ static void sierra_close(struct tty_struct *tty,
614 } 619 }
615 620
616 usb_kill_urb(port->interrupt_in_urb); 621 usb_kill_urb(port->interrupt_in_urb);
617 622 tty_port_tty_set(&port->port, NULL);
618 port->port.tty = NULL; /* FIXME */
619} 623}
620 624
621static int sierra_startup(struct usb_serial *serial) 625static int sierra_startup(struct usb_serial *serial)