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
This commit is contained in:
Andriy Gapon 2018-05-21 20:57:14 +00:00
parent b554075d14
commit d759c295c1

View File

@ -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;