aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r--drivers/usb/serial/option.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index f4914209871d..920241897c95 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -408,24 +408,24 @@ module_exit(option_exit);
408 408
409static void option_rx_throttle(struct usb_serial_port *port) 409static void option_rx_throttle(struct usb_serial_port *port)
410{ 410{
411 dbg("%s", __FUNCTION__); 411 dbg("%s", __func__);
412} 412}
413 413
414static void option_rx_unthrottle(struct usb_serial_port *port) 414static void option_rx_unthrottle(struct usb_serial_port *port)
415{ 415{
416 dbg("%s", __FUNCTION__); 416 dbg("%s", __func__);
417} 417}
418 418
419static void option_break_ctl(struct usb_serial_port *port, int break_state) 419static void option_break_ctl(struct usb_serial_port *port, int break_state)
420{ 420{
421 /* Unfortunately, I don't know how to send a break */ 421 /* Unfortunately, I don't know how to send a break */
422 dbg("%s", __FUNCTION__); 422 dbg("%s", __func__);
423} 423}
424 424
425static void option_set_termios(struct usb_serial_port *port, 425static void option_set_termios(struct usb_serial_port *port,
426 struct ktermios *old_termios) 426 struct ktermios *old_termios)
427{ 427{
428 dbg("%s", __FUNCTION__); 428 dbg("%s", __func__);
429 /* Doesn't support option setting */ 429 /* Doesn't support option setting */
430 tty_termios_copy_hw(port->tty->termios, old_termios); 430 tty_termios_copy_hw(port->tty->termios, old_termios);
431 option_send_setup(port); 431 option_send_setup(port);
@@ -486,7 +486,7 @@ static int option_write(struct usb_serial_port *port,
486 486
487 portdata = usb_get_serial_port_data(port); 487 portdata = usb_get_serial_port_data(port);
488 488
489 dbg("%s: write (%d chars)", __FUNCTION__, count); 489 dbg("%s: write (%d chars)", __func__, count);
490 490
491 i = 0; 491 i = 0;
492 left = count; 492 left = count;
@@ -507,7 +507,7 @@ static int option_write(struct usb_serial_port *port,
507 dbg("usb_write %p failed (err=%d)", 507 dbg("usb_write %p failed (err=%d)",
508 this_urb, this_urb->status); 508 this_urb, this_urb->status);
509 509
510 dbg("%s: endpoint %d buf %d", __FUNCTION__, 510 dbg("%s: endpoint %d buf %d", __func__,
511 usb_pipeendpoint(this_urb->pipe), i); 511 usb_pipeendpoint(this_urb->pipe), i);
512 512
513 /* send the data */ 513 /* send the data */
@@ -529,7 +529,7 @@ static int option_write(struct usb_serial_port *port,
529 } 529 }
530 530
531 count -= left; 531 count -= left;
532 dbg("%s: wrote (did %d)", __FUNCTION__, count); 532 dbg("%s: wrote (did %d)", __func__, count);
533 return count; 533 return count;
534} 534}
535 535
@@ -542,14 +542,14 @@ static void option_indat_callback(struct urb *urb)
542 unsigned char *data = urb->transfer_buffer; 542 unsigned char *data = urb->transfer_buffer;
543 int status = urb->status; 543 int status = urb->status;
544 544
545 dbg("%s: %p", __FUNCTION__, urb); 545 dbg("%s: %p", __func__, urb);
546 546
547 endpoint = usb_pipeendpoint(urb->pipe); 547 endpoint = usb_pipeendpoint(urb->pipe);
548 port = (struct usb_serial_port *) urb->context; 548 port = (struct usb_serial_port *) urb->context;
549 549
550 if (status) { 550 if (status) {
551 dbg("%s: nonzero status: %d on endpoint %02x.", 551 dbg("%s: nonzero status: %d on endpoint %02x.",
552 __FUNCTION__, status, endpoint); 552 __func__, status, endpoint);
553 } else { 553 } else {
554 tty = port->tty; 554 tty = port->tty;
555 if (urb->actual_length) { 555 if (urb->actual_length) {
@@ -557,7 +557,7 @@ static void option_indat_callback(struct urb *urb)
557 tty_insert_flip_string(tty, data, urb->actual_length); 557 tty_insert_flip_string(tty, data, urb->actual_length);
558 tty_flip_buffer_push(tty); 558 tty_flip_buffer_push(tty);
559 } else { 559 } else {
560 dbg("%s: empty read urb received", __FUNCTION__); 560 dbg("%s: empty read urb received", __func__);
561 } 561 }
562 562
563 /* Resubmit urb so we continue receiving */ 563 /* Resubmit urb so we continue receiving */
@@ -565,7 +565,7 @@ static void option_indat_callback(struct urb *urb)
565 err = usb_submit_urb(urb, GFP_ATOMIC); 565 err = usb_submit_urb(urb, GFP_ATOMIC);
566 if (err) 566 if (err)
567 printk(KERN_ERR "%s: resubmit read urb failed. " 567 printk(KERN_ERR "%s: resubmit read urb failed. "
568 "(%d)", __FUNCTION__, err); 568 "(%d)", __func__, err);
569 } 569 }
570 } 570 }
571 return; 571 return;
@@ -577,7 +577,7 @@ static void option_outdat_callback(struct urb *urb)
577 struct option_port_private *portdata; 577 struct option_port_private *portdata;
578 int i; 578 int i;
579 579
580 dbg("%s", __FUNCTION__); 580 dbg("%s", __func__);
581 581
582 port = (struct usb_serial_port *) urb->context; 582 port = (struct usb_serial_port *) urb->context;
583 583
@@ -601,15 +601,15 @@ static void option_instat_callback(struct urb *urb)
601 struct option_port_private *portdata = usb_get_serial_port_data(port); 601 struct option_port_private *portdata = usb_get_serial_port_data(port);
602 struct usb_serial *serial = port->serial; 602 struct usb_serial *serial = port->serial;
603 603
604 dbg("%s", __FUNCTION__); 604 dbg("%s", __func__);
605 dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata); 605 dbg("%s: urb %p port %p has data %p", __func__,urb,port,portdata);
606 606
607 if (status == 0) { 607 if (status == 0) {
608 struct usb_ctrlrequest *req_pkt = 608 struct usb_ctrlrequest *req_pkt =
609 (struct usb_ctrlrequest *)urb->transfer_buffer; 609 (struct usb_ctrlrequest *)urb->transfer_buffer;
610 610
611 if (!req_pkt) { 611 if (!req_pkt) {
612 dbg("%s: NULL req_pkt\n", __FUNCTION__); 612 dbg("%s: NULL req_pkt\n", __func__);
613 return; 613 return;
614 } 614 }
615 if ((req_pkt->bRequestType == 0xA1) && 615 if ((req_pkt->bRequestType == 0xA1) &&
@@ -619,7 +619,7 @@ static void option_instat_callback(struct urb *urb)
619 urb->transfer_buffer + 619 urb->transfer_buffer +
620 sizeof(struct usb_ctrlrequest)); 620 sizeof(struct usb_ctrlrequest));
621 621
622 dbg("%s: signal x%x", __FUNCTION__, signals); 622 dbg("%s: signal x%x", __func__, signals);
623 623
624 old_dcd_state = portdata->dcd_state; 624 old_dcd_state = portdata->dcd_state;
625 portdata->cts_state = 1; 625 portdata->cts_state = 1;
@@ -631,11 +631,11 @@ static void option_instat_callback(struct urb *urb)
631 old_dcd_state && !portdata->dcd_state) 631 old_dcd_state && !portdata->dcd_state)
632 tty_hangup(port->tty); 632 tty_hangup(port->tty);
633 } else { 633 } else {
634 dbg("%s: type %x req %x", __FUNCTION__, 634 dbg("%s: type %x req %x", __func__,
635 req_pkt->bRequestType,req_pkt->bRequest); 635 req_pkt->bRequestType,req_pkt->bRequest);
636 } 636 }
637 } else 637 } else
638 dbg("%s: error %d", __FUNCTION__, status); 638 dbg("%s: error %d", __func__, status);
639 639
640 /* Resubmit urb so we continue receiving IRQ data */ 640 /* Resubmit urb so we continue receiving IRQ data */
641 if (status != -ESHUTDOWN) { 641 if (status != -ESHUTDOWN) {
@@ -643,7 +643,7 @@ static void option_instat_callback(struct urb *urb)
643 err = usb_submit_urb(urb, GFP_ATOMIC); 643 err = usb_submit_urb(urb, GFP_ATOMIC);
644 if (err) 644 if (err)
645 dbg("%s: resubmit intr urb failed. (%d)", 645 dbg("%s: resubmit intr urb failed. (%d)",
646 __FUNCTION__, err); 646 __func__, err);
647 } 647 }
648} 648}
649 649
@@ -662,7 +662,7 @@ static int option_write_room(struct usb_serial_port *port)
662 data_len += OUT_BUFLEN; 662 data_len += OUT_BUFLEN;
663 } 663 }
664 664
665 dbg("%s: %d", __FUNCTION__, data_len); 665 dbg("%s: %d", __func__, data_len);
666 return data_len; 666 return data_len;
667} 667}
668 668
@@ -680,7 +680,7 @@ static int option_chars_in_buffer(struct usb_serial_port *port)
680 if (this_urb && test_bit(i, &portdata->out_busy)) 680 if (this_urb && test_bit(i, &portdata->out_busy))
681 data_len += this_urb->transfer_buffer_length; 681 data_len += this_urb->transfer_buffer_length;
682 } 682 }
683 dbg("%s: %d", __FUNCTION__, data_len); 683 dbg("%s: %d", __func__, data_len);
684 return data_len; 684 return data_len;
685} 685}
686 686
@@ -693,7 +693,7 @@ static int option_open(struct usb_serial_port *port, struct file *filp)
693 693
694 portdata = usb_get_serial_port_data(port); 694 portdata = usb_get_serial_port_data(port);
695 695
696 dbg("%s", __FUNCTION__); 696 dbg("%s", __func__);
697 697
698 /* Set some sane defaults */ 698 /* Set some sane defaults */
699 portdata->rts_state = 1; 699 portdata->rts_state = 1;
@@ -705,7 +705,7 @@ static int option_open(struct usb_serial_port *port, struct file *filp)
705 if (! urb) 705 if (! urb)
706 continue; 706 continue;
707 if (urb->dev != serial->dev) { 707 if (urb->dev != serial->dev) {
708 dbg("%s: dev %p != %p", __FUNCTION__, 708 dbg("%s: dev %p != %p", __func__,
709 urb->dev, serial->dev); 709 urb->dev, serial->dev);
710 continue; 710 continue;
711 } 711 }
@@ -719,7 +719,7 @@ static int option_open(struct usb_serial_port *port, struct file *filp)
719 err = usb_submit_urb(urb, GFP_KERNEL); 719 err = usb_submit_urb(urb, GFP_KERNEL);
720 if (err) { 720 if (err) {
721 dbg("%s: submit urb %d failed (%d) %d", 721 dbg("%s: submit urb %d failed (%d) %d",
722 __FUNCTION__, i, err, 722 __func__, i, err,
723 urb->transfer_buffer_length); 723 urb->transfer_buffer_length);
724 } 724 }
725 } 725 }
@@ -747,7 +747,7 @@ static void option_close(struct usb_serial_port *port, struct file *filp)
747 struct usb_serial *serial = port->serial; 747 struct usb_serial *serial = port->serial;
748 struct option_port_private *portdata; 748 struct option_port_private *portdata;
749 749
750 dbg("%s", __FUNCTION__); 750 dbg("%s", __func__);
751 portdata = usb_get_serial_port_data(port); 751 portdata = usb_get_serial_port_data(port);
752 752
753 portdata->rts_state = 0; 753 portdata->rts_state = 0;
@@ -780,7 +780,7 @@ static struct urb *option_setup_urb(struct usb_serial *serial, int endpoint,
780 780
781 urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ 781 urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
782 if (urb == NULL) { 782 if (urb == NULL) {
783 dbg("%s: alloc for endpoint %d failed.", __FUNCTION__, endpoint); 783 dbg("%s: alloc for endpoint %d failed.", __func__, endpoint);
784 return NULL; 784 return NULL;
785 } 785 }
786 786
@@ -799,7 +799,7 @@ static void option_setup_urbs(struct usb_serial *serial)
799 struct usb_serial_port *port; 799 struct usb_serial_port *port;
800 struct option_port_private *portdata; 800 struct option_port_private *portdata;
801 801
802 dbg("%s", __FUNCTION__); 802 dbg("%s", __func__);
803 803
804 for (i = 0; i < serial->num_ports; i++) { 804 for (i = 0; i < serial->num_ports; i++) {
805 port = serial->port[i]; 805 port = serial->port[i];
@@ -832,7 +832,7 @@ static int option_send_setup(struct usb_serial_port *port)
832 struct usb_serial *serial = port->serial; 832 struct usb_serial *serial = port->serial;
833 struct option_port_private *portdata; 833 struct option_port_private *portdata;
834 int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; 834 int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
835 dbg("%s", __FUNCTION__); 835 dbg("%s", __func__);
836 836
837 portdata = usb_get_serial_port_data(port); 837 portdata = usb_get_serial_port_data(port);
838 838
@@ -858,7 +858,7 @@ static int option_startup(struct usb_serial *serial)
858 struct option_port_private *portdata; 858 struct option_port_private *portdata;
859 u8 *buffer; 859 u8 *buffer;
860 860
861 dbg("%s", __FUNCTION__); 861 dbg("%s", __func__);
862 862
863 /* Now setup per port private data */ 863 /* Now setup per port private data */
864 for (i = 0; i < serial->num_ports; i++) { 864 for (i = 0; i < serial->num_ports; i++) {
@@ -866,7 +866,7 @@ static int option_startup(struct usb_serial *serial)
866 portdata = kzalloc(sizeof(*portdata), GFP_KERNEL); 866 portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
867 if (!portdata) { 867 if (!portdata) {
868 dbg("%s: kmalloc for option_port_private (%d) failed!.", 868 dbg("%s: kmalloc for option_port_private (%d) failed!.",
869 __FUNCTION__, i); 869 __func__, i);
870 return (1); 870 return (1);
871 } 871 }
872 872
@@ -891,7 +891,7 @@ static int option_startup(struct usb_serial *serial)
891 err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); 891 err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
892 if (err) 892 if (err)
893 dbg("%s: submit irq_in urb failed %d", 893 dbg("%s: submit irq_in urb failed %d",
894 __FUNCTION__, err); 894 __func__, err);
895 } 895 }
896 896
897 option_setup_urbs(serial); 897 option_setup_urbs(serial);
@@ -915,7 +915,7 @@ static void option_shutdown(struct usb_serial *serial)
915 struct usb_serial_port *port; 915 struct usb_serial_port *port;
916 struct option_port_private *portdata; 916 struct option_port_private *portdata;
917 917
918 dbg("%s", __FUNCTION__); 918 dbg("%s", __func__);
919 919
920 /* Stop reading/writing urbs */ 920 /* Stop reading/writing urbs */
921 for (i = 0; i < serial->num_ports; ++i) { 921 for (i = 0; i < serial->num_ports; ++i) {