Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Stop potential misuse of vendor names and USB vendor IDs...



details:   https://anonhg.NetBSD.org/src/rev/fc3aa07984e5
branches:  trunk
changeset: 321903:fc3aa07984e5
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Mon Apr 09 16:21:09 2018 +0000

description:
Stop potential misuse of vendor names and USB vendor IDs in root hub
device and string descriptors.

Firstly: Few vendors have identical PCI-SIG vendor IDs and USB-IF vendor
IDs.  As such, using the PCI vendor ID as a USB vendor ID may trample
on whomever is allocated that USB vendor ID.

Secondly: The vendor of the host controller hardware implementation has
little to nothing to do with our usbroothub implementation.  Thus we
should not potentially associate any problems therewith to such third
party.

This change will result in root hubs being identified by USB Vendor ID
0x0000.  Root hub vendor string will now be "NetBSD" (or, specifically:
ostype). Product ID (0x0000) and product strings remain unchanged.

diffstat:

 sys/arch/arm/at91/at91ohci.c              |   8 +++-----
 sys/arch/arm/broadcom/bcm53xx_usb.c       |  10 +---------
 sys/arch/arm/ep93xx/epohci.c              |   6 ++----
 sys/arch/arm/gemini/obio_ehci.c           |  10 ++--------
 sys/arch/arm/imx/imxusb.c                 |   7 ++-----
 sys/arch/arm/nvidia/tegra_ehci.c          |   6 ++----
 sys/arch/arm/omap/obio_ohci.c             |   7 +++----
 sys/arch/arm/omap/omap3_ehci.c            |   8 ++------
 sys/arch/arm/omap/omapl1x_ohci.c          |   4 +---
 sys/arch/arm/s3c2xx0/ohci_s3c24x0.c       |   6 ++----
 sys/arch/arm/samsung/exynos_ehci.c        |   5 ++---
 sys/arch/arm/sunxi/sunxi_musb.c           |   5 ++---
 sys/arch/arm/xscale/pxa2x0_ohci.c         |   3 +--
 sys/arch/arm/zynq/zynq_usb.c              |   7 ++-----
 sys/arch/i386/pci/gcscehci.c              |   9 ++-------
 sys/arch/mips/adm5120/dev/ahci.c          |  21 +++++----------------
 sys/arch/mips/cavium/dev/octeon_usbcvar.h |   5 +----
 sys/arch/mips/ingenic/ingenic_ehci.c      |   6 ++----
 sys/arch/mips/ingenic/ingenic_ohci.c      |   7 ++-----
 sys/arch/mips/ralink/ralink_ehci.c        |   8 ++------
 sys/arch/mips/ralink/ralink_ohci.c        |   8 ++------
 sys/dev/cardbus/ehci_cardbus.c            |   9 ++-------
 sys/dev/cardbus/ohci_cardbus.c            |   9 ++-------
 sys/dev/cardbus/uhci_cardbus.c            |   9 ++-------
 sys/dev/fdt/ehci_fdt.c                    |   6 ++----
 sys/dev/fdt/ohci_fdt.c                    |   6 ++----
 sys/dev/ic/sl811hs.c                      |  14 ++++----------
 sys/dev/marvell/ehci_mv.c                 |   7 ++-----
 sys/dev/pci/ehci_pci.c                    |  10 +++-------
 sys/dev/pci/ohci_pci.c                    |   8 ++------
 sys/dev/pci/uhci_pci.c                    |   8 ++------
 sys/dev/pci/xhci_pci.c                    |   9 ++-------
 sys/dev/usb/ehci.c                        |  17 ++---------------
 sys/dev/usb/ehcivar.h                     |   5 +----
 sys/dev/usb/motg.c                        |  19 ++-----------------
 sys/dev/usb/motgvar.h                     |   5 +----
 sys/dev/usb/ohci.c                        |  17 ++---------------
 sys/dev/usb/ohcivar.h                     |   5 +----
 sys/dev/usb/uhci.c                        |  17 ++---------------
 sys/dev/usb/uhcivar.h                     |   5 +----
 sys/dev/usb/xhci.c                        |  16 ++--------------
 sys/dev/usb/xhcivar.h                     |   5 +----
 sys/external/bsd/dwc2/dwc2.c              |   8 ++------
 43 files changed, 85 insertions(+), 285 deletions(-)

diffs (truncated from 1273 to 300 lines):

diff -r f90beb0893bf -r fc3aa07984e5 sys/arch/arm/at91/at91ohci.c
--- a/sys/arch/arm/at91/at91ohci.c      Mon Apr 09 16:21:05 2018 +0000
+++ b/sys/arch/arm/at91/at91ohci.c      Mon Apr 09 16:21:09 2018 +0000
@@ -1,5 +1,5 @@
-/*     $Id: at91ohci.c,v 1.6 2016/04/23 10:15:27 skrll Exp $   */
-/*     $NetBSD: at91ohci.c,v 1.6 2016/04/23 10:15:27 skrll Exp $       */
+/*     $Id: at91ohci.c,v 1.7 2018/04/09 16:21:09 jakllsch Exp $        */
+/*     $NetBSD: at91ohci.c,v 1.7 2018/04/09 16:21:09 jakllsch Exp $    */
 
 /*-
  * Copyright (c) 2007 Embedtronics Oy.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at91ohci.c,v 1.6 2016/04/23 10:15:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91ohci.c,v 1.7 2018/04/09 16:21:09 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -126,8 +126,6 @@
        bus_space_write_4(sc->sc.iot, sc->sc.ioh, OHCI_INTERRUPT_DISABLE,
                          OHCI_ALL_INTRS);
 
-       strlcpy(sc->sc.sc_vendor, "Atmel", sizeof sc->sc.sc_vendor);
-
        sc->sc_ih = at91_intr_establish(sc->sc_pid, IPL_USB, INTR_HIGH_LEVEL, ohci_intr, sc);
        int err = ohci_init(&sc->sc);
 
diff -r f90beb0893bf -r fc3aa07984e5 sys/arch/arm/broadcom/bcm53xx_usb.c
--- a/sys/arch/arm/broadcom/bcm53xx_usb.c       Mon Apr 09 16:21:05 2018 +0000
+++ b/sys/arch/arm/broadcom/bcm53xx_usb.c       Mon Apr 09 16:21:09 2018 +0000
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: bcm53xx_usb.c,v 1.7 2016/04/23 10:15:27 skrll Exp $");
+__KERNEL_RCSID(1, "$NetBSD: bcm53xx_usb.c,v 1.8 2018/04/09 16:21:09 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -54,8 +54,6 @@
 #include <dev/usb/ehcireg.h>
 #include <dev/usb/ehcivar.h>
 
-#include <dev/pci/pcidevs.h>
-
 struct bcmusb_softc {
        device_t usbsc_dev;
        bus_dma_tag_t usbsc_dmat;
@@ -116,9 +114,6 @@
        sc->sc_bus.ub_dmatag = usbaa->usbaa_dmat;
        sc->sc_bus.ub_hcpriv = sc;
 
-       sc->sc_id_vendor = PCI_VENDOR_BROADCOM;
-       strlcpy(sc->sc_vendor, "Broadcom", sizeof(sc->sc_vendor));
-
        aprint_naive(": OHCI USB controller\n");
        aprint_normal(": OHCI USB controller\n");
 
@@ -176,9 +171,6 @@
                sc->sc_comps[sc->sc_ncomp++] = usbsc->usbsc_ohci_dev;
        }
 
-       sc->sc_id_vendor = PCI_VENDOR_BROADCOM;
-       strlcpy(sc->sc_vendor, "Broadcom", sizeof(sc->sc_vendor));
-
        aprint_naive(": EHCI USB controller\n");
        aprint_normal(": ECHI USB controller\n");
 
diff -r f90beb0893bf -r fc3aa07984e5 sys/arch/arm/ep93xx/epohci.c
--- a/sys/arch/arm/ep93xx/epohci.c      Mon Apr 09 16:21:05 2018 +0000
+++ b/sys/arch/arm/ep93xx/epohci.c      Mon Apr 09 16:21:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: epohci.c,v 1.8 2016/04/23 10:15:28 skrll Exp $ */
+/*     $NetBSD: epohci.c,v 1.9 2018/04/09 16:21:09 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2004 Jesse Off
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: epohci.c,v 1.8 2016/04/23 10:15:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epohci.c,v 1.9 2018/04/09 16:21:09 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -140,8 +140,6 @@
        bus_space_write_4(sc->sc.iot, sc->sc.ioh, OHCI_INTERRUPT_DISABLE,
                          OHCI_ALL_INTRS);
 
-       strlcpy(sc->sc.sc_vendor, "Cirrus Logic", sizeof sc->sc.sc_vendor);
-
        sc->sc_ih = ep93xx_intr_establish(sc->sc_intr, IPL_USB,
                ohci_intr, sc);
        int err = ohci_init(&sc->sc);
diff -r f90beb0893bf -r fc3aa07984e5 sys/arch/arm/gemini/obio_ehci.c
--- a/sys/arch/arm/gemini/obio_ehci.c   Mon Apr 09 16:21:05 2018 +0000
+++ b/sys/arch/arm/gemini/obio_ehci.c   Mon Apr 09 16:21:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: obio_ehci.c,v 1.4 2016/04/23 10:15:28 skrll Exp $      */
+/*     $NetBSD: obio_ehci.c,v 1.5 2018/04/09 16:21:09 jakllsch Exp $   */
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio_ehci.c,v 1.4 2016/04/23 10:15:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio_ehci.c,v 1.5 2018/04/09 16:21:09 jakllsch Exp $");
 
 #include "locators.h"
 
@@ -46,8 +46,6 @@
 #include <arm/gemini/gemini_reg.h>
 #include <arm/gemini/gemini_obiovar.h>
 
-#include <dev/pci/pcidevs.h>
-
 #include <dev/usb/usb.h>
 #include <dev/usb/usbdi.h>
 #include <dev/usb/usbdivar.h>
@@ -132,10 +130,6 @@
 
        sc->sc_bus.ub_revision = USBREV_2_0;
 
-       /* Figure out vendor for root hub descriptor. */
-       sc->sc_id_vendor = PCI_VENDOR_FARADAY;
-       strlcpy(sc->sc_vendor, "SL351x", sizeof(sc->sc_vendor));
-
        int err = ehci_init(sc);
        if (err) {
                aprint_error("%s: init failed, error=%d\n", devname, err);
diff -r f90beb0893bf -r fc3aa07984e5 sys/arch/arm/imx/imxusb.c
--- a/sys/arch/arm/imx/imxusb.c Mon Apr 09 16:21:05 2018 +0000
+++ b/sys/arch/arm/imx/imxusb.c Mon Apr 09 16:21:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: imxusb.c,v 1.12 2016/05/17 06:44:46 ryo Exp $  */
+/*     $NetBSD: imxusb.c,v 1.13 2018/04/09 16:21:09 jakllsch Exp $     */
 /*
  * Copyright (c) 2009, 2010  Genetec Corporation.  All rights reserved.
  * Written by Hashimoto Kenichi and Hiroyuki Bessho for Genetec Corporation.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imxusb.c,v 1.12 2016/05/17 06:44:46 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imxusb.c,v 1.13 2018/04/09 16:21:09 jakllsch Exp $");
 
 #include "opt_imx.h"
 
@@ -202,9 +202,6 @@
 
        intr_establish(aa->aa_irq, IPL_USB, IST_LEVEL, ehci_intr, hsc);
 
-       /* Figure out vendor for root hub descriptor. */
-       strlcpy(hsc->sc_vendor, "i.MX", sizeof(hsc->sc_vendor));
-
        int err = ehci_init(hsc);
        if (err) {
                aprint_error_dev(self, "init failed, error=%d\n", err);
diff -r f90beb0893bf -r fc3aa07984e5 sys/arch/arm/nvidia/tegra_ehci.c
--- a/sys/arch/arm/nvidia/tegra_ehci.c  Mon Apr 09 16:21:05 2018 +0000
+++ b/sys/arch/arm/nvidia/tegra_ehci.c  Mon Apr 09 16:21:09 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_ehci.c,v 1.15 2017/05/25 23:45:04 jmcneill Exp $ */
+/* $NetBSD: tegra_ehci.c,v 1.16 2018/04/09 16:21:09 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_ehci.c,v 1.15 2017/05/25 23:45:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_ehci.c,v 1.16 2018/04/09 16:21:09 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -112,8 +112,6 @@
        sc->sc.sc_bus.ub_revision = USBREV_2_0;
        sc->sc.sc_ncomp = 0;
        sc->sc.sc_flags = EHCIF_ETTF;
-       sc->sc.sc_id_vendor = 0x10de;
-       strlcpy(sc->sc.sc_vendor, "Tegra", sizeof(sc->sc.sc_vendor));
        sc->sc.sc_size = size - TEGRA_EHCI_REG_OFFSET;
        sc->sc.iot = sc->sc_bst;
        bus_space_subregion(sc->sc_bst, sc->sc_bsh, TEGRA_EHCI_REG_OFFSET,
diff -r f90beb0893bf -r fc3aa07984e5 sys/arch/arm/omap/obio_ohci.c
--- a/sys/arch/arm/omap/obio_ohci.c     Mon Apr 09 16:21:05 2018 +0000
+++ b/sys/arch/arm/omap/obio_ohci.c     Mon Apr 09 16:21:09 2018 +0000
@@ -1,7 +1,7 @@
-/*     $Id: obio_ohci.c,v 1.11 2016/04/23 10:15:28 skrll Exp $ */
+/*     $Id: obio_ohci.c,v 1.12 2018/04/09 16:21:09 jakllsch Exp $      */
 
 /* adapted from: */
-/*     $NetBSD: obio_ohci.c,v 1.11 2016/04/23 10:15:28 skrll Exp $     */
+/*     $NetBSD: obio_ohci.c,v 1.12 2018/04/09 16:21:09 jakllsch Exp $  */
 /*     $OpenBSD: pxa2x0_ohci.c,v 1.19 2005/04/08 02:32:54 dlg Exp $ */
 
 /*
@@ -24,7 +24,7 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio_ohci.c,v 1.11 2016/04/23 10:15:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio_ohci.c,v 1.12 2018/04/09 16:21:09 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -148,7 +148,6 @@
                goto free_map;
        }
 
-       strlcpy(sc->sc.sc_vendor, "OMAP", sizeof(sc->sc.sc_vendor));
        int err = ohci_init(&sc->sc);
        if (err) {
                aprint_error_dev(self, "init failed, error=%d\n", err);
diff -r f90beb0893bf -r fc3aa07984e5 sys/arch/arm/omap/omap3_ehci.c
--- a/sys/arch/arm/omap/omap3_ehci.c    Mon Apr 09 16:21:05 2018 +0000
+++ b/sys/arch/arm/omap/omap3_ehci.c    Mon Apr 09 16:21:09 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: omap3_ehci.c,v 1.12 2016/10/04 15:59:36 kiyohara Exp $ */
+/* $NetBSD: omap3_ehci.c,v 1.13 2018/04/09 16:21:09 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2010-2012 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: omap3_ehci.c,v 1.12 2016/10/04 15:59:36 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_ehci.c,v 1.13 2018/04/09 16:21:09 jakllsch Exp $");
 
 #include "locators.h"
 
@@ -41,8 +41,6 @@
 
 #include <machine/intr.h>
 
-#include <dev/pci/pcidevs.h>
-
 #include <dev/usb/usb.h>
 #include <dev/usb/usbdi.h>
 #include <dev/usb/usbdivar.h>
@@ -479,8 +477,6 @@
        sc->sc_uhh_size = UHH_SIZE;
        sc->sc.sc_bus.ub_dmatag = obio->obio_dmat;
        sc->sc.sc_bus.ub_revision = USBREV_2_0;
-       sc->sc.sc_id_vendor = PCI_VENDOR_TI;
-       strlcpy(sc->sc.sc_vendor, "OMAP3", sizeof(sc->sc.sc_vendor));
 
 #ifdef OMAP_3XXX
        omap3_dpll5_init(sc);
diff -r f90beb0893bf -r fc3aa07984e5 sys/arch/arm/omap/omapl1x_ohci.c
--- a/sys/arch/arm/omap/omapl1x_ohci.c  Mon Apr 09 16:21:05 2018 +0000
+++ b/sys/arch/arm/omap/omapl1x_ohci.c  Mon Apr 09 16:21:09 2018 +0000
@@ -41,7 +41,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: omapl1x_ohci.c,v 1.2 2016/04/23 10:15:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omapl1x_ohci.c,v 1.3 2018/04/09 16:21:09 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -147,8 +147,6 @@
                return;
        }
 
-       strlcpy(sc->sc.sc_vendor, "OMAPL1X", sizeof sc->sc.sc_vendor);
-
        int err = ohci_init(&sc->sc);
        if (err) {
                aprint_error_dev(self, "init failed, error=%d\n", err);
diff -r f90beb0893bf -r fc3aa07984e5 sys/arch/arm/s3c2xx0/ohci_s3c24x0.c
--- a/sys/arch/arm/s3c2xx0/ohci_s3c24x0.c       Mon Apr 09 16:21:05 2018 +0000
+++ b/sys/arch/arm/s3c2xx0/ohci_s3c24x0.c       Mon Apr 09 16:21:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci_s3c24x0.c,v 1.9 2016/04/23 10:15:28 skrll Exp $ */
+/*     $NetBSD: ohci_s3c24x0.c,v 1.10 2018/04/09 16:21:09 jakllsch Exp $ */
 
 /* derived from ohci_pci.c */
 
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci_s3c24x0.c,v 1.9 2016/04/23 10:15:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci_s3c24x0.c,v 1.10 2018/04/09 16:21:09 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -120,8 +120,6 @@
                return;
        }
 
-       strlcpy(sc->sc.sc_vendor, "Samsung", sizeof sc->sc.sc_vendor);



Home | Main Index | Thread Index | Old Index