Module Name: src Committed By: thorpej Date: Thu Apr 25 01:33:04 UTC 2024
Modified Files: src/sys/dev/usb: uftdi.c Log Message: Add a match quirk to prevent matching any interface on SiPEED FPGA development boards (e.g. Tang Nano 9K). The FT2232s on these boards are wired up only for JTAG. To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/dev/usb/uftdi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/uftdi.c diff -u src/sys/dev/usb/uftdi.c:1.78 src/sys/dev/usb/uftdi.c:1.79 --- src/sys/dev/usb/uftdi.c:1.78 Wed Apr 17 02:34:45 2024 +++ src/sys/dev/usb/uftdi.c Thu Apr 25 01:33:03 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: uftdi.c,v 1.78 2024/04/17 02:34:45 maya Exp $ */ +/* $NetBSD: uftdi.c,v 1.79 2024/04/25 01:33:03 thorpej Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.78 2024/04/17 02:34:45 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uftdi.c,v 1.79 2024/04/25 01:33:03 thorpej Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -229,7 +229,19 @@ static const struct uftdi_match_quirk_en .vendor_str = "SecuringHardware.com", .product_str = "Tigard V1.1", .match_ret = UMATCH_NONE, - } + }, + /* + * The SiPEED Tang Nano 9K (and other SiPEED Tang FPGA development + * boards) have an FT2232 on-board, wired up only for JTAG. + */ + { + .vendor_id = USB_VENDOR_FTDI, + .product_id = USB_PRODUCT_FTDI_SERIAL_2232C, + .iface_no = -1, + .vendor_str = "SIPEED", + .product_str = "JTAG Debugger", + .match_ret = UMATCH_NONE, + }, }; static int @@ -243,7 +255,7 @@ uftdi_quirk_match(struct usbif_attach_ar q = &uftdi_match_quirks[i]; if (uiaa->uiaa_vendor != q->vendor_id || uiaa->uiaa_product != q->product_id || - uiaa->uiaa_ifaceno != q->iface_no) { + (q->iface_no != -1 && uiaa->uiaa_ifaceno != q->iface_no)) { continue; } if (q->vendor_str != NULL &&