From d759c295c1f4bae0e2f538f8b596054f041cf4f9 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Mon, 21 May 2018 20:57:14 +0000 Subject: [PATCH] uchcom: report detected product based on USB product ID Product IDs are specified in vendor documents. The previously used device ID is not. This is a cosmetic change. No functionality depends on those IDs. Reviewed by: hselasky MFC after: 2 weeks --- sys/dev/usb/serial/uchcom.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/dev/usb/serial/uchcom.c b/sys/dev/usb/serial/uchcom.c index 42baecf5d641..178b25a3ad6f 100644 --- a/sys/dev/usb/serial/uchcom.c +++ b/sys/dev/usb/serial/uchcom.c @@ -322,13 +322,17 @@ uchcom_attach(device_t dev) sc->sc_udev = uaa->device; - switch (uaa->info.bcdDevice) { - case UCHCOM_REV_CH340: + switch (uaa->info.idProduct) { + case USB_PRODUCT_WCH2_CH341SER: device_printf(dev, "CH340 detected\n"); break; - default: + case USB_PRODUCT_WCH2_CH341SER_2: device_printf(dev, "CH341 detected\n"); break; + default: + device_printf(dev, "New CH340/CH341 product 0x%04x detected\n", + uaa->info.idProduct); + break; } iface_index = UCHCOM_IFACE_INDEX;