Source-Changes-HG archive

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

[src/jmcneill-usbmp]: src/sys/dev/usb update a bunch of comments for reality....



details:   https://anonhg.NetBSD.org/src/rev/857d762dc000
branches:  jmcneill-usbmp
changeset: 771808:857d762dc000
user:      mrg <mrg%NetBSD.org@localhost>
date:      Thu Feb 23 09:25:03 2012 +0000

description:
update a bunch of comments for reality.  usb lock isn't a "thread lock",
which is terminology we copied from the audiomp code.

diffstat:

 sys/dev/usb/ehci.c       |  12 ++++++------
 sys/dev/usb/ohci.c       |  20 ++++++++++----------
 sys/dev/usb/uhci.c       |  22 +++++++++++-----------
 sys/dev/usb/usb.c        |  12 ++++++------
 sys/dev/usb/usbdi.c      |  12 ++++++------
 sys/dev/usb/usbdi_util.c |   8 ++++----
 sys/dev/usb/usbdivar.h   |  20 +++++++++-----------
 7 files changed, 52 insertions(+), 54 deletions(-)

diffs (truncated from 430 to 300 lines):

diff -r f3c7196422f6 -r 857d762dc000 sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Mon Feb 20 22:43:12 2012 +0000
+++ b/sys/dev/usb/ehci.c        Thu Feb 23 09:25:03 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.181.6.10 2012/02/20 22:42:24 mrg Exp $ */
+/*     $NetBSD: ehci.c,v 1.181.6.11 2012/02/23 09:25:04 mrg Exp $ */
 
 /*
  * Copyright (c) 2004-2011 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.181.6.10 2012/02/20 22:42:24 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.181.6.11 2012/02/23 09:25:04 mrg Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -1406,11 +1406,11 @@
 }
 
 Static void
-ehci_get_lock(struct usbd_bus *bus, kmutex_t **thread)
+ehci_get_lock(struct usbd_bus *bus, kmutex_t **lock)
 {
        struct ehci_softc *sc = bus->hci_private;
 
-       *thread = &sc->sc_lock;
+       *lock = &sc->sc_lock;
 }
 
 Static void
@@ -1811,7 +1811,7 @@
 }
 
 /*
- * Add an ED to the schedule.  Called with USB thread lock held.
+ * Add an ED to the schedule.  Called with USB lock held.
  */
 Static void
 ehci_add_qh(ehci_softc_t *sc, ehci_soft_qh_t *sqh, ehci_soft_qh_t *head)
@@ -1839,7 +1839,7 @@
 }
 
 /*
- * Remove an ED from the schedule.  Called with USB thread lock held.
+ * Remove an ED from the schedule.  Called with USB lock held.
  */
 Static void
 ehci_rem_qh(ehci_softc_t *sc, ehci_soft_qh_t *sqh, ehci_soft_qh_t *head)
diff -r f3c7196422f6 -r 857d762dc000 sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Mon Feb 20 22:43:12 2012 +0000
+++ b/sys/dev/usb/ohci.c        Thu Feb 23 09:25:03 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.218.6.11 2012/02/20 06:50:21 mrg Exp $      */
+/*     $NetBSD: ohci.c,v 1.218.6.12 2012/02/23 09:25:04 mrg Exp $      */
 /*     $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $       */
 
 /*
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.218.6.11 2012/02/20 06:50:21 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.218.6.12 2012/02/23 09:25:04 mrg Exp $");
 
 #include "opt_usb.h"
 
@@ -991,11 +991,11 @@
 }
 
 Static void
-ohci_get_lock(struct usbd_bus *bus, kmutex_t **thread)
+ohci_get_lock(struct usbd_bus *bus, kmutex_t **lock)
 {
        struct ohci_softc *sc = bus->hci_private;
 
-       *thread = &sc->sc_lock;
+       *lock = &sc->sc_lock;
 }
 
 /*
@@ -1865,7 +1865,7 @@
 }
 
 /*
- * Add an ED to the schedule.  Called with USB thread lock held.
+ * Add an ED to the schedule.  Called with USB lock held.
  */
 Static void
 ohci_add_ed(ohci_softc_t *sc, ohci_soft_ed_t *sed, ohci_soft_ed_t *head)
@@ -1890,7 +1890,7 @@
 }
 
 /*
- * Remove an ED from the schedule.  Called with USB thread lock held.
+ * Remove an ED from the schedule.  Called with USB lock held.
  */
 Static void
 ohci_rem_ed(ohci_softc_t *sc, ohci_soft_ed_t *sed, ohci_soft_ed_t *head)
@@ -1925,7 +1925,7 @@
  */
 
 #define HASH(a) (((a) >> 4) % OHCI_HASH_SIZE)
-/* Called with USB thread lock held. */
+/* Called with USB lock held. */
 void
 ohci_hash_add_td(ohci_softc_t *sc, ohci_soft_td_t *std)
 {
@@ -1936,7 +1936,7 @@
        LIST_INSERT_HEAD(&sc->sc_hash_tds[h], std, hnext);
 }
 
-/* Called with USB thread lock held. */
+/* Called with USB lock held. */
 void
 ohci_hash_rem_td(ohci_softc_t *sc, ohci_soft_td_t *std)
 {
@@ -1960,7 +1960,7 @@
        return (NULL);
 }
 
-/* Called with USB thread lock held. */
+/* Called with USB lock held. */
 void
 ohci_hash_add_itd(ohci_softc_t *sc, ohci_soft_itd_t *sitd)
 {
@@ -1974,7 +1974,7 @@
        LIST_INSERT_HEAD(&sc->sc_hash_itds[h], sitd, hnext);
 }
 
-/* Called with USB thread lock held. */
+/* Called with USB lock held. */
 void
 ohci_hash_rem_itd(ohci_softc_t *sc, ohci_soft_itd_t *sitd)
 {
diff -r f3c7196422f6 -r 857d762dc000 sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Mon Feb 20 22:43:12 2012 +0000
+++ b/sys/dev/usb/uhci.c        Thu Feb 23 09:25:03 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.240.6.10 2012/02/20 06:50:21 mrg Exp $      */
+/*     $NetBSD: uhci.c,v 1.240.6.11 2012/02/23 09:25:04 mrg Exp $      */
 /*     $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $       */
 
 /*
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.240.6.10 2012/02/20 06:50:21 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.240.6.11 2012/02/23 09:25:04 mrg Exp $");
 
 #include "opt_usb.h"
 
@@ -698,11 +698,11 @@
 }
 
 Static void
-uhci_get_lock(struct usbd_bus *bus, kmutex_t **thread)
+uhci_get_lock(struct usbd_bus *bus, kmutex_t **lock)
 {
        struct uhci_softc *sc = bus->hci_private;
 
-       *thread = &sc->sc_lock;
+       *lock = &sc->sc_lock;
 }
 
 
@@ -1089,7 +1089,7 @@
        }
 }
 
-/* Add high speed control QH, called with thread lock held. */
+/* Add high speed control QH, called with lock held. */
 void
 uhci_add_hs_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
 {
@@ -1116,7 +1116,7 @@
 #endif
 }
 
-/* Remove high speed control QH, called with thread lock held. */
+/* Remove high speed control QH, called with lock held. */
 void
 uhci_remove_hs_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
 {
@@ -1166,7 +1166,7 @@
                sc->sc_hctl_end = pqh;
 }
 
-/* Add low speed control QH, called with thread lock held. */
+/* Add low speed control QH, called with lock held. */
 void
 uhci_add_ls_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
 {
@@ -1189,7 +1189,7 @@
        sc->sc_lctl_end = sqh;
 }
 
-/* Remove low speed control QH, called with thread lock held. */
+/* Remove low speed control QH, called with lock held. */
 void
 uhci_remove_ls_ctrl(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
 {
@@ -1223,7 +1223,7 @@
                sc->sc_lctl_end = pqh;
 }
 
-/* Add bulk QH, called with thread lock held. */
+/* Add bulk QH, called with lock held. */
 void
 uhci_add_bulk(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
 {
@@ -1247,7 +1247,7 @@
        uhci_add_loop(sc);
 }
 
-/* Remove bulk QH, called with thread lock held. */
+/* Remove bulk QH, called with lock held. */
 void
 uhci_remove_bulk(uhci_softc_t *sc, uhci_soft_qh_t *sqh)
 {
@@ -1499,7 +1499,7 @@
        uhci_idone(ii);
 }
 
-/* Called with USB thread lock held. */
+/* Called with USB lock held. */
 void
 uhci_idone(uhci_intr_info_t *ii)
 {
diff -r f3c7196422f6 -r 857d762dc000 sys/dev/usb/usb.c
--- a/sys/dev/usb/usb.c Mon Feb 20 22:43:12 2012 +0000
+++ b/sys/dev/usb/usb.c Thu Feb 23 09:25:03 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb.c,v 1.125.6.9 2012/02/20 06:50:21 mrg Exp $        */
+/*     $NetBSD: usb.c,v 1.125.6.10 2012/02/23 09:25:04 mrg Exp $       */
 
 /*
  * Copyright (c) 1998, 2002, 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.125.6.9 2012/02/20 06:50:21 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.125.6.10 2012/02/23 09:25:04 mrg Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_usb.h"
@@ -420,7 +420,7 @@
                cv_signal(&sc->sc_bus->needs_explore_cv);
                mutex_exit(sc->sc_bus->lock);
        } else
-               wakeup(sc);
+               wakeup(sc);     /* XXXSMP ok */
 
        DPRINTF(("usb_event_thread: exit\n"));
        kthread_exit(0);
@@ -839,7 +839,7 @@
                cv_signal(&dev->bus->needs_explore_cv);
                mutex_exit(dev->bus->lock);
        } else
-               wakeup(&dev->bus->needs_explore);
+               wakeup(&dev->bus->needs_explore);       /* XXXSMP ok */
 }
 
 void
@@ -854,7 +854,7 @@
                cv_signal(&dev->bus->needs_explore_cv);
                mutex_exit(dev->bus->lock);
        } else
-               wakeup(&dev->bus->needs_explore);
+               wakeup(&dev->bus->needs_explore);       /* XXXSMP ok */
 }
 
 /* Called at with usb_event_lock held. */
@@ -1038,7 +1038,7 @@
                            sc->sc_bus->lock, hz * 60);
                        mutex_exit(sc->sc_bus->lock);
                } else {
-                       wakeup(&sc->sc_bus->needs_explore);
+                       wakeup(&sc->sc_bus->needs_explore);     /* XXXSMP ok */
                        tsleep(sc, PWAIT, "usbdet", hz * 60);
                }
        }
diff -r f3c7196422f6 -r 857d762dc000 sys/dev/usb/usbdi.c
--- a/sys/dev/usb/usbdi.c       Mon Feb 20 22:43:12 2012 +0000
+++ b/sys/dev/usb/usbdi.c       Thu Feb 23 09:25:03 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbdi.c,v 1.134.2.10 2012/02/20 22:42:47 mrg Exp $     */
+/*     $NetBSD: usbdi.c,v 1.134.2.11 2012/02/23 09:25:04 mrg Exp $     */
 /*     $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $      */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.134.2.10 2012/02/20 22:42:47 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.134.2.11 2012/02/23 09:25:04 mrg Exp $");



Home | Main Index | Thread Index | Old Index