Date: Wed, 11 Nov 2015 16:28:28 -0500 From: Burton Sampley <bsmply@gmail.com> To: Hans Petter Selasky <hps@selasky.org> Cc: freebsd-usb@freebsd.org Subject: Re: How to access a FTDI usb device with a custom vendor and product id's Message-ID: <CANV5k3pCx%2B3za1aPi=u5o36EvicgMgODL=eiTz-_s=nZLqbbAQ@mail.gmail.com> In-Reply-To: <56422764.4040307@selasky.org> References: <CANV5k3rW62rGoXKD4m5meegEJ04T4b_v=QGCqBV5wuGxZjzCbg@mail.gmail.com> <56421DFD.6070503@selasky.org> <CANV5k3oRPP_-_SBz2fih0tA12BzoO9Ua%2BAfJGaE_CCNE3JzpHQ@mail.gmail.com> <564222D8.6020900@selasky.org> <CANV5k3qzn1UU=qvczGXUr3HQhxf0H8emKSV2XBDD%2B%2BfDr1yfjg@mail.gmail.com> <56422764.4040307@selasky.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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) } ^ <scratch space>: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) } ^ <scratch space>: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 <hps@selasky.org> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANV5k3pCx%2B3za1aPi=u5o36EvicgMgODL=eiTz-_s=nZLqbbAQ>