Source-Changes-HG archive

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

[src/trunk]: src/sys/dev convert the remaining dev/sbus drivers to CFATTACH_D...



details:   https://anonhg.NetBSD.org/src/rev/14aa02929a99
branches:  trunk
changeset: 767409:14aa02929a99
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Jul 18 00:58:51 2011 +0000

description:
convert the remaining dev/sbus drivers to CFATTACH_DECL_NEW, cfdata_t
and device_t, including the pci frontend and backend for en(4).

diffstat:

 sys/dev/ic/cd18xxvar.h  |    4 +-
 sys/dev/ic/midway.c     |  184 ++++++++++++++++++++++++------------------------
 sys/dev/ic/midwayvar.h  |    4 +-
 sys/dev/pci/if_en_pci.c |   18 ++--
 sys/dev/sbus/if_en.c    |   22 +----
 sys/dev/sbus/qe.c       |   55 +++++++------
 sys/dev/sbus/sio16.c    |   14 ++-
 sys/dev/sbus/spif.c     |   17 ++-
 sys/dev/sbus/spifvar.h  |    7 +-
 sys/dev/sbus/stp4020.c  |   18 ++--
 sys/dev/sbus/xbox.c     |    9 +-
 11 files changed, 175 insertions(+), 177 deletions(-)

diffs (truncated from 1455 to 300 lines):

diff -r 50ac1cfb237f -r 14aa02929a99 sys/dev/ic/cd18xxvar.h
--- a/sys/dev/ic/cd18xxvar.h    Mon Jul 18 00:43:35 2011 +0000
+++ b/sys/dev/ic/cd18xxvar.h    Mon Jul 18 00:58:51 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd18xxvar.h,v 1.2 2008/05/29 14:51:27 mrg Exp $        */
+/*     $NetBSD: cd18xxvar.h,v 1.3 2011/07/18 00:58:51 mrg Exp $        */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -97,8 +97,6 @@
 
 /* softc allocated per-cd18xx */
 struct cd18xx_softc {
-       struct device           sc_dev;
-
        /* tag and handle for our registers (128 bytes) */
        bus_space_tag_t         sc_tag;
        bus_space_handle_t      sc_handle;
diff -r 50ac1cfb237f -r 14aa02929a99 sys/dev/ic/midway.c
--- a/sys/dev/ic/midway.c       Mon Jul 18 00:43:35 2011 +0000
+++ b/sys/dev/ic/midway.c       Mon Jul 18 00:58:51 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: midway.c,v 1.92 2011/02/01 19:50:03 chuck Exp $        */
+/*     $NetBSD: midway.c,v 1.93 2011/07/18 00:58:51 mrg Exp $  */
 /*     (sync'd to midway.c 1.68)       */
 
 /*
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.92 2011/02/01 19:50:03 chuck Exp $");
+__KERNEL_RCSID(0, "$NetBSD: midway.c,v 1.93 2011/07/18 00:58:51 mrg Exp $");
 
 #include "opt_natm.h"
 
@@ -728,7 +728,7 @@
 
   reg = EN_READ(sc, MID_RESID);
 
-  aprint_normal_dev(&sc->sc_dev, 
+  aprint_normal_dev(sc->sc_dev, 
       "ATM midway v%d, board IDs %d.%d, %s%s%s, %ldKB on-board RAM\n",
        MID_VER(reg), MID_MID(reg), MID_DID(reg),
        (MID_IS_SABRE(reg)) ? "sabre controller, " : "",
@@ -738,19 +738,19 @@
 
   if (sc->is_adaptec) {
     if (sc->bestburstlen == 64 && sc->alburst == 0)
-      aprint_normal_dev(&sc->sc_dev, "passed 64 byte DMA test\n");
+      aprint_normal_dev(sc->sc_dev, "passed 64 byte DMA test\n");
     else
-      aprint_error_dev(&sc->sc_dev, "FAILED DMA TEST: burst=%d, alburst=%d\n",
+      aprint_error_dev(sc->sc_dev, "FAILED DMA TEST: burst=%d, alburst=%d\n",
            sc->bestburstlen, sc->alburst);
   } else {
-    aprint_normal_dev(&sc->sc_dev, "maximum DMA burst length = %d bytes%s\n",
+    aprint_normal_dev(sc->sc_dev, "maximum DMA burst length = %d bytes%s\n",
          sc->bestburstlen, (sc->alburst) ? " (must align)" : "");
   }
 
 #if 0          /* WMAYBE doesn't work, don't complain about it */
   /* check if en_dmaprobe disabled wmaybe */
   if (en_dmaplan == en_dma_planB)
-    aprint_normal_dev(&sc->sc_dev, "note: WMAYBE DMA has been disabled\n");
+    aprint_normal_dev(sc->sc_dev, "note: WMAYBE DMA has been disabled\n");
 #endif
 
   /*
@@ -758,7 +758,7 @@
    */
 
 #if defined(__NetBSD__) || defined(__OpenBSD__)
-  strlcpy(sc->enif.if_xname, device_xname(&sc->sc_dev), IFNAMSIZ);
+  strlcpy(sc->enif.if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
 #endif
 #if !defined(MISSING_IF_SOFTC)
   sc->enif.if_softc = sc;
@@ -784,7 +784,7 @@
   ptr = roundup(ptr, EN_TXSZ * 1024);  /* align */
   sz = sz - (ptr - sav);
   if (EN_TXSZ*1024 * EN_NTX > sz) {
-    aprint_error_dev(&sc->sc_dev, "EN_NTX/EN_TXSZ too big\n");
+    aprint_error_dev(sc->sc_dev, "EN_NTX/EN_TXSZ too big\n");
     return;
   }
   for (lcv = 0 ; lcv < EN_NTX ; lcv++) {
@@ -800,7 +800,7 @@
     memset(&sc->txslot[lcv].indma, 0, sizeof(sc->txslot[lcv].indma));
     memset(&sc->txslot[lcv].q, 0, sizeof(sc->txslot[lcv].q));
 #ifdef EN_DEBUG
-    aprint_debug_dev(&sc->sc_dev, "tx%d: start 0x%x, stop 0x%x\n", lcv,
+    aprint_debug_dev(sc->sc_dev, "tx%d: start 0x%x, stop 0x%x\n", lcv,
                sc->txslot[lcv].start, sc->txslot[lcv].stop);
 #endif
   }
@@ -810,7 +810,7 @@
   sz = sz - (ptr - sav);
   sc->en_nrx = sz / (EN_RXSZ * 1024);
   if (sc->en_nrx <= 0) {
-    aprint_error_dev(&sc->sc_dev, "EN_NTX/EN_TXSZ/EN_RXSZ too big\n");
+    aprint_error_dev(sc->sc_dev, "EN_NTX/EN_TXSZ/EN_RXSZ too big\n");
     return;
   }
 
@@ -838,7 +838,7 @@
        (en_k2sz(EN_RXSZ) << MIDV_SZSHIFT) | MIDV_TRASH;
 
 #ifdef EN_DEBUG
-    aprint_debug_dev(&sc->sc_dev, "rx%d: start 0x%x, stop 0x%x, mode 0x%x\n",
+    aprint_debug_dev(sc->sc_dev, "rx%d: start 0x%x, stop 0x%x, mode 0x%x\n",
        lcv, sc->rxslot[lcv].start, sc->rxslot[lcv].stop, sc->rxslot[lcv].mode);
 #endif
   }
@@ -852,11 +852,11 @@
 #endif
   sc->need_drqs = sc->need_dtqs = 0;
 
-  aprint_normal_dev(&sc->sc_dev,
+  aprint_normal_dev(sc->sc_dev,
        "%d %dKB receive buffers, %d %dKB transmit buffers allocated\n",
        sc->en_nrx, EN_RXSZ, EN_NTX, EN_TXSZ);
 
-  aprint_normal_dev(&sc->sc_dev, "End Station Identifier (mac address) %s\n",
+  aprint_normal_dev(sc->sc_dev, "End Station Identifier (mac address) %s\n",
         ether_sprintf(sc->macaddr));
 
   /*
@@ -945,7 +945,7 @@
   }
   if (EN_NOWMAYBE || fail) {
     if (fail)
-      aprint_error_dev(&sc->sc_dev, "WARNING: WMAYBE DMA test failed %d time(s)\n",
+      aprint_error_dev(sc->sc_dev, "WARNING: WMAYBE DMA test failed %d time(s)\n",
        fail);
     en_dmaplan = en_dma_planB;         /* fall back to plan B */
   }
@@ -1025,14 +1025,14 @@
       DELAY(1);
       cnt--;
       if (cnt == 0) {
-       aprint_error_dev(&sc->sc_dev, "unexpected timeout in tx DMA test\n");
+       aprint_error_dev(sc->sc_dev, "unexpected timeout in tx DMA test\n");
        return(retval);         /* timeout, give up */
       }
     }
     EN_WRAPADD(MID_DTQOFF, MID_DTQEND, sc->dtq_chip, 8);
     reg = EN_READ(sc, MID_INTACK);
     if ((reg & MID_INT_DMA_TX) != MID_INT_DMA_TX) {
-      aprint_error_dev(&sc->sc_dev, "unexpected status in tx DMA test: 0x%x\n",
+      aprint_error_dev(sc->sc_dev, "unexpected status in tx DMA test: 0x%x\n",
                reg);
       return(retval);
     }
@@ -1051,14 +1051,14 @@
       DELAY(1);
       cnt--;
       if (cnt == 0) {
-       aprint_error_dev(&sc->sc_dev, "unexpected timeout in rx DMA test\n");
+       aprint_error_dev(sc->sc_dev, "unexpected timeout in rx DMA test\n");
        return(retval);         /* timeout, give up */
       }
     }
     EN_WRAPADD(MID_DRQOFF, MID_DRQEND, sc->drq_chip, 8);
     reg = EN_READ(sc, MID_INTACK);
     if ((reg & MID_INT_DMA_RX) != MID_INT_DMA_RX) {
-      aprint_error_dev(&sc->sc_dev, "unexpected status in rx DMA test: 0x%x\n",
+      aprint_error_dev(sc->sc_dev, "unexpected status in rx DMA test: 0x%x\n",
                reg);
       return(retval);
     }
@@ -1133,7 +1133,7 @@
                }
 #ifdef EN_DEBUG
                printf("%s: rxvci%d: turn %s raw (boodi) mode\n",
-                       device_xname(&sc->sc_dev), ario->npcb->npcb_vci,
+                       device_xname(sc->sc_dev), ario->npcb->npcb_vci,
                        (ario->rawvalue) ? "on" : "off");
 #endif
                break;
@@ -1297,7 +1297,7 @@
   flags = ATM_PH_FLAGS(&pi->aph);
 
 #ifdef EN_DEBUG
-  printf("%s: %s vpi=%d, vci=%d, flags=%d\n", device_xname(&sc->sc_dev),
+  printf("%s: %s vpi=%d, vci=%d, flags=%d\n", device_xname(sc->sc_dev),
        (on) ? "enable" : "disable", ATM_PH_VPI(&pi->aph), vci, flags);
 #endif
 
@@ -1368,7 +1368,7 @@
   }
   splx(s);             /* enable enintr() */
 #ifdef EN_DEBUG
-  printf("%s: rx%d: VCI %d is now %s\n", device_xname(&sc->sc_dev), slot, vci,
+  printf("%s: rx%d: VCI %d is now %s\n", device_xname(sc->sc_dev), slot, vci,
        (sc->rxslot[slot].oth_flags & ENOTHER_DRAIN) ? "draining" : "free");
 #endif
   return(0);
@@ -1387,7 +1387,7 @@
   int lcv, slot;
 
 #ifdef EN_DEBUG
-  printf("%s: reset\n", device_xname(&sc->sc_dev));
+  printf("%s: reset\n", device_xname(sc->sc_dev));
 #endif
 
   if (sc->en_busreset)
@@ -1420,7 +1420,7 @@
       sc->rxslot[slot].oth_flags = ENOTHER_FREE;
       sc->rxvc2slot[lcv] = RX_NONE;
 #ifdef EN_DEBUG
-  printf("%s: rx%d: VCI %d is now free\n", device_xname(&sc->sc_dev), slot, lcv);
+  printf("%s: rx%d: VCI %d is now free\n", device_xname(sc->sc_dev), slot, lcv);
 #endif
     }
   }
@@ -1475,7 +1475,7 @@
     }
 #endif
 #ifdef EN_DEBUG
-    printf("%s: going down\n", device_xname(&sc->sc_dev));
+    printf("%s: going down\n", device_xname(sc->sc_dev));
 #endif
     en_reset(sc);                      /* to be safe */
     sc->enif.if_flags &= ~IFF_RUNNING; /* disable */
@@ -1486,7 +1486,7 @@
  up:
 #endif
 #ifdef EN_DEBUG
-  printf("%s: going up\n", device_xname(&sc->sc_dev));
+  printf("%s: going up\n", device_xname(sc->sc_dev));
 #endif
   sc->enif.if_flags |= IFF_RUNNING;    /* enable */
 #ifdef ATM_PVCEXT
@@ -1535,7 +1535,7 @@
 
 #ifdef EN_DEBUG
   printf("%s: drq free/chip: %d/0x%x, dtq free/chip: %d/0x%x, hwslist: 0x%x\n",
-    device_xname(&sc->sc_dev), sc->drq_free, sc->drq_chip,
+    device_xname(sc->sc_dev), sc->drq_free, sc->drq_chip,
     sc->dtq_free, sc->dtq_chip, sc->hwslistp);
 #endif
 
@@ -1549,7 +1549,7 @@
     loc = loc >> MIDV_LOCTOPSHFT;      /* top 11 bits */
     EN_WRITE(sc, MIDX_PLACE(slot), MIDX_MKPLACE(en_k2sz(EN_TXSZ), loc));
 #ifdef EN_DEBUG
-    printf("%s: tx%d: place 0x%x\n", device_xname(&sc->sc_dev),  slot,
+    printf("%s: tx%d: place 0x%x\n", device_xname(sc->sc_dev),  slot,
        EN_READ(sc, MIDX_PLACE(slot)));
 #endif
   }
@@ -1590,7 +1590,7 @@
   sc->rxslot[slot].cur = sc->rxslot[slot].start;
 
 #ifdef EN_DEBUG
-    printf("%s: rx%d: assigned to VCI %d\n", device_xname(&sc->sc_dev), slot, vc);
+    printf("%s: rx%d: assigned to VCI %d\n", device_xname(sc->sc_dev), slot, vc);
 #endif
 }
 
@@ -1679,7 +1679,7 @@
 
       if (atm_vpi || atm_vci >= MID_N_VC) {
        printf("%s: output vpi=%d, vci=%d out of card range, dropping...\n",
-               device_xname(&sc->sc_dev), atm_vpi, atm_vci);
+               device_xname(sc->sc_dev), atm_vpi, atm_vci);
        m_freem(m);
        continue;
       }
@@ -1705,7 +1705,7 @@
 
 #ifdef EN_DEBUG
       printf("%s: txvci%d: mlen=%d, got=%d, need=%d, toadd=%d, cell#=%d\n",
-       device_xname(&sc->sc_dev), atm_vci, mlen, got, need, toadd, cellcnt);
+       device_xname(sc->sc_dev), atm_vci, mlen, got, need, toadd, cellcnt);
       printf("     leading_space=%d, trailing_space=%d\n",
        M_LEADINGSPACE(m), M_TRAILINGSPACE(lastm));
 #endif
@@ -1761,7 +1761,7 @@
        EN_COUNT(sc->txmbovr);
        m_freem(m);
 #ifdef EN_DEBUG
-       printf("%s: tx%d: buffer space shortage\n", device_xname(&sc->sc_dev),
+       printf("%s: tx%d: buffer space shortage\n", device_xname(sc->sc_dev),
                txchan);
 #endif
        continue;
@@ -1771,7 +1771,7 @@
 
 #ifdef EN_DEBUG
       printf("%s: tx%d: VPI=%d, VCI=%d, FLAGS=0x%x, speed=0x%x\n",
-       device_xname(&sc->sc_dev), txchan, atm_vpi, atm_vci, atm_flags,
+       device_xname(sc->sc_dev), txchan, atm_vpi, atm_vci, atm_flags,
        sc->txspeed[atm_vci]);
       printf("     adjusted mlen=%d, mbsize=%d\n", mlen,
                sc->txslot[txchan].mbsize);
@@ -1802,7 +1802,7 @@
 
   EN_COUNT(sc->mfix);                  /* count # of calls */



Home | Main Index | Thread Index | Old Index