> Date: Wed, 24 Aug 2022 00:57:40 +1000
> From: Jonathan Gray <[email protected]>
> 
> On Tue, Aug 23, 2022 at 08:24:24AM -0600, Theo de Raadt wrote:
> > Jonathan Gray <[email protected]> wrote:
> > 
> > > > 
> > > > I could recompile and see the device listed as ugen(4):
> > > > 
> > > >   $ dmesg | grep pico-debug
> > > >   ugen1 at uhub4 port 2 "pico-debug CMSIS-DAP" rev 1.10/10.05 addr 2
> > > 
> > > "Peter Lawrence CMSIS-DAP Dapper Miser" is a rather large string
> > > especially as the device already provides one
> > > 
> > > why not just "pico-debug" or "Dapper Miser"?
> > 
> > 
> > I've been wondering about this for a while.
> > 
> > 
> > All of these strings go into all kernels, using memory.  If we know a
> > device provides a name, we always print the device-provided name, right?
> > Can we therefore skip the name entirely in usbdevs, or is usbdevs too dumb
> > to handle empty names?
> 
> Index: usbdevs
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/usbdevs,v
> retrieving revision 1.747
> diff -u -p -r1.747 usbdevs
> --- usbdevs   23 Jun 2022 00:31:37 -0000      1.747
> +++ usbdevs   23 Aug 2022 14:39:28 -0000
> @@ -2432,6 +2432,7 @@ product INTEL2 RMH_8            0x800a  Rate Matchi
>  product INTERBIO IOBOARD     0x1002  IO Board
>  product INTERBIO MINIIOBOARD 0x1003  Mini IO Board
>  product INTERBIO MINIIOBOARD2        0x1006  Mini IO Board
> +product INTERBIO DAPPERMISER 0x2488

If we do this, we probably still want to provide a product name as a
comment.

>  /* Intersil products */
>  product      INTERSIL PRISM_GT       0x1000  PrismGT USB 2.0 WLAN
> 
> results in a usbdevs_data.h entry of
> 
>       {
>           USB_VENDOR_INTERBIO, USB_PRODUCT_INTERBIO_DAPPERMISER,
>           "",
>       },
> 
> reading usb_subr.c usbd_cache_devinfo() that should work
> 
> though if the device doesn't provide a string and we don't either
> we will print "" instead of "product 0x0x2488"
> 
> 

Reply via email to