diff options
| author | jakllsch <jakllsch@NetBSD.org> | 2018-04-09 16:21:09 +0000 |
|---|---|---|
| committer | jakllsch <jakllsch@NetBSD.org> | 2018-04-09 16:21:09 +0000 |
| commit | 254b718590dbf92627a829dcc01d9bea3c47ef00 (patch) | |
| tree | b5ebc2fe001d1a2fd5daf58c8cf1c5a862a1c010 /sys/dev | |
| parent | bc51095628569da08438058a584e71e356ef1ecd (diff) | |
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 (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/cardbus/ehci_cardbus.c | 9 | ||||
| -rw-r--r-- | sys/dev/cardbus/ohci_cardbus.c | 9 | ||||
| -rw-r--r-- | sys/dev/cardbus/uhci_cardbus.c | 9 | ||||
| -rw-r--r-- | sys/dev/fdt/ehci_fdt.c | 6 | ||||
| -rw-r--r-- | sys/dev/fdt/ohci_fdt.c | 6 | ||||
| -rw-r--r-- | sys/dev/ic/sl811hs.c | 14 | ||||
| -rw-r--r-- | sys/dev/marvell/ehci_mv.c | 7 | ||||
| -rw-r--r-- | sys/dev/pci/ehci_pci.c | 10 | ||||
| -rw-r--r-- | sys/dev/pci/ohci_pci.c | 8 | ||||
| -rw-r--r-- | sys/dev/pci/uhci_pci.c | 8 | ||||
| -rw-r--r-- | sys/dev/pci/xhci_pci.c | 9 | ||||
| -rw-r--r-- | sys/dev/usb/ehci.c | 17 | ||||
| -rw-r--r-- | sys/dev/usb/ehcivar.h | 5 | ||||
| -rw-r--r-- | sys/dev/usb/motg.c | 19 | ||||
| -rw-r--r-- | sys/dev/usb/motgvar.h | 5 | ||||
| -rw-r--r-- | sys/dev/usb/ohci.c | 17 | ||||
| -rw-r--r-- | sys/dev/usb/ohcivar.h | 5 | ||||
| -rw-r--r-- | sys/dev/usb/uhci.c | 17 | ||||
| -rw-r--r-- | sys/dev/usb/uhcivar.h | 5 | ||||
| -rw-r--r-- | sys/dev/usb/xhci.c | 16 | ||||
| -rw-r--r-- | sys/dev/usb/xhcivar.h | 5 |
21 files changed, 40 insertions, 166 deletions
diff --git a/sys/dev/cardbus/ehci_cardbus.c b/sys/dev/cardbus/ehci_cardbus.c index dbd966ca911..6e9923cdc48 100644 --- a/sys/dev/cardbus/ehci_cardbus.c +++ b/sys/dev/cardbus/ehci_cardbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci_cardbus.c,v 1.34 2016/07/14 04:00:45 msaitoh Exp $ */ +/* $NetBSD: ehci_cardbus.c,v 1.35 2018/04/09 16:21:10 jakllsch Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.34 2016/07/14 04:00:45 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci_cardbus.c,v 1.35 2018/04/09 16:21:10 jakllsch Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -170,11 +170,6 @@ ehci_cardbus_attach(device_t parent, device_t self, void *aux) return; } - /* Figure out vendor for root hub descriptor. */ - sc->sc.sc_id_vendor = PCI_VENDOR(ca->ca_id); - pci_findvendor(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor), - sc->sc.sc_id_vendor); - /* * Find companion controllers. According to the spec they always * have lower function numbers so they should be enumerated already. diff --git a/sys/dev/cardbus/ohci_cardbus.c b/sys/dev/cardbus/ohci_cardbus.c index 03e52646615..274005843c5 100644 --- a/sys/dev/cardbus/ohci_cardbus.c +++ b/sys/dev/cardbus/ohci_cardbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: ohci_cardbus.c,v 1.43 2016/07/14 04:00:45 msaitoh Exp $ */ +/* $NetBSD: ohci_cardbus.c,v 1.44 2018/04/09 16:21:10 jakllsch Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.43 2016/07/14 04:00:45 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci_cardbus.c,v 1.44 2018/04/09 16:21:10 jakllsch Exp $"); #include "ehci_cardbus.h" @@ -146,11 +146,6 @@ ohci_cardbus_attach(device_t parent, device_t self, void *aux) return; } - /* Figure out vendor for root hub descriptor. */ - sc->sc.sc_id_vendor = PCI_VENDOR(ca->ca_id); - pci_findvendor(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor), - sc->sc.sc_id_vendor); - int err = ohci_init(&sc->sc); if (err) { aprint_error("%s: init failed, error=%d\n", devname, err); diff --git a/sys/dev/cardbus/uhci_cardbus.c b/sys/dev/cardbus/uhci_cardbus.c index 433c1f3ab24..fe6481a1560 100644 --- a/sys/dev/cardbus/uhci_cardbus.c +++ b/sys/dev/cardbus/uhci_cardbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhci_cardbus.c,v 1.24 2016/07/14 04:00:45 msaitoh Exp $ */ +/* $NetBSD: uhci_cardbus.c,v 1.25 2018/04/09 16:21:10 jakllsch Exp $ */ /* * Copyright (c) 1998-2005 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uhci_cardbus.c,v 1.24 2016/07/14 04:00:45 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhci_cardbus.c,v 1.25 2018/04/09 16:21:10 jakllsch Exp $"); #include "ehci_cardbus.h" @@ -153,11 +153,6 @@ uhci_cardbus_attach(device_t parent, device_t self, void *aux) break; } - /* Figure out vendor for root hub descriptor. */ - sc->sc.sc_id_vendor = PCI_VENDOR(ca->ca_id); - pci_findvendor(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor), - sc->sc.sc_id_vendor); - int err = uhci_init(&sc->sc); if (err) { aprint_error("%s: init failed, error=%d\n", devname, err); diff --git a/sys/dev/fdt/ehci_fdt.c b/sys/dev/fdt/ehci_fdt.c index 6d29cc788f5..b59bdb0e8e1 100644 --- a/sys/dev/fdt/ehci_fdt.c +++ b/sys/dev/fdt/ehci_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci_fdt.c,v 1.2 2017/07/08 16:19:56 jmcneill Exp $ */ +/* $NetBSD: ehci_fdt.c,v 1.3 2018/04/09 16:21:10 jakllsch Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.2 2017/07/08 16:19:56 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.3 2018/04/09 16:21:10 jakllsch Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -113,8 +113,6 @@ ehci_fdt_attach(device_t parent, device_t self, void *aux) sc->sc_flags |= EHCIF_ETTF; else sc->sc_ncomp = 1; - sc->sc_id_vendor = 0; - strlcpy(sc->sc_vendor, "Generic", sizeof(sc->sc_vendor)); sc->sc_size = size; sc->iot = faa->faa_bst; if (bus_space_map(sc->iot, addr, size, 0, &sc->ioh) != 0) { diff --git a/sys/dev/fdt/ohci_fdt.c b/sys/dev/fdt/ohci_fdt.c index db7ab4bbbb8..4a868362622 100644 --- a/sys/dev/fdt/ohci_fdt.c +++ b/sys/dev/fdt/ohci_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ohci_fdt.c,v 1.1 2017/06/29 17:04:53 jmcneill Exp $ */ +/* $NetBSD: ohci_fdt.c,v 1.2 2018/04/09 16:21:10 jakllsch Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ohci_fdt.c,v 1.1 2017/06/29 17:04:53 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci_fdt.c,v 1.2 2018/04/09 16:21:10 jakllsch Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -109,8 +109,6 @@ ohci_fdt_attach(device_t parent, device_t self, void *aux) sc->sc_bus.ub_hcpriv = sc; sc->sc_bus.ub_dmatag = faa->faa_dmat; sc->sc_flags = 0; - sc->sc_id_vendor = 0; - strlcpy(sc->sc_vendor, "Generic", sizeof(sc->sc_vendor)); sc->sc_size = size; sc->iot = faa->faa_bst; if (bus_space_map(sc->iot, addr, size, 0, &sc->ioh) != 0) { diff --git a/sys/dev/ic/sl811hs.c b/sys/dev/ic/sl811hs.c index 220a6063891..b2391a8fdf5 100644 --- a/sys/dev/ic/sl811hs.c +++ b/sys/dev/ic/sl811hs.c @@ -1,4 +1,4 @@ -/* $NetBSD: sl811hs.c,v 1.98 2017/10/28 00:37:12 pgoyette Exp $ */ +/* $NetBSD: sl811hs.c,v 1.99 2018/04/09 16:21:10 jakllsch Exp $ */ /* * Not (c) 2007 Matthew Orgass @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.98 2017/10/28 00:37:12 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.99 2018/04/09 16:21:10 jakllsch Exp $"); #ifdef _KERNEL_OPT #include "opt_slhci.h" @@ -3310,12 +3310,7 @@ slhci_roothub_ctrl(struct usbd_bus *bus, usb_device_request_t *req, if (type == UT_READ_DEVICE) { /* value is type (&0xff00) and index (0xff) */ if (value == (UDESC_DEVICE<<8)) { - usb_device_descriptor_t devd; - - actlen = min(buflen, sizeof(devd)); - memcpy(&devd, buf, actlen); - USETW(devd.idVendor, USB_VENDOR_SCANLOGIC); - memcpy(buf, &devd, actlen); + actlen = buflen; error = USBD_NORMAL_COMPLETION; } else if (value == (UDESC_CONFIG<<8)) { struct usb_roothub_descriptors confd; @@ -3329,8 +3324,7 @@ slhci_roothub_ctrl(struct usbd_bus *bus, usb_device_request_t *req, error = USBD_NORMAL_COMPLETION; } else if (value == ((UDESC_STRING<<8)|1)) { /* Vendor */ - actlen = usb_makestrdesc((usb_string_descriptor_t *) - buf, len, "ScanLogic/Cypress"); + actlen = buflen; error = USBD_NORMAL_COMPLETION; } else if (value == ((UDESC_STRING<<8)|2)) { /* Product */ diff --git a/sys/dev/marvell/ehci_mv.c b/sys/dev/marvell/ehci_mv.c index 801eb87ccfa..c72618c7fa2 100644 --- a/sys/dev/marvell/ehci_mv.c +++ b/sys/dev/marvell/ehci_mv.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci_mv.c,v 1.6 2016/04/23 10:15:31 skrll Exp $ */ +/* $NetBSD: ehci_mv.c,v 1.7 2018/04/09 16:21:10 jakllsch Exp $ */ /* * Copyright (c) 2008 KIYOHARA Takashi * All rights reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ehci_mv.c,v 1.6 2016/04/23 10:15:31 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci_mv.c,v 1.7 2018/04/09 16:21:10 jakllsch Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -235,9 +235,6 @@ mvusb_attach(device_t parent, device_t self, void *aux) marvell_intr_establish(mva->mva_irq, IPL_USB, ehci_intr, sc); sc->sc.sc_bus.ub_revision = USBREV_2_0; - /* Figure out vendor for root hub descriptor. */ - sc->sc.sc_id_vendor = 0x0000; /* XXXXX */ - strcpy(sc->sc.sc_vendor, "Marvell"); sc->sc.sc_vendor_init = mvusb_vendor_init; sc->sc.sc_vendor_port_status = mvusb_vendor_port_status; diff --git a/sys/dev/pci/ehci_pci.c b/sys/dev/pci/ehci_pci.c index 6709477325a..23cfe900b35 100644 --- a/sys/dev/pci/ehci_pci.c +++ b/sys/dev/pci/ehci_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci_pci.c,v 1.65 2017/06/12 10:59:47 sborrill Exp $ */ +/* $NetBSD: ehci_pci.c,v 1.66 2018/04/09 16:21:10 jakllsch Exp $ */ /* * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.65 2017/06/12 10:59:47 sborrill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.66 2018/04/09 16:21:10 jakllsch Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -206,12 +206,8 @@ ehci_pci_attach(device_t parent, device_t self, void *aux) break; } - /* Figure out vendor for root hub descriptor. */ - sc->sc.sc_id_vendor = PCI_VENDOR(pa->pa_id); - pci_findvendor(sc->sc.sc_vendor, - sizeof(sc->sc.sc_vendor), sc->sc.sc_id_vendor); /* Enable workaround for dropped interrupts as required */ - switch (sc->sc.sc_id_vendor) { + switch (PCI_VENDOR(pa->pa_id)) { case PCI_VENDOR_ATI: case PCI_VENDOR_VIATECH: sc->sc.sc_flags |= EHCIF_DROPPED_INTR_WORKAROUND; diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c index ad6bed5ebab..f323ddc055f 100644 --- a/sys/dev/pci/ohci_pci.c +++ b/sys/dev/pci/ohci_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ohci_pci.c,v 1.56 2017/05/10 02:46:33 msaitoh Exp $ */ +/* $NetBSD: ohci_pci.c,v 1.57 2018/04/09 16:21:10 jakllsch Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ohci_pci.c,v 1.56 2017/05/10 02:46:33 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci_pci.c,v 1.57 2018/04/09 16:21:10 jakllsch Exp $"); #include "ehci.h" @@ -152,10 +152,6 @@ ohci_pci_attach(device_t parent, device_t self, void *aux) } aprint_normal_dev(self, "interrupting at %s\n", intrstr); - /* Figure out vendor for root hub descriptor. */ - sc->sc.sc_id_vendor = PCI_VENDOR(pa->pa_id); - pci_findvendor(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor), - sc->sc.sc_id_vendor); int err = ohci_init(&sc->sc); if (err) { aprint_error_dev(self, "init failed, error=%d\n", err); diff --git a/sys/dev/pci/uhci_pci.c b/sys/dev/pci/uhci_pci.c index a8eee0b68e0..a72aff751f6 100644 --- a/sys/dev/pci/uhci_pci.c +++ b/sys/dev/pci/uhci_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhci_pci.c,v 1.61 2017/04/27 10:01:54 msaitoh Exp $ */ +/* $NetBSD: uhci_pci.c,v 1.62 2018/04/09 16:21:10 jakllsch Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.61 2017/04/27 10:01:54 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.62 2018/04/09 16:21:10 jakllsch Exp $"); #include "ehci.h" @@ -169,10 +169,6 @@ uhci_pci_attach(device_t parent, device_t self, void *aux) break; } - /* Figure out vendor for root hub descriptor. */ - sc->sc.sc_id_vendor = PCI_VENDOR(pa->pa_id); - pci_findvendor(sc->sc.sc_vendor, sizeof(sc->sc.sc_vendor), - sc->sc.sc_id_vendor); int err = uhci_init(&sc->sc); if (err) { aprint_error_dev(self, "init failed, error=%d\n", err); diff --git a/sys/dev/pci/xhci_pci.c b/sys/dev/pci/xhci_pci.c index 1983310575e..c633dc0e70b 100644 --- a/sys/dev/pci/xhci_pci.c +++ b/sys/dev/pci/xhci_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: xhci_pci.c,v 1.11 2017/12/28 05:43:42 msaitoh Exp $ */ +/* $NetBSD: xhci_pci.c,v 1.12 2018/04/09 16:21:10 jakllsch Exp $ */ /* OpenBSD: xhci_pci.c,v 1.4 2014/07/12 17:38:51 yuo Exp */ /* @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.11 2017/12/28 05:43:42 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci_pci.c,v 1.12 2018/04/09 16:21:10 jakllsch Exp $"); #ifdef _KERNEL_OPT #include "opt_xhci_pci.h" @@ -217,11 +217,6 @@ alloc_retry: } aprint_normal_dev(self, "interrupting at %s\n", intrstr); - /* Figure out vendor for root hub descriptor. */ - sc->sc_id_vendor = PCI_VENDOR(pa->pa_id); - pci_findvendor(sc->sc_vendor, sizeof(sc->sc_vendor), - sc->sc_id_vendor); - /* Intel chipset requires SuperSpeed enable and USB2 port routing */ switch (PCI_VENDOR(pa->pa_id)) { case PCI_VENDOR_INTEL: diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index fc3b7ae6808..3b2ce035dfb 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.257 2017/11/17 08:22:02 skrll Exp $ */ +/* $NetBSD: ehci.c,v 1.258 2018/04/09 16:21:10 jakllsch Exp $ */ /* * Copyright (c) 2004-2012 The NetBSD Foundation, Inc. @@ -53,7 +53,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.257 2017/11/17 08:22:02 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.258 2018/04/09 16:21:10 jakllsch Exp $"); #include "ohci.h" #include "uhci.h" @@ -2317,20 +2317,7 @@ ehci_roothub_ctrl(struct usbd_bus *bus, usb_device_request_t *req, if (len == 0) break; switch (value) { - case C(0, UDESC_DEVICE): { - usb_device_descriptor_t devd; - totlen = min(buflen, sizeof(devd)); - memcpy(&devd, buf, totlen); - USETW(devd.idVendor, sc->sc_id_vendor); - memcpy(buf, &devd, totlen); - break; - - } #define sd ((usb_string_descriptor_t *)buf) - case C(1, UDESC_STRING): - /* Vendor */ - totlen = usb_makestrdesc(sd, len, sc->sc_vendor); - break; case C(2, UDESC_STRING): /* Product */ totlen = usb_makestrdesc(sd, len, "EHCI root hub"); diff --git a/sys/dev/usb/ehcivar.h b/sys/dev/usb/ehcivar.h index 3abc6273b4f..d8303f125cc 100644 --- a/sys/dev/usb/ehcivar.h +++ b/sys/dev/usb/ehcivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: ehcivar.h,v 1.43 2016/04/23 10:15:31 skrll Exp $ */ +/* $NetBSD: ehcivar.h,v 1.44 2018/04/09 16:21:11 jakllsch Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -177,9 +177,6 @@ typedef struct ehci_softc { #define EHCIF_DROPPED_INTR_WORKAROUND 0x01 #define EHCIF_ETTF 0x02 /* Emb. Transaction Translater func. */ - char sc_vendor[32]; /* vendor string for root hub */ - int sc_id_vendor; /* vendor ID for root hub */ - uint32_t sc_cmd; /* shadow of cmd reg during suspend */ u_int sc_ncomp; diff --git a/sys/dev/usb/motg.c b/sys/dev/usb/motg.c index 4f54d985707..ec097b92b46 100644 --- a/sys/dev/usb/motg.c +++ b/sys/dev/usb/motg.c @@ -1,4 +1,4 @@ -/* $NetBSD: motg.c,v 1.20 2018/04/08 13:36:37 jmcneill Exp $ */ +/* $NetBSD: motg.c,v 1.21 2018/04/09 16:21:11 jakllsch Exp $ */ /* * Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.20 2018/04/08 13:36:37 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.21 2018/04/09 16:21:11 jakllsch Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -468,8 +468,6 @@ motg_init(struct motg_softc *sc) sc->sc_bus.ub_revision = USBREV_2_0; sc->sc_bus.ub_usedma = false; sc->sc_bus.ub_hcpriv = sc; - snprintf(sc->sc_vendor, sizeof(sc->sc_vendor), - "Mentor Graphics"); sc->sc_child = config_found(sc->sc_dev, &sc->sc_bus, usbctlprint); return 0; } @@ -810,20 +808,7 @@ motg_roothub_ctrl(struct usbd_bus *bus, usb_device_request_t *req, case C(UR_GET_DESCRIPTOR, UT_READ_DEVICE): DPRINTFN(MD_ROOT, "wValue=0x%04jx", value, 0, 0, 0); switch (value) { - case C(0, UDESC_DEVICE): { - usb_device_descriptor_t devd; - - totlen = min(buflen, sizeof(devd)); - memcpy(&devd, buf, totlen); - USETW(devd.idVendor, sc->sc_id_vendor); - memcpy(buf, &devd, totlen); - break; - } - case C(1, UDESC_STRING): #define sd ((usb_string_descriptor_t *)buf) - /* Vendor */ - totlen = usb_makestrdesc(sd, len, sc->sc_vendor); - break; case C(2, UDESC_STRING): /* Product */ totlen = usb_makestrdesc(sd, len, "MOTG root hub"); diff --git a/sys/dev/usb/motgvar.h b/sys/dev/usb/motgvar.h index 80b7f47cb5c..d254bc3017d 100644 --- a/sys/dev/usb/motgvar.h +++ b/sys/dev/usb/motgvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: motgvar.h,v 1.5 2016/04/23 10:15:32 skrll Exp $ */ +/* $NetBSD: motgvar.h,v 1.6 2018/04/09 16:21:11 jakllsch Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -94,9 +94,6 @@ struct motg_softc { /* Info for the root hub interrupt "pipe". */ struct usbd_xfer *sc_intr_xfer; /* root hub interrupt transfer */ - char sc_vendor[32]; /* vendor string for root hub */ - int sc_id_vendor; /* vendor ID for root hub */ - int sc_port_enabled : 1; int sc_port_enabled_changed : 1; int sc_port_suspended : 1; diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index f637c0c484a..210d19fcf36 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ohci.c,v 1.279 2018/02/03 08:52:52 skrll Exp $ */ +/* $NetBSD: ohci.c,v 1.280 2018/04/09 16:21:11 jakllsch Exp $ */ /* * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.279 2018/02/03 08:52:52 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.280 2018/04/09 16:21:11 jakllsch Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -2376,20 +2376,7 @@ ohci_roothub_ctrl(struct usbd_bus *bus, usb_device_request_t *req, if (len == 0) break; switch (value) { - case C(0, UDESC_DEVICE): { - usb_device_descriptor_t devd; - - totlen = min(buflen, sizeof(devd)); - memcpy(&devd, buf, totlen); - USETW(devd.idVendor, sc->sc_id_vendor); - memcpy(buf, &devd, totlen); - break; - } - case C(1, UDESC_STRING): #define sd ((usb_string_descriptor_t *)buf) - /* Vendor */ - totlen = usb_makestrdesc(sd, len, sc->sc_vendor); - break; case C(2, UDESC_STRING): /* Product */ totlen = usb_makestrdesc(sd, len, "OHCI root hub"); diff --git a/sys/dev/usb/ohcivar.h b/sys/dev/usb/ohcivar.h index ca9161b57c9..311c8470b05 100644 --- a/sys/dev/usb/ohcivar.h +++ b/sys/dev/usb/ohcivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: ohcivar.h,v 1.58 2016/05/22 08:02:23 skrll Exp $ */ +/* $NetBSD: ohcivar.h,v 1.59 2018/04/09 16:21:11 jakllsch Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -129,9 +129,6 @@ typedef struct ohci_softc { struct usbd_xfer *sc_intrxfer; - char sc_vendor[32]; - int sc_id_vendor; - uint32_t sc_control; /* Preserved during suspend/standby */ uint32_t sc_intre; diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 254d67d6f27..811cda3a55a 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhci.c,v 1.279 2017/11/17 08:22:02 skrll Exp $ */ +/* $NetBSD: uhci.c,v 1.280 2018/04/09 16:21:11 jakllsch Exp $ */ /* * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.279 2017/11/17 08:22:02 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.280 2018/04/09 16:21:11 jakllsch Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -3662,20 +3662,7 @@ uhci_roothub_ctrl(struct usbd_bus *bus, usb_device_request_t *req, if (len == 0) break; switch (value) { - case C(0, UDESC_DEVICE): { - usb_device_descriptor_t devd; - - totlen = min(buflen, sizeof(devd)); - memcpy(&devd, buf, totlen); - USETW(devd.idVendor, sc->sc_id_vendor); - memcpy(buf, &devd, totlen); - break; - } - case C(1, UDESC_STRING): #define sd ((usb_string_descriptor_t *)buf) - /* Vendor */ - totlen = usb_makestrdesc(sd, len, sc->sc_vendor); - break; case C(2, UDESC_STRING): /* Product */ totlen = usb_makestrdesc(sd, len, "UHCI root hub"); diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h index f25279b021f..9f13f6067cc 100644 --- a/sys/dev/usb/uhcivar.h +++ b/sys/dev/usb/uhcivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: uhcivar.h,v 1.53 2016/04/23 10:15:32 skrll Exp $ */ +/* $NetBSD: uhcivar.h,v 1.54 2018/04/09 16:21:11 jakllsch Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -188,9 +188,6 @@ typedef struct uhci_softc { struct usbd_xfer *sc_intr_xfer; /* root hub interrupt transfer */ struct callout sc_poll_handle; - char sc_vendor[32]; /* vendor string for root hub */ - int sc_id_vendor; /* vendor ID for root hub */ - device_t sc_child; /* /dev/usb# device */ } uhci_softc_t; diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 4a968fe3abe..8d7fb023c3c 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.86 2018/02/07 15:55:58 prlw1 Exp $ */ +/* $NetBSD: xhci.c,v 1.87 2018/04/09 16:21:11 jakllsch Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.86 2018/02/07 15:55:58 prlw1 Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.87 2018/04/09 16:21:11 jakllsch Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -3377,19 +3377,7 @@ xhci_roothub_ctrl(struct usbd_bus *bus, usb_device_request_t *req, if (len == 0) break; switch (value) { - case C(0, UDESC_DEVICE): { - usb_device_descriptor_t devd; - totlen = min(buflen, sizeof(devd)); - memcpy(&devd, buf, totlen); - USETW(devd.idVendor, sc->sc_id_vendor); - memcpy(buf, &devd, totlen); - break; - } #define sd ((usb_string_descriptor_t *)buf) - case C(1, UDESC_STRING): - /* Vendor */ - totlen = usb_makestrdesc(sd, len, sc->sc_vendor); - break; case C(2, UDESC_STRING): /* Product */ totlen = usb_makestrdesc(sd, len, "xHCI Root Hub"); diff --git a/sys/dev/usb/xhcivar.h b/sys/dev/usb/xhcivar.h index ebeef830481..29ba8ac56dd 100644 --- a/sys/dev/usb/xhcivar.h +++ b/sys/dev/usb/xhcivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: xhcivar.h,v 1.8 2017/09/25 00:03:11 jmcneill Exp $ */ +/* $NetBSD: xhcivar.h,v 1.9 2018/04/09 16:21:11 jakllsch Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -87,9 +87,6 @@ struct xhci_softc { kmutex_t sc_intr_lock; kcondvar_t sc_softwake_cv; - char sc_vendor[32]; /* vendor string for root hub */ - int sc_id_vendor; /* vendor ID for root hub */ - pool_cache_t sc_xferpool; bus_size_t sc_pgsz; /* xHCI page size */ |
