diff options
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r-- | drivers/usb/serial/option.c | 206 |
1 files changed, 158 insertions, 48 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 5ed183477aaf..d560c0b54e6e 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -62,6 +62,8 @@ static int option_tiocmget(struct tty_struct *tty, struct file *file); | |||
62 | static int option_tiocmset(struct tty_struct *tty, struct file *file, | 62 | static int option_tiocmset(struct tty_struct *tty, struct file *file, |
63 | unsigned int set, unsigned int clear); | 63 | unsigned int set, unsigned int clear); |
64 | static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *port); | 64 | static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *port); |
65 | static int option_suspend(struct usb_serial *serial, pm_message_t message); | ||
66 | static int option_resume(struct usb_serial *serial); | ||
65 | 67 | ||
66 | /* Vendor and product IDs */ | 68 | /* Vendor and product IDs */ |
67 | #define OPTION_VENDOR_ID 0x0AF0 | 69 | #define OPTION_VENDOR_ID 0x0AF0 |
@@ -89,6 +91,7 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
89 | #define OPTION_PRODUCT_ETNA_MODEM_GT 0x7041 | 91 | #define OPTION_PRODUCT_ETNA_MODEM_GT 0x7041 |
90 | #define OPTION_PRODUCT_ETNA_MODEM_EX 0x7061 | 92 | #define OPTION_PRODUCT_ETNA_MODEM_EX 0x7061 |
91 | #define OPTION_PRODUCT_ETNA_KOI_MODEM 0x7100 | 93 | #define OPTION_PRODUCT_ETNA_KOI_MODEM 0x7100 |
94 | #define OPTION_PRODUCT_GTM380_MODEM 0x7201 | ||
92 | 95 | ||
93 | #define HUAWEI_VENDOR_ID 0x12D1 | 96 | #define HUAWEI_VENDOR_ID 0x12D1 |
94 | #define HUAWEI_PRODUCT_E600 0x1001 | 97 | #define HUAWEI_PRODUCT_E600 0x1001 |
@@ -158,6 +161,13 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
158 | #define HUAWEI_PRODUCT_E143E 0x143E | 161 | #define HUAWEI_PRODUCT_E143E 0x143E |
159 | #define HUAWEI_PRODUCT_E143F 0x143F | 162 | #define HUAWEI_PRODUCT_E143F 0x143F |
160 | 163 | ||
164 | #define QUANTA_VENDOR_ID 0x0408 | ||
165 | #define QUANTA_PRODUCT_Q101 0xEA02 | ||
166 | #define QUANTA_PRODUCT_Q111 0xEA03 | ||
167 | #define QUANTA_PRODUCT_GLX 0xEA04 | ||
168 | #define QUANTA_PRODUCT_GKE 0xEA05 | ||
169 | #define QUANTA_PRODUCT_GLE 0xEA06 | ||
170 | |||
161 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 | 171 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 |
162 | 172 | ||
163 | /* YISO PRODUCTS */ | 173 | /* YISO PRODUCTS */ |
@@ -190,16 +200,18 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
190 | /* OVATION PRODUCTS */ | 200 | /* OVATION PRODUCTS */ |
191 | #define NOVATELWIRELESS_PRODUCT_MC727 0x4100 | 201 | #define NOVATELWIRELESS_PRODUCT_MC727 0x4100 |
192 | #define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 | 202 | #define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 |
203 | #define NOVATELWIRELESS_PRODUCT_U727 0x5010 | ||
193 | 204 | ||
194 | /* FUTURE NOVATEL PRODUCTS */ | 205 | /* FUTURE NOVATEL PRODUCTS */ |
195 | #define NOVATELWIRELESS_PRODUCT_EVDO_1 0x6000 | 206 | #define NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED 0X6000 |
196 | #define NOVATELWIRELESS_PRODUCT_HSPA_1 0x7000 | 207 | #define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001 |
197 | #define NOVATELWIRELESS_PRODUCT_EMBEDDED_1 0x8000 | 208 | #define NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED 0X7000 |
198 | #define NOVATELWIRELESS_PRODUCT_GLOBAL_1 0x9000 | 209 | #define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED 0X7001 |
199 | #define NOVATELWIRELESS_PRODUCT_EVDO_2 0x6001 | 210 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED 0X8000 |
200 | #define NOVATELWIRELESS_PRODUCT_HSPA_2 0x7001 | 211 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0X8001 |
201 | #define NOVATELWIRELESS_PRODUCT_EMBEDDED_2 0x8001 | 212 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0X9000 |
202 | #define NOVATELWIRELESS_PRODUCT_GLOBAL_2 0x9001 | 213 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0X9001 |
214 | #define NOVATELWIRELESS_PRODUCT_GLOBAL 0XA001 | ||
203 | 215 | ||
204 | /* AMOI PRODUCTS */ | 216 | /* AMOI PRODUCTS */ |
205 | #define AMOI_VENDOR_ID 0x1614 | 217 | #define AMOI_VENDOR_ID 0x1614 |
@@ -209,6 +221,27 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
209 | 221 | ||
210 | #define DELL_VENDOR_ID 0x413C | 222 | #define DELL_VENDOR_ID 0x413C |
211 | 223 | ||
224 | /* Dell modems */ | ||
225 | #define DELL_PRODUCT_5700_MINICARD 0x8114 | ||
226 | #define DELL_PRODUCT_5500_MINICARD 0x8115 | ||
227 | #define DELL_PRODUCT_5505_MINICARD 0x8116 | ||
228 | #define DELL_PRODUCT_5700_EXPRESSCARD 0x8117 | ||
229 | #define DELL_PRODUCT_5510_EXPRESSCARD 0x8118 | ||
230 | |||
231 | #define DELL_PRODUCT_5700_MINICARD_SPRINT 0x8128 | ||
232 | #define DELL_PRODUCT_5700_MINICARD_TELUS 0x8129 | ||
233 | |||
234 | #define DELL_PRODUCT_5720_MINICARD_VZW 0x8133 | ||
235 | #define DELL_PRODUCT_5720_MINICARD_SPRINT 0x8134 | ||
236 | #define DELL_PRODUCT_5720_MINICARD_TELUS 0x8135 | ||
237 | #define DELL_PRODUCT_5520_MINICARD_CINGULAR 0x8136 | ||
238 | #define DELL_PRODUCT_5520_MINICARD_GENERIC_L 0x8137 | ||
239 | #define DELL_PRODUCT_5520_MINICARD_GENERIC_I 0x8138 | ||
240 | |||
241 | #define DELL_PRODUCT_5730_MINICARD_SPRINT 0x8180 | ||
242 | #define DELL_PRODUCT_5730_MINICARD_TELUS 0x8181 | ||
243 | #define DELL_PRODUCT_5730_MINICARD_VZW 0x8182 | ||
244 | |||
212 | #define KYOCERA_VENDOR_ID 0x0c88 | 245 | #define KYOCERA_VENDOR_ID 0x0c88 |
213 | #define KYOCERA_PRODUCT_KPC650 0x17da | 246 | #define KYOCERA_PRODUCT_KPC650 0x17da |
214 | #define KYOCERA_PRODUCT_KPC680 0x180a | 247 | #define KYOCERA_PRODUCT_KPC680 0x180a |
@@ -224,7 +257,7 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
224 | #define ONDA_VENDOR_ID 0x19d2 | 257 | #define ONDA_VENDOR_ID 0x19d2 |
225 | #define ONDA_PRODUCT_MSA501HS 0x0001 | 258 | #define ONDA_PRODUCT_MSA501HS 0x0001 |
226 | #define ONDA_PRODUCT_ET502HS 0x0002 | 259 | #define ONDA_PRODUCT_ET502HS 0x0002 |
227 | #define ONDA_PRODUCT_MT503HS 0x0200 | 260 | #define ONDA_PRODUCT_MT503HS 0x2000 |
228 | 261 | ||
229 | #define BANDRICH_VENDOR_ID 0x1A8D | 262 | #define BANDRICH_VENDOR_ID 0x1A8D |
230 | #define BANDRICH_PRODUCT_C100_1 0x1002 | 263 | #define BANDRICH_PRODUCT_C100_1 0x1002 |
@@ -259,19 +292,13 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
259 | 292 | ||
260 | /* ZTE PRODUCTS */ | 293 | /* ZTE PRODUCTS */ |
261 | #define ZTE_VENDOR_ID 0x19d2 | 294 | #define ZTE_VENDOR_ID 0x19d2 |
295 | #define ZTE_PRODUCT_MF622 0x0001 | ||
262 | #define ZTE_PRODUCT_MF628 0x0015 | 296 | #define ZTE_PRODUCT_MF628 0x0015 |
263 | #define ZTE_PRODUCT_MF626 0x0031 | 297 | #define ZTE_PRODUCT_MF626 0x0031 |
264 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe | 298 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe |
265 | 299 | ||
266 | /* Ericsson products */ | 300 | #define BENQ_VENDOR_ID 0x04a5 |
267 | #define ERICSSON_VENDOR_ID 0x0bdb | 301 | #define BENQ_PRODUCT_H10 0x4068 |
268 | #define ERICSSON_PRODUCT_F3507G 0x1900 | ||
269 | |||
270 | /* Pantech products */ | ||
271 | #define PANTECH_VENDOR_ID 0x106c | ||
272 | #define PANTECH_PRODUCT_PC5740 0x3701 | ||
273 | #define PANTECH_PRODUCT_PC5750 0x3702 /* PX-500 */ | ||
274 | #define PANTECH_PRODUCT_UM150 0x3711 | ||
275 | 302 | ||
276 | static struct usb_device_id option_ids[] = { | 303 | static struct usb_device_id option_ids[] = { |
277 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, | 304 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, |
@@ -298,6 +325,12 @@ static struct usb_device_id option_ids[] = { | |||
298 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_GT) }, | 325 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_GT) }, |
299 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_EX) }, | 326 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_MODEM_EX) }, |
300 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) }, | 327 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_MODEM) }, |
328 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTM380_MODEM) }, | ||
329 | { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_Q101) }, | ||
330 | { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_Q111) }, | ||
331 | { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) }, | ||
332 | { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GKE) }, | ||
333 | { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) }, | ||
301 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600, 0xff, 0xff, 0xff) }, | 334 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600, 0xff, 0xff, 0xff) }, |
302 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220, 0xff, 0xff, 0xff) }, | 335 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220, 0xff, 0xff, 0xff) }, |
303 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS, 0xff, 0xff, 0xff) }, | 336 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220BIS, 0xff, 0xff, 0xff) }, |
@@ -383,31 +416,37 @@ static struct usb_device_id option_ids[] = { | |||
383 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */ | 416 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */ |
384 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */ | 417 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */ |
385 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ | 418 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ |
386 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_1) }, /* Novatel EVDO product */ | 419 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */ |
387 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_1) }, /* Novatel HSPA product */ | 420 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED) }, /* Novatel EVDO product */ |
388 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_1) }, /* Novatel Embedded product */ | 421 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */ |
389 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL_1) }, /* Novatel Global product */ | 422 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */ |
390 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_2) }, /* Novatel EVDO product */ | 423 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */ |
391 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_2) }, /* Novatel HSPA product */ | 424 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) }, /* Novatel EVDO product */ |
392 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EMBEDDED_2) }, /* Novatel Embedded product */ | 425 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED) }, /* Novatel HSPA product */ |
393 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL_2) }, /* Novatel Global product */ | 426 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) }, /* Novatel EVDO Embedded product */ |
427 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) }, /* Novatel HSPA Embedded product */ | ||
428 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL) }, /* Novatel Global product */ | ||
394 | 429 | ||
395 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 430 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
396 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 431 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
397 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, | 432 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H02) }, |
398 | 433 | ||
399 | { USB_DEVICE(DELL_VENDOR_ID, 0x8114) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ | 434 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite EV620 CDMA/EV-DO */ |
400 | { USB_DEVICE(DELL_VENDOR_ID, 0x8115) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ | 435 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5500_MINICARD) }, /* Dell Wireless 5500 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ |
401 | { USB_DEVICE(DELL_VENDOR_ID, 0x8116) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ | 436 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5505_MINICARD) }, /* Dell Wireless 5505 Mobile Broadband HSDPA Mini-Card == Novatel Expedite EU740 HSDPA/3G */ |
402 | { USB_DEVICE(DELL_VENDOR_ID, 0x8117) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */ | 437 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_EXPRESSCARD) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO ExpressCard == Novatel Merlin XV620 CDMA/EV-DO */ |
403 | { USB_DEVICE(DELL_VENDOR_ID, 0x8118) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */ | 438 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5510_EXPRESSCARD) }, /* Dell Wireless 5510 Mobile Broadband HSDPA ExpressCard == Novatel Merlin XU870 HSDPA/3G */ |
404 | { USB_DEVICE(DELL_VENDOR_ID, 0x8128) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */ | 439 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD_SPRINT) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite E720 CDMA/EV-DO */ |
405 | { USB_DEVICE(DELL_VENDOR_ID, 0x8129) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */ | 440 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5700_MINICARD_TELUS) }, /* Dell Wireless 5700 Mobile Broadband CDMA/EVDO Mini-Card == Novatel Expedite ET620 CDMA/EV-DO */ |
406 | { USB_DEVICE(DELL_VENDOR_ID, 0x8133) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */ | 441 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_VZW) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */ |
407 | { USB_DEVICE(DELL_VENDOR_ID, 0x8136) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */ | 442 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_SPRINT) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */ |
408 | { USB_DEVICE(DELL_VENDOR_ID, 0x8137) }, /* Dell Wireless HSDPA 5520 */ | 443 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5720_MINICARD_TELUS) }, /* Dell Wireless 5720 == Novatel EV620 CDMA/EV-DO */ |
409 | { USB_DEVICE(DELL_VENDOR_ID, 0x8138) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */ | 444 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_CINGULAR) }, /* Dell Wireless HSDPA 5520 == Novatel Expedite EU860D */ |
410 | { USB_DEVICE(DELL_VENDOR_ID, 0x8147) }, /* Dell Wireless 5530 Mobile Broadband (3G HSPA) Mini-Card */ | 445 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_GENERIC_L) }, /* Dell Wireless HSDPA 5520 */ |
446 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5520_MINICARD_GENERIC_I) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */ | ||
447 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_SPRINT) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | ||
448 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_TELUS) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | ||
449 | { USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5730_MINICARD_VZW) }, /* Dell Wireless 5730 Mobile Broadband EVDO/HSPA Mini-Card */ | ||
411 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ | 450 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */ |
412 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, | 451 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, |
413 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, | 452 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, |
@@ -472,13 +511,12 @@ static struct usb_device_id option_ids[] = { | |||
472 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | 511 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
473 | { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ | 512 | { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ |
474 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, | 513 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, |
514 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622) }, | ||
475 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) }, | 515 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) }, |
476 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) }, | 516 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) }, |
477 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) }, | 517 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) }, |
478 | { USB_DEVICE(ERICSSON_VENDOR_ID, ERICSSON_PRODUCT_F3507G) }, | 518 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, |
479 | { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_PC5740) }, | 519 | { USB_DEVICE(0x1da5, 0x4515) }, /* BenQ H20 */ |
480 | { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_PC5750) }, | ||
481 | { USB_DEVICE(PANTECH_VENDOR_ID, PANTECH_PRODUCT_UM150) }, | ||
482 | { } /* Terminating entry */ | 520 | { } /* Terminating entry */ |
483 | }; | 521 | }; |
484 | MODULE_DEVICE_TABLE(usb, option_ids); | 522 | MODULE_DEVICE_TABLE(usb, option_ids); |
@@ -487,6 +525,8 @@ static struct usb_driver option_driver = { | |||
487 | .name = "option", | 525 | .name = "option", |
488 | .probe = usb_serial_probe, | 526 | .probe = usb_serial_probe, |
489 | .disconnect = usb_serial_disconnect, | 527 | .disconnect = usb_serial_disconnect, |
528 | .suspend = usb_serial_suspend, | ||
529 | .resume = usb_serial_resume, | ||
490 | .id_table = option_ids, | 530 | .id_table = option_ids, |
491 | .no_dynamic_id = 1, | 531 | .no_dynamic_id = 1, |
492 | }; | 532 | }; |
@@ -515,6 +555,8 @@ static struct usb_serial_driver option_1port_device = { | |||
515 | .attach = option_startup, | 555 | .attach = option_startup, |
516 | .shutdown = option_shutdown, | 556 | .shutdown = option_shutdown, |
517 | .read_int_callback = option_instat_callback, | 557 | .read_int_callback = option_instat_callback, |
558 | .suspend = option_suspend, | ||
559 | .resume = option_resume, | ||
518 | }; | 560 | }; |
519 | 561 | ||
520 | static int debug; | 562 | static int debug; |
@@ -785,10 +827,10 @@ static void option_instat_callback(struct urb *urb) | |||
785 | req_pkt->bRequestType, req_pkt->bRequest); | 827 | req_pkt->bRequestType, req_pkt->bRequest); |
786 | } | 828 | } |
787 | } else | 829 | } else |
788 | dbg("%s: error %d", __func__, status); | 830 | err("%s: error %d", __func__, status); |
789 | 831 | ||
790 | /* Resubmit urb so we continue receiving IRQ data */ | 832 | /* Resubmit urb so we continue receiving IRQ data */ |
791 | if (status != -ESHUTDOWN) { | 833 | if (status != -ESHUTDOWN && status != -ENOENT) { |
792 | urb->dev = serial->dev; | 834 | urb->dev = serial->dev; |
793 | err = usb_submit_urb(urb, GFP_ATOMIC); | 835 | err = usb_submit_urb(urb, GFP_ATOMIC); |
794 | if (err) | 836 | if (err) |
@@ -807,7 +849,6 @@ static int option_write_room(struct tty_struct *tty) | |||
807 | 849 | ||
808 | portdata = usb_get_serial_port_data(port); | 850 | portdata = usb_get_serial_port_data(port); |
809 | 851 | ||
810 | |||
811 | for (i = 0; i < N_OUT_URB; i++) { | 852 | for (i = 0; i < N_OUT_URB; i++) { |
812 | this_urb = portdata->out_urbs[i]; | 853 | this_urb = portdata->out_urbs[i]; |
813 | if (this_urb && !test_bit(i, &portdata->out_busy)) | 854 | if (this_urb && !test_bit(i, &portdata->out_busy)) |
@@ -1069,14 +1110,12 @@ bail_out_error: | |||
1069 | return 1; | 1110 | return 1; |
1070 | } | 1111 | } |
1071 | 1112 | ||
1072 | static void option_shutdown(struct usb_serial *serial) | 1113 | static void stop_read_write_urbs(struct usb_serial *serial) |
1073 | { | 1114 | { |
1074 | int i, j; | 1115 | int i, j; |
1075 | struct usb_serial_port *port; | 1116 | struct usb_serial_port *port; |
1076 | struct option_port_private *portdata; | 1117 | struct option_port_private *portdata; |
1077 | 1118 | ||
1078 | dbg("%s", __func__); | ||
1079 | |||
1080 | /* Stop reading/writing urbs */ | 1119 | /* Stop reading/writing urbs */ |
1081 | for (i = 0; i < serial->num_ports; ++i) { | 1120 | for (i = 0; i < serial->num_ports; ++i) { |
1082 | port = serial->port[i]; | 1121 | port = serial->port[i]; |
@@ -1086,6 +1125,17 @@ static void option_shutdown(struct usb_serial *serial) | |||
1086 | for (j = 0; j < N_OUT_URB; j++) | 1125 | for (j = 0; j < N_OUT_URB; j++) |
1087 | usb_kill_urb(portdata->out_urbs[j]); | 1126 | usb_kill_urb(portdata->out_urbs[j]); |
1088 | } | 1127 | } |
1128 | } | ||
1129 | |||
1130 | static void option_shutdown(struct usb_serial *serial) | ||
1131 | { | ||
1132 | int i, j; | ||
1133 | struct usb_serial_port *port; | ||
1134 | struct option_port_private *portdata; | ||
1135 | |||
1136 | dbg("%s", __func__); | ||
1137 | |||
1138 | stop_read_write_urbs(serial); | ||
1089 | 1139 | ||
1090 | /* Now free them */ | 1140 | /* Now free them */ |
1091 | for (i = 0; i < serial->num_ports; ++i) { | 1141 | for (i = 0; i < serial->num_ports; ++i) { |
@@ -1116,6 +1166,66 @@ static void option_shutdown(struct usb_serial *serial) | |||
1116 | } | 1166 | } |
1117 | } | 1167 | } |
1118 | 1168 | ||
1169 | static int option_suspend(struct usb_serial *serial, pm_message_t message) | ||
1170 | { | ||
1171 | dbg("%s entered", __func__); | ||
1172 | stop_read_write_urbs(serial); | ||
1173 | |||
1174 | return 0; | ||
1175 | } | ||
1176 | |||
1177 | static int option_resume(struct usb_serial *serial) | ||
1178 | { | ||
1179 | int err, i, j; | ||
1180 | struct usb_serial_port *port; | ||
1181 | struct urb *urb; | ||
1182 | struct option_port_private *portdata; | ||
1183 | |||
1184 | dbg("%s entered", __func__); | ||
1185 | /* get the interrupt URBs resubmitted unconditionally */ | ||
1186 | for (i = 0; i < serial->num_ports; i++) { | ||
1187 | port = serial->port[i]; | ||
1188 | if (!port->interrupt_in_urb) { | ||
1189 | dbg("%s: No interrupt URB for port %d\n", __func__, i); | ||
1190 | continue; | ||
1191 | } | ||
1192 | port->interrupt_in_urb->dev = serial->dev; | ||
1193 | err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); | ||
1194 | dbg("Submitted interrupt URB for port %d (result %d)", i, err); | ||
1195 | if (err < 0) { | ||
1196 | err("%s: Error %d for interrupt URB of port%d", | ||
1197 | __func__, err, i); | ||
1198 | return err; | ||
1199 | } | ||
1200 | } | ||
1201 | |||
1202 | for (i = 0; i < serial->num_ports; i++) { | ||
1203 | /* walk all ports */ | ||
1204 | port = serial->port[i]; | ||
1205 | portdata = usb_get_serial_port_data(port); | ||
1206 | mutex_lock(&port->mutex); | ||
1207 | |||
1208 | /* skip closed ports */ | ||
1209 | if (!port->port.count) { | ||
1210 | mutex_unlock(&port->mutex); | ||
1211 | continue; | ||
1212 | } | ||
1213 | |||
1214 | for (j = 0; j < N_IN_URB; j++) { | ||
1215 | urb = portdata->in_urbs[j]; | ||
1216 | err = usb_submit_urb(urb, GFP_NOIO); | ||
1217 | if (err < 0) { | ||
1218 | mutex_unlock(&port->mutex); | ||
1219 | err("%s: Error %d for bulk URB %d", | ||
1220 | __func__, err, i); | ||
1221 | return err; | ||
1222 | } | ||
1223 | } | ||
1224 | mutex_unlock(&port->mutex); | ||
1225 | } | ||
1226 | return 0; | ||
1227 | } | ||
1228 | |||
1119 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1229 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1120 | MODULE_DESCRIPTION(DRIVER_DESC); | 1230 | MODULE_DESCRIPTION(DRIVER_DESC); |
1121 | MODULE_VERSION(DRIVER_VERSION); | 1231 | MODULE_VERSION(DRIVER_VERSION); |