diff options
Diffstat (limited to 'drivers/usb/serial/whiteheat.c')
-rw-r--r-- | drivers/usb/serial/whiteheat.c | 118 |
1 files changed, 56 insertions, 62 deletions
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 38726ef3132b..e96bf8663ffc 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c | |||
@@ -164,9 +164,6 @@ static struct usb_serial_driver whiteheat_fake_device = { | |||
164 | .description = "Connect Tech - WhiteHEAT - (prerenumeration)", | 164 | .description = "Connect Tech - WhiteHEAT - (prerenumeration)", |
165 | .usb_driver = &whiteheat_driver, | 165 | .usb_driver = &whiteheat_driver, |
166 | .id_table = id_table_prerenumeration, | 166 | .id_table = id_table_prerenumeration, |
167 | .num_interrupt_in = NUM_DONT_CARE, | ||
168 | .num_bulk_in = NUM_DONT_CARE, | ||
169 | .num_bulk_out = NUM_DONT_CARE, | ||
170 | .num_ports = 1, | 167 | .num_ports = 1, |
171 | .probe = whiteheat_firmware_download, | 168 | .probe = whiteheat_firmware_download, |
172 | .attach = whiteheat_firmware_attach, | 169 | .attach = whiteheat_firmware_attach, |
@@ -180,9 +177,6 @@ static struct usb_serial_driver whiteheat_device = { | |||
180 | .description = "Connect Tech - WhiteHEAT", | 177 | .description = "Connect Tech - WhiteHEAT", |
181 | .usb_driver = &whiteheat_driver, | 178 | .usb_driver = &whiteheat_driver, |
182 | .id_table = id_table_std, | 179 | .id_table = id_table_std, |
183 | .num_interrupt_in = NUM_DONT_CARE, | ||
184 | .num_bulk_in = NUM_DONT_CARE, | ||
185 | .num_bulk_out = NUM_DONT_CARE, | ||
186 | .num_ports = 4, | 180 | .num_ports = 4, |
187 | .attach = whiteheat_attach, | 181 | .attach = whiteheat_attach, |
188 | .shutdown = whiteheat_shutdown, | 182 | .shutdown = whiteheat_shutdown, |
@@ -225,7 +219,7 @@ struct whiteheat_urb_wrap { | |||
225 | struct whiteheat_private { | 219 | struct whiteheat_private { |
226 | spinlock_t lock; | 220 | spinlock_t lock; |
227 | __u8 flags; | 221 | __u8 flags; |
228 | __u8 mcr; | 222 | __u8 mcr; /* FIXME: no locking on mcr */ |
229 | struct list_head rx_urbs_free; | 223 | struct list_head rx_urbs_free; |
230 | struct list_head rx_urbs_submitted; | 224 | struct list_head rx_urbs_submitted; |
231 | struct list_head rx_urb_q; | 225 | struct list_head rx_urb_q; |
@@ -288,7 +282,7 @@ static int whiteheat_firmware_download (struct usb_serial *serial, const struct | |||
288 | int response; | 282 | int response; |
289 | const struct whiteheat_hex_record *record; | 283 | const struct whiteheat_hex_record *record; |
290 | 284 | ||
291 | dbg("%s", __FUNCTION__); | 285 | dbg("%s", __func__); |
292 | 286 | ||
293 | response = ezusb_set_reset (serial, 1); | 287 | response = ezusb_set_reset (serial, 1); |
294 | 288 | ||
@@ -298,7 +292,7 @@ static int whiteheat_firmware_download (struct usb_serial *serial, const struct | |||
298 | (unsigned char *)record->data, record->data_size, 0xa0); | 292 | (unsigned char *)record->data, record->data_size, 0xa0); |
299 | if (response < 0) { | 293 | if (response < 0) { |
300 | err("%s - ezusb_writememory failed for loader (%d %04X %p %d)", | 294 | err("%s - ezusb_writememory failed for loader (%d %04X %p %d)", |
301 | __FUNCTION__, response, record->address, record->data, record->data_size); | 295 | __func__, response, record->address, record->data, record->data_size); |
302 | break; | 296 | break; |
303 | } | 297 | } |
304 | ++record; | 298 | ++record; |
@@ -315,7 +309,7 @@ static int whiteheat_firmware_download (struct usb_serial *serial, const struct | |||
315 | (unsigned char *)record->data, record->data_size, 0xa3); | 309 | (unsigned char *)record->data, record->data_size, 0xa3); |
316 | if (response < 0) { | 310 | if (response < 0) { |
317 | err("%s - ezusb_writememory failed for first firmware step (%d %04X %p %d)", | 311 | err("%s - ezusb_writememory failed for first firmware step (%d %04X %p %d)", |
318 | __FUNCTION__, response, record->address, record->data, record->data_size); | 312 | __func__, response, record->address, record->data, record->data_size); |
319 | break; | 313 | break; |
320 | } | 314 | } |
321 | ++record; | 315 | ++record; |
@@ -329,7 +323,7 @@ static int whiteheat_firmware_download (struct usb_serial *serial, const struct | |||
329 | (unsigned char *)record->data, record->data_size, 0xa0); | 323 | (unsigned char *)record->data, record->data_size, 0xa0); |
330 | if (response < 0) { | 324 | if (response < 0) { |
331 | err("%s - ezusb_writememory failed for second firmware step (%d %04X %p %d)", | 325 | err("%s - ezusb_writememory failed for second firmware step (%d %04X %p %d)", |
332 | __FUNCTION__, response, record->address, record->data, record->data_size); | 326 | __func__, response, record->address, record->data, record->data_size); |
333 | break; | 327 | break; |
334 | } | 328 | } |
335 | ++record; | 329 | ++record; |
@@ -567,7 +561,7 @@ static void whiteheat_shutdown (struct usb_serial *serial) | |||
567 | struct list_head *tmp2; | 561 | struct list_head *tmp2; |
568 | int i; | 562 | int i; |
569 | 563 | ||
570 | dbg("%s", __FUNCTION__); | 564 | dbg("%s", __func__); |
571 | 565 | ||
572 | /* free up our private data for our command port */ | 566 | /* free up our private data for our command port */ |
573 | command_port = serial->port[COMMAND_PORT]; | 567 | command_port = serial->port[COMMAND_PORT]; |
@@ -604,7 +598,7 @@ static int whiteheat_open (struct usb_serial_port *port, struct file *filp) | |||
604 | int retval = 0; | 598 | int retval = 0; |
605 | struct ktermios old_term; | 599 | struct ktermios old_term; |
606 | 600 | ||
607 | dbg("%s - port %d", __FUNCTION__, port->number); | 601 | dbg("%s - port %d", __func__, port->number); |
608 | 602 | ||
609 | retval = start_command_port(port->serial); | 603 | retval = start_command_port(port->serial); |
610 | if (retval) | 604 | if (retval) |
@@ -637,14 +631,14 @@ static int whiteheat_open (struct usb_serial_port *port, struct file *filp) | |||
637 | /* Start reading from the device */ | 631 | /* Start reading from the device */ |
638 | retval = start_port_read(port); | 632 | retval = start_port_read(port); |
639 | if (retval) { | 633 | if (retval) { |
640 | err("%s - failed submitting read urb, error %d", __FUNCTION__, retval); | 634 | err("%s - failed submitting read urb, error %d", __func__, retval); |
641 | firm_close(port); | 635 | firm_close(port); |
642 | stop_command_port(port->serial); | 636 | stop_command_port(port->serial); |
643 | goto exit; | 637 | goto exit; |
644 | } | 638 | } |
645 | 639 | ||
646 | exit: | 640 | exit: |
647 | dbg("%s - exit, retval = %d", __FUNCTION__, retval); | 641 | dbg("%s - exit, retval = %d", __func__, retval); |
648 | return retval; | 642 | return retval; |
649 | } | 643 | } |
650 | 644 | ||
@@ -657,7 +651,7 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp) | |||
657 | struct list_head *tmp; | 651 | struct list_head *tmp; |
658 | struct list_head *tmp2; | 652 | struct list_head *tmp2; |
659 | 653 | ||
660 | dbg("%s - port %d", __FUNCTION__, port->number); | 654 | dbg("%s - port %d", __func__, port->number); |
661 | 655 | ||
662 | mutex_lock(&port->serial->disc_mutex); | 656 | mutex_lock(&port->serial->disc_mutex); |
663 | /* filp is NULL when called from usb_serial_disconnect */ | 657 | /* filp is NULL when called from usb_serial_disconnect */ |
@@ -732,10 +726,10 @@ static int whiteheat_write(struct usb_serial_port *port, const unsigned char *bu | |||
732 | unsigned long flags; | 726 | unsigned long flags; |
733 | struct list_head *tmp; | 727 | struct list_head *tmp; |
734 | 728 | ||
735 | dbg("%s - port %d", __FUNCTION__, port->number); | 729 | dbg("%s - port %d", __func__, port->number); |
736 | 730 | ||
737 | if (count == 0) { | 731 | if (count == 0) { |
738 | dbg("%s - write request of 0 bytes", __FUNCTION__); | 732 | dbg("%s - write request of 0 bytes", __func__); |
739 | return (0); | 733 | return (0); |
740 | } | 734 | } |
741 | 735 | ||
@@ -754,13 +748,13 @@ static int whiteheat_write(struct usb_serial_port *port, const unsigned char *bu | |||
754 | bytes = (count > port->bulk_out_size) ? port->bulk_out_size : count; | 748 | bytes = (count > port->bulk_out_size) ? port->bulk_out_size : count; |
755 | memcpy (urb->transfer_buffer, buf + sent, bytes); | 749 | memcpy (urb->transfer_buffer, buf + sent, bytes); |
756 | 750 | ||
757 | usb_serial_debug_data(debug, &port->dev, __FUNCTION__, bytes, urb->transfer_buffer); | 751 | usb_serial_debug_data(debug, &port->dev, __func__, bytes, urb->transfer_buffer); |
758 | 752 | ||
759 | urb->dev = serial->dev; | 753 | urb->dev = serial->dev; |
760 | urb->transfer_buffer_length = bytes; | 754 | urb->transfer_buffer_length = bytes; |
761 | result = usb_submit_urb(urb, GFP_ATOMIC); | 755 | result = usb_submit_urb(urb, GFP_ATOMIC); |
762 | if (result) { | 756 | if (result) { |
763 | err("%s - failed submitting write urb, error %d", __FUNCTION__, result); | 757 | err("%s - failed submitting write urb, error %d", __func__, result); |
764 | sent = result; | 758 | sent = result; |
765 | spin_lock_irqsave(&info->lock, flags); | 759 | spin_lock_irqsave(&info->lock, flags); |
766 | list_add(tmp, &info->tx_urbs_free); | 760 | list_add(tmp, &info->tx_urbs_free); |
@@ -786,7 +780,7 @@ static int whiteheat_write_room(struct usb_serial_port *port) | |||
786 | int room = 0; | 780 | int room = 0; |
787 | unsigned long flags; | 781 | unsigned long flags; |
788 | 782 | ||
789 | dbg("%s - port %d", __FUNCTION__, port->number); | 783 | dbg("%s - port %d", __func__, port->number); |
790 | 784 | ||
791 | spin_lock_irqsave(&info->lock, flags); | 785 | spin_lock_irqsave(&info->lock, flags); |
792 | list_for_each(tmp, &info->tx_urbs_free) | 786 | list_for_each(tmp, &info->tx_urbs_free) |
@@ -794,7 +788,7 @@ static int whiteheat_write_room(struct usb_serial_port *port) | |||
794 | spin_unlock_irqrestore(&info->lock, flags); | 788 | spin_unlock_irqrestore(&info->lock, flags); |
795 | room *= port->bulk_out_size; | 789 | room *= port->bulk_out_size; |
796 | 790 | ||
797 | dbg("%s - returns %d", __FUNCTION__, room); | 791 | dbg("%s - returns %d", __func__, room); |
798 | return (room); | 792 | return (room); |
799 | } | 793 | } |
800 | 794 | ||
@@ -804,7 +798,7 @@ static int whiteheat_tiocmget (struct usb_serial_port *port, struct file *file) | |||
804 | struct whiteheat_private *info = usb_get_serial_port_data(port); | 798 | struct whiteheat_private *info = usb_get_serial_port_data(port); |
805 | unsigned int modem_signals = 0; | 799 | unsigned int modem_signals = 0; |
806 | 800 | ||
807 | dbg("%s - port %d", __FUNCTION__, port->number); | 801 | dbg("%s - port %d", __func__, port->number); |
808 | 802 | ||
809 | firm_get_dtr_rts(port); | 803 | firm_get_dtr_rts(port); |
810 | if (info->mcr & UART_MCR_DTR) | 804 | if (info->mcr & UART_MCR_DTR) |
@@ -821,7 +815,7 @@ static int whiteheat_tiocmset (struct usb_serial_port *port, struct file *file, | |||
821 | { | 815 | { |
822 | struct whiteheat_private *info = usb_get_serial_port_data(port); | 816 | struct whiteheat_private *info = usb_get_serial_port_data(port); |
823 | 817 | ||
824 | dbg("%s - port %d", __FUNCTION__, port->number); | 818 | dbg("%s - port %d", __func__, port->number); |
825 | 819 | ||
826 | if (set & TIOCM_RTS) | 820 | if (set & TIOCM_RTS) |
827 | info->mcr |= UART_MCR_RTS; | 821 | info->mcr |= UART_MCR_RTS; |
@@ -844,7 +838,7 @@ static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, un | |||
844 | struct serial_struct serstruct; | 838 | struct serial_struct serstruct; |
845 | void __user *user_arg = (void __user *)arg; | 839 | void __user *user_arg = (void __user *)arg; |
846 | 840 | ||
847 | dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd); | 841 | dbg("%s - port %d, cmd 0x%.4x", __func__, port->number, cmd); |
848 | 842 | ||
849 | switch (cmd) { | 843 | switch (cmd) { |
850 | case TIOCGSERIAL: | 844 | case TIOCGSERIAL: |
@@ -886,7 +880,7 @@ static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, un | |||
886 | 880 | ||
887 | static void whiteheat_set_termios(struct usb_serial_port *port, struct ktermios *old_termios) | 881 | static void whiteheat_set_termios(struct usb_serial_port *port, struct ktermios *old_termios) |
888 | { | 882 | { |
889 | dbg("%s -port %d", __FUNCTION__, port->number); | 883 | dbg("%s -port %d", __func__, port->number); |
890 | firm_setup_port(port); | 884 | firm_setup_port(port); |
891 | } | 885 | } |
892 | 886 | ||
@@ -904,7 +898,7 @@ static int whiteheat_chars_in_buffer(struct usb_serial_port *port) | |||
904 | int chars = 0; | 898 | int chars = 0; |
905 | unsigned long flags; | 899 | unsigned long flags; |
906 | 900 | ||
907 | dbg("%s - port %d", __FUNCTION__, port->number); | 901 | dbg("%s - port %d", __func__, port->number); |
908 | 902 | ||
909 | spin_lock_irqsave(&info->lock, flags); | 903 | spin_lock_irqsave(&info->lock, flags); |
910 | list_for_each(tmp, &info->tx_urbs_submitted) { | 904 | list_for_each(tmp, &info->tx_urbs_submitted) { |
@@ -913,7 +907,7 @@ static int whiteheat_chars_in_buffer(struct usb_serial_port *port) | |||
913 | } | 907 | } |
914 | spin_unlock_irqrestore(&info->lock, flags); | 908 | spin_unlock_irqrestore(&info->lock, flags); |
915 | 909 | ||
916 | dbg ("%s - returns %d", __FUNCTION__, chars); | 910 | dbg ("%s - returns %d", __func__, chars); |
917 | return chars; | 911 | return chars; |
918 | } | 912 | } |
919 | 913 | ||
@@ -923,7 +917,7 @@ static void whiteheat_throttle (struct usb_serial_port *port) | |||
923 | struct whiteheat_private *info = usb_get_serial_port_data(port); | 917 | struct whiteheat_private *info = usb_get_serial_port_data(port); |
924 | unsigned long flags; | 918 | unsigned long flags; |
925 | 919 | ||
926 | dbg("%s - port %d", __FUNCTION__, port->number); | 920 | dbg("%s - port %d", __func__, port->number); |
927 | 921 | ||
928 | spin_lock_irqsave(&info->lock, flags); | 922 | spin_lock_irqsave(&info->lock, flags); |
929 | info->flags |= THROTTLED; | 923 | info->flags |= THROTTLED; |
@@ -939,7 +933,7 @@ static void whiteheat_unthrottle (struct usb_serial_port *port) | |||
939 | int actually_throttled; | 933 | int actually_throttled; |
940 | unsigned long flags; | 934 | unsigned long flags; |
941 | 935 | ||
942 | dbg("%s - port %d", __FUNCTION__, port->number); | 936 | dbg("%s - port %d", __func__, port->number); |
943 | 937 | ||
944 | spin_lock_irqsave(&info->lock, flags); | 938 | spin_lock_irqsave(&info->lock, flags); |
945 | actually_throttled = info->flags & ACTUALLY_THROTTLED; | 939 | actually_throttled = info->flags & ACTUALLY_THROTTLED; |
@@ -960,7 +954,7 @@ static void command_port_write_callback(struct urb *urb) | |||
960 | { | 954 | { |
961 | int status = urb->status; | 955 | int status = urb->status; |
962 | 956 | ||
963 | dbg("%s", __FUNCTION__); | 957 | dbg("%s", __func__); |
964 | 958 | ||
965 | if (status) { | 959 | if (status) { |
966 | dbg("nonzero urb status: %d", status); | 960 | dbg("nonzero urb status: %d", status); |
@@ -971,28 +965,28 @@ static void command_port_write_callback(struct urb *urb) | |||
971 | 965 | ||
972 | static void command_port_read_callback(struct urb *urb) | 966 | static void command_port_read_callback(struct urb *urb) |
973 | { | 967 | { |
974 | struct usb_serial_port *command_port = (struct usb_serial_port *)urb->context; | 968 | struct usb_serial_port *command_port = urb->context; |
975 | struct whiteheat_command_private *command_info; | 969 | struct whiteheat_command_private *command_info; |
976 | int status = urb->status; | 970 | int status = urb->status; |
977 | unsigned char *data = urb->transfer_buffer; | 971 | unsigned char *data = urb->transfer_buffer; |
978 | int result; | 972 | int result; |
979 | 973 | ||
980 | dbg("%s", __FUNCTION__); | 974 | dbg("%s", __func__); |
981 | 975 | ||
982 | command_info = usb_get_serial_port_data(command_port); | 976 | command_info = usb_get_serial_port_data(command_port); |
983 | if (!command_info) { | 977 | if (!command_info) { |
984 | dbg ("%s - command_info is NULL, exiting.", __FUNCTION__); | 978 | dbg ("%s - command_info is NULL, exiting.", __func__); |
985 | return; | 979 | return; |
986 | } | 980 | } |
987 | if (status) { | 981 | if (status) { |
988 | dbg("%s - nonzero urb status: %d", __FUNCTION__, status); | 982 | dbg("%s - nonzero urb status: %d", __func__, status); |
989 | if (status != -ENOENT) | 983 | if (status != -ENOENT) |
990 | command_info->command_finished = WHITEHEAT_CMD_FAILURE; | 984 | command_info->command_finished = WHITEHEAT_CMD_FAILURE; |
991 | wake_up(&command_info->wait_command); | 985 | wake_up(&command_info->wait_command); |
992 | return; | 986 | return; |
993 | } | 987 | } |
994 | 988 | ||
995 | usb_serial_debug_data(debug, &command_port->dev, __FUNCTION__, urb->actual_length, data); | 989 | usb_serial_debug_data(debug, &command_port->dev, __func__, urb->actual_length, data); |
996 | 990 | ||
997 | if (data[0] == WHITEHEAT_CMD_COMPLETE) { | 991 | if (data[0] == WHITEHEAT_CMD_COMPLETE) { |
998 | command_info->command_finished = WHITEHEAT_CMD_COMPLETE; | 992 | command_info->command_finished = WHITEHEAT_CMD_COMPLETE; |
@@ -1002,38 +996,38 @@ static void command_port_read_callback(struct urb *urb) | |||
1002 | wake_up(&command_info->wait_command); | 996 | wake_up(&command_info->wait_command); |
1003 | } else if (data[0] == WHITEHEAT_EVENT) { | 997 | } else if (data[0] == WHITEHEAT_EVENT) { |
1004 | /* These are unsolicited reports from the firmware, hence no waiting command to wakeup */ | 998 | /* These are unsolicited reports from the firmware, hence no waiting command to wakeup */ |
1005 | dbg("%s - event received", __FUNCTION__); | 999 | dbg("%s - event received", __func__); |
1006 | } else if (data[0] == WHITEHEAT_GET_DTR_RTS) { | 1000 | } else if (data[0] == WHITEHEAT_GET_DTR_RTS) { |
1007 | memcpy(command_info->result_buffer, &data[1], urb->actual_length - 1); | 1001 | memcpy(command_info->result_buffer, &data[1], urb->actual_length - 1); |
1008 | command_info->command_finished = WHITEHEAT_CMD_COMPLETE; | 1002 | command_info->command_finished = WHITEHEAT_CMD_COMPLETE; |
1009 | wake_up(&command_info->wait_command); | 1003 | wake_up(&command_info->wait_command); |
1010 | } else { | 1004 | } else { |
1011 | dbg("%s - bad reply from firmware", __FUNCTION__); | 1005 | dbg("%s - bad reply from firmware", __func__); |
1012 | } | 1006 | } |
1013 | 1007 | ||
1014 | /* Continue trying to always read */ | 1008 | /* Continue trying to always read */ |
1015 | command_port->read_urb->dev = command_port->serial->dev; | 1009 | command_port->read_urb->dev = command_port->serial->dev; |
1016 | result = usb_submit_urb(command_port->read_urb, GFP_ATOMIC); | 1010 | result = usb_submit_urb(command_port->read_urb, GFP_ATOMIC); |
1017 | if (result) | 1011 | if (result) |
1018 | dbg("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); | 1012 | dbg("%s - failed resubmitting read urb, error %d", __func__, result); |
1019 | } | 1013 | } |
1020 | 1014 | ||
1021 | 1015 | ||
1022 | static void whiteheat_read_callback(struct urb *urb) | 1016 | static void whiteheat_read_callback(struct urb *urb) |
1023 | { | 1017 | { |
1024 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 1018 | struct usb_serial_port *port = urb->context; |
1025 | struct whiteheat_urb_wrap *wrap; | 1019 | struct whiteheat_urb_wrap *wrap; |
1026 | unsigned char *data = urb->transfer_buffer; | 1020 | unsigned char *data = urb->transfer_buffer; |
1027 | struct whiteheat_private *info = usb_get_serial_port_data(port); | 1021 | struct whiteheat_private *info = usb_get_serial_port_data(port); |
1028 | int status = urb->status; | 1022 | int status = urb->status; |
1029 | 1023 | ||
1030 | dbg("%s - port %d", __FUNCTION__, port->number); | 1024 | dbg("%s - port %d", __func__, port->number); |
1031 | 1025 | ||
1032 | spin_lock(&info->lock); | 1026 | spin_lock(&info->lock); |
1033 | wrap = urb_to_wrap(urb, &info->rx_urbs_submitted); | 1027 | wrap = urb_to_wrap(urb, &info->rx_urbs_submitted); |
1034 | if (!wrap) { | 1028 | if (!wrap) { |
1035 | spin_unlock(&info->lock); | 1029 | spin_unlock(&info->lock); |
1036 | err("%s - Not my urb!", __FUNCTION__); | 1030 | err("%s - Not my urb!", __func__); |
1037 | return; | 1031 | return; |
1038 | } | 1032 | } |
1039 | list_del(&wrap->list); | 1033 | list_del(&wrap->list); |
@@ -1041,14 +1035,14 @@ static void whiteheat_read_callback(struct urb *urb) | |||
1041 | 1035 | ||
1042 | if (status) { | 1036 | if (status) { |
1043 | dbg("%s - nonzero read bulk status received: %d", | 1037 | dbg("%s - nonzero read bulk status received: %d", |
1044 | __FUNCTION__, status); | 1038 | __func__, status); |
1045 | spin_lock(&info->lock); | 1039 | spin_lock(&info->lock); |
1046 | list_add(&wrap->list, &info->rx_urbs_free); | 1040 | list_add(&wrap->list, &info->rx_urbs_free); |
1047 | spin_unlock(&info->lock); | 1041 | spin_unlock(&info->lock); |
1048 | return; | 1042 | return; |
1049 | } | 1043 | } |
1050 | 1044 | ||
1051 | usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data); | 1045 | usb_serial_debug_data(debug, &port->dev, __func__, urb->actual_length, data); |
1052 | 1046 | ||
1053 | spin_lock(&info->lock); | 1047 | spin_lock(&info->lock); |
1054 | list_add_tail(&wrap->list, &info->rx_urb_q); | 1048 | list_add_tail(&wrap->list, &info->rx_urb_q); |
@@ -1065,18 +1059,18 @@ static void whiteheat_read_callback(struct urb *urb) | |||
1065 | 1059 | ||
1066 | static void whiteheat_write_callback(struct urb *urb) | 1060 | static void whiteheat_write_callback(struct urb *urb) |
1067 | { | 1061 | { |
1068 | struct usb_serial_port *port = (struct usb_serial_port *)urb->context; | 1062 | struct usb_serial_port *port = urb->context; |
1069 | struct whiteheat_private *info = usb_get_serial_port_data(port); | 1063 | struct whiteheat_private *info = usb_get_serial_port_data(port); |
1070 | struct whiteheat_urb_wrap *wrap; | 1064 | struct whiteheat_urb_wrap *wrap; |
1071 | int status = urb->status; | 1065 | int status = urb->status; |
1072 | 1066 | ||
1073 | dbg("%s - port %d", __FUNCTION__, port->number); | 1067 | dbg("%s - port %d", __func__, port->number); |
1074 | 1068 | ||
1075 | spin_lock(&info->lock); | 1069 | spin_lock(&info->lock); |
1076 | wrap = urb_to_wrap(urb, &info->tx_urbs_submitted); | 1070 | wrap = urb_to_wrap(urb, &info->tx_urbs_submitted); |
1077 | if (!wrap) { | 1071 | if (!wrap) { |
1078 | spin_unlock(&info->lock); | 1072 | spin_unlock(&info->lock); |
1079 | err("%s - Not my urb!", __FUNCTION__); | 1073 | err("%s - Not my urb!", __func__); |
1080 | return; | 1074 | return; |
1081 | } | 1075 | } |
1082 | list_move(&wrap->list, &info->tx_urbs_free); | 1076 | list_move(&wrap->list, &info->tx_urbs_free); |
@@ -1084,7 +1078,7 @@ static void whiteheat_write_callback(struct urb *urb) | |||
1084 | 1078 | ||
1085 | if (status) { | 1079 | if (status) { |
1086 | dbg("%s - nonzero write bulk status received: %d", | 1080 | dbg("%s - nonzero write bulk status received: %d", |
1087 | __FUNCTION__, status); | 1081 | __func__, status); |
1088 | return; | 1082 | return; |
1089 | } | 1083 | } |
1090 | 1084 | ||
@@ -1104,7 +1098,7 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command, __u8 *d | |||
1104 | int retval = 0; | 1098 | int retval = 0; |
1105 | int t; | 1099 | int t; |
1106 | 1100 | ||
1107 | dbg("%s - command %d", __FUNCTION__, command); | 1101 | dbg("%s - command %d", __func__, command); |
1108 | 1102 | ||
1109 | command_port = port->serial->port[COMMAND_PORT]; | 1103 | command_port = port->serial->port[COMMAND_PORT]; |
1110 | command_info = usb_get_serial_port_data(command_port); | 1104 | command_info = usb_get_serial_port_data(command_port); |
@@ -1118,7 +1112,7 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command, __u8 *d | |||
1118 | command_port->write_urb->dev = port->serial->dev; | 1112 | command_port->write_urb->dev = port->serial->dev; |
1119 | retval = usb_submit_urb (command_port->write_urb, GFP_NOIO); | 1113 | retval = usb_submit_urb (command_port->write_urb, GFP_NOIO); |
1120 | if (retval) { | 1114 | if (retval) { |
1121 | dbg("%s - submit urb failed", __FUNCTION__); | 1115 | dbg("%s - submit urb failed", __func__); |
1122 | goto exit; | 1116 | goto exit; |
1123 | } | 1117 | } |
1124 | 1118 | ||
@@ -1129,19 +1123,19 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command, __u8 *d | |||
1129 | usb_kill_urb(command_port->write_urb); | 1123 | usb_kill_urb(command_port->write_urb); |
1130 | 1124 | ||
1131 | if (command_info->command_finished == false) { | 1125 | if (command_info->command_finished == false) { |
1132 | dbg("%s - command timed out.", __FUNCTION__); | 1126 | dbg("%s - command timed out.", __func__); |
1133 | retval = -ETIMEDOUT; | 1127 | retval = -ETIMEDOUT; |
1134 | goto exit; | 1128 | goto exit; |
1135 | } | 1129 | } |
1136 | 1130 | ||
1137 | if (command_info->command_finished == WHITEHEAT_CMD_FAILURE) { | 1131 | if (command_info->command_finished == WHITEHEAT_CMD_FAILURE) { |
1138 | dbg("%s - command failed.", __FUNCTION__); | 1132 | dbg("%s - command failed.", __func__); |
1139 | retval = -EIO; | 1133 | retval = -EIO; |
1140 | goto exit; | 1134 | goto exit; |
1141 | } | 1135 | } |
1142 | 1136 | ||
1143 | if (command_info->command_finished == WHITEHEAT_CMD_COMPLETE) { | 1137 | if (command_info->command_finished == WHITEHEAT_CMD_COMPLETE) { |
1144 | dbg("%s - command completed.", __FUNCTION__); | 1138 | dbg("%s - command completed.", __func__); |
1145 | switch (command) { | 1139 | switch (command) { |
1146 | case WHITEHEAT_GET_DTR_RTS: | 1140 | case WHITEHEAT_GET_DTR_RTS: |
1147 | info = usb_get_serial_port_data(port); | 1141 | info = usb_get_serial_port_data(port); |
@@ -1186,7 +1180,7 @@ static int firm_setup_port(struct usb_serial_port *port) { | |||
1186 | default: | 1180 | default: |
1187 | case CS8: port_settings.bits = 8; break; | 1181 | case CS8: port_settings.bits = 8; break; |
1188 | } | 1182 | } |
1189 | dbg("%s - data bits = %d", __FUNCTION__, port_settings.bits); | 1183 | dbg("%s - data bits = %d", __func__, port_settings.bits); |
1190 | 1184 | ||
1191 | /* determine the parity */ | 1185 | /* determine the parity */ |
1192 | if (cflag & PARENB) | 1186 | if (cflag & PARENB) |
@@ -1202,21 +1196,21 @@ static int firm_setup_port(struct usb_serial_port *port) { | |||
1202 | port_settings.parity = WHITEHEAT_PAR_EVEN; | 1196 | port_settings.parity = WHITEHEAT_PAR_EVEN; |
1203 | else | 1197 | else |
1204 | port_settings.parity = WHITEHEAT_PAR_NONE; | 1198 | port_settings.parity = WHITEHEAT_PAR_NONE; |
1205 | dbg("%s - parity = %c", __FUNCTION__, port_settings.parity); | 1199 | dbg("%s - parity = %c", __func__, port_settings.parity); |
1206 | 1200 | ||
1207 | /* figure out the stop bits requested */ | 1201 | /* figure out the stop bits requested */ |
1208 | if (cflag & CSTOPB) | 1202 | if (cflag & CSTOPB) |
1209 | port_settings.stop = 2; | 1203 | port_settings.stop = 2; |
1210 | else | 1204 | else |
1211 | port_settings.stop = 1; | 1205 | port_settings.stop = 1; |
1212 | dbg("%s - stop bits = %d", __FUNCTION__, port_settings.stop); | 1206 | dbg("%s - stop bits = %d", __func__, port_settings.stop); |
1213 | 1207 | ||
1214 | /* figure out the flow control settings */ | 1208 | /* figure out the flow control settings */ |
1215 | if (cflag & CRTSCTS) | 1209 | if (cflag & CRTSCTS) |
1216 | port_settings.hflow = (WHITEHEAT_HFLOW_CTS | WHITEHEAT_HFLOW_RTS); | 1210 | port_settings.hflow = (WHITEHEAT_HFLOW_CTS | WHITEHEAT_HFLOW_RTS); |
1217 | else | 1211 | else |
1218 | port_settings.hflow = WHITEHEAT_HFLOW_NONE; | 1212 | port_settings.hflow = WHITEHEAT_HFLOW_NONE; |
1219 | dbg("%s - hardware flow control = %s %s %s %s", __FUNCTION__, | 1213 | dbg("%s - hardware flow control = %s %s %s %s", __func__, |
1220 | (port_settings.hflow & WHITEHEAT_HFLOW_CTS) ? "CTS" : "", | 1214 | (port_settings.hflow & WHITEHEAT_HFLOW_CTS) ? "CTS" : "", |
1221 | (port_settings.hflow & WHITEHEAT_HFLOW_RTS) ? "RTS" : "", | 1215 | (port_settings.hflow & WHITEHEAT_HFLOW_RTS) ? "RTS" : "", |
1222 | (port_settings.hflow & WHITEHEAT_HFLOW_DSR) ? "DSR" : "", | 1216 | (port_settings.hflow & WHITEHEAT_HFLOW_DSR) ? "DSR" : "", |
@@ -1227,15 +1221,15 @@ static int firm_setup_port(struct usb_serial_port *port) { | |||
1227 | port_settings.sflow = WHITEHEAT_SFLOW_RXTX; | 1221 | port_settings.sflow = WHITEHEAT_SFLOW_RXTX; |
1228 | else | 1222 | else |
1229 | port_settings.sflow = WHITEHEAT_SFLOW_NONE; | 1223 | port_settings.sflow = WHITEHEAT_SFLOW_NONE; |
1230 | dbg("%s - software flow control = %c", __FUNCTION__, port_settings.sflow); | 1224 | dbg("%s - software flow control = %c", __func__, port_settings.sflow); |
1231 | 1225 | ||
1232 | port_settings.xon = START_CHAR(port->tty); | 1226 | port_settings.xon = START_CHAR(port->tty); |
1233 | port_settings.xoff = STOP_CHAR(port->tty); | 1227 | port_settings.xoff = STOP_CHAR(port->tty); |
1234 | dbg("%s - XON = %2x, XOFF = %2x", __FUNCTION__, port_settings.xon, port_settings.xoff); | 1228 | dbg("%s - XON = %2x, XOFF = %2x", __func__, port_settings.xon, port_settings.xoff); |
1235 | 1229 | ||
1236 | /* get the baud rate wanted */ | 1230 | /* get the baud rate wanted */ |
1237 | port_settings.baud = tty_get_baud_rate(port->tty); | 1231 | port_settings.baud = tty_get_baud_rate(port->tty); |
1238 | dbg("%s - baud rate = %d", __FUNCTION__, port_settings.baud); | 1232 | dbg("%s - baud rate = %d", __func__, port_settings.baud); |
1239 | 1233 | ||
1240 | /* fixme: should set validated settings */ | 1234 | /* fixme: should set validated settings */ |
1241 | tty_encode_baud_rate(port->tty, port_settings.baud, port_settings.baud); | 1235 | tty_encode_baud_rate(port->tty, port_settings.baud, port_settings.baud); |
@@ -1318,7 +1312,7 @@ static int start_command_port(struct usb_serial *serial) | |||
1318 | command_port->read_urb->dev = serial->dev; | 1312 | command_port->read_urb->dev = serial->dev; |
1319 | retval = usb_submit_urb(command_port->read_urb, GFP_KERNEL); | 1313 | retval = usb_submit_urb(command_port->read_urb, GFP_KERNEL); |
1320 | if (retval) { | 1314 | if (retval) { |
1321 | err("%s - failed submitting read urb, error %d", __FUNCTION__, retval); | 1315 | err("%s - failed submitting read urb, error %d", __func__, retval); |
1322 | goto exit; | 1316 | goto exit; |
1323 | } | 1317 | } |
1324 | } | 1318 | } |
@@ -1454,7 +1448,7 @@ static void rx_data_softint(struct work_struct *work) | |||
1454 | urb->dev = port->serial->dev; | 1448 | urb->dev = port->serial->dev; |
1455 | result = usb_submit_urb(urb, GFP_ATOMIC); | 1449 | result = usb_submit_urb(urb, GFP_ATOMIC); |
1456 | if (result) { | 1450 | if (result) { |
1457 | err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); | 1451 | err("%s - failed resubmitting read urb, error %d", __func__, result); |
1458 | spin_lock_irqsave(&info->lock, flags); | 1452 | spin_lock_irqsave(&info->lock, flags); |
1459 | list_add(tmp, &info->rx_urbs_free); | 1453 | list_add(tmp, &info->rx_urbs_free); |
1460 | continue; | 1454 | continue; |