aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/function/u_serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/function/u_serial.c')
-rw-r--r--drivers/usb/gadget/function/u_serial.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
index ad0aca812002..491082aaf103 100644
--- a/drivers/usb/gadget/function/u_serial.c
+++ b/drivers/usb/gadget/function/u_serial.c
@@ -55,11 +55,8 @@
55 * for a telephone or fax link. And ttyGS2 might be something that just 55 * for a telephone or fax link. And ttyGS2 might be something that just
56 * needs a simple byte stream interface for some messaging protocol that 56 * needs a simple byte stream interface for some messaging protocol that
57 * is managed in userspace ... OBEX, PTP, and MTP have been mentioned. 57 * is managed in userspace ... OBEX, PTP, and MTP have been mentioned.
58 */ 58 *
59 59 *
60#define PREFIX "ttyGS"
61
62/*
63 * gserial is the lifecycle interface, used by USB functions 60 * gserial is the lifecycle interface, used by USB functions
64 * gs_port is the I/O nexus, used by the tty driver 61 * gs_port is the I/O nexus, used by the tty driver
65 * tty_struct links to the tty/filesystem framework 62 * tty_struct links to the tty/filesystem framework
@@ -385,9 +382,9 @@ __acquires(&port->port_lock)
385 list_del(&req->list); 382 list_del(&req->list);
386 req->zero = (gs_buf_data_avail(&port->port_write_buf) == 0); 383 req->zero = (gs_buf_data_avail(&port->port_write_buf) == 0);
387 384
388 pr_vdebug(PREFIX "%d: tx len=%d, 0x%02x 0x%02x 0x%02x ...\n", 385 pr_vdebug("ttyGS%d: tx len=%d, 0x%02x 0x%02x 0x%02x ...\n",
389 port->port_num, len, *((u8 *)req->buf), 386 port->port_num, len, *((u8 *)req->buf),
390 *((u8 *)req->buf+1), *((u8 *)req->buf+2)); 387 *((u8 *)req->buf+1), *((u8 *)req->buf+2));
391 388
392 /* Drop lock while we call out of driver; completions 389 /* Drop lock while we call out of driver; completions
393 * could be issued while we do so. Disconnection may 390 * could be issued while we do so. Disconnection may
@@ -503,13 +500,13 @@ static void gs_rx_push(unsigned long _port)
503 switch (req->status) { 500 switch (req->status) {
504 case -ESHUTDOWN: 501 case -ESHUTDOWN:
505 disconnect = true; 502 disconnect = true;
506 pr_vdebug(PREFIX "%d: shutdown\n", port->port_num); 503 pr_vdebug("ttyGS%d: shutdown\n", port->port_num);
507 break; 504 break;
508 505
509 default: 506 default:
510 /* presumably a transient fault */ 507 /* presumably a transient fault */
511 pr_warning(PREFIX "%d: unexpected RX status %d\n", 508 pr_warn("ttyGS%d: unexpected RX status %d\n",
512 port->port_num, req->status); 509 port->port_num, req->status);
513 /* FALLTHROUGH */ 510 /* FALLTHROUGH */
514 case 0: 511 case 0:
515 /* normal completion */ 512 /* normal completion */
@@ -537,9 +534,8 @@ static void gs_rx_push(unsigned long _port)
537 if (count != size) { 534 if (count != size) {
538 /* stop pushing; TTY layer can't handle more */ 535 /* stop pushing; TTY layer can't handle more */
539 port->n_read += count; 536 port->n_read += count;
540 pr_vdebug(PREFIX "%d: rx block %d/%d\n", 537 pr_vdebug("ttyGS%d: rx block %d/%d\n",
541 port->port_num, 538 port->port_num, count, req->actual);
542 count, req->actual);
543 break; 539 break;
544 } 540 }
545 port->n_read = 0; 541 port->n_read = 0;
@@ -569,7 +565,7 @@ static void gs_rx_push(unsigned long _port)
569 if (do_push) 565 if (do_push)
570 tasklet_schedule(&port->push); 566 tasklet_schedule(&port->push);
571 else 567 else
572 pr_warning(PREFIX "%d: RX not scheduled?\n", 568 pr_warn("ttyGS%d: RX not scheduled?\n",
573 port->port_num); 569 port->port_num);
574 } 570 }
575 } 571 }
@@ -985,7 +981,7 @@ static void gs_unthrottle(struct tty_struct *tty)
985 * read queue backs up enough we'll be NAKing OUT packets. 981 * read queue backs up enough we'll be NAKing OUT packets.
986 */ 982 */
987 tasklet_schedule(&port->push); 983 tasklet_schedule(&port->push);
988 pr_vdebug(PREFIX "%d: unthrottle\n", port->port_num); 984 pr_vdebug("ttyGS%d: unthrottle\n", port->port_num);
989 } 985 }
990 spin_unlock_irqrestore(&port->port_lock, flags); 986 spin_unlock_irqrestore(&port->port_lock, flags);
991} 987}
@@ -1295,7 +1291,7 @@ static int userial_init(void)
1295 return -ENOMEM; 1291 return -ENOMEM;
1296 1292
1297 gs_tty_driver->driver_name = "g_serial"; 1293 gs_tty_driver->driver_name = "g_serial";
1298 gs_tty_driver->name = PREFIX; 1294 gs_tty_driver->name = "ttyGS";
1299 /* uses dynamically assigned dev_t values */ 1295 /* uses dynamically assigned dev_t values */
1300 1296
1301 gs_tty_driver->type = TTY_DRIVER_TYPE_SERIAL; 1297 gs_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;