aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/navman.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/navman.c')
-rw-r--r--drivers/usb/serial/navman.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c
index 7f337c9aeb5f..43c8894353bf 100644
--- a/drivers/usb/serial/navman.c
+++ b/drivers/usb/serial/navman.c
@@ -6,6 +6,10 @@
6 * This program is free software; you can redistribute it and/or 6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License 7 * modify it under the terms of the GNU General Public License
8 * version 2 as published by the Free Software Foundation. 8 * version 2 as published by the Free Software Foundation.
9 *
10 * TODO:
11 * Add termios method that uses copy_hw but also kills all echo
12 * flags as the navman is rx only so cannot echo.
9 */ 13 */
10 14
11#include <linux/kernel.h> 15#include <linux/kernel.h>
@@ -49,15 +53,15 @@ static void navman_read_int_callback(struct urb *urb)
49 case -ESHUTDOWN: 53 case -ESHUTDOWN:
50 /* this urb is terminated, clean up */ 54 /* this urb is terminated, clean up */
51 dbg("%s - urb shutting down with status: %d", 55 dbg("%s - urb shutting down with status: %d",
52 __FUNCTION__, status); 56 __func__, status);
53 return; 57 return;
54 default: 58 default:
55 dbg("%s - nonzero urb status received: %d", 59 dbg("%s - nonzero urb status received: %d",
56 __FUNCTION__, status); 60 __func__, status);
57 goto exit; 61 goto exit;
58 } 62 }
59 63
60 usb_serial_debug_data(debug, &port->dev, __FUNCTION__, 64 usb_serial_debug_data(debug, &port->dev, __func__,
61 urb->actual_length, data); 65 urb->actual_length, data);
62 66
63 tty = port->tty; 67 tty = port->tty;
@@ -72,29 +76,29 @@ exit:
72 if (result) 76 if (result)
73 dev_err(&urb->dev->dev, 77 dev_err(&urb->dev->dev,
74 "%s - Error %d submitting interrupt urb\n", 78 "%s - Error %d submitting interrupt urb\n",
75 __FUNCTION__, result); 79 __func__, result);
76} 80}
77 81
78static int navman_open(struct usb_serial_port *port, struct file *filp) 82static int navman_open(struct usb_serial_port *port, struct file *filp)
79{ 83{
80 int result = 0; 84 int result = 0;
81 85
82 dbg("%s - port %d", __FUNCTION__, port->number); 86 dbg("%s - port %d", __func__, port->number);
83 87
84 if (port->interrupt_in_urb) { 88 if (port->interrupt_in_urb) {
85 dbg("%s - adding interrupt input for treo", __FUNCTION__); 89 dbg("%s - adding interrupt input for treo", __func__);
86 result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); 90 result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
87 if (result) 91 if (result)
88 dev_err(&port->dev, 92 dev_err(&port->dev,
89 "%s - failed submitting interrupt urb, error %d\n", 93 "%s - failed submitting interrupt urb, error %d\n",
90 __FUNCTION__, result); 94 __func__, result);
91 } 95 }
92 return result; 96 return result;
93} 97}
94 98
95static void navman_close(struct usb_serial_port *port, struct file *filp) 99static void navman_close(struct usb_serial_port *port, struct file *filp)
96{ 100{
97 dbg("%s - port %d", __FUNCTION__, port->number); 101 dbg("%s - port %d", __func__, port->number);
98 102
99 usb_kill_urb(port->interrupt_in_urb); 103 usb_kill_urb(port->interrupt_in_urb);
100} 104}
@@ -102,16 +106,12 @@ static void navman_close(struct usb_serial_port *port, struct file *filp)
102static int navman_write(struct usb_serial_port *port, 106static int navman_write(struct usb_serial_port *port,
103 const unsigned char *buf, int count) 107 const unsigned char *buf, int count)
104{ 108{
105 dbg("%s - port %d", __FUNCTION__, port->number); 109 dbg("%s - port %d", __func__, port->number);
106 110
107 /* 111 /*
108 * This device can't write any data, only read from the device 112 * This device can't write any data, only read from the device
109 * so we just silently eat all data sent to us and say it was
110 * successfully sent.
111 * Evil, I know, but do you have a better idea?
112 */ 113 */
113 114 return -EOPNOTSUPP;
114 return count;
115} 115}
116 116
117static struct usb_serial_driver navman_device = { 117static struct usb_serial_driver navman_device = {
@@ -121,9 +121,6 @@ static struct usb_serial_driver navman_device = {
121 }, 121 },
122 .id_table = id_table, 122 .id_table = id_table,
123 .usb_driver = &navman_driver, 123 .usb_driver = &navman_driver,
124 .num_interrupt_in = NUM_DONT_CARE,
125 .num_bulk_in = NUM_DONT_CARE,
126 .num_bulk_out = NUM_DONT_CARE,
127 .num_ports = 1, 124 .num_ports = 1,
128 .open = navman_open, 125 .open = navman_open,
129 .close = navman_close, 126 .close = navman_close,