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 Prefix ehci_xfer members with 'ex_'. No fun...



details:   https://anonhg.NetBSD.org/src/rev/831fa3d7380e
branches:  nick-nhusb
changeset: 334091:831fa3d7380e
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Dec 24 14:11:05 2014 +0000

description:
Prefix ehci_xfer members with 'ex_'. No functional change.

diffstat:

 sys/dev/usb/ehci.c    |  187 +++++++++++++++++++++++++------------------------
 sys/dev/usb/ehcivar.h |   22 ++--
 2 files changed, 105 insertions(+), 104 deletions(-)

diffs (truncated from 693 to 300 lines):

diff -r e006fa6270d8 -r 831fa3d7380e sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Tue Dec 23 19:31:44 2014 +0000
+++ b/sys/dev/usb/ehci.c        Wed Dec 24 14:11:05 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.234.2.19 2014/12/23 19:31:44 skrll Exp $ */
+/*     $NetBSD: ehci.c,v 1.234.2.20 2014/12/24 14:11:05 skrll 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.234.2.19 2014/12/23 19:31:44 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.20 2014/12/24 14:11:05 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -273,13 +273,13 @@
 #define EHCI_NULL htole32(EHCI_LINK_TERMINATE)
 
 #define ehci_add_intr_list(sc, ex) \
-       TAILQ_INSERT_TAIL(&(sc)->sc_intrhead, (ex), inext);
+       TAILQ_INSERT_TAIL(&(sc)->sc_intrhead, (ex), ex_next);
 #define ehci_del_intr_list(sc, ex) \
        do { \
-               TAILQ_REMOVE(&sc->sc_intrhead, (ex), inext); \
-               (ex)->inext.tqe_prev = NULL; \
+               TAILQ_REMOVE(&sc->sc_intrhead, (ex), ex_next); \
+               (ex)->ex_next.tqe_prev = NULL; \
        } while (0)
-#define ehci_active_intr_list(ex) ((ex)->inext.tqe_prev != NULL)
+#define ehci_active_intr_list(ex) ((ex)->ex_next.tqe_prev != NULL)
 
 Static const struct usbd_bus_methods ehci_bus_methods = {
        .ubm_open =     ehci_open,
@@ -778,7 +778,7 @@
         * clue what, so we need to scan through all active transfers. :-(
         */
        for (ex = TAILQ_FIRST(&sc->sc_intrhead); ex; ex = nextex) {
-               nextex = TAILQ_NEXT(ex, inext);
+               nextex = TAILQ_NEXT(ex, ex_next);
                ehci_check_intr(sc, ex);
        }
 
@@ -798,7 +798,7 @@
 Static void
 ehci_check_intr(ehci_softc_t *sc, struct ehci_xfer *ex)
 {
-       usbd_device_handle dev = ex->xfer.ux_pipe->up_dev;
+       usbd_device_handle dev = ex->ex_xfer.ux_pipe->up_dev;
        int attr;
 
        USBHIST_FUNC(); USBHIST_CALLED(ehcidebug);
@@ -806,7 +806,7 @@
 
        KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(&sc->sc_lock));
 
-       attr = ex->xfer.ux_pipe->up_endpoint->ue_edesc->bmAttributes;
+       attr = ex->ex_xfer.ux_pipe->up_endpoint->ue_edesc->bmAttributes;
        if (UE_GET_XFERTYPE(attr) == UE_ISOCHRONOUS) {
                if (dev->ud_speed == USB_SPEED_HIGH)
                        ehci_check_itd_intr(sc, ex);
@@ -828,12 +828,12 @@
 
        KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(&sc->sc_lock));
 
-       if (ex->sqtdstart == NULL) {
+       if (ex->ex_sqtdstart == NULL) {
                printf("ehci_check_qh_intr: not valid sqtd\n");
                return;
        }
 
-       lsqtd = ex->sqtdend;
+       lsqtd = ex->ex_sqtdend;
 #ifdef DIAGNOSTIC
        if (lsqtd == NULL) {
                printf("ehci_check_qh_intr: lsqtd==0\n");
@@ -855,7 +855,8 @@
            sizeof(lsqtd->qtd.qtd_status), BUS_DMASYNC_PREREAD);
        if (status & EHCI_QTD_ACTIVE) {
                USBHIST_LOGN(ehcidebug, 10, "active ex=%p", ex, 0, 0, 0);
-               for (sqtd = ex->sqtdstart; sqtd != lsqtd; sqtd=sqtd->nextqtd) {
+               for (sqtd = ex->ex_sqtdstart; sqtd != lsqtd;
+                    sqtd = sqtd->nextqtd) {
                        usb_syncmem(&sqtd->dma,
                            sqtd->offs + offsetof(ehci_qtd_t, qtd_status),
                            sizeof(sqtd->qtd.qtd_status),
@@ -872,7 +873,7 @@
                                goto done;
                        /* Handle short packets */
                        if (EHCI_QTD_GET_BYTES(status) != 0) {
-                               usbd_pipe_handle pipe = ex->xfer.ux_pipe;
+                               usbd_pipe_handle pipe = ex->ex_xfer.ux_pipe;
                                usb_endpoint_descriptor_t *ed =
                                    pipe->up_endpoint->ue_edesc;
                                uint8_t xt = UE_GET_XFERTYPE(ed->bmAttributes);
@@ -892,12 +893,12 @@
                        }
                }
                USBHIST_LOGN(ehcidebug, 10, "ex=%p std=%p still active",
-                   ex, ex->sqtdstart, 0, 0);
+                   ex, ex->ex_sqtdstart, 0, 0);
                return;
        }
  done:
        USBHIST_LOGN(ehcidebug, 10, "ex=%p done", ex, 0, 0, 0);
-       callout_stop(&ex->xfer.ux_callout);
+       callout_stop(&ex->ex_xfer.ux_callout);
        ehci_idone(ex);
 }
 
@@ -911,15 +912,15 @@
 
        KASSERT(mutex_owned(&sc->sc_lock));
 
-       if (&ex->xfer != SIMPLEQ_FIRST(&ex->xfer.ux_pipe->up_queue))
+       if (&ex->ex_xfer != SIMPLEQ_FIRST(&ex->ex_xfer.ux_pipe->up_queue))
                return;
 
-       if (ex->itdstart == NULL) {
+       if (ex->ex_itdstart == NULL) {
                printf("ehci_check_itd_intr: not valid itd\n");
                return;
        }
 
-       itd = ex->itdend;
+       itd = ex->ex_itdend;
 #ifdef DIAGNOSTIC
        if (itd == NULL) {
                printf("ehci_check_itd_intr: itdend == 0\n");
@@ -945,11 +946,11 @@
        }
 
        USBHIST_LOGN(ehcidebug, 10, "ex %p itd %p still active", ex,
-           ex->itdstart, 0, 0);
+           ex->ex_itdstart, 0, 0);
        return;
 done:
        USBHIST_LOG(ehcidebug, "ex %p done", ex, 0, 0, 0);
-       callout_stop(&ex->xfer.ux_callout);
+       callout_stop(&ex->ex_xfer.ux_callout);
        ehci_idone(ex);
 }
 
@@ -962,15 +963,15 @@
 
        KASSERT(mutex_owned(&sc->sc_lock));
 
-       if (&ex->xfer != SIMPLEQ_FIRST(&ex->xfer.ux_pipe->up_queue))
+       if (&ex->ex_xfer != SIMPLEQ_FIRST(&ex->ex_xfer.ux_pipe->up_queue))
                return;
 
-       if (ex->sitdstart == NULL) {
+       if (ex->ex_sitdstart == NULL) {
                printf("ehci_check_sitd_intr: not valid sitd\n");
                return;
        }
 
-       sitd = ex->sitdend;
+       sitd = ex->ex_sitdend;
 #ifdef DIAGNOSTIC
        if (sitd == NULL) {
                printf("ehci_check_sitd_intr: sitdend == 0\n");
@@ -990,7 +991,7 @@
                return;
 
        USBHIST_LOGN(ehcidebug, 10, "ex=%p done", ex, 0, 0, 0);
-       callout_stop(&(ex->xfer.ux_callout));
+       callout_stop(&(ex->ex_xfer.ux_callout));
        ehci_idone(ex);
 }
 
@@ -998,7 +999,7 @@
 Static void
 ehci_idone(struct ehci_xfer *ex)
 {
-       usbd_xfer_handle xfer = &ex->xfer;
+       usbd_xfer_handle xfer = &ex->ex_xfer;
        struct ehci_pipe *epipe = (struct ehci_pipe *)xfer->ux_pipe;
        struct ehci_softc *sc = xfer->ux_pipe->up_dev->ud_bus->ub_hcpriv;
        ehci_soft_qtd_t *sqtd, *lsqtd;
@@ -1012,14 +1013,14 @@
        USBHIST_LOG(ehcidebug, "ex=%p", ex, 0, 0, 0);
 
 #ifdef DIAGNOSTIC
-       if (ex->isdone) {
+       if (ex->ex_isdone) {
                printf("ehci_idone: ex=%p is done!\n", ex);
 #ifdef EHCI_DEBUG
                ehci_dump_exfer(ex);
 #endif
                return;
        }
-       ex->isdone = 1;
+       ex->ex_isdone = 1;
 #endif
 
        if (xfer->ux_status == USBD_CANCELLED ||
@@ -1030,7 +1031,7 @@
 
        USBHIST_LOG(ehcidebug, "xfer=%p, pipe=%p ready", xfer, epipe, 0, 0);
 #ifdef EHCI_DEBUG
-       ehci_dump_sqtds(ex->sqtdstart);
+       ehci_dump_sqtds(ex->ex_sqtdstart);
 #endif
 
        /* The transfer is done, compute actual length and status. */
@@ -1051,7 +1052,7 @@
                i = xfer->ux_pipe->up_endpoint->ue_edesc->bInterval;
                uframes = min(1 << (i - 1), USB_UFRAMES_PER_FRAME);
 
-               for (itd = ex->itdstart; itd != NULL; itd = itd->xfer_next) {
+               for (itd = ex->ex_itdstart; itd != NULL; itd = itd->xfer_next) {
                        usb_syncmem(&itd->dma,itd->offs + offsetof(ehci_itd_t,itd_ctl),
                            sizeof(itd->itd.itd_ctl), BUS_DMASYNC_POSTWRITE |
                            BUS_DMASYNC_POSTREAD);
@@ -1092,7 +1093,7 @@
                nframes = 0;
                actlen = 0;
 
-               for (sitd = ex->sitdstart; sitd != NULL; sitd = sitd->xfer_next) {
+               for (sitd = ex->ex_sitdstart; sitd != NULL; sitd = sitd->xfer_next) {
                        usb_syncmem(&sitd->dma,sitd->offs + offsetof(ehci_sitd_t, sitd_buffer),
                            sizeof(sitd->sitd.sitd_buffer), BUS_DMASYNC_POSTWRITE |
                            BUS_DMASYNC_POSTREAD);
@@ -1134,9 +1135,9 @@
 
        /* Continue processing xfers using queue heads */
 
-       lsqtd = ex->sqtdend;
+       lsqtd = ex->ex_sqtdend;
        actlen = 0;
-       for (sqtd = ex->sqtdstart; sqtd != lsqtd->nextqtd;
+       for (sqtd = ex->ex_sqtdstart; sqtd != lsqtd->nextqtd;
             sqtd = sqtd->nextqtd) {
                usb_syncmem(&sqtd->dma, sqtd->offs, sizeof(sqtd->qtd),
                    BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD);
@@ -1164,7 +1165,7 @@
                    status, nstatus, 0, 0);
 #if 0
                ehci_dump_sqh(epipe->sqh);
-               ehci_dump_sqtds(ex->sqtdstart);
+               ehci_dump_sqtds(ex->ex_sqtdstart);
 #endif
                epipe->nexttoggle = EHCI_QTD_GET_TOGGLE(nstatus);
        }
@@ -1195,7 +1196,7 @@
                    status & EHCI_QTD_PINGSTATE ? 1 : 0);
 
                ehci_dump_sqh(epipe->sqh);
-               ehci_dump_sqtds(ex->sqtdstart);
+               ehci_dump_sqtds(ex->ex_sqtdstart);
 #endif
                /* low&full speed has an extra error flag */
                if (EHCI_QH_GET_EPS(epipe->sqh->qh.qh_endp) !=
@@ -1503,7 +1504,7 @@
        if (xfer != NULL) {
                memset(xfer, 0, sizeof(struct ehci_xfer));
 #ifdef DIAGNOSTIC
-               EXFER(xfer)->isdone = 1;
+               EXFER(xfer)->ex_isdone = 1;
                xfer->ux_state = XFER_BUSY;
 #endif
        }
@@ -1521,7 +1522,7 @@
                       xfer->ux_state);
        }
        xfer->ux_state = XFER_FREE;
-       if (!EXFER(xfer)->isdone) {
+       if (!EXFER(xfer)->ex_isdone) {
                printf("ehci_freex: !isdone\n");
        }
 #endif
@@ -1814,9 +1815,9 @@
        USBHIST_FUNC(); USBHIST_CALLED(ehcidebug);
 
        USBHIST_LOG(ehcidebug, "ex = %p sqtdstart = %p end = %p",
-           ex, ex->sqtdstart, ex->sqtdend, 0);
+           ex, ex->ex_sqtdstart, ex->ex_sqtdend, 0);
        USBHIST_LOG(ehcidebug, "     itdstart = %p end = %p isdone = %d",
-           ex->itdstart, ex->itdend, ex->isdone, 0);
+           ex->ex_itdstart, ex->ex_itdend, ex->ex_isdone, 0);
 }
 #endif
 
@@ -2146,10 +2147,10 @@
 
        prev = NULL;
 
-       if (exfer->itdstart == NULL || exfer->itdend == NULL)
+       if (exfer->ex_itdstart == NULL || exfer->ex_itdend == NULL)
                panic("ehci isoc xfer being freed, but with no itd chain\n");
 
-       for (itd = exfer->itdstart; itd != NULL; itd = itd->xfer_next) {
+       for (itd = exfer->ex_itdstart; itd != NULL; itd = itd->xfer_next) {
                prev = itd->u.frame_list.prev;
                /* Unlink itd from hardware chain, or frame array */
                if (prev == NULL) { /* We're at the table head */
@@ -2176,15 +2177,15 @@



Home | Main Index | Thread Index | Old Index