Source-Changes-HG archive

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

[src/nick-nhusb]: src/sys/dev/usb Re-enable the TT support that existed previ...



details:   https://anonhg.NetBSD.org/src/rev/b4e4e3870015
branches:  nick-nhusb
changeset: 334399:b4e4e3870015
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Feb 16 08:02:49 2016 +0000

description:
Re-enable the TT support that existed previously here as well

diffstat:

 sys/dev/usb/uhub.c     |  22 +++++++---------------
 sys/dev/usb/usbdivar.h |   8 ++------
 2 files changed, 9 insertions(+), 21 deletions(-)

diffs (108 lines):

diff -r 7db5b1358d80 -r b4e4e3870015 sys/dev/usb/uhub.c
--- a/sys/dev/usb/uhub.c        Tue Feb 16 07:30:46 2016 +0000
+++ b/sys/dev/usb/uhub.c        Tue Feb 16 08:02:49 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhub.c,v 1.126.2.22 2016/02/06 07:53:11 skrll Exp $    */
+/*     $NetBSD: uhub.c,v 1.126.2.23 2016/02/16 08:02:49 skrll Exp $    */
 /*     $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $       */
 /*     $OpenBSD: uhub.c,v 1.86 2015/06/29 18:27:40 mpi Exp $ */
 
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.126.2.22 2016/02/06 07:53:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.126.2.23 2016/02/16 08:02:49 skrll Exp $");
 
 #include <sys/param.h>
 
@@ -256,9 +256,7 @@
        int p, port, nports, nremov, pwrdly;
        struct usbd_interface *iface;
        usb_endpoint_descriptor_t *ed;
-#if 0 /* notyet */
        struct usbd_tt *tts = NULL;
-#endif
 
        UHUBHIST_FUNC(); UHUBHIST_CALLED();
 
@@ -411,14 +409,12 @@
         *        proceed with device attachment
         */
 
-#if 0
        if (UHUB_IS_HIGH_SPEED(sc) && nports > 0) {
                tts = kmem_alloc((UHUB_IS_SINGLE_TT(sc) ? 1 : nports) *
                             sizeof(struct usbd_tt), KM_SLEEP);
                if (!tts)
                        goto bad;
        }
-#endif
        /* Set up data structures */
        for (p = 0; p < nports; p++) {
                struct usbd_port *up = &hub->uh_ports[p];
@@ -432,14 +428,12 @@
                        up->up_power = USB_MIN_POWER;
                up->up_restartcnt = 0;
                up->up_reattach = 0;
-#if 0
                if (UHUB_IS_HIGH_SPEED(sc)) {
-                       up->tt = &tts[UHUB_IS_SINGLE_TT(sc) ? 0 : p];
-                       up->tt->hub = hub;
+                       up->up_tt = &tts[UHUB_IS_SINGLE_TT(sc) ? 0 : p];
+                       up->up_tt->utt_hub = hub;
                } else {
-                       up->tt = NULL;
+                       up->up_tt = NULL;
                }
-#endif
        }
 
        /* XXX should check for none, individual, or ganged power? */
@@ -840,12 +834,10 @@
 
        usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_hub, sc->sc_dev);
 
-#if 0
-       if (hub->ports[0].tt)
-               kmem_free(hub->ports[0].tt,
+       if (hub->uh_ports[0].up_tt)
+               kmem_free(hub->uh_ports[0].up_tt,
                    (UHUB_IS_SINGLE_TT(sc) ? 1 : nports) *
                    sizeof(struct usbd_tt));
-#endif
        kmem_free(hub,
            sizeof(*hub) + (nports-1) * sizeof(struct usbd_port));
        sc->sc_hub->ud_hub = NULL;
diff -r 7db5b1358d80 -r b4e4e3870015 sys/dev/usb/usbdivar.h
--- a/sys/dev/usb/usbdivar.h    Tue Feb 16 07:30:46 2016 +0000
+++ b/sys/dev/usb/usbdivar.h    Tue Feb 16 08:02:49 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdivar.h,v 1.109.2.22 2016/01/10 10:33:43 skrll Exp $        */
+/*     $NetBSD: usbdivar.h,v 1.109.2.23 2016/02/16 08:02:49 skrll Exp $        */
 
 /*
  * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc.
@@ -115,11 +115,9 @@
        void                  (*upm_done)(struct usbd_xfer *);
 };
 
-#if 0 /* notyet */
 struct usbd_tt {
-       struct usbd_hub        *hub;
+       struct usbd_hub        *utt_hub;
 };
-#endif
 
 struct usbd_port {
        usb_port_status_t       up_status;
@@ -130,9 +128,7 @@
        uint8_t                 up_reattach;
        struct usbd_device     *up_dev;         /* Connected device */
        struct usbd_device     *up_parent;      /* The ports hub */
-#if 0
        struct usbd_tt         *up_tt;  /* Transaction translator (if any) */
-#endif
 };
 
 struct usbd_hub {



Home | Main Index | Thread Index | Old Index