Created attachment 218017 [details] Winbond CDC device ID The Tenma 72-2635 bench top supply has a USB CDC interface with vendor 0x0416 product 0x5011. With the attached patch I can connect to and control it. I'm not sure what the name should be though.
Could you also dump the USB device descriptor of this device using: usbconfig -d ugenX.Y dump_device_desc Thank you! Patch looks good! --HPS
Hmm I plugged this into a different system (12.0-RELEASE) and it worked out of the box with umodem, so perhaps there is a regression. Requested output: ugen0.4: <vendor 0x0416 USB Virtual COM> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA) bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0200 bDeviceClass = 0x0002 <Communication device> bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0040 idVendor = 0x0416 idProduct = 0x5011 bcdDevice = 0x0300 iManufacturer = 0x0001 <retrieving string failed> iProduct = 0x0002 <USB Virtual COM> iSerialNumber = 0x0003 <NT2009101400> bNumConfigurations = 0x0001
Also, I just realised I said I wrote the patch on FreeBSD 12.2-BETA1 but it was actually -CURRENT (20200827 r364846).
*** Bug 249385 has been marked as a duplicate of this bug. ***
I've attached a patch for the port. I also filed a bug upstream (https://gitlab.freedesktop.org/xorg/driver/xf86-video-ast/-/issues/5) and notified ASPEED via email but I have no idea how responsive either of those will be.
(In reply to darius from comment #5) Oops I replied to the wrong bug..
I checked again and it works out of the box on 12 but not 13. When I plug it in under 13 I get the following: usb_alloc_device: Failure selecting configuration index 0:USB_ERR_IOERROR, port 11, addr 6 (ignored) ugen0.3: <vendor 0x0416 product 0x5011> at usbus0 If I use usbconfig to set the configuration index it works with the unmodified umodem.ko. Note that I don't see the IO error when running usbconfig, only when I first plug the device in. ie I guess my patch is not needed but it indicates a regression in the USB stack from 12 to 13.
I built from git intending to do a bisect to find the problem but HEAD works: FreeBSD maarsytest.gsoft.com.au 13.0-CURRENT FreeBSD 13.0-CURRENT #0 e48e67dde88-c271644(master): Fri Sep 18 06:55:14 UTC 2020 radar@maarsytest.gsoft.com.au:/usr/obj/local0/tmp/freebsd/amd64.amd64/sys/GENERIC amd64
> ie I guess my patch is not needed but it indicates a regression in the USB stack from 12 to 13. There are similar devices which need a small delay before the configuration index can be selected. Can you try to patch sys/dev/usb/ 's usb_error_t usbd_set_config_index(struct usb_device *udev, uint8_t index) and just add: pause("W", hz); in the beginning? --HPS
A commit references this bug: Author: hselasky Date: Mon Sep 21 18:32:57 UTC 2020 New revision: 365966 URL: https://svnweb.freebsd.org/changeset/base/365966 Log: Add support for Winbond USB CDC modem device found in Tenma power supply. PR: 249384 MFC after: 1 week Submitted by: darius@dons.net.au Sponsored by: Mellanox Technologies // NVIDIA Networking Changes: head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/usbdevs
A commit references this bug: Author: hselasky Date: Tue Oct 20 08:12:35 UTC 2020 New revision: 366874 URL: https://svnweb.freebsd.org/changeset/base/366874 Log: MFC r365966: Add support for Winbond USB CDC modem device found in Tenma power supply. PR: 249384 Submitted by: darius@dons.net.au Sponsored by: Mellanox Technologies // NVIDIA Networking Changes: _U stable/12/ stable/12/sys/dev/usb/serial/umodem.c stable/12/sys/dev/usb/usbdevs
A commit references this bug: Author: hselasky Date: Tue Oct 20 08:13:15 UTC 2020 New revision: 366875 URL: https://svnweb.freebsd.org/changeset/base/366875 Log: MFC r365966: Add support for Winbond USB CDC modem device found in Tenma power supply. PR: 249384 Submitted by: darius@dons.net.au Sponsored by: Mellanox Technologies // NVIDIA Networking Changes: _U stable/11/ stable/11/sys/dev/usb/serial/umodem.c stable/11/sys/dev/usb/usbdevs