diff options
Diffstat (limited to 'drivers/usb/serial/option.c')
| -rw-r--r-- | drivers/usb/serial/option.c | 76 |
1 files changed, 7 insertions, 69 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index f0530c1d7b7a..c856e6f40e22 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -9,40 +9,14 @@ | |||
| 9 | 9 | ||
| 10 | Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org> | 10 | Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org> |
| 11 | 11 | ||
| 12 | History: | 12 | History: see the git log. |
| 13 | |||
| 14 | 2005-05-19 v0.1 Initial version, based on incomplete docs | ||
| 15 | and analysis of misbehavior with the standard driver | ||
| 16 | 2005-05-20 v0.2 Extended the input buffer to avoid losing | ||
| 17 | random 64-byte chunks of data | ||
| 18 | 2005-05-21 v0.3 implemented chars_in_buffer() | ||
| 19 | turned on low_latency | ||
| 20 | simplified the code somewhat | ||
| 21 | 2005-05-24 v0.4 option_write() sometimes deadlocked under heavy load | ||
| 22 | removed some dead code | ||
| 23 | added sponsor notice | ||
| 24 | coding style clean-up | ||
| 25 | 2005-06-20 v0.4.1 add missing braces :-/ | ||
| 26 | killed end-of-line whitespace | ||
| 27 | 2005-07-15 v0.4.2 rename WLAN product to FUSION, add FUSION2 | ||
| 28 | 2005-09-10 v0.4.3 added HUAWEI E600 card and Audiovox AirCard | ||
| 29 | 2005-09-20 v0.4.4 increased recv buffer size: the card sometimes | ||
| 30 | wants to send >2000 bytes. | ||
| 31 | 2006-04-10 v0.5 fixed two array overrun errors :-/ | ||
| 32 | 2006-04-21 v0.5.1 added support for Sierra Wireless MC8755 | ||
| 33 | 2006-05-15 v0.6 re-enable multi-port support | ||
| 34 | 2006-06-01 v0.6.1 add COBRA | ||
| 35 | 2006-06-01 v0.6.2 add backwards-compatibility stuff | ||
| 36 | 2006-06-01 v0.6.3 add Novatel Wireless | ||
| 37 | 2006-06-01 v0.7 Option => GSM | ||
| 38 | 2006-06-01 v0.7.1 add COBRA2 | ||
| 39 | 13 | ||
| 40 | Work sponsored by: Sigos GmbH, Germany <info@sigos.de> | 14 | Work sponsored by: Sigos GmbH, Germany <info@sigos.de> |
| 41 | 15 | ||
| 42 | This driver exists because the "normal" serial driver doesn't work too well | 16 | This driver exists because the "normal" serial driver doesn't work too well |
| 43 | with GSM modems. Issues: | 17 | with GSM modems. Issues: |
| 44 | - data loss -- one single Receive URB is not nearly enough | 18 | - data loss -- one single Receive URB is not nearly enough |
| 45 | - nonstandard flow (Option devices) and multiplex (Sierra) control | 19 | - nonstandard flow (Option devices) control |
| 46 | - controlling the baud rate doesn't make sense | 20 | - controlling the baud rate doesn't make sense |
| 47 | 21 | ||
| 48 | This driver is named "option" because the most common device it's | 22 | This driver is named "option" because the most common device it's |
| @@ -96,8 +70,8 @@ static int option_send_setup(struct usb_serial_port *port); | |||
| 96 | #define OPTION_VENDOR_ID 0x0AF0 | 70 | #define OPTION_VENDOR_ID 0x0AF0 |
| 97 | #define HUAWEI_VENDOR_ID 0x12D1 | 71 | #define HUAWEI_VENDOR_ID 0x12D1 |
| 98 | #define AUDIOVOX_VENDOR_ID 0x0F3D | 72 | #define AUDIOVOX_VENDOR_ID 0x0F3D |
| 99 | #define SIERRAWIRELESS_VENDOR_ID 0x1199 | ||
| 100 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 | 73 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 |
| 74 | #define ANYDATA_VENDOR_ID 0x16d5 | ||
| 101 | 75 | ||
| 102 | #define OPTION_PRODUCT_OLD 0x5000 | 76 | #define OPTION_PRODUCT_OLD 0x5000 |
| 103 | #define OPTION_PRODUCT_FUSION 0x6000 | 77 | #define OPTION_PRODUCT_FUSION 0x6000 |
| @@ -106,8 +80,8 @@ static int option_send_setup(struct usb_serial_port *port); | |||
| 106 | #define OPTION_PRODUCT_COBRA2 0x6600 | 80 | #define OPTION_PRODUCT_COBRA2 0x6600 |
| 107 | #define HUAWEI_PRODUCT_E600 0x1001 | 81 | #define HUAWEI_PRODUCT_E600 0x1001 |
| 108 | #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 | 82 | #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 |
| 109 | #define SIERRAWIRELESS_PRODUCT_MC8755 0x6802 | ||
| 110 | #define NOVATELWIRELESS_PRODUCT_U740 0x1400 | 83 | #define NOVATELWIRELESS_PRODUCT_U740 0x1400 |
| 84 | #define ANYDATA_PRODUCT_ID 0x6501 | ||
| 111 | 85 | ||
| 112 | static struct usb_device_id option_ids[] = { | 86 | static struct usb_device_id option_ids[] = { |
| 113 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) }, | 87 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) }, |
| @@ -117,8 +91,8 @@ static struct usb_device_id option_ids[] = { | |||
| 117 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, | 91 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, |
| 118 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, | 92 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, |
| 119 | { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, | 93 | { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, |
| 120 | { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) }, | ||
| 121 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, | 94 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, |
| 95 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, | ||
| 122 | { } /* Terminating entry */ | 96 | { } /* Terminating entry */ |
| 123 | }; | 97 | }; |
| 124 | 98 | ||
| @@ -131,10 +105,7 @@ static struct usb_device_id option_ids1[] = { | |||
| 131 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, | 105 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, |
| 132 | { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, | 106 | { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, |
| 133 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, | 107 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, |
| 134 | { } /* Terminating entry */ | 108 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, |
| 135 | }; | ||
| 136 | static struct usb_device_id option_ids3[] = { | ||
| 137 | { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) }, | ||
| 138 | { } /* Terminating entry */ | 109 | { } /* Terminating entry */ |
| 139 | }; | 110 | }; |
| 140 | 111 | ||
| @@ -151,37 +122,11 @@ static struct usb_driver option_driver = { | |||
| 151 | /* The card has three separate interfaces, which the serial driver | 122 | /* The card has three separate interfaces, which the serial driver |
| 152 | * recognizes separately, thus num_port=1. | 123 | * recognizes separately, thus num_port=1. |
| 153 | */ | 124 | */ |
| 154 | static struct usb_serial_driver option_3port_device = { | ||
| 155 | .driver = { | ||
| 156 | .owner = THIS_MODULE, | ||
| 157 | .name = "option", | ||
| 158 | }, | ||
| 159 | .description = "GSM modem (3-port)", | ||
| 160 | .id_table = option_ids3, | ||
| 161 | .num_interrupt_in = NUM_DONT_CARE, | ||
| 162 | .num_bulk_in = NUM_DONT_CARE, | ||
| 163 | .num_bulk_out = NUM_DONT_CARE, | ||
| 164 | .num_ports = 3, | ||
| 165 | .open = option_open, | ||
| 166 | .close = option_close, | ||
| 167 | .write = option_write, | ||
| 168 | .write_room = option_write_room, | ||
| 169 | .chars_in_buffer = option_chars_in_buffer, | ||
| 170 | .throttle = option_rx_throttle, | ||
| 171 | .unthrottle = option_rx_unthrottle, | ||
| 172 | .set_termios = option_set_termios, | ||
| 173 | .break_ctl = option_break_ctl, | ||
| 174 | .tiocmget = option_tiocmget, | ||
| 175 | .tiocmset = option_tiocmset, | ||
| 176 | .attach = option_startup, | ||
| 177 | .shutdown = option_shutdown, | ||
| 178 | .read_int_callback = option_instat_callback, | ||
| 179 | }; | ||
| 180 | 125 | ||
| 181 | static struct usb_serial_driver option_1port_device = { | 126 | static struct usb_serial_driver option_1port_device = { |
| 182 | .driver = { | 127 | .driver = { |
| 183 | .owner = THIS_MODULE, | 128 | .owner = THIS_MODULE, |
| 184 | .name = "option", | 129 | .name = "option1", |
| 185 | }, | 130 | }, |
| 186 | .description = "GSM modem (1-port)", | 131 | .description = "GSM modem (1-port)", |
| 187 | .id_table = option_ids1, | 132 | .id_table = option_ids1, |
| @@ -245,9 +190,6 @@ static int __init option_init(void) | |||
| 245 | retval = usb_serial_register(&option_1port_device); | 190 | retval = usb_serial_register(&option_1port_device); |
| 246 | if (retval) | 191 | if (retval) |
| 247 | goto failed_1port_device_register; | 192 | goto failed_1port_device_register; |
| 248 | retval = usb_serial_register(&option_3port_device); | ||
| 249 | if (retval) | ||
| 250 | goto failed_3port_device_register; | ||
| 251 | retval = usb_register(&option_driver); | 193 | retval = usb_register(&option_driver); |
| 252 | if (retval) | 194 | if (retval) |
| 253 | goto failed_driver_register; | 195 | goto failed_driver_register; |
| @@ -257,8 +199,6 @@ static int __init option_init(void) | |||
| 257 | return 0; | 199 | return 0; |
| 258 | 200 | ||
| 259 | failed_driver_register: | 201 | failed_driver_register: |
| 260 | usb_serial_deregister (&option_3port_device); | ||
| 261 | failed_3port_device_register: | ||
| 262 | usb_serial_deregister (&option_1port_device); | 202 | usb_serial_deregister (&option_1port_device); |
| 263 | failed_1port_device_register: | 203 | failed_1port_device_register: |
| 264 | return retval; | 204 | return retval; |
| @@ -267,7 +207,6 @@ failed_1port_device_register: | |||
| 267 | static void __exit option_exit(void) | 207 | static void __exit option_exit(void) |
| 268 | { | 208 | { |
| 269 | usb_deregister (&option_driver); | 209 | usb_deregister (&option_driver); |
| 270 | usb_serial_deregister (&option_3port_device); | ||
| 271 | usb_serial_deregister (&option_1port_device); | 210 | usb_serial_deregister (&option_1port_device); |
| 272 | } | 211 | } |
| 273 | 212 | ||
| @@ -656,7 +595,6 @@ static void option_setup_urbs(struct usb_serial *serial) | |||
| 656 | 595 | ||
| 657 | dbg("%s", __FUNCTION__); | 596 | dbg("%s", __FUNCTION__); |
| 658 | 597 | ||
| 659 | |||
| 660 | for (i = 0; i < serial->num_ports; i++) { | 598 | for (i = 0; i < serial->num_ports; i++) { |
| 661 | port = serial->port[i]; | 599 | port = serial->port[i]; |
| 662 | portdata = usb_get_serial_port_data(port); | 600 | portdata = usb_get_serial_port_data(port); |
