0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <linux/kernel.h>
0015 #include <linux/tty.h>
0016 #include <linux/module.h>
0017 #include <linux/usb.h>
0018 #include <linux/usb/serial.h>
0019
0020 #define DEVICE_N(vendor, IDS, nport) \
0021 static const struct usb_device_id vendor##_id_table[] = { \
0022 IDS(), \
0023 { }, \
0024 }; \
0025 static struct usb_serial_driver vendor##_device = { \
0026 .driver = { \
0027 .owner = THIS_MODULE, \
0028 .name = #vendor, \
0029 }, \
0030 .id_table = vendor##_id_table, \
0031 .num_ports = nport, \
0032 };
0033
0034 #define DEVICE(vendor, IDS) DEVICE_N(vendor, IDS, 1)
0035
0036
0037 #define CARELINK_IDS() \
0038 { USB_DEVICE(0x0a21, 0x8001) }
0039 DEVICE(carelink, CARELINK_IDS);
0040
0041
0042 #define ZIO_IDS() \
0043 { USB_DEVICE(0x1CBE, 0x0103) }
0044 DEVICE(zio, ZIO_IDS);
0045
0046
0047 #define FUNSOFT_IDS() \
0048 { USB_DEVICE(0x1404, 0xcddc) }
0049 DEVICE(funsoft, FUNSOFT_IDS);
0050
0051
0052 #define FLASHLOADER_IDS() \
0053 { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, USB_CLASS_CDC_DATA) }, \
0054 { USB_DEVICE(0x8087, 0x0716) }, \
0055 { USB_DEVICE(0x8087, 0x0801) }
0056 DEVICE(flashloader, FLASHLOADER_IDS);
0057
0058
0059 #define GOOGLE_IDS() \
0060 { USB_VENDOR_AND_INTERFACE_INFO(0x18d1, \
0061 USB_CLASS_VENDOR_SPEC, \
0062 0x50, \
0063 0x01) }
0064 DEVICE(google, GOOGLE_IDS);
0065
0066
0067 #define LIBTRANSISTOR_IDS() \
0068 { USB_DEVICE(0x1209, 0x8b00) }
0069 DEVICE(libtransistor, LIBTRANSISTOR_IDS);
0070
0071
0072 #define VIVOPAY_IDS() \
0073 { USB_DEVICE(0x1d5f, 0x1004) }
0074 DEVICE(vivopay, VIVOPAY_IDS);
0075
0076
0077 #define MOTO_IDS() \
0078 { USB_DEVICE(0x05c6, 0x3197) }, \
0079 { USB_DEVICE(0x0c44, 0x0022) }, \
0080 { USB_DEVICE(0x22b8, 0x2a64) }, \
0081 { USB_DEVICE(0x22b8, 0x2c84) }, \
0082 { USB_DEVICE(0x22b8, 0x2c64) }
0083 DEVICE(moto_modem, MOTO_IDS);
0084
0085
0086 #define MOTOROLA_TETRA_IDS() \
0087 { USB_DEVICE(0x0cad, 0x9011) }, \
0088 { USB_DEVICE(0x0cad, 0x9012) }, \
0089 { USB_DEVICE(0x0cad, 0x9013) }, \
0090 { USB_DEVICE(0x0cad, 0x9015) }, \
0091 { USB_DEVICE(0x0cad, 0x9016) }
0092 DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS);
0093
0094
0095 #define NOKIA_IDS() \
0096 { USB_DEVICE(0x0421, 0x069a) }
0097 DEVICE(nokia, NOKIA_IDS);
0098
0099
0100 #define NOVATEL_IDS() \
0101 { USB_DEVICE(0x09d7, 0x0100) }
0102 DEVICE_N(novatel_gps, NOVATEL_IDS, 3);
0103
0104
0105 #define HP4X_IDS() \
0106 { USB_DEVICE(0x03f0, 0x0121) }
0107 DEVICE(hp4x, HP4X_IDS);
0108
0109
0110 #define SUUNTO_IDS() \
0111 { USB_DEVICE(0x0fcf, 0x1008) }, \
0112 { USB_DEVICE(0x0fcf, 0x1009) }
0113 DEVICE(suunto, SUUNTO_IDS);
0114
0115
0116 #define SIEMENS_IDS() \
0117 { USB_DEVICE(0x908, 0x0004) }
0118 DEVICE(siemens_mpi, SIEMENS_IDS);
0119
0120
0121 static struct usb_serial_driver * const serial_drivers[] = {
0122 &carelink_device,
0123 &zio_device,
0124 &funsoft_device,
0125 &flashloader_device,
0126 &google_device,
0127 &libtransistor_device,
0128 &vivopay_device,
0129 &moto_modem_device,
0130 &motorola_tetra_device,
0131 &nokia_device,
0132 &novatel_gps_device,
0133 &hp4x_device,
0134 &suunto_device,
0135 &siemens_mpi_device,
0136 NULL
0137 };
0138
0139 static const struct usb_device_id id_table[] = {
0140 CARELINK_IDS(),
0141 ZIO_IDS(),
0142 FUNSOFT_IDS(),
0143 FLASHLOADER_IDS(),
0144 GOOGLE_IDS(),
0145 LIBTRANSISTOR_IDS(),
0146 VIVOPAY_IDS(),
0147 MOTO_IDS(),
0148 MOTOROLA_TETRA_IDS(),
0149 NOKIA_IDS(),
0150 NOVATEL_IDS(),
0151 HP4X_IDS(),
0152 SUUNTO_IDS(),
0153 SIEMENS_IDS(),
0154 { },
0155 };
0156 MODULE_DEVICE_TABLE(usb, id_table);
0157
0158 module_usb_serial_driver(serial_drivers, id_table);
0159 MODULE_LICENSE("GPL v2");