diff options
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r-- | drivers/usb/serial/option.c | 177 |
1 files changed, 166 insertions, 11 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 0577e4b61114..84d0edad8e4f 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/errno.h> | 37 | #include <linux/errno.h> |
38 | #include <linux/tty.h> | 38 | #include <linux/tty.h> |
39 | #include <linux/tty_flip.h> | 39 | #include <linux/tty_flip.h> |
40 | #include <linux/slab.h> | ||
40 | #include <linux/module.h> | 41 | #include <linux/module.h> |
41 | #include <linux/bitops.h> | 42 | #include <linux/bitops.h> |
42 | #include <linux/usb.h> | 43 | #include <linux/usb.h> |
@@ -288,7 +289,9 @@ static int option_resume(struct usb_serial *serial); | |||
288 | 289 | ||
289 | #define QUALCOMM_VENDOR_ID 0x05C6 | 290 | #define QUALCOMM_VENDOR_ID 0x05C6 |
290 | 291 | ||
291 | #define MAXON_VENDOR_ID 0x16d8 | 292 | #define CMOTECH_VENDOR_ID 0x16d8 |
293 | #define CMOTECH_PRODUCT_6008 0x6008 | ||
294 | #define CMOTECH_PRODUCT_6280 0x6280 | ||
292 | 295 | ||
293 | #define TELIT_VENDOR_ID 0x1bc7 | 296 | #define TELIT_VENDOR_ID 0x1bc7 |
294 | #define TELIT_PRODUCT_UC864E 0x1003 | 297 | #define TELIT_PRODUCT_UC864E 0x1003 |
@@ -302,6 +305,11 @@ static int option_resume(struct usb_serial *serial); | |||
302 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe | 305 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe |
303 | #define ZTE_PRODUCT_AC8710 0xfff1 | 306 | #define ZTE_PRODUCT_AC8710 0xfff1 |
304 | #define ZTE_PRODUCT_AC2726 0xfff5 | 307 | #define ZTE_PRODUCT_AC2726 0xfff5 |
308 | #define ZTE_PRODUCT_AC8710T 0xffff | ||
309 | |||
310 | /* ZTE PRODUCTS -- alternate vendor ID */ | ||
311 | #define ZTE_VENDOR_ID2 0x1d6b | ||
312 | #define ZTE_PRODUCT_MF_330 0x0002 | ||
305 | 313 | ||
306 | #define BENQ_VENDOR_ID 0x04a5 | 314 | #define BENQ_VENDOR_ID 0x04a5 |
307 | #define BENQ_PRODUCT_H10 0x4068 | 315 | #define BENQ_PRODUCT_H10 0x4068 |
@@ -309,6 +317,7 @@ static int option_resume(struct usb_serial *serial); | |||
309 | #define DLINK_VENDOR_ID 0x1186 | 317 | #define DLINK_VENDOR_ID 0x1186 |
310 | #define DLINK_PRODUCT_DWM_652 0x3e04 | 318 | #define DLINK_PRODUCT_DWM_652 0x3e04 |
311 | #define DLINK_PRODUCT_DWM_652_U5 0xce16 | 319 | #define DLINK_PRODUCT_DWM_652_U5 0xce16 |
320 | #define DLINK_PRODUCT_DWM_652_U5A 0xce1e | ||
312 | 321 | ||
313 | #define QISDA_VENDOR_ID 0x1da5 | 322 | #define QISDA_VENDOR_ID 0x1da5 |
314 | #define QISDA_PRODUCT_H21_4512 0x4512 | 323 | #define QISDA_PRODUCT_H21_4512 0x4512 |
@@ -332,15 +341,66 @@ static int option_resume(struct usb_serial *serial); | |||
332 | #define ALCATEL_VENDOR_ID 0x1bbb | 341 | #define ALCATEL_VENDOR_ID 0x1bbb |
333 | #define ALCATEL_PRODUCT_X060S 0x0000 | 342 | #define ALCATEL_PRODUCT_X060S 0x0000 |
334 | 343 | ||
344 | #define PIRELLI_VENDOR_ID 0x1266 | ||
345 | #define PIRELLI_PRODUCT_C100_1 0x1002 | ||
346 | #define PIRELLI_PRODUCT_C100_2 0x1003 | ||
347 | #define PIRELLI_PRODUCT_1004 0x1004 | ||
348 | #define PIRELLI_PRODUCT_1005 0x1005 | ||
349 | #define PIRELLI_PRODUCT_1006 0x1006 | ||
350 | #define PIRELLI_PRODUCT_1007 0x1007 | ||
351 | #define PIRELLI_PRODUCT_1008 0x1008 | ||
352 | #define PIRELLI_PRODUCT_1009 0x1009 | ||
353 | #define PIRELLI_PRODUCT_100A 0x100a | ||
354 | #define PIRELLI_PRODUCT_100B 0x100b | ||
355 | #define PIRELLI_PRODUCT_100C 0x100c | ||
356 | #define PIRELLI_PRODUCT_100D 0x100d | ||
357 | #define PIRELLI_PRODUCT_100E 0x100e | ||
358 | #define PIRELLI_PRODUCT_100F 0x100f | ||
359 | #define PIRELLI_PRODUCT_1011 0x1011 | ||
360 | #define PIRELLI_PRODUCT_1012 0x1012 | ||
361 | |||
335 | /* Airplus products */ | 362 | /* Airplus products */ |
336 | #define AIRPLUS_VENDOR_ID 0x1011 | 363 | #define AIRPLUS_VENDOR_ID 0x1011 |
337 | #define AIRPLUS_PRODUCT_MCD650 0x3198 | 364 | #define AIRPLUS_PRODUCT_MCD650 0x3198 |
338 | 365 | ||
366 | /* Longcheer/Longsung vendor ID; makes whitelabel devices that | ||
367 | * many other vendors like 4G Systems, Alcatel, ChinaBird, | ||
368 | * Mobidata, etc sell under their own brand names. | ||
369 | */ | ||
370 | #define LONGCHEER_VENDOR_ID 0x1c9e | ||
371 | |||
339 | /* 4G Systems products */ | 372 | /* 4G Systems products */ |
340 | #define FOUR_G_SYSTEMS_VENDOR_ID 0x1c9e | 373 | /* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick * |
374 | * It seems to contain a Qualcomm QSC6240/6290 chipset */ | ||
341 | #define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603 | 375 | #define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603 |
342 | 376 | ||
343 | static struct usb_device_id option_ids[] = { | 377 | /* Haier products */ |
378 | #define HAIER_VENDOR_ID 0x201e | ||
379 | #define HAIER_PRODUCT_CE100 0x2009 | ||
380 | |||
381 | #define CINTERION_VENDOR_ID 0x0681 | ||
382 | |||
383 | /* some devices interfaces need special handling due to a number of reasons */ | ||
384 | enum option_blacklist_reason { | ||
385 | OPTION_BLACKLIST_NONE = 0, | ||
386 | OPTION_BLACKLIST_SENDSETUP = 1, | ||
387 | OPTION_BLACKLIST_RESERVED_IF = 2 | ||
388 | }; | ||
389 | |||
390 | struct option_blacklist_info { | ||
391 | const u32 infolen; /* number of interface numbers on blacklist */ | ||
392 | const u8 *ifaceinfo; /* pointer to the array holding the numbers */ | ||
393 | enum option_blacklist_reason reason; | ||
394 | }; | ||
395 | |||
396 | static const u8 four_g_w14_no_sendsetup[] = { 0, 1 }; | ||
397 | static const struct option_blacklist_info four_g_w14_blacklist = { | ||
398 | .infolen = ARRAY_SIZE(four_g_w14_no_sendsetup), | ||
399 | .ifaceinfo = four_g_w14_no_sendsetup, | ||
400 | .reason = OPTION_BLACKLIST_SENDSETUP | ||
401 | }; | ||
402 | |||
403 | static const struct usb_device_id option_ids[] = { | ||
344 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, | 404 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, |
345 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, | 405 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, |
346 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, | 406 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA_LIGHT) }, |
@@ -516,7 +576,8 @@ static struct usb_device_id option_ids[] = { | |||
516 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, | 576 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, |
517 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ | 577 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ |
518 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | 578 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
519 | { USB_DEVICE(MAXON_VENDOR_ID, 0x6280) }, /* BP3-USB & BP3-EXT HSDPA */ | 579 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ |
580 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6008) }, | ||
520 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, | 581 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864E) }, |
521 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, | 582 | { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UC864G) }, |
522 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ | 583 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF622, 0xff, 0xff, 0xff) }, /* ZTE WCDMA products */ |
@@ -580,18 +641,57 @@ static struct usb_device_id option_ids[] = { | |||
580 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xff) }, | 641 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xff) }, |
581 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) }, | 642 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff, 0xff, 0xff) }, |
582 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, | 643 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) }, |
644 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff) }, | ||
645 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0106, 0xff, 0xff, 0xff) }, | ||
646 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0108, 0xff, 0xff, 0xff) }, | ||
647 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0113, 0xff, 0xff, 0xff) }, | ||
648 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0117, 0xff, 0xff, 0xff) }, | ||
649 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0118, 0xff, 0xff, 0xff) }, | ||
650 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0121, 0xff, 0xff, 0xff) }, | ||
651 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0122, 0xff, 0xff, 0xff) }, | ||
652 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0123, 0xff, 0xff, 0xff) }, | ||
653 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0124, 0xff, 0xff, 0xff) }, | ||
654 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0125, 0xff, 0xff, 0xff) }, | ||
655 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0126, 0xff, 0xff, 0xff) }, | ||
656 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0128, 0xff, 0xff, 0xff) }, | ||
657 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0142, 0xff, 0xff, 0xff) }, | ||
658 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) }, | ||
659 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) }, | ||
660 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0145, 0xff, 0xff, 0xff) }, | ||
661 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0146, 0xff, 0xff, 0xff) }, | ||
662 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) }, | ||
663 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0148, 0xff, 0xff, 0xff) }, | ||
664 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0149, 0xff, 0xff, 0xff) }, | ||
665 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0150, 0xff, 0xff, 0xff) }, | ||
666 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0151, 0xff, 0xff, 0xff) }, | ||
667 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) }, | ||
668 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0153, 0xff, 0xff, 0xff) }, | ||
669 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0154, 0xff, 0xff, 0xff) }, | ||
670 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0155, 0xff, 0xff, 0xff) }, | ||
671 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) }, | ||
672 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff) }, | ||
673 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff) }, | ||
674 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0159, 0xff, 0xff, 0xff) }, | ||
675 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xff) }, | ||
676 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) }, | ||
677 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) }, | ||
583 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */ | 678 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */ |
584 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) }, | 679 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) }, |
585 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) }, | 680 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) }, |
586 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) }, | 681 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) }, |
587 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) }, | 682 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) }, |
588 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) }, | 683 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) }, |
684 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) }, | ||
685 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) }, | ||
589 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, | 686 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, |
590 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, | 687 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, |
591 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, | 688 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, |
689 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, | ||
690 | { USB_DEVICE(ZTE_VENDOR_ID2, ZTE_PRODUCT_MF_330) }, | ||
592 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, | 691 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, |
593 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, | 692 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, |
594 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ | 693 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */ |
694 | { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5A) }, | ||
595 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, | 695 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4512) }, |
596 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, | 696 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H21_4523) }, |
597 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, | 697 | { USB_DEVICE(QISDA_VENDOR_ID, QISDA_PRODUCT_H20_4515) }, |
@@ -603,7 +703,29 @@ static struct usb_device_id option_ids[] = { | |||
603 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, | 703 | { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, |
604 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, | 704 | { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, |
605 | { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, | 705 | { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) }, |
606 | { USB_DEVICE(FOUR_G_SYSTEMS_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14) }, | 706 | { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14), |
707 | .driver_info = (kernel_ulong_t)&four_g_w14_blacklist | ||
708 | }, | ||
709 | { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, | ||
710 | /* Pirelli */ | ||
711 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)}, | ||
712 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_2)}, | ||
713 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1004)}, | ||
714 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1005)}, | ||
715 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1006)}, | ||
716 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1007)}, | ||
717 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1008)}, | ||
718 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1009)}, | ||
719 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100A)}, | ||
720 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100B) }, | ||
721 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100C) }, | ||
722 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100D) }, | ||
723 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100E) }, | ||
724 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) }, | ||
725 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, | ||
726 | { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, | ||
727 | |||
728 | { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) }, | ||
607 | { } /* Terminating entry */ | 729 | { } /* Terminating entry */ |
608 | }; | 730 | }; |
609 | MODULE_DEVICE_TABLE(usb, option_ids); | 731 | MODULE_DEVICE_TABLE(usb, option_ids); |
@@ -667,6 +789,7 @@ struct option_intf_private { | |||
667 | spinlock_t susp_lock; | 789 | spinlock_t susp_lock; |
668 | unsigned int suspended:1; | 790 | unsigned int suspended:1; |
669 | int in_flight; | 791 | int in_flight; |
792 | struct option_blacklist_info *blacklist_info; | ||
670 | }; | 793 | }; |
671 | 794 | ||
672 | struct option_port_private { | 795 | struct option_port_private { |
@@ -726,19 +849,44 @@ static int option_probe(struct usb_serial *serial, | |||
726 | const struct usb_device_id *id) | 849 | const struct usb_device_id *id) |
727 | { | 850 | { |
728 | struct option_intf_private *data; | 851 | struct option_intf_private *data; |
852 | |||
729 | /* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */ | 853 | /* D-Link DWM 652 still exposes CD-Rom emulation interface in modem mode */ |
730 | if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID && | 854 | if (serial->dev->descriptor.idVendor == DLINK_VENDOR_ID && |
731 | serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 && | 855 | serial->dev->descriptor.idProduct == DLINK_PRODUCT_DWM_652 && |
732 | serial->interface->cur_altsetting->desc.bInterfaceClass == 0x8) | 856 | serial->interface->cur_altsetting->desc.bInterfaceClass == 0x8) |
733 | return -ENODEV; | 857 | return -ENODEV; |
734 | 858 | ||
859 | /* Bandrich modem and AT command interface is 0xff */ | ||
860 | if ((serial->dev->descriptor.idVendor == BANDRICH_VENDOR_ID || | ||
861 | serial->dev->descriptor.idVendor == PIRELLI_VENDOR_ID) && | ||
862 | serial->interface->cur_altsetting->desc.bInterfaceClass != 0xff) | ||
863 | return -ENODEV; | ||
864 | |||
735 | data = serial->private = kzalloc(sizeof(struct option_intf_private), GFP_KERNEL); | 865 | data = serial->private = kzalloc(sizeof(struct option_intf_private), GFP_KERNEL); |
736 | if (!data) | 866 | if (!data) |
737 | return -ENOMEM; | 867 | return -ENOMEM; |
738 | spin_lock_init(&data->susp_lock); | 868 | spin_lock_init(&data->susp_lock); |
869 | data->blacklist_info = (struct option_blacklist_info*) id->driver_info; | ||
739 | return 0; | 870 | return 0; |
740 | } | 871 | } |
741 | 872 | ||
873 | static enum option_blacklist_reason is_blacklisted(const u8 ifnum, | ||
874 | const struct option_blacklist_info *blacklist) | ||
875 | { | ||
876 | const u8 *info; | ||
877 | int i; | ||
878 | |||
879 | if (blacklist) { | ||
880 | info = blacklist->ifaceinfo; | ||
881 | |||
882 | for (i = 0; i < blacklist->infolen; i++) { | ||
883 | if (info[i] == ifnum) | ||
884 | return blacklist->reason; | ||
885 | } | ||
886 | } | ||
887 | return OPTION_BLACKLIST_NONE; | ||
888 | } | ||
889 | |||
742 | static void option_set_termios(struct tty_struct *tty, | 890 | static void option_set_termios(struct tty_struct *tty, |
743 | struct usb_serial_port *port, struct ktermios *old_termios) | 891 | struct usb_serial_port *port, struct ktermios *old_termios) |
744 | { | 892 | { |
@@ -879,7 +1027,6 @@ static void option_indat_callback(struct urb *urb) | |||
879 | } else { | 1027 | } else { |
880 | tty = tty_port_tty_get(&port->port); | 1028 | tty = tty_port_tty_get(&port->port); |
881 | if (urb->actual_length) { | 1029 | if (urb->actual_length) { |
882 | tty_buffer_request_room(tty, urb->actual_length); | ||
883 | tty_insert_flip_string(tty, data, urb->actual_length); | 1030 | tty_insert_flip_string(tty, data, urb->actual_length); |
884 | tty_flip_buffer_push(tty); | 1031 | tty_flip_buffer_push(tty); |
885 | } else | 1032 | } else |
@@ -887,9 +1034,9 @@ static void option_indat_callback(struct urb *urb) | |||
887 | tty_kref_put(tty); | 1034 | tty_kref_put(tty); |
888 | 1035 | ||
889 | /* Resubmit urb so we continue receiving */ | 1036 | /* Resubmit urb so we continue receiving */ |
890 | if (port->port.count && status != -ESHUTDOWN) { | 1037 | if (status != -ESHUTDOWN) { |
891 | err = usb_submit_urb(urb, GFP_ATOMIC); | 1038 | err = usb_submit_urb(urb, GFP_ATOMIC); |
892 | if (err) | 1039 | if (err && err != -EPERM) |
893 | printk(KERN_ERR "%s: resubmit read urb failed. " | 1040 | printk(KERN_ERR "%s: resubmit read urb failed. " |
894 | "(%d)", __func__, err); | 1041 | "(%d)", __func__, err); |
895 | else | 1042 | else |
@@ -943,7 +1090,7 @@ static void option_instat_callback(struct urb *urb) | |||
943 | (struct usb_ctrlrequest *)urb->transfer_buffer; | 1090 | (struct usb_ctrlrequest *)urb->transfer_buffer; |
944 | 1091 | ||
945 | if (!req_pkt) { | 1092 | if (!req_pkt) { |
946 | dbg("%s: NULL req_pkt\n", __func__); | 1093 | dbg("%s: NULL req_pkt", __func__); |
947 | return; | 1094 | return; |
948 | } | 1095 | } |
949 | if ((req_pkt->bRequestType == 0xA1) && | 1096 | if ((req_pkt->bRequestType == 0xA1) && |
@@ -1169,11 +1316,19 @@ static void option_setup_urbs(struct usb_serial *serial) | |||
1169 | static int option_send_setup(struct usb_serial_port *port) | 1316 | static int option_send_setup(struct usb_serial_port *port) |
1170 | { | 1317 | { |
1171 | struct usb_serial *serial = port->serial; | 1318 | struct usb_serial *serial = port->serial; |
1319 | struct option_intf_private *intfdata = | ||
1320 | (struct option_intf_private *) serial->private; | ||
1172 | struct option_port_private *portdata; | 1321 | struct option_port_private *portdata; |
1173 | int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; | 1322 | int ifNum = serial->interface->cur_altsetting->desc.bInterfaceNumber; |
1174 | int val = 0; | 1323 | int val = 0; |
1175 | dbg("%s", __func__); | 1324 | dbg("%s", __func__); |
1176 | 1325 | ||
1326 | if (is_blacklisted(ifNum, intfdata->blacklist_info) == | ||
1327 | OPTION_BLACKLIST_SENDSETUP) { | ||
1328 | dbg("No send_setup on blacklisted interface #%d\n", ifNum); | ||
1329 | return -EIO; | ||
1330 | } | ||
1331 | |||
1177 | portdata = usb_get_serial_port_data(port); | 1332 | portdata = usb_get_serial_port_data(port); |
1178 | 1333 | ||
1179 | if (portdata->dtr_state) | 1334 | if (portdata->dtr_state) |
@@ -1312,7 +1467,7 @@ static int option_suspend(struct usb_serial *serial, pm_message_t message) | |||
1312 | 1467 | ||
1313 | dbg("%s entered", __func__); | 1468 | dbg("%s entered", __func__); |
1314 | 1469 | ||
1315 | if (serial->dev->auto_pm) { | 1470 | if (message.event & PM_EVENT_AUTO) { |
1316 | spin_lock_irq(&intfdata->susp_lock); | 1471 | spin_lock_irq(&intfdata->susp_lock); |
1317 | b = intfdata->in_flight; | 1472 | b = intfdata->in_flight; |
1318 | spin_unlock_irq(&intfdata->susp_lock); | 1473 | spin_unlock_irq(&intfdata->susp_lock); |
@@ -1359,7 +1514,7 @@ static int option_resume(struct usb_serial *serial) | |||
1359 | for (i = 0; i < serial->num_ports; i++) { | 1514 | for (i = 0; i < serial->num_ports; i++) { |
1360 | port = serial->port[i]; | 1515 | port = serial->port[i]; |
1361 | if (!port->interrupt_in_urb) { | 1516 | if (!port->interrupt_in_urb) { |
1362 | dbg("%s: No interrupt URB for port %d\n", __func__, i); | 1517 | dbg("%s: No interrupt URB for port %d", __func__, i); |
1363 | continue; | 1518 | continue; |
1364 | } | 1519 | } |
1365 | err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); | 1520 | err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); |