From owner-freebsd-usb@freebsd.org Wed Nov 11 21:28:29 2015 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 770BBA2C001 for ; Wed, 11 Nov 2015 21:28:29 +0000 (UTC) (envelope-from bsmply@gmail.com) Received: from mail-oi0-x230.google.com (mail-oi0-x230.google.com [IPv6:2607:f8b0:4003:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BCDB120F for ; Wed, 11 Nov 2015 21:28:29 +0000 (UTC) (envelope-from bsmply@gmail.com) Received: by oige206 with SMTP id e206so22699018oig.2 for ; Wed, 11 Nov 2015 13:28:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=vUf++EurUfP3r/v2gCHJls6vZaudP9L96xgu/ly1XT4=; b=ThiUh1jkyAUTM2u6GouEARahDeSPdOmYYyiWj6P3C/80K7+MXXWYSbLGwtUjvWAszg jp7mCsoMpvylt72ofYjmX6rio6m9rSmuXaTftlFvKmgeUXg6bIX79/N/NjAubXdigalV 3PVeSXbhU2uyQ8Hni/YURTDwxv8gwYahrFIJWyrgIDKMUFXPHM+UNmcjQCjWi/yzg9gT Jtiz9JsSv8C6P+9SuwrRbjWtH3i67K92pKdpHESwp6WOoMpFFKDrl1LZqOgiWUJ1ho2+ 1CrtFKGL2eDK9vhOq1Nc0O3HIw/7biTdBJYS6x3AZdmBX3pR8MMjHbnlkDUxi94fMszY Qq4Q== MIME-Version: 1.0 X-Received: by 10.202.108.79 with SMTP id h76mr6400518oic.47.1447277308570; Wed, 11 Nov 2015 13:28:28 -0800 (PST) Received: by 10.76.44.145 with HTTP; Wed, 11 Nov 2015 13:28:28 -0800 (PST) In-Reply-To: <56422764.4040307@selasky.org> References: <56421DFD.6070503@selasky.org> <564222D8.6020900@selasky.org> <56422764.4040307@selasky.org> Date: Wed, 11 Nov 2015 16:28:28 -0500 Message-ID: Subject: Re: How to access a FTDI usb device with a custom vendor and product id's From: Burton Sampley To: Hans Petter Selasky Cc: freebsd-usb@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 21:28:29 -0000 I added a line to the table, but it seems to have failed since I used the VID# instead of the VID# name. Where are the VID names mapped to the VID#'s? Apparently, I know enough about coding to be dangerous. I'll do some more digging to try to fix my own error. Here's a diff of the original source and my modified source: [/usr/src/sys/dev/usb/serial]$ /usr/bin/diff ./uftdi.c ./uftdi.c.ORIG 914d913 < UFTDI_DEV(2100, 9e56, 0), [/usr/src/sys/dev/usb/serial]$ Here's the compile splattage: ===> usb/uftdi (all) cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/src/sys/GENERIC/opt_global.h -I. -I@ -I@/contrib/altq -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/obj/usr/src/sys/GENERIC -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -gdwarf-2 -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -c /usr/src/sys/modules/usb/uftdi/../../../dev/usb/serial/uftdi.c -o uftdi.o /usr/src/sys/modules/usb/uftdi/../../../dev/usb/serial/uftdi.c:914:2: error: use of undeclared identifier 'USB_VENDOR_2100' UFTDI_DEV(2100, 9e56, 0), ^ /usr/src/sys/modules/usb/uftdi/../../../dev/usb/serial/uftdi.c:275:13: note: expanded from macro 'UFTDI_DEV' { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } ^ :167:1: note: expanded from here USB_VENDOR_2100 ^ @/dev/usb/usbdi.h:332:14: note: expanded from macro 'USB_VPI' USB_VENDOR(vend), USB_PRODUCT(prod), USB_DRIVER_INFO(info) ^ @/dev/usb/usbdi.h:323:40: note: expanded from macro 'USB_VENDOR' .match_flag_vendor = 1, .idVendor = (vend) ^ /usr/src/sys/modules/usb/uftdi/../../../dev/usb/serial/uftdi.c:914:2: error: use of undeclared identifier 'USB_PRODUCT_2100_9e56' /usr/src/sys/modules/usb/uftdi/../../../dev/usb/serial/uftdi.c:275:29: note: expanded from macro 'UFTDI_DEV' { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } ^ :170:1: note: expanded from here USB_PRODUCT_2100_9e56 ^ @/dev/usb/usbdi.h:332:33: note: expanded from macro 'USB_VPI' USB_VENDOR(vend), USB_PRODUCT(prod), USB_DRIVER_INFO(info) ^ @/dev/usb/usbdi.h:326:42: note: expanded from macro 'USB_PRODUCT' .match_flag_product = 1, .idProduct = (prod) ^ /usr/src/sys/modules/usb/uftdi/../../../dev/usb/serial/uftdi.c:1067:48: error: invalid application of 'sizeof' to an incomplete type 'const struct usb_device_id []' id = usbd_lookup_id_by_info(uftdi_devs, sizeof(uftdi_devs), ^~~~~~~~~~~~ 3 errors generated. *** Error code 1 Stop. make[5]: stopped in /usr/src/sys/modules/usb/uftdi *** Error code 1 Stop. make[4]: stopped in /usr/src/sys/modules/usb *** Error code 1 Stop. make[3]: stopped in /usr/src/sys/modules *** Error code 1 Stop. make[2]: stopped in /usr/obj/usr/src/sys/GENERIC *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. make: stopped in /usr/src [/usr/src]$ On Tue, Nov 10, 2015 at 12:20 PM, Hans Petter Selasky wrote: > On 11/10/15 18:14, Burton Sampley wrote: > >> Thank you. I do not have the kernel source on this system, so I will need >> to setup the kernel source, then modify the table in uftdi.c with the >> custom entries, then recompile the module and reload it. It may take some >> time for me to complete these actions. Should I report back to this email >> list if this solution resolves my problem? >> > > Hi, > > Please keep us updated. Nice to hear some success stories too ;-) > > And also there is #bsdusb on EF-net. > > --HPS > -- Your mind is like a parachute, it works much better when it is open.