aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r--drivers/usb/serial/option.c157
1 files changed, 106 insertions, 51 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index ced9f32b29d9..8c3f55b080b4 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -67,54 +67,115 @@ static int option_tiocmset(struct usb_serial_port *port, struct file *file,
67static int option_send_setup(struct usb_serial_port *port); 67static int option_send_setup(struct usb_serial_port *port);
68 68
69/* Vendor and product IDs */ 69/* Vendor and product IDs */
70#define OPTION_VENDOR_ID 0x0AF0 70#define OPTION_VENDOR_ID 0x0AF0
71#define HUAWEI_VENDOR_ID 0x12D1 71#define OPTION_PRODUCT_COLT 0x5000
72#define AUDIOVOX_VENDOR_ID 0x0F3D 72#define OPTION_PRODUCT_RICOLA 0x6000
73#define NOVATELWIRELESS_VENDOR_ID 0x1410 73#define OPTION_PRODUCT_RICOLA_LIGHT 0x6100
74#define ANYDATA_VENDOR_ID 0x16d5 74#define OPTION_PRODUCT_RICOLA_QUAD 0x6200
75 75#define OPTION_PRODUCT_RICOLA_QUAD_LIGHT 0x6300
76#define OPTION_PRODUCT_OLD 0x5000 76#define OPTION_PRODUCT_RICOLA_NDIS 0x6050
77#define OPTION_PRODUCT_FUSION 0x6000 77#define OPTION_PRODUCT_RICOLA_NDIS_LIGHT 0x6150
78#define OPTION_PRODUCT_FUSION2 0x6300 78#define OPTION_PRODUCT_RICOLA_NDIS_QUAD 0x6250
79#define OPTION_PRODUCT_COBRA 0x6500 79#define OPTION_PRODUCT_RICOLA_NDIS_QUAD_LIGHT 0x6350
80#define OPTION_PRODUCT_COBRA2 0x6600 80#define OPTION_PRODUCT_COBRA 0x6500
81#define OPTION_PRODUCT_GTMAX36 0x6701 81#define OPTION_PRODUCT_COBRA_BUS 0x6501
82#define HUAWEI_PRODUCT_E600 0x1001 82#define OPTION_PRODUCT_VIPER 0x6600
83#define HUAWEI_PRODUCT_E220 0x1003 83#define OPTION_PRODUCT_VIPER_BUS 0x6601
84#define AUDIOVOX_PRODUCT_AIRCARD 0x0112 84#define OPTION_PRODUCT_GT_MAX_READY 0x6701
85#define NOVATELWIRELESS_PRODUCT_U740 0x1400 85#define OPTION_PRODUCT_GT_MAX 0x6711
86#define ANYDATA_PRODUCT_ID 0x6501 86#define OPTION_PRODUCT_FUJI_MODEM_LIGHT 0x6721
87#define OPTION_PRODUCT_FUJI_MODEM_GT 0x6741
88#define OPTION_PRODUCT_FUJI_MODEM_EX 0x6761
89#define OPTION_PRODUCT_FUJI_NETWORK_LIGHT 0x6731
90#define OPTION_PRODUCT_FUJI_NETWORK_GT 0x6751
91#define OPTION_PRODUCT_FUJI_NETWORK_EX 0x6771
92#define OPTION_PRODUCT_KOI_MODEM 0x6800
93#define OPTION_PRODUCT_KOI_NETWORK 0x6811
94#define OPTION_PRODUCT_SCORPION_MODEM 0x6901
95#define OPTION_PRODUCT_SCORPION_NETWORK 0x6911
96#define OPTION_PRODUCT_ETNA_MODEM 0x7001
97#define OPTION_PRODUCT_ETNA_NETWORK 0x7011
98#define OPTION_PRODUCT_ETNA_MODEM_LITE 0x7021
99#define OPTION_PRODUCT_ETNA_MODEM_GT 0x7041
100#define OPTION_PRODUCT_ETNA_MODEM_EX 0x7061
101#define OPTION_PRODUCT_ETNA_NETWORK_LITE 0x7031
102#define OPTION_PRODUCT_ETNA_NETWORK_GT 0x7051
103#define OPTION_PRODUCT_ETNA_NETWORK_EX 0x7071
104#define OPTION_PRODUCT_ETNA_KOI_MODEM 0x7100
105#define OPTION_PRODUCT_ETNA_KOI_NETWORK 0x7111
106
107#define HUAWEI_VENDOR_ID 0x12D1
108#define HUAWEI_PRODUCT_E600 0x1001
109#define HUAWEI_PRODUCT_E220 0x1003
110
111#define NOVATELWIRELESS_VENDOR_ID 0x1410
112
113#define ANYDATA_VENDOR_ID 0x16d5
114#define ANYDATA_PRODUCT_ID 0x6501
115
116#define BANDRICH_VENDOR_ID 0x1A8D
117#define BANDRICH_PRODUCT_C100_1 0x1002
118#define BANDRICH_PRODUCT_C100_2 0x1003
119
120#define DELL_VENDOR_ID 0x413C
87 121
88static struct usb_device_id option_ids[] = { 122static struct usb_device_id option_ids[] = {
89 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) }, 123 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) },
90 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) }, 124 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) },
91 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, 125 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) },
126 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_QUAD) },
127 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_QUAD_LIGHT) },
128 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_NDIS) },
129 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_NDIS_LIGHT) },
130 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_NDIS_QUAD) },
131 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_NDIS_QUAD_LIGHT) },
92 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, 132 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) },
93 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, 133 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA_BUS) },
94 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) }, 134 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_VIPER) },
135 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_VIPER_BUS) },
136 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GT_MAX_READY) },
137 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GT_MAX) },
138 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_MODEM_LIGHT) },
139 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_MODEM_GT) },
140 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_MODEM_EX) },
141 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_NETWORK_LIGHT) },
142 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_NETWORK_GT) },
143 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUJI_NETWORK_EX) },
144 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_KOI_MODEM) },
145 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_KOI_NETWORK) },
146 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_SCORPION_MODEM) },
147 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_SCORPION_NETWORK) },
148 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM) },
149 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK) },
150 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_LITE) },
151 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_GT) },
152 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_EX) },
153 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK_LITE) },
154 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK_GT) },
155 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_NETWORK_EX) },
156 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) },
157 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) },
95 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, 158 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
96 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, 159 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) },
97 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, 160 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */
98 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, 161 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1110) }, /* Novatel Merlin S620 */
162 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1120) }, /* Novatel Merlin EX720 */
163 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1130) }, /* Novatel Merlin S720 */
164 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1400) }, /* Novatel U730 */
165 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1410) }, /* Novatel U740 */
166 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1420) }, /* Novatel EU870 */
167 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */
168 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel XU870 */
169 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2100) }, /* Novatel EV620 CDMA/EV-DO */
170 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */
171 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */
172 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */
99 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, 173 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },
174 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) },
175 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) },
176 { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard */
100 { } /* Terminating entry */ 177 { } /* Terminating entry */
101}; 178};
102
103static struct usb_device_id option_ids1[] = {
104 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) },
105 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) },
106 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) },
107 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) },
108 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) },
109 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) },
110 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) },
111 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) },
112 { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) },
113 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) },
114 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) },
115 { } /* Terminating entry */
116};
117
118MODULE_DEVICE_TABLE(usb, option_ids); 179MODULE_DEVICE_TABLE(usb, option_ids);
119 180
120static struct usb_driver option_driver = { 181static struct usb_driver option_driver = {
@@ -136,7 +197,7 @@ static struct usb_serial_driver option_1port_device = {
136 }, 197 },
137 .description = "GSM modem (1-port)", 198 .description = "GSM modem (1-port)",
138 .usb_driver = &option_driver, 199 .usb_driver = &option_driver,
139 .id_table = option_ids1, 200 .id_table = option_ids,
140 .num_interrupt_in = NUM_DONT_CARE, 201 .num_interrupt_in = NUM_DONT_CARE,
141 .num_bulk_in = NUM_DONT_CARE, 202 .num_bulk_in = NUM_DONT_CARE,
142 .num_bulk_out = NUM_DONT_CARE, 203 .num_bulk_out = NUM_DONT_CARE,
@@ -539,12 +600,6 @@ static int option_open(struct usb_serial_port *port, struct file *filp)
539 return (0); 600 return (0);
540} 601}
541 602
542static inline void stop_urb(struct urb *urb)
543{
544 if (urb && urb->status == -EINPROGRESS)
545 usb_kill_urb(urb);
546}
547
548static void option_close(struct usb_serial_port *port, struct file *filp) 603static void option_close(struct usb_serial_port *port, struct file *filp)
549{ 604{
550 int i; 605 int i;
@@ -562,9 +617,9 @@ static void option_close(struct usb_serial_port *port, struct file *filp)
562 617
563 /* Stop reading/writing urbs */ 618 /* Stop reading/writing urbs */
564 for (i = 0; i < N_IN_URB; i++) 619 for (i = 0; i < N_IN_URB; i++)
565 stop_urb(portdata->in_urbs[i]); 620 usb_kill_urb(portdata->in_urbs[i]);
566 for (i = 0; i < N_OUT_URB; i++) 621 for (i = 0; i < N_OUT_URB; i++)
567 stop_urb(portdata->out_urbs[i]); 622 usb_kill_urb(portdata->out_urbs[i]);
568 } 623 }
569 port->tty = NULL; 624 port->tty = NULL;
570} 625}
@@ -695,9 +750,9 @@ static void option_shutdown(struct usb_serial *serial)
695 port = serial->port[i]; 750 port = serial->port[i];
696 portdata = usb_get_serial_port_data(port); 751 portdata = usb_get_serial_port_data(port);
697 for (j = 0; j < N_IN_URB; j++) 752 for (j = 0; j < N_IN_URB; j++)
698 stop_urb(portdata->in_urbs[j]); 753 usb_kill_urb(portdata->in_urbs[j]);
699 for (j = 0; j < N_OUT_URB; j++) 754 for (j = 0; j < N_OUT_URB; j++)
700 stop_urb(portdata->out_urbs[j]); 755 usb_kill_urb(portdata->out_urbs[j]);
701 } 756 }
702 757
703 /* Now free them */ 758 /* Now free them */