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.c129
1 files changed, 84 insertions, 45 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index ed678811e6a6..29074c1ba22b 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, 2007, 2008 Kevin Lloyd <linux@sierrawireless.com> 4 Copyright (C) 2006, 2007, 2008 Kevin Lloyd <klloyd@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.
@@ -14,8 +14,8 @@
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.8" 17#define DRIVER_VERSION "v.1.2.9c"
18#define DRIVER_AUTHOR "Kevin Lloyd <linux@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
21#include <linux/kernel.h> 21#include <linux/kernel.h>
@@ -31,7 +31,6 @@
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 33#define SWIMS_USB_REQUEST_SetMode 0x0B
34#define SWIMS_USB_REQUEST_TYPE_VSC_SET 0x40
35#define SWIMS_SET_MODE_Modem 0x0001 34#define SWIMS_SET_MODE_Modem 0x0001
36 35
37/* per port private data */ 36/* per port private data */
@@ -55,7 +54,7 @@ static int sierra_set_power_state(struct usb_device *udev, __u16 swiState)
55 dev_dbg(&udev->dev, "%s", "SET POWER STATE\n"); 54 dev_dbg(&udev->dev, "%s", "SET POWER STATE\n");
56 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 55 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
57 SWIMS_USB_REQUEST_SetPower, /* __u8 request */ 56 SWIMS_USB_REQUEST_SetPower, /* __u8 request */
58 SWIMS_USB_REQUEST_TYPE_VSC_SET, /* __u8 request type */ 57 USB_TYPE_VENDOR, /* __u8 request type */
59 swiState, /* __u16 value */ 58 swiState, /* __u16 value */
60 0, /* __u16 index */ 59 0, /* __u16 index */
61 NULL, /* void *data */ 60 NULL, /* void *data */
@@ -70,7 +69,7 @@ static int sierra_set_ms_mode(struct usb_device *udev, __u16 eSWocMode)
70 dev_dbg(&udev->dev, "%s", "DEVICE MODE SWITCH\n"); 69 dev_dbg(&udev->dev, "%s", "DEVICE MODE SWITCH\n");
71 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 70 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
72 SWIMS_USB_REQUEST_SetMode, /* __u8 request */ 71 SWIMS_USB_REQUEST_SetMode, /* __u8 request */
73 SWIMS_USB_REQUEST_TYPE_VSC_SET, /* __u8 request type */ 72 USB_TYPE_VENDOR, /* __u8 request type */
74 eSWocMode, /* __u16 value */ 73 eSWocMode, /* __u16 value */
75 0x0000, /* __u16 index */ 74 0x0000, /* __u16 index */
76 NULL, /* void *data */ 75 NULL, /* void *data */
@@ -85,7 +84,7 @@ static int sierra_vsc_set_nmea(struct usb_device *udev, __u16 enable)
85 dev_dbg(&udev->dev, "%s", "NMEA Enable sent\n"); 84 dev_dbg(&udev->dev, "%s", "NMEA Enable sent\n");
86 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 85 result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
87 SWIMS_USB_REQUEST_SetNmea, /* __u8 request */ 86 SWIMS_USB_REQUEST_SetNmea, /* __u8 request */
88 SWIMS_USB_REQUEST_TYPE_VSC_SET, /* __u8 request type */ 87 USB_TYPE_VENDOR, /* __u8 request type */
89 enable, /* __u16 value */ 88 enable, /* __u16 value */
90 0x0000, /* __u16 index */ 89 0x0000, /* __u16 index */
91 NULL, /* void *data */ 90 NULL, /* void *data */
@@ -109,6 +108,26 @@ static int sierra_calc_num_ports(struct usb_serial *serial)
109 return result; 108 return result;
110} 109}
111 110
111static int sierra_calc_interface(struct usb_serial *serial)
112{
113 int interface;
114 struct usb_interface *p_interface;
115 struct usb_host_interface *p_host_interface;
116
117 /* Get the interface structure pointer from the serial struct */
118 p_interface = serial->interface;
119
120 /* Get a pointer to the host interface structure */
121 p_host_interface = p_interface->cur_altsetting;
122
123 /* read the interface descriptor for this active altsetting
124 * to find out the interface number we are on
125 */
126 interface = p_host_interface->desc.bInterfaceNumber;
127
128 return interface;
129}
130
112static int sierra_probe(struct usb_serial *serial, 131static int sierra_probe(struct usb_serial *serial,
113 const struct usb_device_id *id) 132 const struct usb_device_id *id)
114{ 133{
@@ -124,6 +143,22 @@ static int sierra_probe(struct usb_serial *serial,
124 ifnum = serial->interface->cur_altsetting->desc.bInterfaceNumber; 143 ifnum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
125 udev = serial->dev; 144 udev = serial->dev;
126 145
146 /* Figure out the interface number from the serial structure */
147 ifnum = sierra_calc_interface(serial);
148
149 /*
150 * If this interface supports more than 1 alternate
151 * select the 2nd one
152 */
153 if (serial->interface->num_altsetting == 2) {
154 dev_dbg(&udev->dev,
155 "Selecting alt setting for interface %d\n",
156 ifnum);
157
158 /* We know the alternate setting is 1 for the MC8785 */
159 usb_set_interface(udev, ifnum, 1);
160 }
161
127 /* Check if in installer mode */ 162 /* Check if in installer mode */
128 if (truinstall && id->driver_info == DEVICE_INSTALLER) { 163 if (truinstall && id->driver_info == DEVICE_INSTALLER) {
129 dev_dbg(&udev->dev, "%s", "FOUND TRU-INSTALL DEVICE(SW)\n"); 164 dev_dbg(&udev->dev, "%s", "FOUND TRU-INSTALL DEVICE(SW)\n");
@@ -156,7 +191,7 @@ static struct usb_device_id id_table [] = {
156 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ 191 { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */
157 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ 192 { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */
158 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ 193 { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */
159 { USB_DEVICE(0x1199, 0x0023) }, /* Sierra Wireless AirCard */ 194 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x0023, 0xFF, 0xFF, 0xFF) }, /* Sierra Wireless C597 */
160 195
161 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ 196 { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */
162 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ 197 { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
@@ -164,15 +199,20 @@ static struct usb_device_id id_table [] = {
164 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */ 199 { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */
165 { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Thinkpad internal) */ 200 { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Thinkpad internal) */
166 { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */ 201 { USB_DEVICE(0x1199, 0x6815) }, /* Sierra Wireless MC8775 */
202 { USB_DEVICE(0x03f0, 0x1e1d) }, /* HP hs2300 a.k.a MC8775 */
167 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ 203 { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
204 { USB_DEVICE(0x1199, 0x6821) }, /* Sierra Wireless AirCard 875U */
168 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/ 205 { USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/
169 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/ 206 { USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/
207 { USB_DEVICE(0x1199, 0x683B), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless MC8785 Composite*/
170 { USB_DEVICE(0x1199, 0x6850) }, /* Sierra Wireless AirCard 880 */ 208 { USB_DEVICE(0x1199, 0x6850) }, /* Sierra Wireless AirCard 880 */
171 { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */ 209 { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */
172 { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880 E */ 210 { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880 E */
173 { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881 E */ 211 { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881 E */
174 { USB_DEVICE(0x1199, 0x6855) }, /* Sierra Wireless AirCard 880 U */ 212 { USB_DEVICE(0x1199, 0x6855) }, /* Sierra Wireless AirCard 880 U */
175 { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881 U */ 213 { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881 U */
214 { USB_DEVICE(0x1199, 0x6859), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 885 E */
215 { USB_DEVICE(0x1199, 0x685A), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 885 E */
176 216
177 { USB_DEVICE(0x1199, 0x6468) }, /* Sierra Wireless MP3G - EVDO */ 217 { USB_DEVICE(0x1199, 0x6468) }, /* Sierra Wireless MP3G - EVDO */
178 { USB_DEVICE(0x1199, 0x6469) }, /* Sierra Wireless MP3G - UMTS/HSPA */ 218 { USB_DEVICE(0x1199, 0x6469) }, /* Sierra Wireless MP3G - UMTS/HSPA */
@@ -216,7 +256,7 @@ static int sierra_send_setup(struct usb_serial_port *port)
216 struct sierra_port_private *portdata; 256 struct sierra_port_private *portdata;
217 __u16 interface = 0; 257 __u16 interface = 0;
218 258
219 dbg("%s", __FUNCTION__); 259 dbg("%s", __func__);
220 260
221 portdata = usb_get_serial_port_data(port); 261 portdata = usb_get_serial_port_data(port);
222 262
@@ -246,24 +286,24 @@ static int sierra_send_setup(struct usb_serial_port *port)
246 286
247static void sierra_rx_throttle(struct usb_serial_port *port) 287static void sierra_rx_throttle(struct usb_serial_port *port)
248{ 288{
249 dbg("%s", __FUNCTION__); 289 dbg("%s", __func__);
250} 290}
251 291
252static void sierra_rx_unthrottle(struct usb_serial_port *port) 292static void sierra_rx_unthrottle(struct usb_serial_port *port)
253{ 293{
254 dbg("%s", __FUNCTION__); 294 dbg("%s", __func__);
255} 295}
256 296
257static void sierra_break_ctl(struct usb_serial_port *port, int break_state) 297static void sierra_break_ctl(struct usb_serial_port *port, int break_state)
258{ 298{
259 /* Unfortunately, I don't know how to send a break */ 299 /* Unfortunately, I don't know how to send a break */
260 dbg("%s", __FUNCTION__); 300 dbg("%s", __func__);
261} 301}
262 302
263static void sierra_set_termios(struct usb_serial_port *port, 303static void sierra_set_termios(struct usb_serial_port *port,
264 struct ktermios *old_termios) 304 struct ktermios *old_termios)
265{ 305{
266 dbg("%s", __FUNCTION__); 306 dbg("%s", __func__);
267 tty_termios_copy_hw(port->tty->termios, old_termios); 307 tty_termios_copy_hw(port->tty->termios, old_termios);
268 sierra_send_setup(port); 308 sierra_send_setup(port);
269} 309}
@@ -317,14 +357,14 @@ static void sierra_outdat_callback(struct urb *urb)
317 int status = urb->status; 357 int status = urb->status;
318 unsigned long flags; 358 unsigned long flags;
319 359
320 dbg("%s - port %d", __FUNCTION__, port->number); 360 dbg("%s - port %d", __func__, port->number);
321 361
322 /* free up the transfer buffer, as usb_free_urb() does not do this */ 362 /* free up the transfer buffer, as usb_free_urb() does not do this */
323 kfree(urb->transfer_buffer); 363 kfree(urb->transfer_buffer);
324 364
325 if (status) 365 if (status)
326 dbg("%s - nonzero write bulk status received: %d", 366 dbg("%s - nonzero write bulk status received: %d",
327 __FUNCTION__, status); 367 __func__, status);
328 368
329 spin_lock_irqsave(&portdata->lock, flags); 369 spin_lock_irqsave(&portdata->lock, flags);
330 --portdata->outstanding_urbs; 370 --portdata->outstanding_urbs;
@@ -346,12 +386,12 @@ static int sierra_write(struct usb_serial_port *port,
346 386
347 portdata = usb_get_serial_port_data(port); 387 portdata = usb_get_serial_port_data(port);
348 388
349 dbg("%s: write (%d chars)", __FUNCTION__, count); 389 dbg("%s: write (%d chars)", __func__, count);
350 390
351 spin_lock_irqsave(&portdata->lock, flags); 391 spin_lock_irqsave(&portdata->lock, flags);
352 if (portdata->outstanding_urbs > N_OUT_URB) { 392 if (portdata->outstanding_urbs > N_OUT_URB) {
353 spin_unlock_irqrestore(&portdata->lock, flags); 393 spin_unlock_irqrestore(&portdata->lock, flags);
354 dbg("%s - write limit hit\n", __FUNCTION__); 394 dbg("%s - write limit hit\n", __func__);
355 return 0; 395 return 0;
356 } 396 }
357 portdata->outstanding_urbs++; 397 portdata->outstanding_urbs++;
@@ -373,7 +413,7 @@ static int sierra_write(struct usb_serial_port *port,
373 413
374 memcpy(buffer, buf, count); 414 memcpy(buffer, buf, count);
375 415
376 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, count, buffer); 416 usb_serial_debug_data(debug, &port->dev, __func__, count, buffer);
377 417
378 usb_fill_bulk_urb(urb, serial->dev, 418 usb_fill_bulk_urb(urb, serial->dev,
379 usb_sndbulkpipe(serial->dev, 419 usb_sndbulkpipe(serial->dev,
@@ -384,7 +424,7 @@ static int sierra_write(struct usb_serial_port *port,
384 status = usb_submit_urb(urb, GFP_ATOMIC); 424 status = usb_submit_urb(urb, GFP_ATOMIC);
385 if (status) { 425 if (status) {
386 dev_err(&port->dev, "%s - usb_submit_urb(write bulk) failed " 426 dev_err(&port->dev, "%s - usb_submit_urb(write bulk) failed "
387 "with status = %d\n", __FUNCTION__, status); 427 "with status = %d\n", __func__, status);
388 count = status; 428 count = status;
389 goto error; 429 goto error;
390 } 430 }
@@ -414,14 +454,14 @@ static void sierra_indat_callback(struct urb *urb)
414 unsigned char *data = urb->transfer_buffer; 454 unsigned char *data = urb->transfer_buffer;
415 int status = urb->status; 455 int status = urb->status;
416 456
417 dbg("%s: %p", __FUNCTION__, urb); 457 dbg("%s: %p", __func__, urb);
418 458
419 endpoint = usb_pipeendpoint(urb->pipe); 459 endpoint = usb_pipeendpoint(urb->pipe);
420 port = (struct usb_serial_port *) urb->context; 460 port = urb->context;
421 461
422 if (status) { 462 if (status) {
423 dbg("%s: nonzero status: %d on endpoint %02x.", 463 dbg("%s: nonzero status: %d on endpoint %02x.",
424 __FUNCTION__, status, endpoint); 464 __func__, status, endpoint);
425 } else { 465 } else {
426 tty = port->tty; 466 tty = port->tty;
427 if (urb->actual_length) { 467 if (urb->actual_length) {
@@ -429,7 +469,7 @@ static void sierra_indat_callback(struct urb *urb)
429 tty_insert_flip_string(tty, data, urb->actual_length); 469 tty_insert_flip_string(tty, data, urb->actual_length);
430 tty_flip_buffer_push(tty); 470 tty_flip_buffer_push(tty);
431 } else { 471 } else {
432 dbg("%s: empty read urb received", __FUNCTION__); 472 dbg("%s: empty read urb received", __func__);
433 } 473 }
434 474
435 /* Resubmit urb so we continue receiving */ 475 /* Resubmit urb so we continue receiving */
@@ -447,19 +487,19 @@ static void sierra_instat_callback(struct urb *urb)
447{ 487{
448 int err; 488 int err;
449 int status = urb->status; 489 int status = urb->status;
450 struct usb_serial_port *port = (struct usb_serial_port *) urb->context; 490 struct usb_serial_port *port = urb->context;
451 struct sierra_port_private *portdata = usb_get_serial_port_data(port); 491 struct sierra_port_private *portdata = usb_get_serial_port_data(port);
452 struct usb_serial *serial = port->serial; 492 struct usb_serial *serial = port->serial;
453 493
454 dbg("%s", __FUNCTION__); 494 dbg("%s", __func__);
455 dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata); 495 dbg("%s: urb %p port %p has data %p", __func__, urb, port, portdata);
456 496
457 if (status == 0) { 497 if (status == 0) {
458 struct usb_ctrlrequest *req_pkt = 498 struct usb_ctrlrequest *req_pkt =
459 (struct usb_ctrlrequest *)urb->transfer_buffer; 499 (struct usb_ctrlrequest *)urb->transfer_buffer;
460 500
461 if (!req_pkt) { 501 if (!req_pkt) {
462 dbg("%s: NULL req_pkt\n", __FUNCTION__); 502 dbg("%s: NULL req_pkt\n", __func__);
463 return; 503 return;
464 } 504 }
465 if ((req_pkt->bRequestType == 0xA1) && 505 if ((req_pkt->bRequestType == 0xA1) &&
@@ -469,7 +509,7 @@ static void sierra_instat_callback(struct urb *urb)
469 urb->transfer_buffer + 509 urb->transfer_buffer +
470 sizeof(struct usb_ctrlrequest)); 510 sizeof(struct usb_ctrlrequest));
471 511
472 dbg("%s: signal x%x", __FUNCTION__, signals); 512 dbg("%s: signal x%x", __func__, signals);
473 513
474 old_dcd_state = portdata->dcd_state; 514 old_dcd_state = portdata->dcd_state;
475 portdata->cts_state = 1; 515 portdata->cts_state = 1;
@@ -481,11 +521,11 @@ static void sierra_instat_callback(struct urb *urb)
481 old_dcd_state && !portdata->dcd_state) 521 old_dcd_state && !portdata->dcd_state)
482 tty_hangup(port->tty); 522 tty_hangup(port->tty);
483 } else { 523 } else {
484 dbg("%s: type %x req %x", __FUNCTION__, 524 dbg("%s: type %x req %x", __func__,
485 req_pkt->bRequestType,req_pkt->bRequest); 525 req_pkt->bRequestType, req_pkt->bRequest);
486 } 526 }
487 } else 527 } else
488 dbg("%s: error %d", __FUNCTION__, status); 528 dbg("%s: error %d", __func__, status);
489 529
490 /* Resubmit urb so we continue receiving IRQ data */ 530 /* Resubmit urb so we continue receiving IRQ data */
491 if (status != -ESHUTDOWN) { 531 if (status != -ESHUTDOWN) {
@@ -493,7 +533,7 @@ static void sierra_instat_callback(struct urb *urb)
493 err = usb_submit_urb(urb, GFP_ATOMIC); 533 err = usb_submit_urb(urb, GFP_ATOMIC);
494 if (err) 534 if (err)
495 dbg("%s: resubmit intr urb failed. (%d)", 535 dbg("%s: resubmit intr urb failed. (%d)",
496 __FUNCTION__, err); 536 __func__, err);
497 } 537 }
498} 538}
499 539
@@ -502,14 +542,14 @@ static int sierra_write_room(struct usb_serial_port *port)
502 struct sierra_port_private *portdata = usb_get_serial_port_data(port); 542 struct sierra_port_private *portdata = usb_get_serial_port_data(port);
503 unsigned long flags; 543 unsigned long flags;
504 544
505 dbg("%s - port %d", __FUNCTION__, port->number); 545 dbg("%s - port %d", __func__, port->number);
506 546
507 /* try to give a good number back based on if we have any free urbs at 547 /* try to give a good number back based on if we have any free urbs at
508 * this point in time */ 548 * this point in time */
509 spin_lock_irqsave(&portdata->lock, flags); 549 spin_lock_irqsave(&portdata->lock, flags);
510 if (portdata->outstanding_urbs > N_OUT_URB * 2 / 3) { 550 if (portdata->outstanding_urbs > N_OUT_URB * 2 / 3) {
511 spin_unlock_irqrestore(&portdata->lock, flags); 551 spin_unlock_irqrestore(&portdata->lock, flags);
512 dbg("%s - write limit hit\n", __FUNCTION__); 552 dbg("%s - write limit hit\n", __func__);
513 return 0; 553 return 0;
514 } 554 }
515 spin_unlock_irqrestore(&portdata->lock, flags); 555 spin_unlock_irqrestore(&portdata->lock, flags);
@@ -519,13 +559,15 @@ static int sierra_write_room(struct usb_serial_port *port)
519 559
520static int sierra_chars_in_buffer(struct usb_serial_port *port) 560static int sierra_chars_in_buffer(struct usb_serial_port *port)
521{ 561{
522 dbg("%s - port %d", __FUNCTION__, port->number); 562 dbg("%s - port %d", __func__, port->number);
523 563
524 /* 564 /*
525 * We can't really account for how much data we 565 * We can't really account for how much data we
526 * have sent out, but hasn't made it through to the 566 * have sent out, but hasn't made it through to the
527 * device as we can't see the backend here, so just 567 * device as we can't see the backend here, so just
528 * tell the tty layer that everything is flushed. 568 * tell the tty layer that everything is flushed.
569 *
570 * FIXME: should walk the outstanding urbs info
529 */ 571 */
530 return 0; 572 return 0;
531} 573}
@@ -540,7 +582,7 @@ static int sierra_open(struct usb_serial_port *port, struct file *filp)
540 582
541 portdata = usb_get_serial_port_data(port); 583 portdata = usb_get_serial_port_data(port);
542 584
543 dbg("%s", __FUNCTION__); 585 dbg("%s", __func__);
544 586
545 /* Set some sane defaults */ 587 /* Set some sane defaults */
546 portdata->rts_state = 1; 588 portdata->rts_state = 1;
@@ -552,7 +594,7 @@ static int sierra_open(struct usb_serial_port *port, struct file *filp)
552 if (!urb) 594 if (!urb)
553 continue; 595 continue;
554 if (urb->dev != serial->dev) { 596 if (urb->dev != serial->dev) {
555 dbg("%s: dev %p != %p", __FUNCTION__, 597 dbg("%s: dev %p != %p", __func__,
556 urb->dev, serial->dev); 598 urb->dev, serial->dev);
557 continue; 599 continue;
558 } 600 }
@@ -590,7 +632,7 @@ static void sierra_close(struct usb_serial_port *port, struct file *filp)
590 struct usb_serial *serial = port->serial; 632 struct usb_serial *serial = port->serial;
591 struct sierra_port_private *portdata; 633 struct sierra_port_private *portdata;
592 634
593 dbg("%s", __FUNCTION__); 635 dbg("%s", __func__);
594 portdata = usb_get_serial_port_data(port); 636 portdata = usb_get_serial_port_data(port);
595 637
596 portdata->rts_state = 0; 638 portdata->rts_state = 0;
@@ -620,7 +662,7 @@ static int sierra_startup(struct usb_serial *serial)
620 int i; 662 int i;
621 int j; 663 int j;
622 664
623 dbg("%s", __FUNCTION__); 665 dbg("%s", __func__);
624 666
625 /* Set Device mode to D0 */ 667 /* Set Device mode to D0 */
626 sierra_set_power_state(serial->dev, 0x0000); 668 sierra_set_power_state(serial->dev, 0x0000);
@@ -635,7 +677,7 @@ static int sierra_startup(struct usb_serial *serial)
635 portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); 677 portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
636 if (!portdata) { 678 if (!portdata) {
637 dbg("%s: kmalloc for sierra_port_private (%d) failed!.", 679 dbg("%s: kmalloc for sierra_port_private (%d) failed!.",
638 __FUNCTION__, i); 680 __func__, i);
639 return -ENOMEM; 681 return -ENOMEM;
640 } 682 }
641 spin_lock_init(&portdata->lock); 683 spin_lock_init(&portdata->lock);
@@ -656,7 +698,7 @@ static int sierra_startup(struct usb_serial *serial)
656 urb = usb_alloc_urb(0, GFP_KERNEL); 698 urb = usb_alloc_urb(0, GFP_KERNEL);
657 if (urb == NULL) { 699 if (urb == NULL) {
658 dbg("%s: alloc for in port failed.", 700 dbg("%s: alloc for in port failed.",
659 __FUNCTION__); 701 __func__);
660 continue; 702 continue;
661 } 703 }
662 /* Fill URB using supplied data. */ 704 /* Fill URB using supplied data. */
@@ -678,7 +720,7 @@ static void sierra_shutdown(struct usb_serial *serial)
678 struct usb_serial_port *port; 720 struct usb_serial_port *port;
679 struct sierra_port_private *portdata; 721 struct sierra_port_private *portdata;
680 722
681 dbg("%s", __FUNCTION__); 723 dbg("%s", __func__);
682 724
683 for (i = 0; i < serial->num_ports; ++i) { 725 for (i = 0; i < serial->num_ports; ++i) {
684 port = serial->port[i]; 726 port = serial->port[i];
@@ -706,9 +748,6 @@ static struct usb_serial_driver sierra_device = {
706 .description = "Sierra USB modem", 748 .description = "Sierra USB modem",
707 .id_table = id_table, 749 .id_table = id_table,
708 .usb_driver = &sierra_driver, 750 .usb_driver = &sierra_driver,
709 .num_interrupt_in = NUM_DONT_CARE,
710 .num_bulk_in = NUM_DONT_CARE,
711 .num_bulk_out = NUM_DONT_CARE,
712 .calc_num_ports = sierra_calc_num_ports, 751 .calc_num_ports = sierra_calc_num_ports,
713 .probe = sierra_probe, 752 .probe = sierra_probe,
714 .open = sierra_open, 753 .open = sierra_open,