From 4e4909aea6b462832c9a2419e859caa7a88a9312 Mon Sep 17 00:00:00 2001 From: avg 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;