[haiku-commits] haiku: hrev44370 - src/add-ons/kernel/drivers/ports/usb_serial

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 21 Jul 2012 05:24:00 +0200 (CEST)

hrev44370 adds 1 changeset to branch 'master'
old head: 667fd4d0eaf904b3928d52c740e0bbc7bdc88f86
new head: 5ba5e31f8a59cb5f3299edd7af256d0fb4db12aa

----------------------------------------------------------------------------

5ba5e31: usb_serial: clean up usb device identification
  
  * Update FTDI, KLSI, Prolific, and Silicon drivers to share a
    common structural layout for device identification.
  * More flexible and cleaner than massive switch case statements.
  * Avoids the problem of different chipsets from identical vendors.

                          [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev44370
Commit:      5ba5e31f8a59cb5f3299edd7af256d0fb4db12aa
URL:         http://cgit.haiku-os.org/haiku/commit/?id=5ba5e31
Author:      Alexander von Gluck IV <kallisti5@xxxxxxxxxxx>
Date:        Sat Jul 21 02:48:40 2012 UTC

----------------------------------------------------------------------------

8 files changed, 230 insertions(+), 487 deletions(-)
.../kernel/drivers/ports/usb_serial/FTDI.cpp       |   11 +-
src/add-ons/kernel/drivers/ports/usb_serial/FTDI.h |   15 +-
src/add-ons/kernel/drivers/ports/usb_serial/KLSI.h |   15 +-
.../kernel/drivers/ports/usb_serial/Prolific.h     |   42 +-
.../drivers/ports/usb_serial/SerialDevice.cpp      |  473 ++--------------
.../kernel/drivers/ports/usb_serial/SerialDevice.h |   12 +
.../kernel/drivers/ports/usb_serial/Silicon.cpp    |    3 +
.../kernel/drivers/ports/usb_serial/Silicon.h      |  146 ++++-

----------------------------------------------------------------------------

diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/FTDI.cpp 
b/src/add-ons/kernel/drivers/ports/usb_serial/FTDI.cpp
index 1d77c60..649975b 100644
--- a/src/add-ons/kernel/drivers/ports/usb_serial/FTDI.cpp
+++ b/src/add-ons/kernel/drivers/ports/usb_serial/FTDI.cpp
@@ -4,10 +4,16 @@
  *
  * Copyright (c) 2003 by Siarzhuk Zharski <imker@xxxxxx>
  * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ *             Alexander von Gluck IV, kallisti5@xxxxxxxxxxx
  */
+
+
 #include "FTDI.h"
 #include "FTDIRegs.h"
 
+
 FTDIDevice::FTDIDevice(usb_device device, uint16 vendorID, uint16 productID,
        const char *description)
        :       SerialDevice(device, vendorID, productID, description),
@@ -46,7 +52,7 @@ FTDIDevice::AddDevice(const usb_configuration_info *config)
                }
 
                if (pipesSet >= 3) {
-                       if (ProductID() == PRODUCT_FTDI_8U100AX)
+                       if (ProductID() == 0x8372) // AU100AX
                                fHeaderLength = 1;
                        else
                                fHeaderLength = 0;
@@ -84,7 +90,8 @@ FTDIDevice::SetLineCoding(usb_cdc_line_coding *lineCoding)
                lineCoding->databits);
 
        int32 rate = 0;
-       if (ProductID() == PRODUCT_FTDI_8U100AX) {
+       if (ProductID() == 0x8372) {
+               // AU100AX
                switch (lineCoding->speed) {
                        case 300: rate = ftdi_sio_b300; break;
                        case 600: rate = ftdi_sio_b600; break;
diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/FTDI.h 
b/src/add-ons/kernel/drivers/ports/usb_serial/FTDI.h
index 05b7cb2..7e32721 100644
--- a/src/add-ons/kernel/drivers/ports/usb_serial/FTDI.h
+++ b/src/add-ons/kernel/drivers/ports/usb_serial/FTDI.h
@@ -4,16 +4,24 @@
  *
  * Copyright (c) 2003 by Siarzhuk Zharski <imker@xxxxxx>
  * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ *             Alexander von Gluck IV, kallisti5@xxxxxxxxxxx
  */
 #ifndef _USB_FTDI_H_
 #define _USB_FTDI_H_
 
+
 #include "SerialDevice.h"
 
+
 /* supported vendor and product ids */
-#define VENDOR_FTDI                            0x0403
-#define PRODUCT_FTDI_8U100AX   0x8372
-#define PRODUCT_FTDI_8U232AM   0x6001
+#define VENDOR_FTDI            0x0403
+
+const usb_serial_device kFTDIDevices[] = {
+       {VENDOR_FTDI, 0x8372, "FTDI 8U100AX serial converter"},
+       {VENDOR_FTDI, 0x6001, "FTDI 8U232AM serial converter"}
+};
 
 #define FTDI_BUFFER_SIZE               64
 
@@ -40,4 +48,5 @@ private:
                uint8                                   fStatusLSR;
 };
 
+
 #endif //_USB_FTDI_H_
diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/KLSI.h 
b/src/add-ons/kernel/drivers/ports/usb_serial/KLSI.h
index bc2dce5..52e1e78 100644
--- a/src/add-ons/kernel/drivers/ports/usb_serial/KLSI.h
+++ b/src/add-ons/kernel/drivers/ports/usb_serial/KLSI.h
@@ -8,13 +8,19 @@
 #ifndef _USB_KLSI_H_
 #define _USB_KLSI_H_
 
+
 #include "SerialDevice.h"
 
+
 /* supported vendor and product ids */
-#define VENDOR_PALM                                    0x0830
-#define VENDOR_KLSI                                    0x05e9
-#define PRODUCT_PALM_CONNECT           0x0080
-#define PRODUCT_KLSI_KL5KUSB105D       0x00c0
+#define VENDOR_PALM            0x0830
+#define VENDOR_KLSI            0x05e9
+
+const usb_serial_device kKLSIDevices[] = {
+       {VENDOR_PALM, 0x0080, "PalmConnect RS232"},
+       {VENDOR_KLSI, 0x00c0, "KLSI KL5KUSB105D"}
+};
+
 
 /* protocol defines */
 #define KLSI_SET_REQUEST                       0x01
@@ -58,4 +64,5 @@ virtual       void                                    
OnWrite(const char *buffer, size_t *numBytes,
 virtual        void                                    OnClose();
 };
 
+
 #endif //_USB_KLSI_H_
diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/Prolific.h 
b/src/add-ons/kernel/drivers/ports/usb_serial/Prolific.h
index 81e6de0..acae254 100644
--- a/src/add-ons/kernel/drivers/ports/usb_serial/Prolific.h
+++ b/src/add-ons/kernel/drivers/ports/usb_serial/Prolific.h
@@ -4,36 +4,43 @@
  *
  * Copyright (c) 2003-2004 by Siarzhuk Zharski <imker@xxxxxx>
  * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ *             Alexander von Gluck IV, kallisti5@xxxxxxxxxxx
  */
 #ifndef _USB_PROLIFIC_H_
 #define _USB_PROLIFIC_H_
 
+
 #include "ACM.h"
 
+
 /* supported vendor and product ids */
 #define VENDOR_PROLIFIC                0x067b
-#define VENDOR_IODATA          0x04bb
 #define VENDOR_ATEN                    0x0557
-#define VENDOR_TDK                     0x04bf
-#define VENDOR_RATOC           0x0584
 #define VENDOR_ELECOM          0x056e
-#define        VENDOR_SOURCENEXT       0x0833
-#define        VENDOR_HAL                      0x0b41
-
-#define PRODUCT_IODATA_USBRSAQ                 0x0a03
-#define PRODUCT_PROLIFIC_RSAQ2                 0x04bb
-#define PRODUCT_ATEN_UC232A                            0x2008
-#define PRODUCT_PROLIFIC_PL2303                        0x2303
-#define PRODUCT_TDK_UHA6400                            0x0117
-#define PRODUCT_RATOC_REXUSB60                 0xb000
-#define PRODUCT_ELECOM_UCSGT                   0x5003
-#define        PRODUCT_SOURCENEXT_KEIKAI8              0x039f
-#define        PRODUCT_SOURCENEXT_KEIKAI8_CHG  0x012e
-#define        PRODUCT_HAL_IMR001                              0x0011
+#define VENDOR_HAL                     0x0b41
+#define VENDOR_IODATA          0x04bb
+#define VENDOR_RATOC           0x0584
+#define VENDOR_SOURCENEXT      0x0833
+#define VENDOR_TDK                     0x04bf
+
+const usb_serial_device kProlificDevices[] = {
+       {VENDOR_PROLIFIC,       0x04bb, "PL2303 Serial adapter (IODATA 
USB-RSAQ2)"},
+       {VENDOR_PROLIFIC,       0x2303, "PL2303 Serial adapter (ATEN/IOGEAR 
UC232A)"},
+       {VENDOR_ATEN,           0x2008, "Aten Serial adapter"},
+       {VENDOR_ELECOM,         0x5003, "Elecom UC-SGT"},
+       {VENDOR_HAL,            0x0011, "HAL Corporation Crossam2+USB"},
+       {VENDOR_IODATA,         0x0a03, "I/O Data USB serial adapter 
USB-RSAQ1"},
+       {VENDOR_RATOC,          0xb000, "Ratoc USB serial adapter REX-USB60"},
+       {VENDOR_SOURCENEXT,     0x039f, "SOURCENEXT KeikaiDenwa 8"},
+       {VENDOR_SOURCENEXT,     0x039f, "SOURCENEXT KeikaiDenwa 8 with 
charger"},
+       {VENDOR_TDK,            0x0117, "TDK USB-PHS Adapter UHA6400"}
+};
+
 
 /* protocol defines */
 #define PROLIFIC_SET_REQUEST   0x01
-
 #define PROLIFIC_BUF_SIZE              256
 
 struct request_item;
@@ -55,4 +62,5 @@ private:
                bool                                    fIsHX;
 };
 
+
 #endif //_USB_PROLIFIC_H_
diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp 
b/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp
index 0d76a31..2d8e62e 100644
--- a/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp
+++ b/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp
@@ -4,7 +4,12 @@
  *
  * Copyright (c) 2003 by Siarzhuk Zharski <imker@xxxxxx>
  * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ *             Alexander von Gluck IV, kallisti5@xxxxxxxxxxx
  */
+
+
 #include <new>
 
 #include "SerialDevice.h"
@@ -714,451 +719,47 @@ SerialDevice *
 SerialDevice::MakeDevice(usb_device device, uint16 vendorID,
        uint16 productID)
 {
-       const char *description = NULL;
-
-       switch (vendorID) {
-               case VENDOR_IODATA:
-               case VENDOR_ATEN:
-               case VENDOR_TDK:
-               case VENDOR_RATOC:
-               case VENDOR_PROLIFIC:
-               case VENDOR_ELECOM:
-               case VENDOR_SOURCENEXT:
-               case VENDOR_HAL:
-               {
-                       switch (productID) {
-                               case PRODUCT_PROLIFIC_RSAQ2:
-                                       description = "PL2303 Serial adapter 
(IODATA USB-RSAQ2)";
-                                       break;
-                               case PRODUCT_IODATA_USBRSAQ:
-                                       description = "I/O Data USB serial 
adapter USB-RSAQ1";
-                                       break;
-                               case PRODUCT_ATEN_UC232A:
-                                       description = "Aten Serial adapter";
-                                       break;
-                               case PRODUCT_TDK_UHA6400:
-                                       description = "TDK USB-PHS Adapter 
UHA6400";
-                                       break;
-                               case PRODUCT_RATOC_REXUSB60:
-                                       description = "Ratoc USB serial adapter 
REX-USB60";
-                                       break;
-                               case PRODUCT_PROLIFIC_PL2303:
-                                       description = "PL2303 Serial adapter 
(ATEN/IOGEAR UC232A)";
-                                       break;
-                               case PRODUCT_ELECOM_UCSGT:
-                                       description = "Elecom UC-SGT";
-                                       break;
-                               case PRODUCT_SOURCENEXT_KEIKAI8:
-                                       description = "SOURCENEXT KeikaiDenwa 
8";
-                                       break;
-                               case PRODUCT_SOURCENEXT_KEIKAI8_CHG:
-                                       description = "SOURCENEXT KeikaiDenwa 8 
with charger";
-                                       break;
-                               case PRODUCT_HAL_IMR001:
-                                       description = "HAL Corporation 
Crossam2+USB";
-                                       break;
-                       }
-
-                       if (description == NULL)
-                               break;
-
-                       return new(std::nothrow) ProlificDevice(device, 
vendorID, productID,
-                               description);
-               }
-
-               case VENDOR_FTDI:
-               {
-                       switch (productID) {
-                               case PRODUCT_FTDI_8U100AX:
-                                       description = "FTDI 8U100AX serial 
converter";
-                                       break;
-                               case PRODUCT_FTDI_8U232AM:
-                                       description = "FTDI 8U232AM serial 
converter";
-                                       break;
-                       }
-
-                       if (description == NULL)
-                               break;
-
-                       return new(std::nothrow) FTDIDevice(device, vendorID, 
productID,
-                               description);
-               }
-
-               case VENDOR_PALM:
-               case VENDOR_KLSI:
-               {
-                       switch (productID) {
-                               case PRODUCT_PALM_CONNECT:
-                                       description = "PalmConnect RS232";
-                                       break;
-                               case PRODUCT_KLSI_KL5KUSB105D:
-                                       description = "KLSI KL5KUSB105D";
-                                       break;
-                       }
-
-                       if (description == NULL)
-                               break;
-
-                       return new(std::nothrow) KLSIDevice(device, vendorID, 
productID,
-                               description);
-               }
-
-               case VENDOR_RENESAS:
-               {
-                       switch (productID) {
-                               case 0x0053:
-                                       description = "Renesas RX610 RX-Stick";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_AKATOM:
-               {
-                       switch (productID) {
-                               case 0x066A:
-                                       description = "AKTAKOM ACE-1001";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_PIRELLI:
-               {
-                       switch (productID) {
-                               case 0xE000:
-                               case 0xE003:
-                                       description = "Pirelli DP-L10 GSM 
Mobile";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_CYPHERLAB:
-               {
-                       switch (productID) {
-                               case 0x1000:
-                                       description = "Cipherlab CCD Barcode 
Scanner";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_GEMALTO:
-               {
-                       switch (productID) {
-                               case 0x5501:
-                                       description = "Gemalto contactless 
smartcard reader";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_DIGIANSWER:
-               {
-                       switch (productID) {
-                               case 0x000A:
-                                       description = "Digianswer ZigBee MAC 
device";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_MEI:
-               {
-                       switch (productID) {
-                               case 0x1100:
-                               case 0x1101:
-                                       description = "MEI Acceptor";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_DYNASTREAM:
-               {
-                       switch (productID) {
-                               case 0x1003:
-                               case 0x1004:
-                               case 0x1006:
-                                       description = "Dynastream ANT 
development board";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_KNOCKOFF:
-               {
-                       switch (productID) {
-                               case 0xAA26:
-                                       description = "Knock-off DCU-11";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
+       // FTDI Serial Device
+       for (uint32 i = 0; i < sizeof(kFTDIDevices)
+               / sizeof(kFTDIDevices[0]); i++) {
+               if (vendorID == kFTDIDevices[i].vendorID
+                       && productID == kFTDIDevices[i].productID) {
+                        return new(std::nothrow) FTDIDevice(device, vendorID, 
productID,
+                               kFTDIDevices[i].deviceName);
                }
-               case VENDOR_SIEMENS:
-               {
-                       switch (productID) {
-                               case 0x10C5:
-                                       description = "Siemens MC60";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_NOKIA:
-               {
-                       switch (productID) {
-                               case 0xAC70:
-                                       description = "Nokia CA-42";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_SILICON:
-               {
-                       switch (productID) {
-                               case 0x0F91:
-                               case 0x1101:
-                               case 0x1601:
-                               case 0x800A:
-                               case 0x803B:
-                               case 0x8044:
-                               case 0x804E:
-                               case 0x8053:
-                               case 0x8054:
-                               case 0x8066:
-                               case 0x806F:
-                               case 0x807A:
-                               case 0x80CA:
-                               case 0x80DD:
-                               case 0x80F6:
-                               case 0x8115:
-                               case 0x813D:
-                               case 0x813F:
-                               case 0x814A:
-                               case 0x814B:
-                               case 0x8156:
-                               case 0x815E:
-                               case 0x818B:
-                               case 0x819F:
-                               case 0x81A6:
-                               case 0x81AC:
-                               case 0x81AD:
-                               case 0x81C8:
-                               case 0x81E2:
-                               case 0x81E7:
-                               case 0x81E8:
-                               case 0x81F2:
-                               case 0x8218:
-                               case 0x822B:
-                               case 0x826B:
-                               case 0x8293:
-                               case 0x82F9:
-                               case 0x8341:
-                               case 0x8382:
-                               case 0x83A8:
-                               case 0x83D8:
-                               case 0x8411:
-                               case 0x8418:
-                               case 0x846E:
-                               case 0x8477:
-                               case 0x85EA:
-                               case 0x85EB:
-                               case 0x8664:
-                               case 0x8665:
-                               case 0xEA60:
-                               case 0xEA61:
-                               case 0xEA71:
-                               case 0xF001:
-                               case 0xF002:
-                               case 0xF003:
-                               case 0xF004:
-                                       description = "Silicon Labs CP210x USB 
UART converter";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_SILICON2:
-               {
-                       switch (productID) {
-                               case 0xEA61:
-                                       description = "Silicon Labs GPRS USB 
Modem";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_SILICON3:
-               {
-                       switch (productID) {
-                               case 0xEA6A:
-                                       description = "Silicon Labs GPRS USB 
Modem 100EU";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_BALTECH:
-               {
-                       switch (productID) {
-                               case 0x9999:
-                                       description = "Balteck card reader";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_OWEN:
-               {
-                       switch (productID) {
-                               case 0x0004:
-                                       description = "Owen AC4 USB-RS485 
Converter";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_CLIPSAL:
-               {
-                       switch (productID) {
-                               case 0x0303:
-                                       description = "Clipsal 5500PCU C-Bus 
USB interface";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_JABLOTRON:
-               {
-                       switch (productID) {
-                               case 0x0001:
-                                       description = "Jablotron serial 
interface";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_WIENER:
-               {
-                       switch (productID) {
-                               case 0x0010:
-                               case 0x0011:
-                               case 0x0012:
-                               case 0x0015:
-                                       description = "W-IE-NE-R Plein & Baus 
GmbH device";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_WAVESENSE:
-               {
-                       switch (productID) {
-                               case 0xAAAA:
-                                       description = "Wavesense Jazz blood 
glucose meter";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_VAISALA:
-               {
-                       switch (productID) {
-                               case 0x0200:
-                                       description = "Vaisala USB instrument";
-                                       break;
-                       }
-
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
-               }
-               case VENDOR_ELV:
-               {
-                       switch (productID) {
-                               case 0xE00F:
-                                       description = "ELV USB I²C interface";
-                                       break;
-                       }
+       }
 
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
+       // KLSI Serial Device
+       for (uint32 i = 0; i < sizeof(kKLSIDevices)
+               / sizeof(kKLSIDevices[0]); i++) {
+               if (vendorID == kKLSIDevices[i].vendorID
+                       && productID == kKLSIDevices[i].productID) {
+                        return new(std::nothrow) KLSIDevice(device, vendorID, 
productID,
+                               kKLSIDevices[i].deviceName);
                }
-               case VENDOR_WAGO:
-               {
-                       switch (productID) {
-                               case 0x07A6:
-                                       description = "WAGO 750-923 USB 
Service";
-                                       break;
-                       }
+       }
 
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
+       // Prolific Serial Device
+       for (uint32 i = 0; i < sizeof(kProlificDevices)
+               / sizeof(kProlificDevices[0]); i++) {
+               if (vendorID == kProlificDevices[i].vendorID
+                       && productID == kProlificDevices[i].productID) {
+                        return new(std::nothrow) ProlificDevice(device, 
vendorID, productID,
+                               kProlificDevices[i].deviceName);
                }
-               case VENDOR_DW700:
-               {
-                       switch (productID) {
-                               case 0x9500:
-                                       description = "DW700 GPS USB interface";
-                                       break;
-                       }
+       }
 
-                       if (description != NULL)
-                               goto SILICON;
-                       break;
+       // Silicon Serial Device
+       for (uint32 i = 0; i < sizeof(kSiliconDevices)
+               / sizeof(kSiliconDevices[0]); i++) {
+               if (vendorID == kSiliconDevices[i].vendorID
+                       && productID == kSiliconDevices[i].productID) {
+                        return new(std::nothrow) SiliconDevice(device, 
vendorID, productID,
+                               kSiliconDevices[i].deviceName);
                }
-
-SILICON:
-               return new(std::nothrow) SiliconDevice(device, vendorID, 
productID,
-                       description);
        }
 
+       // Otherwise, return standard ACM device
        return new(std::nothrow) ACMDevice(device, vendorID, productID,
                "CDC ACM compatible device");
 }
diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.h 
b/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.h
index e27ecdd..57afc10 100644
--- a/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.h
+++ b/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.h
@@ -4,12 +4,24 @@
  *
  * Copyright (c) 2003 by Siarzhuk Zharski <imker@xxxxxx>
  * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ *             Alexander von Gluck IV, kallisti5@xxxxxxxxxxx
  */
 #ifndef _USB_DEVICE_H_
 #define _USB_DEVICE_H_
 
+
 #include "Driver.h"
 
+
+struct usb_serial_device {
+       uint32      vendorID;
+       uint32      productID;
+       const char* deviceName;
+};
+
+
 class SerialDevice {
 public:
                                                                
SerialDevice(usb_device device,
diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/Silicon.cpp 
b/src/add-ons/kernel/drivers/ports/usb_serial/Silicon.cpp
index 5f3a33e..f902302 100644
--- a/src/add-ons/kernel/drivers/ports/usb_serial/Silicon.cpp
+++ b/src/add-ons/kernel/drivers/ports/usb_serial/Silicon.cpp
@@ -1,6 +1,9 @@
 /*
  * Copyright 2011, Adrien Destugues <pulkomandy@xxxxxxxxxxxxxxxxx>
  * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ *             Alexander von Gluck IV, kallisti5@xxxxxxxxxxx
  */
 
 
diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/Silicon.h 
b/src/add-ons/kernel/drivers/ports/usb_serial/Silicon.h
index 3c1897d..e12916b 100644
--- a/src/add-ons/kernel/drivers/ports/usb_serial/Silicon.h
+++ b/src/add-ons/kernel/drivers/ports/usb_serial/Silicon.h
@@ -1,12 +1,133 @@
 /*
  * Copyright 2011, Adrien Destugues <pulkomandy@xxxxxxxxxxxxxxxxx>
  * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ *             Alexander von Gluck IV, kallisti5@xxxxxxxxxxx
  */
 #ifndef _USB_SILICON_H_
 #define _USB_SILICON_H_
 
+
 #include "SerialDevice.h"
 
+
+/* supported vendor and product ids */
+#define VENDOR_RENESAS         0x045B
+#define VENDOR_AKATOM          0x0471
+#define VENDOR_PIRELLI         0x0489
+#define VENDOR_CYPHERLAB       0x0745
+#define VENDOR_GEMALTO         0x08E6
+#define VENDOR_DIGIANSWER      0x08FD
+#define VENDOR_MEI                     0x0BED
+#define VENDOR_DYNASTREAM      0x0FCF
+#define VENDOR_KNOCKOFF                0x10A6
+#define VENDOR_SIEMENS         0x10AB
+#define VENDOR_NOKIA           0x10B5
+#define VENDOR_SILICON         0x10C4
+#define VENDOR_SILICON2                0x10C5
+#define VENDOR_SILICON3                0x10CE
+#define VENDOR_BALTECH         0x13AD
+#define VENDOR_OWEN                    0x1555
+#define VENDOR_CLIPSAL         0x166A
+#define VENDOR_JABLOTRON       0x16D6
+#define VENDOR_WIENER          0x16DC
+#define VENDOR_WAVESENSE       0x17F4
+#define VENDOR_VAISALA         0x1843
+#define VENDOR_ELV                     0x18EF
+#define VENDOR_WAGO                    0x1BE3
+#define VENDOR_DW700           0x413C
+
+const usb_serial_device kSiliconDevices[] = {
+       {VENDOR_RENESAS,        0x0053, "Renesas RX610 RX-Stick"},
+       {VENDOR_AKATOM,         0x066A, "AKTAKOM ACE-1001"},
+       {VENDOR_PIRELLI,        0xE000, "Pirelli DP-L10 GSM Mobile"},
+       {VENDOR_PIRELLI,        0xE003, "Pirelli DP-L10 GSM Mobile"},
+       {VENDOR_CYPHERLAB,      0x1000, "Cipherlab CCD Barcode Scanner"},
+       {VENDOR_GEMALTO,        0x5501, "Gemalto contactless smartcard reader"},
+       {VENDOR_DIGIANSWER,     0x000A, "Digianswer ZigBee MAC device"},
+       {VENDOR_MEI,            0x1100, "MEI Acceptor"},
+       {VENDOR_MEI,            0x1101, "MEI Acceptor"},
+       {VENDOR_DYNASTREAM,     0x1003, "Dynastream ANT development board"},
+       {VENDOR_DYNASTREAM,     0x1004, "Dynastream ANT development board"},
+       {VENDOR_DYNASTREAM,     0x1006, "Dynastream ANT development board"},
+       {VENDOR_KNOCKOFF,       0xAA26, "Knock-off DCU-11"},
+       {VENDOR_SIEMENS,        0x10C5, "Siemens MC60"},
+       {VENDOR_NOKIA,          0xAC70, "Nokia CA-42"},
+       {VENDOR_BALTECH,        0x9999, "Balteck card reader"},
+       {VENDOR_OWEN,           0x0004, "Owen AC4 USB-RS485 Converter"},
+       {VENDOR_CLIPSAL,        0x0303, "Clipsal 5500PCU C-Bus USB interface"},
+       {VENDOR_JABLOTRON,      0x0001, "Jablotron serial interface"},
+       {VENDOR_WIENER,         0x0010, "W-IE-NE-R Plein & Baus GmbH device"},
+       {VENDOR_WIENER,         0x0011, "W-IE-NE-R Plein & Baus GmbH device"},
+       {VENDOR_WIENER,         0x0012, "W-IE-NE-R Plein & Baus GmbH device"},
+       {VENDOR_WIENER,         0x0015, "W-IE-NE-R Plein & Baus GmbH device"},
+       {VENDOR_WAVESENSE,      0xAAAA, "Wavesense Jazz blood glucose meter"},
+       {VENDOR_VAISALA,        0x0200, "Vaisala USB instrument"},
+       {VENDOR_ELV,            0xE00F, "ELV USB I²C interface"},
+       {VENDOR_WAGO,           0x07A6, "WAGO 750-923 USB Service"},
+       {VENDOR_DW700,          0x9500, "DW700 GPS USB interface"},
+       {VENDOR_SILICON,        0x0F91, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x1101, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x1601, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x800A, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x803B, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8044, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x804E, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8053, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8054, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8066, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x806F, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x807A, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x80CA, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x80DD, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x80F6, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8115, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x813D, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x813F, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x814A, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x814B, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8156, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x815E, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x818B, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x819F, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x81A6, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x81AC, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x81AD, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x81C8, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x81E2, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x81E7, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x81E8, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x81F2, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8218, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x822B, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x826B, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8293, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x82F9, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8341, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8382, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x83A8, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x83D8, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8411, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8418, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x846E, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8477, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x85EA, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x85EB, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8664, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0x8665, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0xEA60, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0xEA61, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0xEA71, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0xF001, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0xF002, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0xF003, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON,        0xF004, "Silicon Labs CP210x USB UART 
converter"},
+       {VENDOR_SILICON2,       0xEA61, "Silicon Labs GPRS USB Modem"},
+       {VENDOR_SILICON3,       0xEA6A, "Silicon Labs GPRS USB Modem 100EU"}
+};
+
+
 class SiliconDevice : public SerialDevice {
 public:
                                        SiliconDevice(usb_device device, uint16 
vendorID,
@@ -98,30 +219,5 @@ status_t                    WriteConfig(CP210XRequest 
request, uint16_t* data,
                                                size_t size);
 };
 
-#define VENDOR_RENESAS         0x045B
-#define VENDOR_AKATOM          0x0471
-#define VENDOR_PIRELLI         0x0489
-#define VENDOR_CYPHERLAB       0x0745
-#define VENDOR_GEMALTO         0x08E6
-#define VENDOR_DIGIANSWER      0x08FD
-#define VENDOR_MEI                     0x0BED
-#define VENDOR_DYNASTREAM      0x0FCF
-#define VENDOR_KNOCKOFF                0x10A6
-#define VENDOR_SIEMENS         0x10AB
-#define VENDOR_NOKIA           0x10B5
-#define VENDOR_SILICON         0x10C4
-#define VENDOR_SILICON2                0x10C5
-#define VENDOR_SILICON3                0x10CE
-#define VENDOR_BALTECH         0x13AD
-#define VENDOR_OWEN                    0x1555
-#define VENDOR_CLIPSAL         0x166A
-#define VENDOR_JABLOTRON       0x16D6
-#define VENDOR_WIENER          0x16DC
-#define VENDOR_WAVESENSE       0x17F4
-#define VENDOR_VAISALA         0x1843
-#define VENDOR_ELV                     0x18EF
-#define VENDOR_WAGO                    0x1BE3
-#define VENDOR_DW700           0x413C
-
 
 #endif //_USB_SILICON_H_


Other related posts: