aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/io_edgeport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/io_edgeport.c')
-rw-r--r--drivers/usb/serial/io_edgeport.c326
1 files changed, 163 insertions, 163 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 3428ccc28da..ce2e487f324 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -371,7 +371,7 @@ static int get_string (struct usb_device *dev, int Id, char *string, int buflen)
371 struct usb_string_descriptor StringDesc; 371 struct usb_string_descriptor StringDesc;
372 struct usb_string_descriptor *pStringDesc; 372 struct usb_string_descriptor *pStringDesc;
373 373
374 dbg("%s - USB String ID = %d", __FUNCTION__, Id ); 374 dbg("%s - USB String ID = %d", __func__, Id );
375 375
376 if (!usb_get_descriptor(dev, USB_DT_STRING, Id, &StringDesc, sizeof(StringDesc))) { 376 if (!usb_get_descriptor(dev, USB_DT_STRING, Id, &StringDesc, sizeof(StringDesc))) {
377 return 0; 377 return 0;
@@ -391,7 +391,7 @@ static int get_string (struct usb_device *dev, int Id, char *string, int buflen)
391 unicode_to_ascii(string, buflen, pStringDesc->wData, pStringDesc->bLength/2); 391 unicode_to_ascii(string, buflen, pStringDesc->wData, pStringDesc->bLength/2);
392 392
393 kfree(pStringDesc); 393 kfree(pStringDesc);
394 dbg("%s - USB String %s", __FUNCTION__, string); 394 dbg("%s - USB String %s", __func__, string);
395 return strlen(string); 395 return strlen(string);
396} 396}
397 397
@@ -407,7 +407,7 @@ static int get_string_desc (struct usb_device *dev, int Id, struct usb_string_de
407 struct usb_string_descriptor StringDesc; 407 struct usb_string_descriptor StringDesc;
408 struct usb_string_descriptor *pStringDesc; 408 struct usb_string_descriptor *pStringDesc;
409 409
410 dbg("%s - USB String ID = %d", __FUNCTION__, Id ); 410 dbg("%s - USB String ID = %d", __func__, Id );
411 411
412 if (!usb_get_descriptor(dev, USB_DT_STRING, Id, &StringDesc, sizeof(StringDesc))) { 412 if (!usb_get_descriptor(dev, USB_DT_STRING, Id, &StringDesc, sizeof(StringDesc))) {
413 return 0; 413 return 0;
@@ -537,7 +537,7 @@ static int get_epic_descriptor(struct edgeport_serial *ep)
537 sizeof(struct edge_compatibility_descriptor), 537 sizeof(struct edge_compatibility_descriptor),
538 300); 538 300);
539 539
540 dbg("%s result = %d", __FUNCTION__, result); 540 dbg("%s result = %d", __func__, result);
541 541
542 if (result > 0) { 542 if (result > 0) {
543 ep->is_epic = 1; 543 ep->is_epic = 1;
@@ -589,7 +589,7 @@ static int get_epic_descriptor(struct edgeport_serial *ep)
589 *****************************************************************************/ 589 *****************************************************************************/
590static void edge_interrupt_callback (struct urb *urb) 590static void edge_interrupt_callback (struct urb *urb)
591{ 591{
592 struct edgeport_serial *edge_serial = (struct edgeport_serial *)urb->context; 592 struct edgeport_serial *edge_serial = urb->context;
593 struct edgeport_port *edge_port; 593 struct edgeport_port *edge_port;
594 struct usb_serial_port *port; 594 struct usb_serial_port *port;
595 unsigned char *data = urb->transfer_buffer; 595 unsigned char *data = urb->transfer_buffer;
@@ -601,7 +601,7 @@ static void edge_interrupt_callback (struct urb *urb)
601 int result; 601 int result;
602 int status = urb->status; 602 int status = urb->status;
603 603
604 dbg("%s", __FUNCTION__); 604 dbg("%s", __func__);
605 605
606 switch (status) { 606 switch (status) {
607 case 0: 607 case 0:
@@ -612,35 +612,35 @@ static void edge_interrupt_callback (struct urb *urb)
612 case -ESHUTDOWN: 612 case -ESHUTDOWN:
613 /* this urb is terminated, clean up */ 613 /* this urb is terminated, clean up */
614 dbg("%s - urb shutting down with status: %d", 614 dbg("%s - urb shutting down with status: %d",
615 __FUNCTION__, status); 615 __func__, status);
616 return; 616 return;
617 default: 617 default:
618 dbg("%s - nonzero urb status received: %d", 618 dbg("%s - nonzero urb status received: %d",
619 __FUNCTION__, status); 619 __func__, status);
620 goto exit; 620 goto exit;
621 } 621 }
622 622
623 // process this interrupt-read even if there are no ports open 623 // process this interrupt-read even if there are no ports open
624 if (length) { 624 if (length) {
625 usb_serial_debug_data(debug, &edge_serial->serial->dev->dev, __FUNCTION__, length, data); 625 usb_serial_debug_data(debug, &edge_serial->serial->dev->dev, __func__, length, data);
626 626
627 if (length > 1) { 627 if (length > 1) {
628 bytes_avail = data[0] | (data[1] << 8); 628 bytes_avail = data[0] | (data[1] << 8);
629 if (bytes_avail) { 629 if (bytes_avail) {
630 spin_lock(&edge_serial->es_lock); 630 spin_lock(&edge_serial->es_lock);
631 edge_serial->rxBytesAvail += bytes_avail; 631 edge_serial->rxBytesAvail += bytes_avail;
632 dbg("%s - bytes_avail=%d, rxBytesAvail=%d, read_in_progress=%d", __FUNCTION__, bytes_avail, edge_serial->rxBytesAvail, edge_serial->read_in_progress); 632 dbg("%s - bytes_avail=%d, rxBytesAvail=%d, read_in_progress=%d", __func__, bytes_avail, edge_serial->rxBytesAvail, edge_serial->read_in_progress);
633 633
634 if (edge_serial->rxBytesAvail > 0 && 634 if (edge_serial->rxBytesAvail > 0 &&
635 !edge_serial->read_in_progress) { 635 !edge_serial->read_in_progress) {
636 dbg("%s - posting a read", __FUNCTION__); 636 dbg("%s - posting a read", __func__);
637 edge_serial->read_in_progress = true; 637 edge_serial->read_in_progress = true;
638 638
639 /* we have pending bytes on the bulk in pipe, send a request */ 639 /* we have pending bytes on the bulk in pipe, send a request */
640 edge_serial->read_urb->dev = edge_serial->serial->dev; 640 edge_serial->read_urb->dev = edge_serial->serial->dev;
641 result = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC); 641 result = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC);
642 if (result) { 642 if (result) {
643 dev_err(&edge_serial->serial->dev->dev, "%s - usb_submit_urb(read bulk) failed with result = %d\n", __FUNCTION__, result); 643 dev_err(&edge_serial->serial->dev->dev, "%s - usb_submit_urb(read bulk) failed with result = %d\n", __func__, result);
644 edge_serial->read_in_progress = false; 644 edge_serial->read_in_progress = false;
645 } 645 }
646 } 646 }
@@ -659,7 +659,7 @@ static void edge_interrupt_callback (struct urb *urb)
659 spin_lock(&edge_port->ep_lock); 659 spin_lock(&edge_port->ep_lock);
660 edge_port->txCredits += txCredits; 660 edge_port->txCredits += txCredits;
661 spin_unlock(&edge_port->ep_lock); 661 spin_unlock(&edge_port->ep_lock);
662 dbg("%s - txcredits for port%d = %d", __FUNCTION__, portNumber, edge_port->txCredits); 662 dbg("%s - txcredits for port%d = %d", __func__, portNumber, edge_port->txCredits);
663 663
664 /* tell the tty driver that something has changed */ 664 /* tell the tty driver that something has changed */
665 if (edge_port->port->tty) 665 if (edge_port->port->tty)
@@ -677,7 +677,7 @@ static void edge_interrupt_callback (struct urb *urb)
677exit: 677exit:
678 result = usb_submit_urb (urb, GFP_ATOMIC); 678 result = usb_submit_urb (urb, GFP_ATOMIC);
679 if (result) { 679 if (result) {
680 dev_err(&urb->dev->dev, "%s - Error %d submitting control urb\n", __FUNCTION__, result); 680 dev_err(&urb->dev->dev, "%s - Error %d submitting control urb\n", __func__, result);
681 } 681 }
682} 682}
683 683
@@ -689,49 +689,49 @@ exit:
689 *****************************************************************************/ 689 *****************************************************************************/
690static void edge_bulk_in_callback (struct urb *urb) 690static void edge_bulk_in_callback (struct urb *urb)
691{ 691{
692 struct edgeport_serial *edge_serial = (struct edgeport_serial *)urb->context; 692 struct edgeport_serial *edge_serial = urb->context;
693 unsigned char *data = urb->transfer_buffer; 693 unsigned char *data = urb->transfer_buffer;
694 int retval; 694 int retval;
695 __u16 raw_data_length; 695 __u16 raw_data_length;
696 int status = urb->status; 696 int status = urb->status;
697 697
698 dbg("%s", __FUNCTION__); 698 dbg("%s", __func__);
699 699
700 if (status) { 700 if (status) {
701 dbg("%s - nonzero read bulk status received: %d", 701 dbg("%s - nonzero read bulk status received: %d",
702 __FUNCTION__, status); 702 __func__, status);
703 edge_serial->read_in_progress = false; 703 edge_serial->read_in_progress = false;
704 return; 704 return;
705 } 705 }
706 706
707 if (urb->actual_length == 0) { 707 if (urb->actual_length == 0) {
708 dbg("%s - read bulk callback with no data", __FUNCTION__); 708 dbg("%s - read bulk callback with no data", __func__);
709 edge_serial->read_in_progress = false; 709 edge_serial->read_in_progress = false;
710 return; 710 return;
711 } 711 }
712 712
713 raw_data_length = urb->actual_length; 713 raw_data_length = urb->actual_length;
714 714
715 usb_serial_debug_data(debug, &edge_serial->serial->dev->dev, __FUNCTION__, raw_data_length, data); 715 usb_serial_debug_data(debug, &edge_serial->serial->dev->dev, __func__, raw_data_length, data);
716 716
717 spin_lock(&edge_serial->es_lock); 717 spin_lock(&edge_serial->es_lock);
718 718
719 /* decrement our rxBytes available by the number that we just got */ 719 /* decrement our rxBytes available by the number that we just got */
720 edge_serial->rxBytesAvail -= raw_data_length; 720 edge_serial->rxBytesAvail -= raw_data_length;
721 721
722 dbg("%s - Received = %d, rxBytesAvail %d", __FUNCTION__, raw_data_length, edge_serial->rxBytesAvail); 722 dbg("%s - Received = %d, rxBytesAvail %d", __func__, raw_data_length, edge_serial->rxBytesAvail);
723 723
724 process_rcvd_data (edge_serial, data, urb->actual_length); 724 process_rcvd_data (edge_serial, data, urb->actual_length);
725 725
726 /* check to see if there's any more data for us to read */ 726 /* check to see if there's any more data for us to read */
727 if (edge_serial->rxBytesAvail > 0) { 727 if (edge_serial->rxBytesAvail > 0) {
728 dbg("%s - posting a read", __FUNCTION__); 728 dbg("%s - posting a read", __func__);
729 edge_serial->read_urb->dev = edge_serial->serial->dev; 729 edge_serial->read_urb->dev = edge_serial->serial->dev;
730 retval = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC); 730 retval = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC);
731 if (retval) { 731 if (retval) {
732 dev_err(&urb->dev->dev, 732 dev_err(&urb->dev->dev,
733 "%s - usb_submit_urb(read bulk) failed, " 733 "%s - usb_submit_urb(read bulk) failed, "
734 "retval = %d\n", __FUNCTION__, retval); 734 "retval = %d\n", __func__, retval);
735 edge_serial->read_in_progress = false; 735 edge_serial->read_in_progress = false;
736 } 736 }
737 } else { 737 } else {
@@ -749,15 +749,15 @@ static void edge_bulk_in_callback (struct urb *urb)
749 *****************************************************************************/ 749 *****************************************************************************/
750static void edge_bulk_out_data_callback (struct urb *urb) 750static void edge_bulk_out_data_callback (struct urb *urb)
751{ 751{
752 struct edgeport_port *edge_port = (struct edgeport_port *)urb->context; 752 struct edgeport_port *edge_port = urb->context;
753 struct tty_struct *tty; 753 struct tty_struct *tty;
754 int status = urb->status; 754 int status = urb->status;
755 755
756 dbg("%s", __FUNCTION__); 756 dbg("%s", __func__);
757 757
758 if (status) { 758 if (status) {
759 dbg("%s - nonzero write bulk status received: %d", 759 dbg("%s - nonzero write bulk status received: %d",
760 __FUNCTION__, status); 760 __func__, status);
761 } 761 }
762 762
763 tty = edge_port->port->tty; 763 tty = edge_port->port->tty;
@@ -782,14 +782,14 @@ static void edge_bulk_out_data_callback (struct urb *urb)
782 *****************************************************************************/ 782 *****************************************************************************/
783static void edge_bulk_out_cmd_callback (struct urb *urb) 783static void edge_bulk_out_cmd_callback (struct urb *urb)
784{ 784{
785 struct edgeport_port *edge_port = (struct edgeport_port *)urb->context; 785 struct edgeport_port *edge_port = urb->context;
786 struct tty_struct *tty; 786 struct tty_struct *tty;
787 int status = urb->status; 787 int status = urb->status;
788 788
789 dbg("%s", __FUNCTION__); 789 dbg("%s", __func__);
790 790
791 atomic_dec(&CmdUrbs); 791 atomic_dec(&CmdUrbs);
792 dbg("%s - FREE URB %p (outstanding %d)", __FUNCTION__, urb, atomic_read(&CmdUrbs)); 792 dbg("%s - FREE URB %p (outstanding %d)", __func__, urb, atomic_read(&CmdUrbs));
793 793
794 794
795 /* clean up the transfer buffer */ 795 /* clean up the transfer buffer */
@@ -799,7 +799,7 @@ static void edge_bulk_out_cmd_callback (struct urb *urb)
799 usb_free_urb (urb); 799 usb_free_urb (urb);
800 800
801 if (status) { 801 if (status) {
802 dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, status); 802 dbg("%s - nonzero write bulk status received: %d", __func__, status);
803 return; 803 return;
804 } 804 }
805 805
@@ -833,7 +833,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
833 struct edgeport_serial *edge_serial; 833 struct edgeport_serial *edge_serial;
834 int response; 834 int response;
835 835
836 dbg("%s - port %d", __FUNCTION__, port->number); 836 dbg("%s - port %d", __func__, port->number);
837 837
838 if (edge_port == NULL) 838 if (edge_port == NULL)
839 return -ENODEV; 839 return -ENODEV;
@@ -883,7 +883,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
883 * this interrupt will continue as long as the edgeport is connected */ 883 * this interrupt will continue as long as the edgeport is connected */
884 response = usb_submit_urb (edge_serial->interrupt_read_urb, GFP_KERNEL); 884 response = usb_submit_urb (edge_serial->interrupt_read_urb, GFP_KERNEL);
885 if (response) { 885 if (response) {
886 dev_err(&port->dev, "%s - Error %d submitting control urb\n", __FUNCTION__, response); 886 dev_err(&port->dev, "%s - Error %d submitting control urb\n", __func__, response);
887 } 887 }
888 } 888 }
889 889
@@ -907,7 +907,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
907 response = send_iosp_ext_cmd (edge_port, IOSP_CMD_OPEN_PORT, 0); 907 response = send_iosp_ext_cmd (edge_port, IOSP_CMD_OPEN_PORT, 0);
908 908
909 if (response < 0) { 909 if (response < 0) {
910 dev_err(&port->dev, "%s - error sending open port command\n", __FUNCTION__); 910 dev_err(&port->dev, "%s - error sending open port command\n", __func__);
911 edge_port->openPending = false; 911 edge_port->openPending = false;
912 return -ENODEV; 912 return -ENODEV;
913 } 913 }
@@ -917,7 +917,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
917 917
918 if (!edge_port->open) { 918 if (!edge_port->open) {
919 /* open timed out */ 919 /* open timed out */
920 dbg("%s - open timedout", __FUNCTION__); 920 dbg("%s - open timedout", __func__);
921 edge_port->openPending = false; 921 edge_port->openPending = false;
922 return -ENODEV; 922 return -ENODEV;
923 } 923 }
@@ -930,7 +930,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
930 edge_port->txfifo.fifo = kmalloc (edge_port->maxTxCredits, GFP_KERNEL); 930 edge_port->txfifo.fifo = kmalloc (edge_port->maxTxCredits, GFP_KERNEL);
931 931
932 if (!edge_port->txfifo.fifo) { 932 if (!edge_port->txfifo.fifo) {
933 dbg("%s - no memory", __FUNCTION__); 933 dbg("%s - no memory", __func__);
934 edge_close (port, filp); 934 edge_close (port, filp);
935 return -ENOMEM; 935 return -ENOMEM;
936 } 936 }
@@ -940,14 +940,14 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
940 edge_port->write_in_progress = false; 940 edge_port->write_in_progress = false;
941 941
942 if (!edge_port->write_urb) { 942 if (!edge_port->write_urb) {
943 dbg("%s - no memory", __FUNCTION__); 943 dbg("%s - no memory", __func__);
944 edge_close (port, filp); 944 edge_close (port, filp);
945 return -ENOMEM; 945 return -ENOMEM;
946 } 946 }
947 947
948 dbg("%s(%d) - Initialize TX fifo to %d bytes", __FUNCTION__, port->number, edge_port->maxTxCredits); 948 dbg("%s(%d) - Initialize TX fifo to %d bytes", __func__, port->number, edge_port->maxTxCredits);
949 949
950 dbg("%s exited", __FUNCTION__); 950 dbg("%s exited", __func__);
951 951
952 return 0; 952 return 0;
953} 953}
@@ -976,11 +976,11 @@ static void block_until_chase_response(struct edgeport_port *edge_port)
976 976
977 // Did we get our Chase response 977 // Did we get our Chase response
978 if (!edge_port->chaseResponsePending) { 978 if (!edge_port->chaseResponsePending) {
979 dbg("%s - Got Chase Response", __FUNCTION__); 979 dbg("%s - Got Chase Response", __func__);
980 980
981 // did we get all of our credit back? 981 // did we get all of our credit back?
982 if (edge_port->txCredits == edge_port->maxTxCredits ) { 982 if (edge_port->txCredits == edge_port->maxTxCredits ) {
983 dbg("%s - Got all credits", __FUNCTION__); 983 dbg("%s - Got all credits", __func__);
984 return; 984 return;
985 } 985 }
986 } 986 }
@@ -995,12 +995,12 @@ static void block_until_chase_response(struct edgeport_port *edge_port)
995 loop--; 995 loop--;
996 if (loop == 0) { 996 if (loop == 0) {
997 edge_port->chaseResponsePending = false; 997 edge_port->chaseResponsePending = false;
998 dbg("%s - Chase TIMEOUT", __FUNCTION__); 998 dbg("%s - Chase TIMEOUT", __func__);
999 return; 999 return;
1000 } 1000 }
1001 } else { 1001 } else {
1002 // Reset timeout value back to 10 seconds 1002 // Reset timeout value back to 10 seconds
1003 dbg("%s - Last %d, Current %d", __FUNCTION__, lastCredits, edge_port->txCredits); 1003 dbg("%s - Last %d, Current %d", __func__, lastCredits, edge_port->txCredits);
1004 loop = 10; 1004 loop = 10;
1005 } 1005 }
1006 } 1006 }
@@ -1031,7 +1031,7 @@ static void block_until_tx_empty (struct edgeport_port *edge_port)
1031 1031
1032 // Is the Edgeport Buffer empty? 1032 // Is the Edgeport Buffer empty?
1033 if (lastCount == 0) { 1033 if (lastCount == 0) {
1034 dbg("%s - TX Buffer Empty", __FUNCTION__); 1034 dbg("%s - TX Buffer Empty", __func__);
1035 return; 1035 return;
1036 } 1036 }
1037 1037
@@ -1040,13 +1040,13 @@ static void block_until_tx_empty (struct edgeport_port *edge_port)
1040 schedule_timeout(timeout); 1040 schedule_timeout(timeout);
1041 finish_wait(&edge_port->wait_chase, &wait); 1041 finish_wait(&edge_port->wait_chase, &wait);
1042 1042
1043 dbg("%s wait", __FUNCTION__); 1043 dbg("%s wait", __func__);
1044 1044
1045 if (lastCount == fifo->count) { 1045 if (lastCount == fifo->count) {
1046 // No activity.. count down. 1046 // No activity.. count down.
1047 loop--; 1047 loop--;
1048 if (loop == 0) { 1048 if (loop == 0) {
1049 dbg("%s - TIMEOUT", __FUNCTION__); 1049 dbg("%s - TIMEOUT", __func__);
1050 return; 1050 return;
1051 } 1051 }
1052 } else { 1052 } else {
@@ -1067,7 +1067,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
1067 struct edgeport_port *edge_port; 1067 struct edgeport_port *edge_port;
1068 int status; 1068 int status;
1069 1069
1070 dbg("%s - port %d", __FUNCTION__, port->number); 1070 dbg("%s - port %d", __func__, port->number);
1071 1071
1072 edge_serial = usb_get_serial_data(port->serial); 1072 edge_serial = usb_get_serial_data(port->serial);
1073 edge_port = usb_get_serial_port_data(port); 1073 edge_port = usb_get_serial_port_data(port);
@@ -1085,7 +1085,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
1085 /* flush and chase */ 1085 /* flush and chase */
1086 edge_port->chaseResponsePending = true; 1086 edge_port->chaseResponsePending = true;
1087 1087
1088 dbg("%s - Sending IOSP_CMD_CHASE_PORT", __FUNCTION__); 1088 dbg("%s - Sending IOSP_CMD_CHASE_PORT", __func__);
1089 status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0); 1089 status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0);
1090 if (status == 0) { 1090 if (status == 0) {
1091 // block until chase finished 1091 // block until chase finished
@@ -1099,7 +1099,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
1099 ((edge_serial->is_epic) && 1099 ((edge_serial->is_epic) &&
1100 (edge_serial->epic_descriptor.Supports.IOSPClose))) { 1100 (edge_serial->epic_descriptor.Supports.IOSPClose))) {
1101 /* close the port */ 1101 /* close the port */
1102 dbg("%s - Sending IOSP_CMD_CLOSE_PORT", __FUNCTION__); 1102 dbg("%s - Sending IOSP_CMD_CLOSE_PORT", __func__);
1103 send_iosp_ext_cmd (edge_port, IOSP_CMD_CLOSE_PORT, 0); 1103 send_iosp_ext_cmd (edge_port, IOSP_CMD_CLOSE_PORT, 0);
1104 } 1104 }
1105 1105
@@ -1119,7 +1119,7 @@ static void edge_close (struct usb_serial_port *port, struct file * filp)
1119 kfree(edge_port->txfifo.fifo); 1119 kfree(edge_port->txfifo.fifo);
1120 edge_port->txfifo.fifo = NULL; 1120 edge_port->txfifo.fifo = NULL;
1121 1121
1122 dbg("%s exited", __FUNCTION__); 1122 dbg("%s exited", __func__);
1123} 1123}
1124 1124
1125/***************************************************************************** 1125/*****************************************************************************
@@ -1139,7 +1139,7 @@ static int edge_write (struct usb_serial_port *port, const unsigned char *data,
1139 int secondhalf; 1139 int secondhalf;
1140 unsigned long flags; 1140 unsigned long flags;
1141 1141
1142 dbg("%s - port %d", __FUNCTION__, port->number); 1142 dbg("%s - port %d", __func__, port->number);
1143 1143
1144 if (edge_port == NULL) 1144 if (edge_port == NULL)
1145 return -ENODEV; 1145 return -ENODEV;
@@ -1152,12 +1152,12 @@ static int edge_write (struct usb_serial_port *port, const unsigned char *data,
1152 // calculate number of bytes to put in fifo 1152 // calculate number of bytes to put in fifo
1153 copySize = min ((unsigned int)count, (edge_port->txCredits - fifo->count)); 1153 copySize = min ((unsigned int)count, (edge_port->txCredits - fifo->count));
1154 1154
1155 dbg("%s(%d) of %d byte(s) Fifo room %d -- will copy %d bytes", __FUNCTION__, 1155 dbg("%s(%d) of %d byte(s) Fifo room %d -- will copy %d bytes", __func__,
1156 port->number, count, edge_port->txCredits - fifo->count, copySize); 1156 port->number, count, edge_port->txCredits - fifo->count, copySize);
1157 1157
1158 /* catch writes of 0 bytes which the tty driver likes to give us, and when txCredits is empty */ 1158 /* catch writes of 0 bytes which the tty driver likes to give us, and when txCredits is empty */
1159 if (copySize == 0) { 1159 if (copySize == 0) {
1160 dbg("%s - copySize = Zero", __FUNCTION__); 1160 dbg("%s - copySize = Zero", __func__);
1161 goto finish_write; 1161 goto finish_write;
1162 } 1162 }
1163 1163
@@ -1169,11 +1169,11 @@ static int edge_write (struct usb_serial_port *port, const unsigned char *data,
1169 1169
1170 bytesleft = fifo->size - fifo->head; 1170 bytesleft = fifo->size - fifo->head;
1171 firsthalf = min (bytesleft, copySize); 1171 firsthalf = min (bytesleft, copySize);
1172 dbg("%s - copy %d bytes of %d into fifo ", __FUNCTION__, firsthalf, bytesleft); 1172 dbg("%s - copy %d bytes of %d into fifo ", __func__, firsthalf, bytesleft);
1173 1173
1174 /* now copy our data */ 1174 /* now copy our data */
1175 memcpy(&fifo->fifo[fifo->head], data, firsthalf); 1175 memcpy(&fifo->fifo[fifo->head], data, firsthalf);
1176 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, firsthalf, &fifo->fifo[fifo->head]); 1176 usb_serial_debug_data(debug, &port->dev, __func__, firsthalf, &fifo->fifo[fifo->head]);
1177 1177
1178 // update the index and size 1178 // update the index and size
1179 fifo->head += firsthalf; 1179 fifo->head += firsthalf;
@@ -1187,9 +1187,9 @@ static int edge_write (struct usb_serial_port *port, const unsigned char *data,
1187 secondhalf = copySize-firsthalf; 1187 secondhalf = copySize-firsthalf;
1188 1188
1189 if (secondhalf) { 1189 if (secondhalf) {
1190 dbg("%s - copy rest of data %d", __FUNCTION__, secondhalf); 1190 dbg("%s - copy rest of data %d", __func__, secondhalf);
1191 memcpy(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf); 1191 memcpy(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf);
1192 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, secondhalf, &fifo->fifo[fifo->head]); 1192 usb_serial_debug_data(debug, &port->dev, __func__, secondhalf, &fifo->fifo[fifo->head]);
1193 // update the index and size 1193 // update the index and size
1194 fifo->count += secondhalf; 1194 fifo->count += secondhalf;
1195 fifo->head += secondhalf; 1195 fifo->head += secondhalf;
@@ -1201,7 +1201,7 @@ finish_write:
1201 1201
1202 send_more_port_data((struct edgeport_serial *)usb_get_serial_data(port->serial), edge_port); 1202 send_more_port_data((struct edgeport_serial *)usb_get_serial_data(port->serial), edge_port);
1203 1203
1204 dbg("%s wrote %d byte(s) TxCredits %d, Fifo %d", __FUNCTION__, copySize, edge_port->txCredits, fifo->count); 1204 dbg("%s wrote %d byte(s) TxCredits %d, Fifo %d", __func__, copySize, edge_port->txCredits, fifo->count);
1205 1205
1206 return copySize; 1206 return copySize;
1207} 1207}
@@ -1232,14 +1232,14 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
1232 int secondhalf; 1232 int secondhalf;
1233 unsigned long flags; 1233 unsigned long flags;
1234 1234
1235 dbg("%s(%d)", __FUNCTION__, edge_port->port->number); 1235 dbg("%s(%d)", __func__, edge_port->port->number);
1236 1236
1237 spin_lock_irqsave(&edge_port->ep_lock, flags); 1237 spin_lock_irqsave(&edge_port->ep_lock, flags);
1238 1238
1239 if (edge_port->write_in_progress || 1239 if (edge_port->write_in_progress ||
1240 !edge_port->open || 1240 !edge_port->open ||
1241 (fifo->count == 0)) { 1241 (fifo->count == 0)) {
1242 dbg("%s(%d) EXIT - fifo %d, PendingWrite = %d", __FUNCTION__, edge_port->port->number, fifo->count, edge_port->write_in_progress); 1242 dbg("%s(%d) EXIT - fifo %d, PendingWrite = %d", __func__, edge_port->port->number, fifo->count, edge_port->write_in_progress);
1243 goto exit_send; 1243 goto exit_send;
1244 } 1244 }
1245 1245
@@ -1251,7 +1251,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
1251 // it's better to wait for more credits so we can do a larger 1251 // it's better to wait for more credits so we can do a larger
1252 // write. 1252 // write.
1253 if (edge_port->txCredits < EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(edge_port->maxTxCredits,EDGE_FW_BULK_MAX_PACKET_SIZE)) { 1253 if (edge_port->txCredits < EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(edge_port->maxTxCredits,EDGE_FW_BULK_MAX_PACKET_SIZE)) {
1254 dbg("%s(%d) Not enough credit - fifo %d TxCredit %d", __FUNCTION__, edge_port->port->number, fifo->count, edge_port->txCredits ); 1254 dbg("%s(%d) Not enough credit - fifo %d TxCredit %d", __func__, edge_port->port->number, fifo->count, edge_port->txCredits );
1255 goto exit_send; 1255 goto exit_send;
1256 } 1256 }
1257 1257
@@ -1269,7 +1269,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
1269 count = fifo->count; 1269 count = fifo->count;
1270 buffer = kmalloc (count+2, GFP_ATOMIC); 1270 buffer = kmalloc (count+2, GFP_ATOMIC);
1271 if (buffer == NULL) { 1271 if (buffer == NULL) {
1272 dev_err(&edge_port->port->dev, "%s - no more kernel memory...\n", __FUNCTION__); 1272 dev_err(&edge_port->port->dev, "%s - no more kernel memory...\n", __func__);
1273 edge_port->write_in_progress = false; 1273 edge_port->write_in_progress = false;
1274 goto exit_send; 1274 goto exit_send;
1275 } 1275 }
@@ -1294,7 +1294,7 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
1294 } 1294 }
1295 1295
1296 if (count) 1296 if (count)
1297 usb_serial_debug_data(debug, &edge_port->port->dev, __FUNCTION__, count, &buffer[2]); 1297 usb_serial_debug_data(debug, &edge_port->port->dev, __func__, count, &buffer[2]);
1298 1298
1299 /* fill up the urb with all of our data and submit it */ 1299 /* fill up the urb with all of our data and submit it */
1300 usb_fill_bulk_urb (urb, edge_serial->serial->dev, 1300 usb_fill_bulk_urb (urb, edge_serial->serial->dev,
@@ -1309,14 +1309,14 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
1309 status = usb_submit_urb(urb, GFP_ATOMIC); 1309 status = usb_submit_urb(urb, GFP_ATOMIC);
1310 if (status) { 1310 if (status) {
1311 /* something went wrong */ 1311 /* something went wrong */
1312 dev_err(&edge_port->port->dev, "%s - usb_submit_urb(write bulk) failed, status = %d, data lost\n", __FUNCTION__, status); 1312 dev_err(&edge_port->port->dev, "%s - usb_submit_urb(write bulk) failed, status = %d, data lost\n", __func__, status);
1313 edge_port->write_in_progress = false; 1313 edge_port->write_in_progress = false;
1314 1314
1315 /* revert the credits as something bad happened. */ 1315 /* revert the credits as something bad happened. */
1316 edge_port->txCredits += count; 1316 edge_port->txCredits += count;
1317 edge_port->icount.tx -= count; 1317 edge_port->icount.tx -= count;
1318 } 1318 }
1319 dbg("%s wrote %d byte(s) TxCredit %d, Fifo %d", __FUNCTION__, count, edge_port->txCredits, fifo->count); 1319 dbg("%s wrote %d byte(s) TxCredit %d, Fifo %d", __func__, count, edge_port->txCredits, fifo->count);
1320 1320
1321exit_send: 1321exit_send:
1322 spin_unlock_irqrestore(&edge_port->ep_lock, flags); 1322 spin_unlock_irqrestore(&edge_port->ep_lock, flags);
@@ -1337,17 +1337,17 @@ static int edge_write_room (struct usb_serial_port *port)
1337 int room; 1337 int room;
1338 unsigned long flags; 1338 unsigned long flags;
1339 1339
1340 dbg("%s", __FUNCTION__); 1340 dbg("%s", __func__);
1341 1341
1342 if (edge_port == NULL) 1342 if (edge_port == NULL)
1343 return -ENODEV; 1343 return -ENODEV;
1344 if (edge_port->closePending) 1344 if (edge_port->closePending)
1345 return -ENODEV; 1345 return -ENODEV;
1346 1346
1347 dbg("%s - port %d", __FUNCTION__, port->number); 1347 dbg("%s - port %d", __func__, port->number);
1348 1348
1349 if (!edge_port->open) { 1349 if (!edge_port->open) {
1350 dbg("%s - port not opened", __FUNCTION__); 1350 dbg("%s - port not opened", __func__);
1351 return -EINVAL; 1351 return -EINVAL;
1352 } 1352 }
1353 1353
@@ -1356,7 +1356,7 @@ static int edge_write_room (struct usb_serial_port *port)
1356 room = edge_port->txCredits - edge_port->txfifo.count; 1356 room = edge_port->txCredits - edge_port->txfifo.count;
1357 spin_unlock_irqrestore(&edge_port->ep_lock, flags); 1357 spin_unlock_irqrestore(&edge_port->ep_lock, flags);
1358 1358
1359 dbg("%s - returns %d", __FUNCTION__, room); 1359 dbg("%s - returns %d", __func__, room);
1360 return room; 1360 return room;
1361} 1361}
1362 1362
@@ -1376,7 +1376,7 @@ static int edge_chars_in_buffer (struct usb_serial_port *port)
1376 int num_chars; 1376 int num_chars;
1377 unsigned long flags; 1377 unsigned long flags;
1378 1378
1379 dbg("%s", __FUNCTION__); 1379 dbg("%s", __func__);
1380 1380
1381 if (edge_port == NULL) 1381 if (edge_port == NULL)
1382 return -ENODEV; 1382 return -ENODEV;
@@ -1384,7 +1384,7 @@ static int edge_chars_in_buffer (struct usb_serial_port *port)
1384 return -ENODEV; 1384 return -ENODEV;
1385 1385
1386 if (!edge_port->open) { 1386 if (!edge_port->open) {
1387 dbg("%s - port not opened", __FUNCTION__); 1387 dbg("%s - port not opened", __func__);
1388 return -EINVAL; 1388 return -EINVAL;
1389 } 1389 }
1390 1390
@@ -1392,7 +1392,7 @@ static int edge_chars_in_buffer (struct usb_serial_port *port)
1392 num_chars = edge_port->maxTxCredits - edge_port->txCredits + edge_port->txfifo.count; 1392 num_chars = edge_port->maxTxCredits - edge_port->txCredits + edge_port->txfifo.count;
1393 spin_unlock_irqrestore(&edge_port->ep_lock, flags); 1393 spin_unlock_irqrestore(&edge_port->ep_lock, flags);
1394 if (num_chars) { 1394 if (num_chars) {
1395 dbg("%s(port %d) - returns %d", __FUNCTION__, port->number, num_chars); 1395 dbg("%s(port %d) - returns %d", __func__, port->number, num_chars);
1396 } 1396 }
1397 1397
1398 return num_chars; 1398 return num_chars;
@@ -1410,19 +1410,19 @@ static void edge_throttle (struct usb_serial_port *port)
1410 struct tty_struct *tty; 1410 struct tty_struct *tty;
1411 int status; 1411 int status;
1412 1412
1413 dbg("%s - port %d", __FUNCTION__, port->number); 1413 dbg("%s - port %d", __func__, port->number);
1414 1414
1415 if (edge_port == NULL) 1415 if (edge_port == NULL)
1416 return; 1416 return;
1417 1417
1418 if (!edge_port->open) { 1418 if (!edge_port->open) {
1419 dbg("%s - port not opened", __FUNCTION__); 1419 dbg("%s - port not opened", __func__);
1420 return; 1420 return;
1421 } 1421 }
1422 1422
1423 tty = port->tty; 1423 tty = port->tty;
1424 if (!tty) { 1424 if (!tty) {
1425 dbg ("%s - no tty available", __FUNCTION__); 1425 dbg ("%s - no tty available", __func__);
1426 return; 1426 return;
1427 } 1427 }
1428 1428
@@ -1459,19 +1459,19 @@ static void edge_unthrottle (struct usb_serial_port *port)
1459 struct tty_struct *tty; 1459 struct tty_struct *tty;
1460 int status; 1460 int status;
1461 1461
1462 dbg("%s - port %d", __FUNCTION__, port->number); 1462 dbg("%s - port %d", __func__, port->number);
1463 1463
1464 if (edge_port == NULL) 1464 if (edge_port == NULL)
1465 return; 1465 return;
1466 1466
1467 if (!edge_port->open) { 1467 if (!edge_port->open) {
1468 dbg("%s - port not opened", __FUNCTION__); 1468 dbg("%s - port not opened", __func__);
1469 return; 1469 return;
1470 } 1470 }
1471 1471
1472 tty = port->tty; 1472 tty = port->tty;
1473 if (!tty) { 1473 if (!tty) {
1474 dbg ("%s - no tty available", __FUNCTION__); 1474 dbg ("%s - no tty available", __func__);
1475 return; 1475 return;
1476 } 1476 }
1477 1477
@@ -1509,18 +1509,18 @@ static void edge_set_termios (struct usb_serial_port *port, struct ktermios *old
1509 unsigned int cflag; 1509 unsigned int cflag;
1510 1510
1511 cflag = tty->termios->c_cflag; 1511 cflag = tty->termios->c_cflag;
1512 dbg("%s - clfag %08x iflag %08x", __FUNCTION__, 1512 dbg("%s - clfag %08x iflag %08x", __func__,
1513 tty->termios->c_cflag, tty->termios->c_iflag); 1513 tty->termios->c_cflag, tty->termios->c_iflag);
1514 dbg("%s - old clfag %08x old iflag %08x", __FUNCTION__, 1514 dbg("%s - old clfag %08x old iflag %08x", __func__,
1515 old_termios->c_cflag, old_termios->c_iflag); 1515 old_termios->c_cflag, old_termios->c_iflag);
1516 1516
1517 dbg("%s - port %d", __FUNCTION__, port->number); 1517 dbg("%s - port %d", __func__, port->number);
1518 1518
1519 if (edge_port == NULL) 1519 if (edge_port == NULL)
1520 return; 1520 return;
1521 1521
1522 if (!edge_port->open) { 1522 if (!edge_port->open) {
1523 dbg("%s - port not opened", __FUNCTION__); 1523 dbg("%s - port not opened", __func__);
1524 return; 1524 return;
1525 } 1525 }
1526 1526
@@ -1549,7 +1549,7 @@ static int get_lsr_info(struct edgeport_port *edge_port, unsigned int __user *va
1549 spin_lock_irqsave(&edge_port->ep_lock, flags); 1549 spin_lock_irqsave(&edge_port->ep_lock, flags);
1550 if (edge_port->maxTxCredits == edge_port->txCredits && 1550 if (edge_port->maxTxCredits == edge_port->txCredits &&
1551 edge_port->txfifo.count == 0) { 1551 edge_port->txfifo.count == 0) {
1552 dbg("%s -- Empty", __FUNCTION__); 1552 dbg("%s -- Empty", __func__);
1553 result = TIOCSER_TEMT; 1553 result = TIOCSER_TEMT;
1554 } 1554 }
1555 spin_unlock_irqrestore(&edge_port->ep_lock, flags); 1555 spin_unlock_irqrestore(&edge_port->ep_lock, flags);
@@ -1569,7 +1569,7 @@ static int get_number_bytes_avail(struct edgeport_port *edge_port, unsigned int
1569 1569
1570 result = tty->read_cnt; 1570 result = tty->read_cnt;
1571 1571
1572 dbg("%s(%d) = %d", __FUNCTION__, edge_port->port->number, result); 1572 dbg("%s(%d) = %d", __func__, edge_port->port->number, result);
1573 if (copy_to_user(value, &result, sizeof(int))) 1573 if (copy_to_user(value, &result, sizeof(int)))
1574 return -EFAULT; 1574 return -EFAULT;
1575 //return 0; 1575 //return 0;
@@ -1581,7 +1581,7 @@ static int edge_tiocmset (struct usb_serial_port *port, struct file *file, unsig
1581 struct edgeport_port *edge_port = usb_get_serial_port_data(port); 1581 struct edgeport_port *edge_port = usb_get_serial_port_data(port);
1582 unsigned int mcr; 1582 unsigned int mcr;
1583 1583
1584 dbg("%s - port %d", __FUNCTION__, port->number); 1584 dbg("%s - port %d", __func__, port->number);
1585 1585
1586 mcr = edge_port->shadowMCR; 1586 mcr = edge_port->shadowMCR;
1587 if (set & TIOCM_RTS) 1587 if (set & TIOCM_RTS)
@@ -1612,7 +1612,7 @@ static int edge_tiocmget(struct usb_serial_port *port, struct file *file)
1612 unsigned int msr; 1612 unsigned int msr;
1613 unsigned int mcr; 1613 unsigned int mcr;
1614 1614
1615 dbg("%s - port %d", __FUNCTION__, port->number); 1615 dbg("%s - port %d", __func__, port->number);
1616 1616
1617 msr = edge_port->shadowMSR; 1617 msr = edge_port->shadowMSR;
1618 mcr = edge_port->shadowMCR; 1618 mcr = edge_port->shadowMCR;
@@ -1624,7 +1624,7 @@ static int edge_tiocmget(struct usb_serial_port *port, struct file *file)
1624 | ((msr & EDGEPORT_MSR_DSR) ? TIOCM_DSR: 0); /* 0x100 */ 1624 | ((msr & EDGEPORT_MSR_DSR) ? TIOCM_DSR: 0); /* 0x100 */
1625 1625
1626 1626
1627 dbg("%s -- %x", __FUNCTION__, result); 1627 dbg("%s -- %x", __func__, result);
1628 1628
1629 return result; 1629 return result;
1630} 1630}
@@ -1670,30 +1670,30 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
1670 struct async_icount cprev; 1670 struct async_icount cprev;
1671 struct serial_icounter_struct icount; 1671 struct serial_icounter_struct icount;
1672 1672
1673 dbg("%s - port %d, cmd = 0x%x", __FUNCTION__, port->number, cmd); 1673 dbg("%s - port %d, cmd = 0x%x", __func__, port->number, cmd);
1674 1674
1675 switch (cmd) { 1675 switch (cmd) {
1676 // return number of bytes available 1676 // return number of bytes available
1677 case TIOCINQ: 1677 case TIOCINQ:
1678 dbg("%s (%d) TIOCINQ", __FUNCTION__, port->number); 1678 dbg("%s (%d) TIOCINQ", __func__, port->number);
1679 return get_number_bytes_avail(edge_port, (unsigned int __user *) arg); 1679 return get_number_bytes_avail(edge_port, (unsigned int __user *) arg);
1680 break; 1680 break;
1681 1681
1682 case TIOCSERGETLSR: 1682 case TIOCSERGETLSR:
1683 dbg("%s (%d) TIOCSERGETLSR", __FUNCTION__, port->number); 1683 dbg("%s (%d) TIOCSERGETLSR", __func__, port->number);
1684 return get_lsr_info(edge_port, (unsigned int __user *) arg); 1684 return get_lsr_info(edge_port, (unsigned int __user *) arg);
1685 return 0; 1685 return 0;
1686 1686
1687 case TIOCGSERIAL: 1687 case TIOCGSERIAL:
1688 dbg("%s (%d) TIOCGSERIAL", __FUNCTION__, port->number); 1688 dbg("%s (%d) TIOCGSERIAL", __func__, port->number);
1689 return get_serial_info(edge_port, (struct serial_struct __user *) arg); 1689 return get_serial_info(edge_port, (struct serial_struct __user *) arg);
1690 1690
1691 case TIOCSSERIAL: 1691 case TIOCSSERIAL:
1692 dbg("%s (%d) TIOCSSERIAL", __FUNCTION__, port->number); 1692 dbg("%s (%d) TIOCSSERIAL", __func__, port->number);
1693 break; 1693 break;
1694 1694
1695 case TIOCMIWAIT: 1695 case TIOCMIWAIT:
1696 dbg("%s (%d) TIOCMIWAIT", __FUNCTION__, port->number); 1696 dbg("%s (%d) TIOCMIWAIT", __func__, port->number);
1697 cprev = edge_port->icount; 1697 cprev = edge_port->icount;
1698 while (1) { 1698 while (1) {
1699 prepare_to_wait(&edge_port->delta_msr_wait, &wait, TASK_INTERRUPTIBLE); 1699 prepare_to_wait(&edge_port->delta_msr_wait, &wait, TASK_INTERRUPTIBLE);
@@ -1732,7 +1732,7 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
1732 icount.brk = cnow.brk; 1732 icount.brk = cnow.brk;
1733 icount.buf_overrun = cnow.buf_overrun; 1733 icount.buf_overrun = cnow.buf_overrun;
1734 1734
1735 dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__, port->number, icount.rx, icount.tx ); 1735 dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __func__, port->number, icount.rx, icount.tx );
1736 if (copy_to_user((void __user *)arg, &icount, sizeof(icount))) 1736 if (copy_to_user((void __user *)arg, &icount, sizeof(icount)))
1737 return -EFAULT; 1737 return -EFAULT;
1738 return 0; 1738 return 0;
@@ -1758,7 +1758,7 @@ static void edge_break (struct usb_serial_port *port, int break_state)
1758 /* flush and chase */ 1758 /* flush and chase */
1759 edge_port->chaseResponsePending = true; 1759 edge_port->chaseResponsePending = true;
1760 1760
1761 dbg("%s - Sending IOSP_CMD_CHASE_PORT", __FUNCTION__); 1761 dbg("%s - Sending IOSP_CMD_CHASE_PORT", __func__);
1762 status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0); 1762 status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0);
1763 if (status == 0) { 1763 if (status == 0) {
1764 // block until chase finished 1764 // block until chase finished
@@ -1772,14 +1772,14 @@ static void edge_break (struct usb_serial_port *port, int break_state)
1772 ((edge_serial->is_epic) && 1772 ((edge_serial->is_epic) &&
1773 (edge_serial->epic_descriptor.Supports.IOSPSetClrBreak))) { 1773 (edge_serial->epic_descriptor.Supports.IOSPSetClrBreak))) {
1774 if (break_state == -1) { 1774 if (break_state == -1) {
1775 dbg("%s - Sending IOSP_CMD_SET_BREAK", __FUNCTION__); 1775 dbg("%s - Sending IOSP_CMD_SET_BREAK", __func__);
1776 status = send_iosp_ext_cmd (edge_port, IOSP_CMD_SET_BREAK, 0); 1776 status = send_iosp_ext_cmd (edge_port, IOSP_CMD_SET_BREAK, 0);
1777 } else { 1777 } else {
1778 dbg("%s - Sending IOSP_CMD_CLEAR_BREAK", __FUNCTION__); 1778 dbg("%s - Sending IOSP_CMD_CLEAR_BREAK", __func__);
1779 status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CLEAR_BREAK, 0); 1779 status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CLEAR_BREAK, 0);
1780 } 1780 }
1781 if (status) { 1781 if (status) {
1782 dbg("%s - error sending break set/clear command.", __FUNCTION__); 1782 dbg("%s - error sending break set/clear command.", __func__);
1783 } 1783 }
1784 } 1784 }
1785 1785
@@ -1799,14 +1799,14 @@ static void process_rcvd_data (struct edgeport_serial *edge_serial, unsigned cha
1799 __u16 lastBufferLength; 1799 __u16 lastBufferLength;
1800 __u16 rxLen; 1800 __u16 rxLen;
1801 1801
1802 dbg("%s", __FUNCTION__); 1802 dbg("%s", __func__);
1803 1803
1804 lastBufferLength = bufferLength + 1; 1804 lastBufferLength = bufferLength + 1;
1805 1805
1806 while (bufferLength > 0) { 1806 while (bufferLength > 0) {
1807 /* failsafe incase we get a message that we don't understand */ 1807 /* failsafe incase we get a message that we don't understand */
1808 if (lastBufferLength == bufferLength) { 1808 if (lastBufferLength == bufferLength) {
1809 dbg("%s - stuck in loop, exiting it.", __FUNCTION__); 1809 dbg("%s - stuck in loop, exiting it.", __func__);
1810 break; 1810 break;
1811 } 1811 }
1812 lastBufferLength = bufferLength; 1812 lastBufferLength = bufferLength;
@@ -1828,7 +1828,7 @@ static void process_rcvd_data (struct edgeport_serial *edge_serial, unsigned cha
1828 ++buffer; 1828 ++buffer;
1829 --bufferLength; 1829 --bufferLength;
1830 1830
1831 dbg("%s - Hdr1=%02X Hdr2=%02X", __FUNCTION__, edge_serial->rxHeader1, edge_serial->rxHeader2); 1831 dbg("%s - Hdr1=%02X Hdr2=%02X", __func__, edge_serial->rxHeader1, edge_serial->rxHeader2);
1832 1832
1833 // Process depending on whether this header is 1833 // Process depending on whether this header is
1834 // data or status 1834 // data or status
@@ -1858,7 +1858,7 @@ static void process_rcvd_data (struct edgeport_serial *edge_serial, unsigned cha
1858 edge_serial->rxPort = IOSP_GET_HDR_PORT(edge_serial->rxHeader1); 1858 edge_serial->rxPort = IOSP_GET_HDR_PORT(edge_serial->rxHeader1);
1859 edge_serial->rxBytesRemaining = IOSP_GET_HDR_DATA_LEN(edge_serial->rxHeader1, edge_serial->rxHeader2); 1859 edge_serial->rxBytesRemaining = IOSP_GET_HDR_DATA_LEN(edge_serial->rxHeader1, edge_serial->rxHeader2);
1860 1860
1861 dbg("%s - Data for Port %u Len %u", __FUNCTION__, edge_serial->rxPort, edge_serial->rxBytesRemaining); 1861 dbg("%s - Data for Port %u Len %u", __func__, edge_serial->rxPort, edge_serial->rxBytesRemaining);
1862 1862
1863 //ASSERT( DevExt->RxPort < DevExt->NumPorts ); 1863 //ASSERT( DevExt->RxPort < DevExt->NumPorts );
1864 //ASSERT( DevExt->RxBytesRemaining < IOSP_MAX_DATA_LENGTH ); 1864 //ASSERT( DevExt->RxBytesRemaining < IOSP_MAX_DATA_LENGTH );
@@ -1891,7 +1891,7 @@ static void process_rcvd_data (struct edgeport_serial *edge_serial, unsigned cha
1891 if (edge_port->open) { 1891 if (edge_port->open) {
1892 tty = edge_port->port->tty; 1892 tty = edge_port->port->tty;
1893 if (tty) { 1893 if (tty) {
1894 dbg("%s - Sending %d bytes to TTY for port %d", __FUNCTION__, rxLen, edge_serial->rxPort); 1894 dbg("%s - Sending %d bytes to TTY for port %d", __func__, rxLen, edge_serial->rxPort);
1895 edge_tty_recv(&edge_serial->serial->dev->dev, tty, buffer, rxLen); 1895 edge_tty_recv(&edge_serial->serial->dev->dev, tty, buffer, rxLen);
1896 } 1896 }
1897 edge_port->icount.rx += rxLen; 1897 edge_port->icount.rx += rxLen;
@@ -1930,17 +1930,17 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
1930 port = edge_serial->serial->port[edge_serial->rxPort]; 1930 port = edge_serial->serial->port[edge_serial->rxPort];
1931 edge_port = usb_get_serial_port_data(port); 1931 edge_port = usb_get_serial_port_data(port);
1932 if (edge_port == NULL) { 1932 if (edge_port == NULL) {
1933 dev_err(&edge_serial->serial->dev->dev, "%s - edge_port == NULL for port %d\n", __FUNCTION__, edge_serial->rxPort); 1933 dev_err(&edge_serial->serial->dev->dev, "%s - edge_port == NULL for port %d\n", __func__, edge_serial->rxPort);
1934 return; 1934 return;
1935 } 1935 }
1936 1936
1937 dbg("%s - port %d", __FUNCTION__, edge_serial->rxPort); 1937 dbg("%s - port %d", __func__, edge_serial->rxPort);
1938 1938
1939 if (code == IOSP_EXT_STATUS) { 1939 if (code == IOSP_EXT_STATUS) {
1940 switch (byte2) { 1940 switch (byte2) {
1941 case IOSP_EXT_STATUS_CHASE_RSP: 1941 case IOSP_EXT_STATUS_CHASE_RSP:
1942 // we want to do EXT status regardless of port open/closed 1942 // we want to do EXT status regardless of port open/closed
1943 dbg("%s - Port %u EXT CHASE_RSP Data = %02x", __FUNCTION__, edge_serial->rxPort, byte3 ); 1943 dbg("%s - Port %u EXT CHASE_RSP Data = %02x", __func__, edge_serial->rxPort, byte3 );
1944 // Currently, the only EXT_STATUS is Chase, so process here instead of one more call 1944 // Currently, the only EXT_STATUS is Chase, so process here instead of one more call
1945 // to one more subroutine. If/when more EXT_STATUS, there'll be more work to do. 1945 // to one more subroutine. If/when more EXT_STATUS, there'll be more work to do.
1946 // Also, we currently clear flag and close the port regardless of content of above's Byte3. 1946 // Also, we currently clear flag and close the port regardless of content of above's Byte3.
@@ -1951,7 +1951,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
1951 return; 1951 return;
1952 1952
1953 case IOSP_EXT_STATUS_RX_CHECK_RSP: 1953 case IOSP_EXT_STATUS_RX_CHECK_RSP:
1954 dbg("%s ========== Port %u CHECK_RSP Sequence = %02x =============\n", __FUNCTION__, edge_serial->rxPort, byte3 ); 1954 dbg("%s ========== Port %u CHECK_RSP Sequence = %02x =============\n", __func__, edge_serial->rxPort, byte3 );
1955 //Port->RxCheckRsp = true; 1955 //Port->RxCheckRsp = true;
1956 return; 1956 return;
1957 } 1957 }
@@ -1960,7 +1960,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
1960 if (code == IOSP_STATUS_OPEN_RSP) { 1960 if (code == IOSP_STATUS_OPEN_RSP) {
1961 edge_port->txCredits = GET_TX_BUFFER_SIZE(byte3); 1961 edge_port->txCredits = GET_TX_BUFFER_SIZE(byte3);
1962 edge_port->maxTxCredits = edge_port->txCredits; 1962 edge_port->maxTxCredits = edge_port->txCredits;
1963 dbg("%s - Port %u Open Response Inital MSR = %02x TxBufferSize = %d", __FUNCTION__, edge_serial->rxPort, byte2, edge_port->txCredits); 1963 dbg("%s - Port %u Open Response Inital MSR = %02x TxBufferSize = %d", __func__, edge_serial->rxPort, byte2, edge_port->txCredits);
1964 handle_new_msr (edge_port, byte2); 1964 handle_new_msr (edge_port, byte2);
1965 1965
1966 /* send the current line settings to the port so we are in sync with any further termios calls */ 1966 /* send the current line settings to the port so we are in sync with any further termios calls */
@@ -1984,23 +1984,23 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
1984 switch (code) { 1984 switch (code) {
1985 // Not currently sent by Edgeport 1985 // Not currently sent by Edgeport
1986 case IOSP_STATUS_LSR: 1986 case IOSP_STATUS_LSR:
1987 dbg("%s - Port %u LSR Status = %02x", __FUNCTION__, edge_serial->rxPort, byte2); 1987 dbg("%s - Port %u LSR Status = %02x", __func__, edge_serial->rxPort, byte2);
1988 handle_new_lsr(edge_port, false, byte2, 0); 1988 handle_new_lsr(edge_port, false, byte2, 0);
1989 break; 1989 break;
1990 1990
1991 case IOSP_STATUS_LSR_DATA: 1991 case IOSP_STATUS_LSR_DATA:
1992 dbg("%s - Port %u LSR Status = %02x, Data = %02x", __FUNCTION__, edge_serial->rxPort, byte2, byte3); 1992 dbg("%s - Port %u LSR Status = %02x, Data = %02x", __func__, edge_serial->rxPort, byte2, byte3);
1993 // byte2 is LSR Register 1993 // byte2 is LSR Register
1994 // byte3 is broken data byte 1994 // byte3 is broken data byte
1995 handle_new_lsr(edge_port, true, byte2, byte3); 1995 handle_new_lsr(edge_port, true, byte2, byte3);
1996 break; 1996 break;
1997 // 1997 //
1998 // case IOSP_EXT_4_STATUS: 1998 // case IOSP_EXT_4_STATUS:
1999 // dbg("%s - Port %u LSR Status = %02x Data = %02x", __FUNCTION__, edge_serial->rxPort, byte2, byte3); 1999 // dbg("%s - Port %u LSR Status = %02x Data = %02x", __func__, edge_serial->rxPort, byte2, byte3);
2000 // break; 2000 // break;
2001 // 2001 //
2002 case IOSP_STATUS_MSR: 2002 case IOSP_STATUS_MSR:
2003 dbg("%s - Port %u MSR Status = %02x", __FUNCTION__, edge_serial->rxPort, byte2); 2003 dbg("%s - Port %u MSR Status = %02x", __func__, edge_serial->rxPort, byte2);
2004 2004
2005 // Process this new modem status and generate appropriate 2005 // Process this new modem status and generate appropriate
2006 // events, etc, based on the new status. This routine 2006 // events, etc, based on the new status. This routine
@@ -2009,7 +2009,7 @@ static void process_rcvd_status (struct edgeport_serial *edge_serial, __u8 byte2
2009 break; 2009 break;
2010 2010
2011 default: 2011 default:
2012 dbg("%s - Unrecognized IOSP status code %u\n", __FUNCTION__, code); 2012 dbg("%s - Unrecognized IOSP status code %u\n", __func__, code);
2013 break; 2013 break;
2014 } 2014 }
2015 2015
@@ -2029,7 +2029,7 @@ static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned c
2029 cnt = tty_buffer_request_room(tty, length); 2029 cnt = tty_buffer_request_room(tty, length);
2030 if (cnt < length) { 2030 if (cnt < length) {
2031 dev_err(dev, "%s - dropping data, %d bytes lost\n", 2031 dev_err(dev, "%s - dropping data, %d bytes lost\n",
2032 __FUNCTION__, length - cnt); 2032 __func__, length - cnt);
2033 if(cnt == 0) 2033 if(cnt == 0)
2034 break; 2034 break;
2035 } 2035 }
@@ -2050,7 +2050,7 @@ static void handle_new_msr(struct edgeport_port *edge_port, __u8 newMsr)
2050{ 2050{
2051 struct async_icount *icount; 2051 struct async_icount *icount;
2052 2052
2053 dbg("%s %02x", __FUNCTION__, newMsr); 2053 dbg("%s %02x", __func__, newMsr);
2054 2054
2055 if (newMsr & (EDGEPORT_MSR_DELTA_CTS | EDGEPORT_MSR_DELTA_DSR | EDGEPORT_MSR_DELTA_RI | EDGEPORT_MSR_DELTA_CD)) { 2055 if (newMsr & (EDGEPORT_MSR_DELTA_CTS | EDGEPORT_MSR_DELTA_DSR | EDGEPORT_MSR_DELTA_RI | EDGEPORT_MSR_DELTA_CD)) {
2056 icount = &edge_port->icount; 2056 icount = &edge_port->icount;
@@ -2087,7 +2087,7 @@ static void handle_new_lsr(struct edgeport_port *edge_port, __u8 lsrData, __u8 l
2087 __u8 newLsr = (__u8)(lsr & (__u8)(LSR_OVER_ERR | LSR_PAR_ERR | LSR_FRM_ERR | LSR_BREAK)); 2087 __u8 newLsr = (__u8)(lsr & (__u8)(LSR_OVER_ERR | LSR_PAR_ERR | LSR_FRM_ERR | LSR_BREAK));
2088 struct async_icount *icount; 2088 struct async_icount *icount;
2089 2089
2090 dbg("%s - %02x", __FUNCTION__, newLsr); 2090 dbg("%s - %02x", __func__, newLsr);
2091 2091
2092 edge_port->shadowLSR = lsr; 2092 edge_port->shadowLSR = lsr;
2093 2093
@@ -2136,11 +2136,11 @@ static int sram_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u
2136 __u16 current_length; 2136 __u16 current_length;
2137 unsigned char *transfer_buffer; 2137 unsigned char *transfer_buffer;
2138 2138
2139 dbg("%s - %x, %x, %d", __FUNCTION__, extAddr, addr, length); 2139 dbg("%s - %x, %x, %d", __func__, extAddr, addr, length);
2140 2140
2141 transfer_buffer = kmalloc (64, GFP_KERNEL); 2141 transfer_buffer = kmalloc (64, GFP_KERNEL);
2142 if (!transfer_buffer) { 2142 if (!transfer_buffer) {
2143 dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 64); 2143 dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __func__, 64);
2144 return -ENOMEM; 2144 return -ENOMEM;
2145 } 2145 }
2146 2146
@@ -2152,7 +2152,7 @@ static int sram_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u
2152 } else { 2152 } else {
2153 current_length = length; 2153 current_length = length;
2154 } 2154 }
2155// dbg("%s - writing %x, %x, %d", __FUNCTION__, extAddr, addr, current_length); 2155// dbg("%s - writing %x, %x, %d", __func__, extAddr, addr, current_length);
2156 memcpy (transfer_buffer, data, current_length); 2156 memcpy (transfer_buffer, data, current_length);
2157 result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), USB_REQUEST_ION_WRITE_RAM, 2157 result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), USB_REQUEST_ION_WRITE_RAM,
2158 0x40, addr, extAddr, transfer_buffer, current_length, 300); 2158 0x40, addr, extAddr, transfer_buffer, current_length, 300);
@@ -2181,11 +2181,11 @@ static int rom_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u1
2181 __u16 current_length; 2181 __u16 current_length;
2182 unsigned char *transfer_buffer; 2182 unsigned char *transfer_buffer;
2183 2183
2184// dbg("%s - %x, %x, %d", __FUNCTION__, extAddr, addr, length); 2184// dbg("%s - %x, %x, %d", __func__, extAddr, addr, length);
2185 2185
2186 transfer_buffer = kmalloc (64, GFP_KERNEL); 2186 transfer_buffer = kmalloc (64, GFP_KERNEL);
2187 if (!transfer_buffer) { 2187 if (!transfer_buffer) {
2188 dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 64); 2188 dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __func__, 64);
2189 return -ENOMEM; 2189 return -ENOMEM;
2190 } 2190 }
2191 2191
@@ -2197,7 +2197,7 @@ static int rom_write (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u1
2197 } else { 2197 } else {
2198 current_length = length; 2198 current_length = length;
2199 } 2199 }
2200// dbg("%s - writing %x, %x, %d", __FUNCTION__, extAddr, addr, current_length); 2200// dbg("%s - writing %x, %x, %d", __func__, extAddr, addr, current_length);
2201 memcpy (transfer_buffer, data, current_length); 2201 memcpy (transfer_buffer, data, current_length);
2202 result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), USB_REQUEST_ION_WRITE_ROM, 2202 result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), USB_REQUEST_ION_WRITE_ROM,
2203 0x40, addr, extAddr, transfer_buffer, current_length, 300); 2203 0x40, addr, extAddr, transfer_buffer, current_length, 300);
@@ -2226,11 +2226,11 @@ static int rom_read (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16
2226 __u16 current_length; 2226 __u16 current_length;
2227 unsigned char *transfer_buffer; 2227 unsigned char *transfer_buffer;
2228 2228
2229 dbg("%s - %x, %x, %d", __FUNCTION__, extAddr, addr, length); 2229 dbg("%s - %x, %x, %d", __func__, extAddr, addr, length);
2230 2230
2231 transfer_buffer = kmalloc (64, GFP_KERNEL); 2231 transfer_buffer = kmalloc (64, GFP_KERNEL);
2232 if (!transfer_buffer) { 2232 if (!transfer_buffer) {
2233 dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 64); 2233 dev_err(&serial->dev->dev, "%s - kmalloc(%d) failed.\n", __func__, 64);
2234 return -ENOMEM; 2234 return -ENOMEM;
2235 } 2235 }
2236 2236
@@ -2242,7 +2242,7 @@ static int rom_read (struct usb_serial *serial, __u16 extAddr, __u16 addr, __u16
2242 } else { 2242 } else {
2243 current_length = length; 2243 current_length = length;
2244 } 2244 }
2245// dbg("%s - %x, %x, %d", __FUNCTION__, extAddr, addr, current_length); 2245// dbg("%s - %x, %x, %d", __func__, extAddr, addr, current_length);
2246 result = usb_control_msg (serial->dev, usb_rcvctrlpipe(serial->dev, 0), USB_REQUEST_ION_READ_ROM, 2246 result = usb_control_msg (serial->dev, usb_rcvctrlpipe(serial->dev, 0), USB_REQUEST_ION_READ_ROM,
2247 0xC0, addr, extAddr, transfer_buffer, current_length, 300); 2247 0xC0, addr, extAddr, transfer_buffer, current_length, 300);
2248 if (result < 0) 2248 if (result < 0)
@@ -2269,11 +2269,11 @@ static int send_iosp_ext_cmd (struct edgeport_port *edge_port, __u8 command, __u
2269 int length = 0; 2269 int length = 0;
2270 int status = 0; 2270 int status = 0;
2271 2271
2272 dbg("%s - %d, %d", __FUNCTION__, command, param); 2272 dbg("%s - %d, %d", __func__, command, param);
2273 2273
2274 buffer = kmalloc (10, GFP_ATOMIC); 2274 buffer = kmalloc (10, GFP_ATOMIC);
2275 if (!buffer) { 2275 if (!buffer) {
2276 dev_err(&edge_port->port->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 10); 2276 dev_err(&edge_port->port->dev, "%s - kmalloc(%d) failed.\n", __func__, 10);
2277 return -ENOMEM; 2277 return -ENOMEM;
2278 } 2278 }
2279 2279
@@ -2304,7 +2304,7 @@ static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer
2304 struct urb *urb; 2304 struct urb *urb;
2305 int timeout; 2305 int timeout;
2306 2306
2307 usb_serial_debug_data(debug, &edge_port->port->dev, __FUNCTION__, length, buffer); 2307 usb_serial_debug_data(debug, &edge_port->port->dev, __func__, length, buffer);
2308 2308
2309 /* Allocate our next urb */ 2309 /* Allocate our next urb */
2310 urb = usb_alloc_urb (0, GFP_ATOMIC); 2310 urb = usb_alloc_urb (0, GFP_ATOMIC);
@@ -2312,7 +2312,7 @@ static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer
2312 return -ENOMEM; 2312 return -ENOMEM;
2313 2313
2314 atomic_inc(&CmdUrbs); 2314 atomic_inc(&CmdUrbs);
2315 dbg("%s - ALLOCATE URB %p (outstanding %d)", __FUNCTION__, urb, atomic_read(&CmdUrbs)); 2315 dbg("%s - ALLOCATE URB %p (outstanding %d)", __func__, urb, atomic_read(&CmdUrbs));
2316 2316
2317 usb_fill_bulk_urb (urb, edge_serial->serial->dev, 2317 usb_fill_bulk_urb (urb, edge_serial->serial->dev,
2318 usb_sndbulkpipe(edge_serial->serial->dev, edge_serial->bulk_out_endpoint), 2318 usb_sndbulkpipe(edge_serial->serial->dev, edge_serial->bulk_out_endpoint),
@@ -2323,7 +2323,7 @@ static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer
2323 2323
2324 if (status) { 2324 if (status) {
2325 /* something went wrong */ 2325 /* something went wrong */
2326 dev_err(&edge_port->port->dev, "%s - usb_submit_urb(write command) failed, status = %d\n", __FUNCTION__, status); 2326 dev_err(&edge_port->port->dev, "%s - usb_submit_urb(write command) failed, status = %d\n", __func__, status);
2327 usb_kill_urb(urb); 2327 usb_kill_urb(urb);
2328 usb_free_urb(urb); 2328 usb_free_urb(urb);
2329 atomic_dec(&CmdUrbs); 2329 atomic_dec(&CmdUrbs);
@@ -2337,7 +2337,7 @@ static int write_cmd_usb (struct edgeport_port *edge_port, unsigned char *buffer
2337 2337
2338 if (edge_port->commandPending) { 2338 if (edge_port->commandPending) {
2339 /* command timed out */ 2339 /* command timed out */
2340 dbg("%s - command timed out", __FUNCTION__); 2340 dbg("%s - command timed out", __func__);
2341 status = -EINVAL; 2341 status = -EINVAL;
2342 } 2342 }
2343#endif 2343#endif
@@ -2367,18 +2367,18 @@ static int send_cmd_write_baud_rate (struct edgeport_port *edge_port, int baudRa
2367 return 0; 2367 return 0;
2368 } 2368 }
2369 2369
2370 dbg("%s - port = %d, baud = %d", __FUNCTION__, edge_port->port->number, baudRate); 2370 dbg("%s - port = %d, baud = %d", __func__, edge_port->port->number, baudRate);
2371 2371
2372 status = calc_baud_rate_divisor (baudRate, &divisor); 2372 status = calc_baud_rate_divisor (baudRate, &divisor);
2373 if (status) { 2373 if (status) {
2374 dev_err(&edge_port->port->dev, "%s - bad baud rate\n", __FUNCTION__); 2374 dev_err(&edge_port->port->dev, "%s - bad baud rate\n", __func__);
2375 return status; 2375 return status;
2376 } 2376 }
2377 2377
2378 // Alloc memory for the string of commands. 2378 // Alloc memory for the string of commands.
2379 cmdBuffer = kmalloc (0x100, GFP_ATOMIC); 2379 cmdBuffer = kmalloc (0x100, GFP_ATOMIC);
2380 if (!cmdBuffer) { 2380 if (!cmdBuffer) {
2381 dev_err(&edge_port->port->dev, "%s - kmalloc(%d) failed.\n", __FUNCTION__, 0x100); 2381 dev_err(&edge_port->port->dev, "%s - kmalloc(%d) failed.\n", __func__, 0x100);
2382 return -ENOMEM; 2382 return -ENOMEM;
2383 } 2383 }
2384 currCmd = cmdBuffer; 2384 currCmd = cmdBuffer;
@@ -2414,7 +2414,7 @@ static int calc_baud_rate_divisor (int baudrate, int *divisor)
2414 __u16 custom; 2414 __u16 custom;
2415 2415
2416 2416
2417 dbg("%s - %d", __FUNCTION__, baudrate); 2417 dbg("%s - %d", __func__, baudrate);
2418 2418
2419 for (i = 0; i < ARRAY_SIZE(divisor_table); i++) { 2419 for (i = 0; i < ARRAY_SIZE(divisor_table); i++) {
2420 if ( divisor_table[i].BaudRate == baudrate ) { 2420 if ( divisor_table[i].BaudRate == baudrate ) {
@@ -2432,7 +2432,7 @@ static int calc_baud_rate_divisor (int baudrate, int *divisor)
2432 2432
2433 *divisor = custom; 2433 *divisor = custom;
2434 2434
2435 dbg("%s - Baud %d = %d\n", __FUNCTION__, baudrate, custom); 2435 dbg("%s - Baud %d = %d\n", __func__, baudrate, custom);
2436 return 0; 2436 return 0;
2437 } 2437 }
2438 2438
@@ -2452,7 +2452,7 @@ static int send_cmd_write_uart_register (struct edgeport_port *edge_port, __u8 r
2452 unsigned long cmdLen = 0; 2452 unsigned long cmdLen = 0;
2453 int status; 2453 int status;
2454 2454
2455 dbg("%s - write to %s register 0x%02x", (regNum == MCR) ? "MCR" : "LCR", __FUNCTION__, regValue); 2455 dbg("%s - write to %s register 0x%02x", (regNum == MCR) ? "MCR" : "LCR", __func__, regValue);
2456 2456
2457 if (edge_serial->is_epic && 2457 if (edge_serial->is_epic &&
2458 !edge_serial->epic_descriptor.Supports.IOSPWriteMCR && 2458 !edge_serial->epic_descriptor.Supports.IOSPWriteMCR &&
@@ -2513,29 +2513,29 @@ static void change_port_settings (struct edgeport_port *edge_port, struct ktermi
2513 __u8 txFlow; 2513 __u8 txFlow;
2514 int status; 2514 int status;
2515 2515
2516 dbg("%s - port %d", __FUNCTION__, edge_port->port->number); 2516 dbg("%s - port %d", __func__, edge_port->port->number);
2517 2517
2518 if (!edge_port->open && 2518 if (!edge_port->open &&
2519 !edge_port->openPending) { 2519 !edge_port->openPending) {
2520 dbg("%s - port not opened", __FUNCTION__); 2520 dbg("%s - port not opened", __func__);
2521 return; 2521 return;
2522 } 2522 }
2523 2523
2524 tty = edge_port->port->tty; 2524 tty = edge_port->port->tty;
2525 if ((!tty) || 2525 if ((!tty) ||
2526 (!tty->termios)) { 2526 (!tty->termios)) {
2527 dbg("%s - no tty structures", __FUNCTION__); 2527 dbg("%s - no tty structures", __func__);
2528 return; 2528 return;
2529 } 2529 }
2530 2530
2531 cflag = tty->termios->c_cflag; 2531 cflag = tty->termios->c_cflag;
2532 2532
2533 switch (cflag & CSIZE) { 2533 switch (cflag & CSIZE) {
2534 case CS5: lData = LCR_BITS_5; mask = 0x1f; dbg("%s - data bits = 5", __FUNCTION__); break; 2534 case CS5: lData = LCR_BITS_5; mask = 0x1f; dbg("%s - data bits = 5", __func__); break;
2535 case CS6: lData = LCR_BITS_6; mask = 0x3f; dbg("%s - data bits = 6", __FUNCTION__); break; 2535 case CS6: lData = LCR_BITS_6; mask = 0x3f; dbg("%s - data bits = 6", __func__); break;
2536 case CS7: lData = LCR_BITS_7; mask = 0x7f; dbg("%s - data bits = 7", __FUNCTION__); break; 2536 case CS7: lData = LCR_BITS_7; mask = 0x7f; dbg("%s - data bits = 7", __func__); break;
2537 default: 2537 default:
2538 case CS8: lData = LCR_BITS_8; dbg("%s - data bits = 8", __FUNCTION__); break; 2538 case CS8: lData = LCR_BITS_8; dbg("%s - data bits = 8", __func__); break;
2539 } 2539 }
2540 2540
2541 lParity = LCR_PAR_NONE; 2541 lParity = LCR_PAR_NONE;
@@ -2543,28 +2543,28 @@ static void change_port_settings (struct edgeport_port *edge_port, struct ktermi
2543 if (cflag & CMSPAR) { 2543 if (cflag & CMSPAR) {
2544 if (cflag & PARODD) { 2544 if (cflag & PARODD) {
2545 lParity = LCR_PAR_MARK; 2545 lParity = LCR_PAR_MARK;
2546 dbg("%s - parity = mark", __FUNCTION__); 2546 dbg("%s - parity = mark", __func__);
2547 } else { 2547 } else {
2548 lParity = LCR_PAR_SPACE; 2548 lParity = LCR_PAR_SPACE;
2549 dbg("%s - parity = space", __FUNCTION__); 2549 dbg("%s - parity = space", __func__);
2550 } 2550 }
2551 } else if (cflag & PARODD) { 2551 } else if (cflag & PARODD) {
2552 lParity = LCR_PAR_ODD; 2552 lParity = LCR_PAR_ODD;
2553 dbg("%s - parity = odd", __FUNCTION__); 2553 dbg("%s - parity = odd", __func__);
2554 } else { 2554 } else {
2555 lParity = LCR_PAR_EVEN; 2555 lParity = LCR_PAR_EVEN;
2556 dbg("%s - parity = even", __FUNCTION__); 2556 dbg("%s - parity = even", __func__);
2557 } 2557 }
2558 } else { 2558 } else {
2559 dbg("%s - parity = none", __FUNCTION__); 2559 dbg("%s - parity = none", __func__);
2560 } 2560 }
2561 2561
2562 if (cflag & CSTOPB) { 2562 if (cflag & CSTOPB) {
2563 lStop = LCR_STOP_2; 2563 lStop = LCR_STOP_2;
2564 dbg("%s - stop bits = 2", __FUNCTION__); 2564 dbg("%s - stop bits = 2", __func__);
2565 } else { 2565 } else {
2566 lStop = LCR_STOP_1; 2566 lStop = LCR_STOP_1;
2567 dbg("%s - stop bits = 1", __FUNCTION__); 2567 dbg("%s - stop bits = 1", __func__);
2568 } 2568 }
2569 2569
2570 /* figure out the flow control settings */ 2570 /* figure out the flow control settings */
@@ -2572,9 +2572,9 @@ static void change_port_settings (struct edgeport_port *edge_port, struct ktermi
2572 if (cflag & CRTSCTS) { 2572 if (cflag & CRTSCTS) {
2573 rxFlow |= IOSP_RX_FLOW_RTS; 2573 rxFlow |= IOSP_RX_FLOW_RTS;
2574 txFlow |= IOSP_TX_FLOW_CTS; 2574 txFlow |= IOSP_TX_FLOW_CTS;
2575 dbg("%s - RTS/CTS is enabled", __FUNCTION__); 2575 dbg("%s - RTS/CTS is enabled", __func__);
2576 } else { 2576 } else {
2577 dbg("%s - RTS/CTS is disabled", __FUNCTION__); 2577 dbg("%s - RTS/CTS is disabled", __func__);
2578 } 2578 }
2579 2579
2580 /* if we are implementing XON/XOFF, set the start and stop character in the device */ 2580 /* if we are implementing XON/XOFF, set the start and stop character in the device */
@@ -2592,17 +2592,17 @@ static void change_port_settings (struct edgeport_port *edge_port, struct ktermi
2592 /* if we are implementing INBOUND XON/XOFF */ 2592 /* if we are implementing INBOUND XON/XOFF */
2593 if (I_IXOFF(tty)) { 2593 if (I_IXOFF(tty)) {
2594 rxFlow |= IOSP_RX_FLOW_XON_XOFF; 2594 rxFlow |= IOSP_RX_FLOW_XON_XOFF;
2595 dbg("%s - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x", __FUNCTION__, start_char, stop_char); 2595 dbg("%s - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x", __func__, start_char, stop_char);
2596 } else { 2596 } else {
2597 dbg("%s - INBOUND XON/XOFF is disabled", __FUNCTION__); 2597 dbg("%s - INBOUND XON/XOFF is disabled", __func__);
2598 } 2598 }
2599 2599
2600 /* if we are implementing OUTBOUND XON/XOFF */ 2600 /* if we are implementing OUTBOUND XON/XOFF */
2601 if (I_IXON(tty)) { 2601 if (I_IXON(tty)) {
2602 txFlow |= IOSP_TX_FLOW_XON_XOFF; 2602 txFlow |= IOSP_TX_FLOW_XON_XOFF;
2603 dbg("%s - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x", __FUNCTION__, start_char, stop_char); 2603 dbg("%s - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x", __func__, start_char, stop_char);
2604 } else { 2604 } else {
2605 dbg("%s - OUTBOUND XON/XOFF is disabled", __FUNCTION__); 2605 dbg("%s - OUTBOUND XON/XOFF is disabled", __func__);
2606 } 2606 }
2607 } 2607 }
2608 2608
@@ -2645,7 +2645,7 @@ static void change_port_settings (struct edgeport_port *edge_port, struct ktermi
2645 baud = 9600; 2645 baud = 9600;
2646 } 2646 }
2647 2647
2648 dbg("%s - baud rate = %d", __FUNCTION__, baud); 2648 dbg("%s - baud rate = %d", __func__, baud);
2649 status = send_cmd_write_baud_rate (edge_port, baud); 2649 status = send_cmd_write_baud_rate (edge_port, baud);
2650 if (status == -1) { 2650 if (status == -1) {
2651 /* Speed change was not possible - put back the old speed */ 2651 /* Speed change was not possible - put back the old speed */
@@ -2843,7 +2843,7 @@ static int edge_startup (struct usb_serial *serial)
2843 /* create our private serial structure */ 2843 /* create our private serial structure */
2844 edge_serial = kzalloc(sizeof(struct edgeport_serial), GFP_KERNEL); 2844 edge_serial = kzalloc(sizeof(struct edgeport_serial), GFP_KERNEL);
2845 if (edge_serial == NULL) { 2845 if (edge_serial == NULL) {
2846 dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); 2846 dev_err(&serial->dev->dev, "%s - Out of memory\n", __func__);
2847 return -ENOMEM; 2847 return -ENOMEM;
2848 } 2848 }
2849 spin_lock_init(&edge_serial->es_lock); 2849 spin_lock_init(&edge_serial->es_lock);
@@ -2885,19 +2885,19 @@ static int edge_startup (struct usb_serial *serial)
2885 serial->num_ports); 2885 serial->num_ports);
2886 } 2886 }
2887 2887
2888 dbg("%s - time 1 %ld", __FUNCTION__, jiffies); 2888 dbg("%s - time 1 %ld", __func__, jiffies);
2889 2889
2890 /* If not an EPiC device */ 2890 /* If not an EPiC device */
2891 if (!edge_serial->is_epic) { 2891 if (!edge_serial->is_epic) {
2892 /* now load the application firmware into this device */ 2892 /* now load the application firmware into this device */
2893 load_application_firmware (edge_serial); 2893 load_application_firmware (edge_serial);
2894 2894
2895 dbg("%s - time 2 %ld", __FUNCTION__, jiffies); 2895 dbg("%s - time 2 %ld", __func__, jiffies);
2896 2896
2897 /* Check current Edgeport EEPROM and update if necessary */ 2897 /* Check current Edgeport EEPROM and update if necessary */
2898 update_edgeport_E2PROM (edge_serial); 2898 update_edgeport_E2PROM (edge_serial);
2899 2899
2900 dbg("%s - time 3 %ld", __FUNCTION__, jiffies); 2900 dbg("%s - time 3 %ld", __func__, jiffies);
2901 2901
2902 /* set the configuration to use #1 */ 2902 /* set the configuration to use #1 */
2903// dbg("set_configuration 1"); 2903// dbg("set_configuration 1");
@@ -2911,7 +2911,7 @@ static int edge_startup (struct usb_serial *serial)
2911 for (i = 0; i < serial->num_ports; ++i) { 2911 for (i = 0; i < serial->num_ports; ++i) {
2912 edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL); 2912 edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL);
2913 if (edge_port == NULL) { 2913 if (edge_port == NULL) {
2914 dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__); 2914 dev_err(&serial->dev->dev, "%s - Out of memory\n", __func__);
2915 for (j = 0; j < i; ++j) { 2915 for (j = 0; j < i; ++j) {
2916 kfree (usb_get_serial_port_data(serial->port[j])); 2916 kfree (usb_get_serial_port_data(serial->port[j]));
2917 usb_set_serial_port_data(serial->port[j], NULL); 2917 usb_set_serial_port_data(serial->port[j], NULL);
@@ -3017,7 +3017,7 @@ static int edge_startup (struct usb_serial *serial)
3017 * continue as long as the edgeport is connected */ 3017 * continue as long as the edgeport is connected */
3018 response = usb_submit_urb(edge_serial->interrupt_read_urb, GFP_KERNEL); 3018 response = usb_submit_urb(edge_serial->interrupt_read_urb, GFP_KERNEL);
3019 if (response) 3019 if (response)
3020 err("%s - Error %d submitting control urb", __FUNCTION__, response); 3020 err("%s - Error %d submitting control urb", __func__, response);
3021 } 3021 }
3022 return response; 3022 return response;
3023} 3023}
@@ -3032,7 +3032,7 @@ static void edge_shutdown (struct usb_serial *serial)
3032 struct edgeport_serial *edge_serial = usb_get_serial_data(serial); 3032 struct edgeport_serial *edge_serial = usb_get_serial_data(serial);
3033 int i; 3033 int i;
3034 3034
3035 dbg("%s", __FUNCTION__); 3035 dbg("%s", __func__);
3036 3036
3037 /* stop reads and writes on all ports */ 3037 /* stop reads and writes on all ports */
3038 for (i=0; i < serial->num_ports; ++i) { 3038 for (i=0; i < serial->num_ports; ++i) {