- printf -> kprintf, sprintf -> ksprintf

This commit is contained in:
christos 1996-10-10 22:18:34 +00:00
parent 48635ba80c
commit 4c14cd79b2
7 changed files with 315 additions and 322 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: am7990.c,v 1.20 1996/07/05 23:56:57 abrown Exp $ */
/* $NetBSD: am7990.c,v 1.21 1996/10/10 22:18:34 christos Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@ -189,8 +189,8 @@ am7990_config(sc)
panic("am7990_config: weird memory size");
}
printf(": address %s\n", ether_sprintf(sc->sc_arpcom.ac_enaddr));
printf("%s: %d receive buffers, %d transmit buffers\n",
kprintf(": address %s\n", ether_sprintf(sc->sc_arpcom.ac_enaddr));
kprintf("%s: %d receive buffers, %d transmit buffers\n",
sc->sc_dev.dv_xname, sc->sc_nrbuf, sc->sc_ntbuf);
sc->sc_sh = shutdownhook_establish(am7990_shutdown, sc);
@ -345,7 +345,7 @@ am7990_init(sc)
ifp->if_timer = 0;
am7990_start(ifp);
} else
printf("%s: card failed to initialize\n", sc->sc_dev.dv_xname);
kprintf("%s: card failed to initialize\n", sc->sc_dev.dv_xname);
if (sc->sc_hwinit)
(*sc->sc_hwinit)(sc);
}
@ -446,7 +446,7 @@ am7990_read(sc, boff, len)
if (len <= sizeof(struct ether_header) ||
len > ETHERMTU + sizeof(struct ether_header)) {
#ifdef LEDEBUG
printf("%s: invalid packet size %d; dropping\n",
kprintf("%s: invalid packet size %d; dropping\n",
sc->sc_dev.dv_xname, len);
#endif
ifp->if_ierrors++;
@ -532,25 +532,25 @@ am7990_rint(sc)
#ifdef LEDEBUG
if ((rmd.rmd1_bits & LE_R1_OFLO) == 0) {
if (rmd.rmd1_bits & LE_R1_FRAM)
printf("%s: framing error\n",
kprintf("%s: framing error\n",
sc->sc_dev.dv_xname);
if (rmd.rmd1_bits & LE_R1_CRC)
printf("%s: crc mismatch\n",
kprintf("%s: crc mismatch\n",
sc->sc_dev.dv_xname);
}
#endif
} else {
if (rmd.rmd1_bits & LE_R1_OFLO)
printf("%s: overflow\n",
kprintf("%s: overflow\n",
sc->sc_dev.dv_xname);
}
if (rmd.rmd1_bits & LE_R1_BUFF)
printf("%s: receive buffer error\n",
kprintf("%s: receive buffer error\n",
sc->sc_dev.dv_xname);
ifp->if_ierrors++;
} else if ((rmd.rmd1_bits & (LE_R1_STP | LE_R1_ENP)) !=
(LE_R1_STP | LE_R1_ENP)) {
printf("%s: dropping chained buffer\n",
kprintf("%s: dropping chained buffer\n",
sc->sc_dev.dv_xname);
ifp->if_ierrors++;
} else {
@ -569,7 +569,7 @@ am7990_rint(sc)
#ifdef LEDEBUG
if (sc->sc_debug)
printf("sc->sc_last_rd = %x, rmd: "
kprintf("sc->sc_last_rd = %x, rmd: "
"ladr %04x, hadr %02x, flags %02x, "
"bcnt %04x, mcnt %04x\n",
sc->sc_last_rd,
@ -599,11 +599,11 @@ am7990_tint(sc)
#ifdef LEDEBUG
if (sc->sc_debug)
printf("trans tmd: "
"ladr %04x, hadr %02x, flags %02x, "
"bcnt %04x, mcnt %04x\n",
tmd.tmd0, tmd.tmd1_hadr, tmd.tmd1_bits,
tmd.tmd2, tmd.tmd3);
kprintf("trans tmd: "
"ladr %04x, hadr %02x, flags %02x, "
"bcnt %04x, mcnt %04x\n",
tmd.tmd0, tmd.tmd1_hadr, tmd.tmd1_bits,
tmd.tmd2, tmd.tmd3);
#endif
(*sc->sc_copyfromdesc)(sc, &tmd, LE_TMDADDR(sc, bix),
@ -616,10 +616,10 @@ am7990_tint(sc)
if (tmd.tmd1_bits & LE_T1_ERR) {
if (tmd.tmd3 & LE_T3_BUFF)
printf("%s: transmit buffer error\n",
kprintf("%s: transmit buffer error\n",
sc->sc_dev.dv_xname);
else if (tmd.tmd3 & LE_T3_UFLO)
printf("%s: underflow\n", sc->sc_dev.dv_xname);
kprintf("%s: underflow\n", sc->sc_dev.dv_xname);
if (tmd.tmd3 & (LE_T3_BUFF | LE_T3_UFLO)) {
am7990_reset(sc);
return;
@ -628,13 +628,13 @@ am7990_tint(sc)
if (sc->sc_nocarrier)
(*sc->sc_nocarrier)(sc);
else
printf("%s: lost carrier\n",
kprintf("%s: lost carrier\n",
sc->sc_dev.dv_xname);
}
if (tmd.tmd3 & LE_T3_LCOL)
ifp->if_collisions++;
if (tmd.tmd3 & LE_T3_RTRY) {
printf("%s: excessive collisions, tdr %d\n",
kprintf("%s: excessive collisions, tdr %d\n",
sc->sc_dev.dv_xname,
tmd.tmd3 & LE_T3_TDR_MASK);
ifp->if_collisions += 16;
@ -676,7 +676,7 @@ am7990_intr(arg)
isr = (*sc->sc_rdcsr)(sc, LE_CSR0);
#ifdef LEDEBUG
if (sc->sc_debug)
printf("%s: am7990_intr entering with isr=%04x\n",
kprintf("%s: am7990_intr entering with isr=%04x\n",
sc->sc_dev.dv_xname, isr);
#endif
if ((isr & LE_C0_INTR) == 0)
@ -688,37 +688,37 @@ am7990_intr(arg)
if (isr & LE_C0_ERR) {
if (isr & LE_C0_BABL) {
#ifdef LEDEBUG
printf("%s: babble\n", sc->sc_dev.dv_xname);
kprintf("%s: babble\n", sc->sc_dev.dv_xname);
#endif
ifp->if_oerrors++;
}
#if 0
if (isr & LE_C0_CERR) {
printf("%s: collision error\n", sc->sc_dev.dv_xname);
kprintf("%s: collision error\n", sc->sc_dev.dv_xname);
ifp->if_collisions++;
}
#endif
if (isr & LE_C0_MISS) {
#ifdef LEDEBUG
printf("%s: missed packet\n", sc->sc_dev.dv_xname);
kprintf("%s: missed packet\n", sc->sc_dev.dv_xname);
#endif
ifp->if_ierrors++;
}
if (isr & LE_C0_MERR) {
printf("%s: memory error\n", sc->sc_dev.dv_xname);
kprintf("%s: memory error\n", sc->sc_dev.dv_xname);
am7990_reset(sc);
return (1);
}
}
if ((isr & LE_C0_RXON) == 0) {
printf("%s: receiver disabled\n", sc->sc_dev.dv_xname);
kprintf("%s: receiver disabled\n", sc->sc_dev.dv_xname);
ifp->if_ierrors++;
am7990_reset(sc);
return (1);
}
if ((isr & LE_C0_TXON) == 0) {
printf("%s: transmitter disabled\n", sc->sc_dev.dv_xname);
kprintf("%s: transmitter disabled\n", sc->sc_dev.dv_xname);
ifp->if_oerrors++;
am7990_reset(sc);
return (1);
@ -774,7 +774,7 @@ am7990_start(ifp)
if (tmd.tmd1_bits & LE_T1_OWN) {
ifp->if_flags |= IFF_OACTIVE;
printf("missing buffer, no_td = %d, last_td = %d\n",
kprintf("missing buffer, no_td = %d, last_td = %d\n",
sc->sc_no_td, sc->sc_last_td);
}
@ -798,7 +798,7 @@ am7990_start(ifp)
#ifdef LEDEBUG
if (len > ETHERMTU + sizeof(struct ether_header))
printf("packet length %d\n", len);
kprintf("packet length %d\n", len);
#endif
ifp->if_timer = 5;
@ -970,18 +970,18 @@ am7990_recv_print(sc, no)
(*sc->sc_copyfromdesc)(sc, &rmd, LE_RMDADDR(sc, no), sizeof(rmd));
len = rmd.rmd3;
printf("%s: receive buffer %d, len = %d\n", sc->sc_dev.dv_xname, no,
kprintf("%s: receive buffer %d, len = %d\n", sc->sc_dev.dv_xname, no,
len);
printf("%s: status %04x\n", sc->sc_dev.dv_xname,
kprintf("%s: status %04x\n", sc->sc_dev.dv_xname,
(*sc->sc_rdcsr)(sc, LE_CSR0));
printf("%s: ladr %04x, hadr %02x, flags %02x, bcnt %04x, mcnt %04x\n",
kprintf("%s: ladr %04x, hadr %02x, flags %02x, bcnt %04x, mcnt %04x\n",
sc->sc_dev.dv_xname,
rmd.rmd0, rmd.rmd1_hadr, rmd.rmd1_bits, rmd.rmd2, rmd.rmd3);
if (len >= sizeof(eh)) {
(*sc->sc_copyfrombuf)(sc, &eh, LE_RBUFADDR(sc, no), sizeof(eh));
printf("%s: dst %s", sc->sc_dev.dv_xname,
kprintf("%s: dst %s", sc->sc_dev.dv_xname,
ether_sprintf(eh.ether_dhost));
printf(" src %s type %04x\n", ether_sprintf(eh.ether_shost),
kprintf(" src %s type %04x\n", ether_sprintf(eh.ether_shost),
ntohs(eh.ether_type));
}
}
@ -997,18 +997,18 @@ am7990_xmit_print(sc, no)
(*sc->sc_copyfromdesc)(sc, &tmd, LE_TMDADDR(sc, no), sizeof(tmd));
len = -tmd.tmd2;
printf("%s: transmit buffer %d, len = %d\n", sc->sc_dev.dv_xname, no,
kprintf("%s: transmit buffer %d, len = %d\n", sc->sc_dev.dv_xname, no,
len);
printf("%s: status %04x\n", sc->sc_dev.dv_xname,
kprintf("%s: status %04x\n", sc->sc_dev.dv_xname,
(*sc->sc_rdcsr)(sc, LE_CSR0));
printf("%s: ladr %04x, hadr %02x, flags %02x, bcnt %04x, mcnt %04x\n",
kprintf("%s: ladr %04x, hadr %02x, flags %02x, bcnt %04x, mcnt %04x\n",
sc->sc_dev.dv_xname,
tmd.tmd0, tmd.tmd1_hadr, tmd.tmd1_bits, tmd.tmd2, tmd.tmd3);
if (len >= sizeof(eh)) {
(*sc->sc_copyfrombuf)(sc, &eh, LE_TBUFADDR(sc, no), sizeof(eh));
printf("%s: dst %s", sc->sc_dev.dv_xname,
kprintf("%s: dst %s", sc->sc_dev.dv_xname,
ether_sprintf(eh.ether_dhost));
printf(" src %s type %04x\n", ether_sprintf(eh.ether_shost),
kprintf(" src %s type %04x\n", ether_sprintf(eh.ether_shost),
ntohs(eh.ether_type));
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: elink3.c,v 1.8 1996/09/29 11:19:42 christos Exp $ */
/* $NetBSD: elink3.c,v 1.9 1996/10/10 22:18:36 christos Exp $ */
/*
* Copyright (c) 1994 Herb Peyerl <hpeyerl@beer.org>
@ -108,25 +108,25 @@ epconfig(sc, conn)
u_int16_t i;
sc->ep_connectors = 0;
printf("%s: ", sc->sc_dev.dv_xname);
kprintf("%s: ", sc->sc_dev.dv_xname);
if (conn & IS_AUI) {
printf("aui");
kprintf("aui");
sc->ep_connectors |= AUI;
}
if (conn & IS_BNC) {
if (sc->ep_connectors)
printf("/");
printf("bnc");
kprintf("/");
kprintf("bnc");
sc->ep_connectors |= BNC;
}
if (conn & IS_UTP) {
if (sc->ep_connectors)
printf("/");
printf("utp");
kprintf("/");
kprintf("utp");
sc->ep_connectors |= UTP;
}
if (!sc->ep_connectors)
printf("no connectors!");
kprintf("no connectors!");
/*
* Read the station address from the eeprom
@ -143,7 +143,7 @@ epconfig(sc, conn)
sc->sc_arpcom.ac_enaddr[(i << 1) + 1] = x;
}
printf(" address %s\n", ether_sprintf(sc->sc_arpcom.ac_enaddr));
kprintf(" address %s\n", ether_sprintf(sc->sc_arpcom.ac_enaddr));
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_softc = sc;
@ -428,8 +428,8 @@ readcheck:
/* Check if we are stuck and reset [see XXX comment] */
if (epstatus(sc)) {
if (ifp->if_flags & IFF_DEBUG)
printf("%s: adapter reset\n",
sc->sc_dev.dv_xname);
kprintf("%s: adapter reset\n",
sc->sc_dev.dv_xname);
epreset(sc);
}
}
@ -462,26 +462,26 @@ epstatus(sc)
if (fifost & FIFOS_RX_UNDERRUN) {
if (sc->sc_arpcom.ac_if.if_flags & IFF_DEBUG)
printf("%s: RX underrun\n", sc->sc_dev.dv_xname);
kprintf("%s: RX underrun\n", sc->sc_dev.dv_xname);
epreset(sc);
return 0;
}
if (fifost & FIFOS_RX_STATUS_OVERRUN) {
if (sc->sc_arpcom.ac_if.if_flags & IFF_DEBUG)
printf("%s: RX Status overrun\n", sc->sc_dev.dv_xname);
kprintf("%s: RX Status overrun\n", sc->sc_dev.dv_xname);
return 1;
}
if (fifost & FIFOS_RX_OVERRUN) {
if (sc->sc_arpcom.ac_if.if_flags & IFF_DEBUG)
printf("%s: RX overrun\n", sc->sc_dev.dv_xname);
kprintf("%s: RX overrun\n", sc->sc_dev.dv_xname);
return 1;
}
if (fifost & FIFOS_TX_OVERRUN) {
if (sc->sc_arpcom.ac_if.if_flags & IFF_DEBUG)
printf("%s: TX overrun\n", sc->sc_dev.dv_xname);
kprintf("%s: TX overrun\n", sc->sc_dev.dv_xname);
epreset(sc);
return 0;
}
@ -508,13 +508,13 @@ eptxstat(sc)
if (i & TXS_JABBER) {
++sc->sc_arpcom.ac_if.if_oerrors;
if (sc->sc_arpcom.ac_if.if_flags & IFF_DEBUG)
printf("%s: jabber (%x)\n",
kprintf("%s: jabber (%x)\n",
sc->sc_dev.dv_xname, i);
epreset(sc);
} else if (i & TXS_UNDERRUN) {
++sc->sc_arpcom.ac_if.if_oerrors;
if (sc->sc_arpcom.ac_if.if_flags & IFF_DEBUG)
printf("%s: fifo underrun (%x) @%d\n",
kprintf("%s: fifo underrun (%x) @%d\n",
sc->sc_dev.dv_xname, i,
sc->tx_start_thresh);
if (sc->tx_succ_ok < 100)
@ -568,8 +568,8 @@ epintr(arg)
epstart(&sc->sc_arpcom.ac_if);
}
if (status & S_CARD_FAILURE) {
printf("%s: adapter failure (%x)\n",
sc->sc_dev.dv_xname, status);
kprintf("%s: adapter failure (%x)\n",
sc->sc_dev.dv_xname, status);
epreset(sc);
return (1);
}
@ -617,7 +617,7 @@ again:
s = "dribble bits";
if (s)
printf("%s: %s\n", sc->sc_dev.dv_xname, s);
kprintf("%s: %s\n", sc->sc_dev.dv_xname, s);
}
if (len & ERR_INCOMPLETE)
@ -690,8 +690,8 @@ again:
/* Check if we are stuck and reset [see XXX comment] */
if (len & ERR_INCOMPLETE) {
if (ifp->if_flags & IFF_DEBUG)
printf("%s: adapter reset\n",
sc->sc_dev.dv_xname);
kprintf("%s: adapter reset\n",
sc->sc_dev.dv_xname);
epreset(sc);
return;
}
@ -1003,12 +1003,12 @@ epbusyeeprom(sc)
break;
}
if (!i) {
printf("\n%s: eeprom failed to come ready\n",
kprintf("\n%s: eeprom failed to come ready\n",
sc->sc_dev.dv_xname);
return (1);
}
if (j & EEPROM_TST_MODE) {
printf("\n%s: erase pencil mark, or disable plug-n-play mode!\n",
kprintf("\n%s: erase pencil mark, or disable plug-n-play mode!\n",
sc->sc_dev.dv_xname);
return (1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: midway.c,v 1.15 1996/08/02 02:55:14 chuck Exp $ */
/* $NetBSD: midway.c,v 1.16 1996/10/10 22:18:37 christos Exp $ */
/* (sync'd to midway.c 1.62) */
/*
@ -238,7 +238,7 @@ u_int32_t r;
{
if (r > MID_MAXOFF || (r % 4)) {
printf("en_read out of range, r=0x%x\n", r);
kprintf("en_read out of range, r=0x%x\n", r);
panic("en_read");
}
return(bus_mem_read_4(sc->en_bc, sc->en_base, r));
@ -253,7 +253,7 @@ u_int32_t r, v;
{
if (r > MID_MAXOFF || (r % 4)) {
printf("en_write out of range, r=0x%x\n", r);
kprintf("en_write out of range, r=0x%x\n", r);
panic("en_write");
}
bus_mem_write_4(sc->en_bc, sc->en_base, r, v);
@ -581,18 +581,18 @@ done_probe:
reg = EN_READ(sc, MID_RESID);
printf("%s: ATM midway v%d, board IDs %d.%d, %s%s%s, %dKB on-board RAM\n",
kprintf("%s: ATM midway v%d, board IDs %d.%d, %s%s%s, %dKB on-board RAM\n",
sc->sc_dev.dv_xname, MID_VER(reg), MID_MID(reg), MID_DID(reg),
(MID_IS_SABRE(reg)) ? "sabre controller, " : "",
(MID_IS_SUNI(reg)) ? "SUNI" : "Utopia",
(!MID_IS_SUNI(reg) && MID_IS_UPIPE(reg)) ? " (pipelined)" : "",
sc->en_obmemsz / 1024);
printf("%s: maximum DMA burst length = %d bytes%s\n", sc->sc_dev.dv_xname,
kprintf("%s: maximum DMA burst length = %d bytes%s\n", sc->sc_dev.dv_xname,
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)
printf("%s: note: WMAYBE DMA has been disabled\n", sc->sc_dev.dv_xname);
kprintf("%s: note: WMAYBE DMA has been disabled\n", sc->sc_dev.dv_xname);
#endif
/*
@ -622,7 +622,7 @@ done_probe:
ptr = roundup(ptr, EN_TXSZ * 1024); /* align */
sz = sz - (ptr - sav);
if (EN_TXSZ*1024 * EN_NTX > sz) {
printf("%s: EN_NTX/EN_TXSZ too big\n", sc->sc_dev.dv_xname);
kprintf("%s: EN_NTX/EN_TXSZ too big\n", sc->sc_dev.dv_xname);
return;
}
for (lcv = 0 ; lcv < EN_NTX ; lcv++) {
@ -634,7 +634,7 @@ done_probe:
bzero(&sc->txslot[lcv].indma, sizeof(sc->txslot[lcv].indma));
bzero(&sc->txslot[lcv].q, sizeof(sc->txslot[lcv].q));
#ifdef EN_DEBUG
printf("%s: tx%d: start 0x%x, stop 0x%x\n", sc->sc_dev.dv_xname, lcv,
kprintf("%s: tx%d: start 0x%x, stop 0x%x\n", sc->sc_dev.dv_xname, lcv,
sc->txslot[lcv].start, sc->txslot[lcv].stop);
#endif
}
@ -644,7 +644,7 @@ done_probe:
sz = sz - (ptr - sav);
sc->en_nrx = sz / (EN_RXSZ * 1024);
if (sc->en_nrx <= 0) {
printf("%s: EN_NTX/EN_TXSZ/EN_RXSZ too big\n", sc->sc_dev.dv_xname);
kprintf("%s: EN_NTX/EN_TXSZ/EN_RXSZ too big\n", sc->sc_dev.dv_xname);
return;
}
for (lcv = 0 ; lcv < sc->en_nrx ; lcv++) {
@ -664,7 +664,7 @@ done_probe:
(en_k2sz(EN_RXSZ) << MIDV_SZSHIFT) | MIDV_TRASH;
#ifdef EN_DEBUG
printf("%s: rx%d: start 0x%x, stop 0x%x, mode 0x%x\n", sc->sc_dev.dv_xname,
kprintf("%s: rx%d: start 0x%x, stop 0x%x, mode 0x%x\n", sc->sc_dev.dv_xname,
lcv, sc->rxslot[lcv].start, sc->rxslot[lcv].stop, sc->rxslot[lcv].mode);
#endif
}
@ -678,7 +678,7 @@ done_probe:
#endif
sc->need_drqs = sc->need_dtqs = 0;
printf("%s: %d %dKB receive buffers, %d %dKB transmit buffers allocated\n",
kprintf("%s: %d %dKB receive buffers, %d %dKB transmit buffers allocated\n",
sc->sc_dev.dv_xname, sc->en_nrx, EN_RXSZ, EN_NTX, EN_TXSZ);
/*
@ -757,7 +757,7 @@ struct en_softc *sc;
}
if (EN_NOWMAYBE || fail) {
if (fail)
printf("%s: WARNING: WMAYBE DMA test failed %d time(s)\n",
kprintf("%s: WARNING: WMAYBE DMA test failed %d time(s)\n",
sc->sc_dev.dv_xname, fail);
en_dmaplan = en_dma_planB; /* fall back to plan B */
}
@ -833,14 +833,14 @@ int wmtry;
DELAY(1);
cnt--;
if (cnt == 0) {
printf("%s: unexpected timeout in tx DMA test\n", sc->sc_dev.dv_xname);
kprintf("%s: unexpected timeout in tx DMA test\n", sc->sc_dev.dv_xname);
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) {
printf("%s: unexpected status in tx DMA test: 0x%x\n",
kprintf("%s: unexpected status in tx DMA test: 0x%x\n",
sc->sc_dev.dv_xname, reg);
return(retval);
}
@ -856,14 +856,14 @@ int wmtry;
DELAY(1);
cnt--;
if (cnt == 0) {
printf("%s: unexpected timeout in rx DMA test\n", sc->sc_dev.dv_xname);
kprintf("%s: unexpected timeout in rx DMA test\n", sc->sc_dev.dv_xname);
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) {
printf("%s: unexpected status in rx DMA test: 0x%x\n",
kprintf("%s: unexpected status in rx DMA test: 0x%x\n",
sc->sc_dev.dv_xname, reg);
return(retval);
}
@ -932,7 +932,7 @@ caddr_t data;
sc->rxslot[slot].raw_threshold = 0;
}
#ifdef EN_DEBUG
printf("%s: rxvci%d: turn %s raw (boodi) mode\n",
kprintf("%s: rxvci%d: turn %s raw (boodi) mode\n",
sc->sc_dev.dv_xname, ario->npcb->npcb_vci,
(ario->rawvalue) ? "on" : "off");
#endif
@ -1009,7 +1009,7 @@ int on;
flags = ATM_PH_FLAGS(&pi->aph);
#ifdef EN_DEBUG
printf("%s: %s vpi=%d, vci=%d, flags=%d\n", sc->sc_dev.dv_xname,
kprintf("%s: %s vpi=%d, vci=%d, flags=%d\n", sc->sc_dev.dv_xname,
(on) ? "enable" : "disable", ATM_PH_VPI(&pi->aph), vci, flags);
#endif
@ -1039,7 +1039,7 @@ int on;
sc->rxslot[slot].rxhand = pi->rxhand;
if (sc->rxslot[slot].indma.ifq_head || sc->rxslot[slot].q.ifq_head)
panic("en_rxctl: left over mbufs on enable");
en_loadvc(sc, vci); /* does debug printf for us */
en_loadvc(sc, vci); /* does debug kprintf for us */
return(0);
}
@ -1074,7 +1074,7 @@ int on;
}
splx(s); /* enable enintr() */
#ifdef EN_DEBUG
printf("%s: rx%d: VCI %d is now %s\n", sc->sc_dev.dv_xname, slot, vci,
kprintf("%s: rx%d: VCI %d is now %s\n", sc->sc_dev.dv_xname, slot, vci,
(sc->rxslot[slot].oth_flags & ENOTHER_DRAIN) ? "draining" : "free");
#endif
return(0);
@ -1096,7 +1096,7 @@ struct en_softc *sc;
int lcv, slot;
#ifdef EN_DEBUG
printf("%s: reset\n", sc->sc_dev.dv_xname);
kprintf("%s: reset\n", sc->sc_dev.dv_xname);
#endif
EN_WRITE(sc, MID_RESID, 0x0); /* reset hardware */
@ -1127,7 +1127,7 @@ struct en_softc *sc;
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", sc->sc_dev.dv_xname, slot, lcv);
kprintf("%s: rx%d: VCI %d is now free\n", sc->sc_dev.dv_xname, slot, lcv);
#endif
}
}
@ -1170,7 +1170,7 @@ struct en_softc *sc;
if ((sc->enif.if_flags & IFF_UP) == 0) {
#ifdef EN_DEBUG
printf("%s: going down\n", sc->sc_dev.dv_xname);
kprintf("%s: going down\n", sc->sc_dev.dv_xname);
#endif
en_reset(sc); /* to be safe */
sc->enif.if_flags &= ~IFF_RUNNING; /* disable */
@ -1178,7 +1178,7 @@ struct en_softc *sc;
}
#ifdef EN_DEBUG
printf("%s: going up\n", sc->sc_dev.dv_xname);
kprintf("%s: going up\n", sc->sc_dev.dv_xname);
#endif
sc->enif.if_flags |= IFF_RUNNING; /* enable */
@ -1209,7 +1209,7 @@ struct en_softc *sc;
sc->swsl_size = sc->swsl_head = sc->swsl_tail = 0;
#ifdef EN_DEBUG
printf("%s: drq free/chip: %d/0x%x, dtq free/chip: %d/0x%x, hwslist: 0x%x\n",
kprintf("%s: drq free/chip: %d/0x%x, dtq free/chip: %d/0x%x, hwslist: 0x%x\n",
sc->sc_dev.dv_xname, sc->drq_free, sc->drq_chip,
sc->dtq_free, sc->dtq_chip, sc->hwslistp);
#endif
@ -1224,7 +1224,7 @@ struct en_softc *sc;
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", sc->sc_dev.dv_xname, slot,
kprintf("%s: tx%d: place 0x%x\n", sc->sc_dev.dv_xname, slot,
EN_READ(sc, MIDX_PLACE(slot)));
#endif
}
@ -1269,7 +1269,7 @@ int vc;
sc->rxslot[slot].cur = sc->rxslot[slot].start;
#ifdef EN_DEBUG
printf("%s: rx%d: assigned to VCI %d\n", sc->sc_dev.dv_xname, slot, vc);
kprintf("%s: rx%d: assigned to VCI %d\n", sc->sc_dev.dv_xname, slot, vc);
#endif
}
@ -1356,7 +1356,7 @@ struct ifnet *ifp;
*/
if (atm_vpi || atm_vci > MID_N_VC) {
printf("%s: output vpi=%d, vci=%d out of card range, dropping...\n",
kprintf("%s: output vpi=%d, vci=%d out of card range, dropping...\n",
sc->sc_dev.dv_xname, atm_vpi, atm_vci);
m_freem(m);
continue;
@ -1382,9 +1382,9 @@ struct ifnet *ifp;
toadd = need - got; /* recompute, including zero padding */
#ifdef EN_DEBUG
printf("%s: txvci%d: mlen=%d, got=%d, need=%d, toadd=%d, cell#=%d\n",
kprintf("%s: txvci%d: mlen=%d, got=%d, need=%d, toadd=%d, cell#=%d\n",
sc->sc_dev.dv_xname, atm_vci, mlen, got, need, toadd, cellcnt);
printf(" leading_space=%d, trailing_space=%d\n",
kprintf(" leading_space=%d, trailing_space=%d\n",
M_LEADINGSPACE(m), M_TRAILINGSPACE(lastm));
#endif
@ -1448,7 +1448,7 @@ struct ifnet *ifp;
EN_COUNT(sc->txmbovr);
m_freem(m);
#ifdef EN_DEBUG
printf("%s: tx%d: buffer space shortage\n", ifp->if_xname,
kprintf("%s: tx%d: buffer space shortage\n", ifp->if_xname,
txchan);
#endif
continue;
@ -1457,10 +1457,10 @@ struct ifnet *ifp;
sc->txslot[txchan].mbsize += mlen;
#ifdef EN_DEBUG
printf("%s: tx%d: VPI=%d, VCI=%d, FLAGS=0x%x, speed=0x%x\n",
kprintf("%s: tx%d: VPI=%d, VCI=%d, FLAGS=0x%x, speed=0x%x\n",
sc->sc_dev.dv_xname, txchan, atm_vpi, atm_vci, atm_flags,
sc->txspeed[atm_vci]);
printf(" adjusted mlen=%d, mbsize=%d\n", mlen,
kprintf(" adjusted mlen=%d, mbsize=%d\n", mlen,
sc->txslot[txchan].mbsize);
#endif
@ -1491,7 +1491,7 @@ struct mbuf **mm, *prev;
EN_COUNT(sc->mfix); /* count # of calls */
#ifdef EN_DEBUG
printf("%s: mfix mbuf m_data=0x%x, m_len=%d\n", sc->sc_dev.dv_xname,
kprintf("%s: mfix mbuf m_data=0x%x, m_len=%d\n", sc->sc_dev.dv_xname,
m->m_data, m->m_len);
#endif
@ -1568,7 +1568,7 @@ int chan;
u_int8_t *cp;
#ifdef EN_DEBUG
printf("%s: tx%d: starting...\n", sc->sc_dev.dv_xname, chan);
kprintf("%s: tx%d: starting...\n", sc->sc_dev.dv_xname, chan);
#endif
/*
@ -1589,7 +1589,7 @@ again:
if (launch.t == NULL) {
#ifdef EN_DEBUG
printf("%s: tx%d: ...done!\n", sc->sc_dev.dv_xname, chan);
kprintf("%s: tx%d: ...done!\n", sc->sc_dev.dv_xname, chan);
#endif
return; /* >>> exit here if no data waiting for DMA <<< */
}
@ -1661,7 +1661,7 @@ again:
launch.need += MID_TBD_SIZE;
if (launch.need > EN_TXSZ * 1024) {
printf("%s: tx%d: packet larger than xmit buffer (%d > %d)\n",
kprintf("%s: tx%d: packet larger than xmit buffer (%d > %d)\n",
sc->sc_dev.dv_xname, chan, launch.need, EN_TXSZ * 1024);
goto dequeue_drop;
}
@ -1669,7 +1669,7 @@ again:
if (launch.need > sc->txslot[chan].bfree) {
EN_COUNT(sc->txoutspace);
#ifdef EN_DEBUG
printf("%s: tx%d: out of trasmit space\n", sc->sc_dev.dv_xname, chan);
kprintf("%s: tx%d: out of trasmit space\n", sc->sc_dev.dv_xname, chan);
#endif
return; /* >>> exit here if out of obmem buffer space <<< */
}
@ -1685,7 +1685,7 @@ again:
sc->need_dtqs = 1;
EN_COUNT(sc->txdtqout);
#ifdef EN_DEBUG
printf("%s: tx%d: out of trasmit DTQs\n", sc->sc_dev.dv_xname, chan);
kprintf("%s: tx%d: out of trasmit DTQs\n", sc->sc_dev.dv_xname, chan);
#endif
return; /* >>> exit here if out of dtqs <<< */
}
@ -1790,14 +1790,14 @@ struct en_launch *l;
#ifdef EN_DIAG
if ((need - MID_TBD_SIZE) % MID_ATMDATASZ)
printf("%s: tx%d: bogus trasmit needs (%d)\n", sc->sc_dev.dv_xname, chan,
kprintf("%s: tx%d: bogus trasmit needs (%d)\n", sc->sc_dev.dv_xname, chan,
need);
#endif
#ifdef EN_DEBUG
printf("%s: tx%d: launch mbuf 0x%x! cur=0x%x[%d], need=%d, addtail=%d\n",
kprintf("%s: tx%d: launch mbuf 0x%x! cur=0x%x[%d], need=%d, addtail=%d\n",
sc->sc_dev.dv_xname, chan, l->t, cur, (cur-start)/4, need, addtail);
count = EN_READ(sc, MIDX_PLACE(chan));
printf(" HW: base_address=0x%x, size=%d, read=%d, descstart=%d\n",
kprintf(" HW: base_address=0x%x, size=%d, read=%d, descstart=%d\n",
MIDX_BASE(count), MIDX_SZ(count), EN_READ(sc, MIDX_READPTR(chan)),
EN_READ(sc, MIDX_DESCSTART(chan)));
#endif
@ -1809,7 +1809,7 @@ struct en_launch *l;
if ((l->atm_flags & EN_OBHDR) == 0) {
/* note: data already in correct byte order. use WRITEDAT to xfer */
#ifdef EN_DEBUG
printf("%s: tx%d: insert header 0x%x 0x%x\n", sc->sc_dev.dv_xname,
kprintf("%s: tx%d: insert header 0x%x 0x%x\n", sc->sc_dev.dv_xname,
chan, ntohl(l->tbd1), ntohl(l->tbd2));
#endif
EN_WRITEDAT(sc, cur, l->tbd1);
@ -1845,7 +1845,7 @@ struct en_launch *l;
}
need -= len;
#ifdef EN_DEBUG
printf("%s: tx%d: copied %d bytes (%d left, cur now 0x%x)\n",
kprintf("%s: tx%d: copied %d bytes (%d left, cur now 0x%x)\n",
sc->sc_dev.dv_xname, chan, len, need, cur);
#endif
continue; /* continue on to next mbuf */
@ -1855,7 +1855,7 @@ struct en_launch *l;
if (dma != cur) {
EN_DTQADD(sc, WORD_IDX(start,cur), chan, MIDDMA_JK, 0, 0, 0);
#ifdef EN_DEBUG
printf("%s: tx%d: dtq_sync: advance pointer to %d\n",
kprintf("%s: tx%d: dtq_sync: advance pointer to %d\n",
sc->sc_dev.dv_xname, chan, cur);
#endif
}
@ -1891,7 +1891,7 @@ struct en_launch *l;
need -= cnt;
EN_WRAPADD(start, stop, cur, cnt);
#ifdef EN_DEBUG
printf("%s: tx%d: small al_dma %d bytes (%d left, cur now 0x%x)\n",
kprintf("%s: tx%d: small al_dma %d bytes (%d left, cur now 0x%x)\n",
sc->sc_dev.dv_xname, chan, cnt, need, cur);
#endif
len -= cnt;
@ -1920,7 +1920,7 @@ struct en_launch *l;
need -= cnt;
EN_WRAPADD(start, stop, cur, cnt);
#ifdef EN_DEBUG
printf("%s: tx%d: al_dma %d bytes (%d left, cur now 0x%x)\n",
kprintf("%s: tx%d: al_dma %d bytes (%d left, cur now 0x%x)\n",
sc->sc_dev.dv_xname, chan, cnt, need, cur);
#endif
len -= cnt;
@ -1939,7 +1939,7 @@ struct en_launch *l;
need -= cnt;
EN_WRAPADD(start, stop, cur, cnt);
#ifdef EN_DEBUG
printf("%s: tx%d: best_dma %d bytes (%d left, cur now 0x%x)\n",
kprintf("%s: tx%d: best_dma %d bytes (%d left, cur now 0x%x)\n",
sc->sc_dev.dv_xname, chan, cnt, need, cur);
#endif
len -= cnt;
@ -1959,7 +1959,7 @@ struct en_launch *l;
need -= cnt;
EN_WRAPADD(start, stop, cur, cnt);
#ifdef EN_DEBUG
printf("%s: tx%d: cleanup_dma %d bytes (%d left, cur now 0x%x)\n",
kprintf("%s: tx%d: cleanup_dma %d bytes (%d left, cur now 0x%x)\n",
sc->sc_dev.dv_xname, chan, cnt, need, cur);
#endif
len -= cnt;
@ -1983,7 +1983,7 @@ struct en_launch *l;
need -= len;
EN_WRAPADD(start, stop, cur, len);
#ifdef EN_DEBUG
printf("%s: tx%d: byte cleanup_dma %d bytes (%d left, cur now 0x%x)\n",
kprintf("%s: tx%d: byte cleanup_dma %d bytes (%d left, cur now 0x%x)\n",
sc->sc_dev.dv_xname, chan, len, need, cur);
#endif
end = (need == 0) ? MID_DMA_END : 0;
@ -2029,7 +2029,7 @@ struct en_launch *l;
if (l->aal == MID_TBD_AAL5)
pad -= 2;
#ifdef EN_DEBUG
printf("%s: tx%d: padding %d bytes\n",
kprintf("%s: tx%d: padding %d bytes\n",
sc->sc_dev.dv_xname, chan, pad * sizeof(u_int32_t));
#endif
while (pad--) {
@ -2053,7 +2053,7 @@ done:
/* update current pointer */
sc->txslot[chan].cur = cur;
#ifdef EN_DEBUG
printf("%s: tx%d: DONE! cur now = 0x%x\n",
kprintf("%s: tx%d: DONE! cur now = 0x%x\n",
sc->sc_dev.dv_xname, chan, cur);
#endif
@ -2082,7 +2082,7 @@ void *arg;
EN_INTR_RET(0); /* not us */
#ifdef EN_DEBUG
printf("%s: interrupt=0x%b\n", sc->sc_dev.dv_xname, reg, MID_INTBITS);
kprintf("%s: interrupt=0x%b\n", sc->sc_dev.dv_xname, reg, MID_INTBITS);
#endif
/*
@ -2090,7 +2090,7 @@ void *arg;
*/
if ((reg & (MID_INT_IDENT|MID_INT_LERR|MID_INT_DMA_ERR|MID_INT_SUNI)) != 0) {
printf("%s: unexpected interrupt=0x%b, resetting card\n",
kprintf("%s: unexpected interrupt=0x%b, resetting card\n",
sc->sc_dev.dv_xname, reg, MID_INTBITS);
#ifdef EN_DEBUG
#ifdef DDB
@ -2127,7 +2127,7 @@ void *arg;
else
sc->txslot[lcv].bfree = (val + (EN_TXSZ*1024)) - sc->txslot[lcv].cur;
#ifdef EN_DEBUG
printf("%s: tx%d: trasmit done. %d bytes now free in buffer\n",
kprintf("%s: tx%d: trasmit done. %d bytes now free in buffer\n",
sc->sc_dev.dv_xname, lcv, sc->txslot[lcv].bfree);
#endif
}
@ -2147,7 +2147,7 @@ void *arg;
kick = MID_NTX_CH - 1; /* assume power of 2, kick all! */
sc->need_dtqs = 0; /* recalculated in "kick" loop below */
#ifdef EN_DEBUG
printf("%s: cleared need DTQ condition\n", sc->sc_dev.dv_xname);
kprintf("%s: cleared need DTQ condition\n", sc->sc_dev.dv_xname);
#endif
}
do { /* while idx != val */
@ -2159,7 +2159,7 @@ void *arg;
if (!m) panic("enintr: dtqsync");
sc->txslot[slot].mbsize -= EN_DQ_LEN(dtq);
#ifdef EN_DEBUG
printf("%s: tx%d: free %d dma bytes, mbsize now %d\n",
kprintf("%s: tx%d: free %d dma bytes, mbsize now %d\n",
sc->sc_dev.dv_xname, slot, EN_DQ_LEN(dtq),
sc->txslot[slot].mbsize);
#endif
@ -2177,7 +2177,7 @@ void *arg;
if (kick) {
#ifdef EN_DEBUG
printf("%s: tx kick mask = 0x%x\n", sc->sc_dev.dv_xname, kick);
kprintf("%s: tx kick mask = 0x%x\n", sc->sc_dev.dv_xname, kick);
#endif
for (mask = 1, lcv = 0 ; lcv < EN_NTX ; lcv++, mask = mask * 2) {
if ((kick & mask) && sc->txslot[lcv].q.ifq_head) {
@ -2205,7 +2205,7 @@ void *arg;
slot = EN_DQ_SLOT(drq);
IF_DEQUEUE(&sc->rxslot[slot].indma, m);
if (!m) {
printf("%s: lost mbuf in slot %d!\n", sc->sc_dev.dv_xname, slot);
kprintf("%s: lost mbuf in slot %d!\n", sc->sc_dev.dv_xname, slot);
panic("enintr: drqsync");
}
@ -2221,7 +2221,7 @@ void *arg;
sc->rxslot[slot].atm_vci = RX_NONE;
sc->rxvc2slot[vci] = RX_NONE;
#ifdef EN_DEBUG
printf("%s: rx%d: VCI %d now free\n", sc->sc_dev.dv_xname,
kprintf("%s: rx%d: VCI %d now free\n", sc->sc_dev.dv_xname,
slot, vci);
#endif
}
@ -2230,7 +2230,7 @@ void *arg;
ATM_PH_VPI(&ah) = 0;
ATM_PH_SETVCI(&ah, sc->rxslot[slot].atm_vci);
#ifdef EN_DEBUG
printf("%s: rx%d: rxvci%d: atm_input, mbuf 0x%x, len %d, hand 0x%x\n",
kprintf("%s: rx%d: rxvci%d: atm_input, mbuf 0x%x, len %d, hand 0x%x\n",
sc->sc_dev.dv_xname, slot, sc->rxslot[slot].atm_vci, m,
EN_DQ_LEN(drq), sc->rxslot[slot].rxhand);
#endif
@ -2246,7 +2246,7 @@ void *arg;
need_softserv = 1;
sc->need_drqs = 0;
#ifdef EN_DEBUG
printf("%s: cleared need DRQ condition\n", sc->sc_dev.dv_xname);
kprintf("%s: cleared need DRQ condition\n", sc->sc_dev.dv_xname);
#endif
}
}
@ -2265,7 +2265,7 @@ void *arg;
EN_WRAPADD(MID_SLOFF, MID_SLEND, sc->hwslistp, 4);/* advance hw ptr */
slot = sc->rxvc2slot[vci];
if (slot == RX_NONE) {
printf("%s: unexpected rx interrupt on VCI %d\n",
kprintf("%s: unexpected rx interrupt on VCI %d\n",
sc->sc_dev.dv_xname, vci);
EN_WRITE(sc, MID_VC(vci), MIDV_TRASH); /* rx off, damn it! */
continue; /* next */
@ -2274,7 +2274,7 @@ void *arg;
EN_COUNT(sc->hwpull);
#ifdef EN_DEBUG
printf("%s: pulled VCI %d off hwslist\n", sc->sc_dev.dv_xname, vci);
kprintf("%s: pulled VCI %d off hwslist\n", sc->sc_dev.dv_xname, vci);
#endif
/* add it to the software service list (if needed) */
@ -2286,7 +2286,7 @@ void *arg;
EN_WRAPADD(0, MID_SL_N, sc->swsl_tail, 1);
sc->swsl_size++;
#ifdef EN_DEBUG
printf("%s: added VCI %d to swslist\n", sc->sc_dev.dv_xname, vci);
kprintf("%s: added VCI %d to swslist\n", sc->sc_dev.dv_xname, vci);
#endif
}
} while (sc->hwslistp != chip);
@ -2306,7 +2306,7 @@ void *arg;
if (reg & MID_INT_DMA_OVR) {
EN_COUNT(sc->dmaovr);
#ifdef EN_DEBUG
printf("%s: MID_INT_DMA_OVR\n", sc->sc_dev.dv_xname);
kprintf("%s: MID_INT_DMA_OVR\n", sc->sc_dev.dv_xname);
#endif
}
reg = EN_READ(sc, MID_STAT);
@ -2350,7 +2350,7 @@ struct en_softc *sc;
next_vci:
if (sc->swsl_size == 0) {
#ifdef EN_DEBUG
printf("%s: en_service done\n", sc->sc_dev.dv_xname);
kprintf("%s: en_service done\n", sc->sc_dev.dv_xname);
#endif
return; /* >>> exit here if swsl now empty <<< */
}
@ -2375,7 +2375,7 @@ next_vci:
cur = sc->rxslot[slot].cur;
#ifdef EN_DEBUG
printf("%s: rx%d: service vci=%d raw=%d start/stop/cur=0x%x 0x%x 0x%x\n",
kprintf("%s: rx%d: service vci=%d raw=%d start/stop/cur=0x%x 0x%x 0x%x\n",
sc->sc_dev.dv_xname, slot, vci, raw, start, stop, cur);
#endif
@ -2391,7 +2391,7 @@ defer: /* defer processing */
sc->swsl_size--;
/* >>> remove from swslist <<< */
#ifdef EN_DEBUG
printf("%s: rx%d: remove vci %d from swslist\n",
kprintf("%s: rx%d: remove vci %d from swslist\n",
sc->sc_dev.dv_xname, slot, vci);
#endif
goto next_vci;
@ -2438,9 +2438,9 @@ defer: /* defer processing */
pdu = EN_READ(sc, pdu); /* READ swaps to proper byte order */
fill = tlen - MID_RBD_SIZE - MID_PDU_LEN(pdu);
if (fill < 0) {
printf("%s: invalid AAL5 PDU length detected, dropping frame\n",
kprintf("%s: invalid AAL5 PDU length detected, dropping frame\n",
sc->sc_dev.dv_xname);
printf("%s: got %d cells (%d bytes), AAL5 len is %d bytes (pdu=0x%x)\n",
kprintf("%s: got %d cells (%d bytes), AAL5 len is %d bytes (pdu=0x%x)\n",
sc->sc_dev.dv_xname, MID_RBD_CNT(rbd), tlen - MID_RBD_SIZE,
MID_PDU_LEN(pdu), pdu);
fill = tlen;
@ -2469,7 +2469,7 @@ defer: /* defer processing */
sav = mtod(m, u_int32_t *);
if (sav[0] != cur) {
#ifdef EN_DEBUG
printf("%s: rx%d: q'ed mbuf 0x%x not ours\n",
kprintf("%s: rx%d: q'ed mbuf 0x%x not ours\n",
sc->sc_dev.dv_xname, slot, m);
#endif
m = NULL; /* wasn't ours */
@ -2479,7 +2479,7 @@ defer: /* defer processing */
IF_DEQUEUE(&sc->rxslot[slot].q, m);
drqneed = sav[1];
#ifdef EN_DEBUG
printf("%s: rx%d: recovered q'ed mbuf 0x%x (drqneed=%d)\n",
kprintf("%s: rx%d: recovered q'ed mbuf 0x%x (drqneed=%d)\n",
sc->sc_dev.dv_xname, slot, drqneed);
#endif
}
@ -2492,17 +2492,17 @@ defer: /* defer processing */
mlen = 0;
EN_COUNT(sc->rxmbufout);
#ifdef EN_DEBUG
printf("%s: rx%d: out of mbufs\n", sc->sc_dev.dv_xname, slot);
kprintf("%s: rx%d: out of mbufs\n", sc->sc_dev.dv_xname, slot);
#endif
}
#ifdef EN_DEBUG
printf("%s: rx%d: allocate mbuf 0x%x, mlen=%d, drqneed=%d\n",
kprintf("%s: rx%d: allocate mbuf 0x%x, mlen=%d, drqneed=%d\n",
sc->sc_dev.dv_xname, slot, m, mlen, drqneed);
#endif
}
#ifdef EN_DEBUG
printf("%s: rx%d: VCI %d, mbuf_chain 0x%x, mlen %d, fill %d\n",
kprintf("%s: rx%d: VCI %d, mbuf_chain 0x%x, mlen %d, fill %d\n",
sc->sc_dev.dv_xname, slot, vci, m, mlen, fill);
#endif
@ -2517,7 +2517,7 @@ defer: /* defer processing */
if (m == NULL) {
EN_COUNT(sc->rxoutboth);
#ifdef EN_DEBUG
printf("%s: rx%d: out of DRQs *and* mbufs!\n", sc->sc_dev.dv_xname, slot);
kprintf("%s: rx%d: out of DRQs *and* mbufs!\n", sc->sc_dev.dv_xname, slot);
#endif
return; /* >>> exit here if out of both mbufs and DRQs <<< */
}
@ -2527,7 +2527,7 @@ defer: /* defer processing */
IF_ENQUEUE(&sc->rxslot[slot].q, m);
EN_COUNT(sc->rxdrqout);
#ifdef EN_DEBUG
printf("%s: rx%d: out of DRQs\n", sc->sc_dev.dv_xname, slot);
kprintf("%s: rx%d: out of DRQs\n", sc->sc_dev.dv_xname, slot);
#endif
return; /* >>> exit here if out of DRQs <<< */
}
@ -2556,7 +2556,7 @@ defer: /* defer processing */
data = mtod(tmp, u_int32_t *);
#ifdef EN_DEBUG
printf("%s: rx%d: load mbuf 0x%x, m_len=%d, m_data=0x%x, tlen=%d\n",
kprintf("%s: rx%d: load mbuf 0x%x, m_len=%d, m_data=0x%x, tlen=%d\n",
sc->sc_dev.dv_xname, slot, tmp, tmp->m_len, tmp->m_data, tlen);
#endif
@ -2571,7 +2571,7 @@ defer: /* defer processing */
}
need -= tlen;
#ifdef EN_DEBUG
printf("%s: rx%d: vci%d: copied %d bytes (%d left)\n",
kprintf("%s: rx%d: vci%d: copied %d bytes (%d left)\n",
sc->sc_dev.dv_xname, slot, vci, tlen, need);
#endif
continue;
@ -2581,7 +2581,7 @@ defer: /* defer processing */
if (dma != cur) {
EN_DRQADD(sc, WORD_IDX(start,cur), vci, MIDDMA_JK, 0, 0, 0, 0);
#ifdef EN_DEBUG
printf("%s: rx%d: vci%d: drq_sync: advance pointer to %d\n",
kprintf("%s: rx%d: vci%d: drq_sync: advance pointer to %d\n",
sc->sc_dev.dv_xname, slot, vci, cur);
#endif
}
@ -2602,7 +2602,7 @@ defer: /* defer processing */
need -= cnt;
EN_WRAPADD(start, stop, cur, cnt);
#ifdef EN_DEBUG
printf("%s: rx%d: vci%d: al_dma %d bytes (%d left)\n",
kprintf("%s: rx%d: vci%d: al_dma %d bytes (%d left)\n",
sc->sc_dev.dv_xname, slot, vci, cnt, need);
#endif
tlen -= cnt;
@ -2621,7 +2621,7 @@ defer: /* defer processing */
need -= cnt;
EN_WRAPADD(start, stop, cur, cnt);
#ifdef EN_DEBUG
printf("%s: rx%d: vci%d: best_dma %d bytes (%d left)\n",
kprintf("%s: rx%d: vci%d: best_dma %d bytes (%d left)\n",
sc->sc_dev.dv_xname, slot, vci, cnt, need);
#endif
tlen -= cnt;
@ -2640,7 +2640,7 @@ defer: /* defer processing */
need -= tlen;
EN_WRAPADD(start, stop, cur, tlen);
#ifdef EN_DEBUG
printf("%s: rx%d: vci%d: cleanup_dma %d bytes (%d left)\n",
kprintf("%s: rx%d: vci%d: cleanup_dma %d bytes (%d left)\n",
sc->sc_dev.dv_xname, slot, vci, tlen, need);
#endif
end = (need == 0 && !fill) ? MID_DMA_END : 0;
@ -2657,10 +2657,10 @@ defer: /* defer processing */
if (fill || dma != cur) {
#ifdef EN_DEBUG
if (fill)
printf("%s: rx%d: vci%d: skipping %d bytes of fill\n",
kprintf("%s: rx%d: vci%d: skipping %d bytes of fill\n",
sc->sc_dev.dv_xname, slot, vci, fill);
else
printf("%s: rx%d: vci%d: syncing chip from 0x%x to 0x%x [cur]\n",
kprintf("%s: rx%d: vci%d: syncing chip from 0x%x to 0x%x [cur]\n",
sc->sc_dev.dv_xname, slot, vci, dma, cur);
#endif
EN_WRAPADD(start, stop, cur, fill);
@ -2690,7 +2690,7 @@ done:
sc->rxslot[slot].cur = cur; /* update master copy of 'cur' */
#ifdef EN_DEBUG
printf("%s: rx%d: vci%d: DONE! cur now =0x%x\n",
kprintf("%s: rx%d: vci%d: DONE! cur now =0x%x\n",
sc->sc_dev.dv_xname, slot, vci, cur);
#endif
@ -2732,89 +2732,89 @@ int unit, level;
if (unit != -1 && unit != lcv)
continue;
printf("dumping device %s at level 0x%b\n", sc->sc_dev.dv_xname, level,
kprintf("dumping device %s at level 0x%b\n", sc->sc_dev.dv_xname, level,
END_BITS);
if (sc->dtq_us == 0) {
printf("<hasn't been en_init'd yet>\n");
kprintf("<hasn't been en_init'd yet>\n");
continue;
}
if (level & END_STATS) {
printf(" en_stats:\n");
printf(" %d mfix (%d failed); %d/%d head/tail byte DMAs, %d flushes\n",
kprintf(" en_stats:\n");
kprintf(" %d mfix (%d failed); %d/%d head/tail byte DMAs, %d flushes\n",
sc->mfix, sc->mfixfail, sc->headbyte, sc->tailbyte, sc->tailflush);
printf(" %d rx dma overflow interrupts\n", sc->dmaovr);
printf(" %d times we ran out of TX space and stalled\n",
kprintf(" %d rx dma overflow interrupts\n", sc->dmaovr);
kprintf(" %d times we ran out of TX space and stalled\n",
sc->txoutspace);
printf(" %d times we ran out of DTQs\n", sc->txdtqout);
printf(" %d times we launched a packet\n", sc->launch);
printf(" %d times we launched without on-board header\n", sc->lheader);
printf(" %d times we launched without on-board tail\n", sc->ltail);
printf(" %d times we pulled the hw service list\n", sc->hwpull);
printf(" %d times we pushed a vci on the sw service list\n",
kprintf(" %d times we ran out of DTQs\n", sc->txdtqout);
kprintf(" %d times we launched a packet\n", sc->launch);
kprintf(" %d times we launched without on-board header\n", sc->lheader);
kprintf(" %d times we launched without on-board tail\n", sc->ltail);
kprintf(" %d times we pulled the hw service list\n", sc->hwpull);
kprintf(" %d times we pushed a vci on the sw service list\n",
sc->swadd);
printf(" %d times RX pulled an mbuf from Q that wasn't ours\n",
kprintf(" %d times RX pulled an mbuf from Q that wasn't ours\n",
sc->rxqnotus);
printf(" %d times RX pulled a good mbuf from Q\n", sc->rxqus);
printf(" %d times we ran out of mbufs *and* DRQs\n", sc->rxoutboth);
printf(" %d times we ran out of DRQs\n", sc->rxdrqout);
kprintf(" %d times RX pulled a good mbuf from Q\n", sc->rxqus);
kprintf(" %d times we ran out of mbufs *and* DRQs\n", sc->rxoutboth);
kprintf(" %d times we ran out of DRQs\n", sc->rxdrqout);
printf(" %d trasmit packets dropped due to mbsize\n", sc->txmbovr);
printf(" %d cells trashed due to turned off rxvc\n", sc->vtrash);
printf(" %d cells trashed due to totally full buffer\n", sc->otrash);
printf(" %d cells trashed due almost full buffer\n", sc->ttrash);
printf(" %d rx mbuf allocation failures\n", sc->rxmbufout);
kprintf(" %d trasmit packets dropped due to mbsize\n", sc->txmbovr);
kprintf(" %d cells trashed due to turned off rxvc\n", sc->vtrash);
kprintf(" %d cells trashed due to totally full buffer\n", sc->otrash);
kprintf(" %d cells trashed due almost full buffer\n", sc->ttrash);
kprintf(" %d rx mbuf allocation failures\n", sc->rxmbufout);
#ifdef NATM
printf(" %d drops at natmintrq\n", natmintrq.ifq_drops);
kprintf(" %d drops at natmintrq\n", natmintrq.ifq_drops);
#ifdef NATM_STAT
printf(" natmintr so_rcv: ok/drop cnt: %d/%d, ok/drop bytes: %d/%d\n",
kprintf(" natmintr so_rcv: ok/drop cnt: %d/%d, ok/drop bytes: %d/%d\n",
natm_sookcnt, natm_sodropcnt, natm_sookbytes, natm_sodropbytes);
#endif
#endif
}
if (level & END_MREGS) {
printf("mregs:\n");
printf("resid = 0x%x\n", EN_READ(sc, MID_RESID));
printf("interrupt status = 0x%b\n",
kprintf("mregs:\n");
kprintf("resid = 0x%x\n", EN_READ(sc, MID_RESID));
kprintf("interrupt status = 0x%b\n",
EN_READ(sc, MID_INTSTAT), MID_INTBITS);
printf("interrupt enable = 0x%b\n",
kprintf("interrupt enable = 0x%b\n",
EN_READ(sc, MID_INTENA), MID_INTBITS);
printf("mcsr = 0x%b\n", EN_READ(sc, MID_MAST_CSR), MID_MCSRBITS);
printf("serv_write = [chip=%d] [us=%d]\n", EN_READ(sc, MID_SERV_WRITE),
kprintf("mcsr = 0x%b\n", EN_READ(sc, MID_MAST_CSR), MID_MCSRBITS);
kprintf("serv_write = [chip=%d] [us=%d]\n", EN_READ(sc, MID_SERV_WRITE),
MID_SL_A2REG(sc->hwslistp));
printf("dma addr = 0x%x\n", EN_READ(sc, MID_DMA_ADDR));
printf("DRQ: chip[rd=0x%x,wr=0x%x], sc[chip=0x%x,us=0x%x]\n",
kprintf("dma addr = 0x%x\n", EN_READ(sc, MID_DMA_ADDR));
kprintf("DRQ: chip[rd=0x%x,wr=0x%x], sc[chip=0x%x,us=0x%x]\n",
MID_DRQ_REG2A(EN_READ(sc, MID_DMA_RDRX)),
MID_DRQ_REG2A(EN_READ(sc, MID_DMA_WRRX)), sc->drq_chip, sc->drq_us);
printf("DTQ: chip[rd=0x%x,wr=0x%x], sc[chip=0x%x,us=0x%x]\n",
kprintf("DTQ: chip[rd=0x%x,wr=0x%x], sc[chip=0x%x,us=0x%x]\n",
MID_DTQ_REG2A(EN_READ(sc, MID_DMA_RDTX)),
MID_DTQ_REG2A(EN_READ(sc, MID_DMA_WRTX)), sc->dtq_chip, sc->dtq_us);
printf(" unusal txspeeds: ");
kprintf(" unusal txspeeds: ");
for (cnt = 0 ; cnt < MID_N_VC ; cnt++)
if (sc->txspeed[cnt])
printf(" vci%d=0x%x", cnt, sc->txspeed[cnt]);
printf("\n");
kprintf(" vci%d=0x%x", cnt, sc->txspeed[cnt]);
kprintf("\n");
printf(" rxvc slot mappings: ");
kprintf(" rxvc slot mappings: ");
for (cnt = 0 ; cnt < MID_N_VC ; cnt++)
if (sc->rxvc2slot[cnt] != RX_NONE)
printf(" %d->%d", cnt, sc->rxvc2slot[cnt]);
printf("\n");
kprintf(" %d->%d", cnt, sc->rxvc2slot[cnt]);
kprintf("\n");
}
if (level & END_TX) {
printf("tx:\n");
kprintf("tx:\n");
for (slot = 0 ; slot < EN_NTX; slot++) {
printf("tx%d: start/stop/cur=0x%x/0x%x/0x%x [%d] ", slot,
kprintf("tx%d: start/stop/cur=0x%x/0x%x/0x%x [%d] ", slot,
sc->txslot[slot].start, sc->txslot[slot].stop, sc->txslot[slot].cur,
(sc->txslot[slot].cur - sc->txslot[slot].start)/4);
printf("mbsize=%d, bfree=%d\n", sc->txslot[slot].mbsize,
kprintf("mbsize=%d, bfree=%d\n", sc->txslot[slot].mbsize,
sc->txslot[slot].bfree);
printf("txhw: base_address=0x%x, size=%d, read=%d, descstart=%d\n",
kprintf("txhw: base_address=0x%x, size=%d, read=%d, descstart=%d\n",
MIDX_BASE(EN_READ(sc, MIDX_PLACE(slot))),
MIDX_SZ(EN_READ(sc, MIDX_PLACE(slot))),
EN_READ(sc, MIDX_READPTR(slot)), EN_READ(sc, MIDX_DESCSTART(slot)));
@ -2822,15 +2822,15 @@ int unit, level;
}
if (level & END_RX) {
printf(" recv slots:\n");
kprintf(" recv slots:\n");
for (slot = 0 ; slot < sc->en_nrx; slot++) {
printf("rx%d: vci=%d: start/stop/cur=0x%x/0x%x/0x%x ", slot,
kprintf("rx%d: vci=%d: start/stop/cur=0x%x/0x%x/0x%x ", slot,
sc->rxslot[slot].atm_vci, sc->rxslot[slot].start,
sc->rxslot[slot].stop, sc->rxslot[slot].cur);
printf("mode=0x%x, atm_flags=0x%x, oth_flags=0x%x\n",
kprintf("mode=0x%x, atm_flags=0x%x, oth_flags=0x%x\n",
sc->rxslot[slot].mode, sc->rxslot[slot].atm_flags,
sc->rxslot[slot].oth_flags);
printf("RXHW: mode=0x%x, DST_RP=0x%x, WP_ST_CNT=0x%x\n",
kprintf("RXHW: mode=0x%x, DST_RP=0x%x, WP_ST_CNT=0x%x\n",
EN_READ(sc, MID_VC(sc->rxslot[slot].atm_vci)),
EN_READ(sc, MID_DST_RP(sc->rxslot[slot].atm_vci)),
EN_READ(sc, MID_WP_ST_CNT(sc->rxslot[slot].atm_vci)));
@ -2838,12 +2838,12 @@ int unit, level;
}
if (level & END_DTQ) {
printf(" dtq [need_dtqs=%d,dtq_free=%d]:\n",
kprintf(" dtq [need_dtqs=%d,dtq_free=%d]:\n",
sc->need_dtqs, sc->dtq_free);
ptr = sc->dtq_chip;
while (ptr != sc->dtq_us) {
reg = EN_READ(sc, ptr);
printf("\t0x%x=[cnt=%d, chan=%d, end=%d, type=%d @ 0x%x]\n",
kprintf("\t0x%x=[cnt=%d, chan=%d, end=%d, type=%d @ 0x%x]\n",
sc->dtq[MID_DTQ_A2REG(ptr)], MID_DMA_CNT(reg), MID_DMA_TXCHAN(reg),
(reg & MID_DMA_END) != 0, MID_DMA_TYPE(reg), EN_READ(sc, ptr+4));
EN_WRAPADD(MID_DTQOFF, MID_DTQEND, ptr, 8);
@ -2851,12 +2851,12 @@ int unit, level;
}
if (level & END_DRQ) {
printf(" drq [need_drqs=%d,drq_free=%d]:\n",
kprintf(" drq [need_drqs=%d,drq_free=%d]:\n",
sc->need_drqs, sc->drq_free);
ptr = sc->drq_chip;
while (ptr != sc->drq_us) {
reg = EN_READ(sc, ptr);
printf("\t0x%x=[cnt=%d, chan=%d, end=%d, type=%d @ 0x%x]\n",
kprintf("\t0x%x=[cnt=%d, chan=%d, end=%d, type=%d @ 0x%x]\n",
sc->drq[MID_DRQ_A2REG(ptr)], MID_DMA_CNT(reg), MID_DMA_RXVCI(reg),
(reg & MID_DMA_END) != 0, MID_DMA_TYPE(reg), EN_READ(sc, ptr+4));
EN_WRAPADD(MID_DRQOFF, MID_DRQEND, ptr, 8);
@ -2864,11 +2864,11 @@ int unit, level;
}
if (level & END_SWSL) {
printf(" swslist [size=%d]: ", sc->swsl_size);
kprintf(" swslist [size=%d]: ", sc->swsl_size);
for (cnt = sc->swsl_head ; cnt != sc->swsl_tail ;
cnt = (cnt + 1) % MID_SL_N)
printf("0x%x ", sc->swslist[cnt]);
printf("\n");
kprintf("0x%x ", sc->swslist[cnt]);
kprintf("\n");
}
}
@ -2889,18 +2889,18 @@ int unit, addr, len;
if (unit < 0 || unit > en_cd.cd_ndevs ||
(sc = (struct en_softc *) en_cd.cd_devs[unit]) == NULL) {
printf("invalid unit number: %d\n", unit);
kprintf("invalid unit number: %d\n", unit);
return(0);
}
addr = addr & ~3;
if (addr < MID_RAMOFF || addr + len*4 > MID_MAXOFF || len <= 0) {
printf("invalid addr/len number: %d, %d\n", addr, len);
kprintf("invalid addr/len number: %d, %d\n", addr, len);
return(0);
}
printf("dumping %d words starting at offset 0x%x\n", len, addr);
kprintf("dumping %d words starting at offset 0x%x\n", len, addr);
while (len--) {
reg = EN_READ(sc, addr);
printf("mem[0x%x] = 0x%x\n", addr, reg);
kprintf("mem[0x%x] = 0x%x\n", addr, reg);
addr += 4;
}
return(0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ncr5380sbc.c,v 1.11 1996/05/13 14:10:21 christos Exp $ */
/* $NetBSD: ncr5380sbc.c,v 1.12 1996/10/10 22:18:38 christos Exp $ */
/*
* Copyright (c) 1995 David Jones, Gordon W. Ross
@ -116,7 +116,7 @@ void ncr5380_cmd_timeout __P((void *));
#ifndef DDB
/* This is used only in recoverable places. */
#define Debugger() printf("Debug: ncr5380.c:%d\n", __LINE__)
#define Debugger() kprintf("Debug: ncr5380.c:%d\n", __LINE__)
#endif
#ifdef NCR5380_DEBUG
@ -508,15 +508,15 @@ ncr5380_cmd_timeout(arg)
/* Get all our variables... */
xs = sr->sr_xs;
if (xs == NULL) {
printf("ncr5380_cmd_timeout: no scsi_xfer\n");
kprintf("ncr5380_cmd_timeout: no scsi_xfer\n");
goto out;
}
sc_link = xs->sc_link;
sc = sc_link->adapter_softc;
printf("%s: cmd timeout, targ=%d, lun=%d\n",
sc->sc_dev.dv_xname,
sr->sr_target, sr->sr_lun);
kprintf("%s: cmd timeout, targ=%d, lun=%d\n",
sc->sc_dev.dv_xname,
sr->sr_target, sr->sr_lun);
/*
* Mark the overdue job as failed, and arrange for
@ -600,9 +600,9 @@ ncr5380_scsi_cmd(xs)
/* Terminate any current command. */
sr = sc->sc_current;
if (sr) {
printf("%s: polled request aborting %d/%d\n",
sc->sc_dev.dv_xname,
sr->sr_target, sr->sr_lun);
kprintf("%s: polled request aborting %d/%d\n",
sc->sc_dev.dv_xname,
sr->sr_target, sr->sr_lun);
ncr5380_abort(sc);
}
if (sc->sc_state != NCR_IDLE) {
@ -732,7 +732,7 @@ ncr5380_done(sc)
case SCSI_CHECK:
if (sr->sr_flags & SR_SENSE) {
/* Sense command also asked for sense? */
printf("ncr5380_done: sense asked for sense\n");
kprintf("ncr5380_done: sense asked for sense\n");
NCR_BREAK();
xs->error = XS_DRIVER_STUFFUP;
break;
@ -756,8 +756,8 @@ ncr5380_done(sc)
/* This is our "impossible" initial value. */
/* fallthrough */
default:
printf("%s: target %d, bad status=%d\n",
sc->sc_dev.dv_xname, sr->sr_target, sr->sr_status);
kprintf("%s: target %d, bad status=%d\n",
sc->sc_dev.dv_xname, sr->sr_target, sr->sr_status);
xs->error = XS_DRIVER_STUFFUP;
break;
}
@ -881,8 +881,8 @@ next_job:
/* Lost the race! reselected out from under us! */
/* Work with the reselected job. */
if (sr->sr_flags & SR_IMMED) {
printf("%s: reselected while polling (abort)\n",
sc->sc_dev.dv_xname);
kprintf("%s: reselected while polling (abort)\n",
sc->sc_dev.dv_xname);
/* Abort the reselected job. */
sc->sc_state |= NCR_ABORTING;
sc->sc_msgpriq |= SEND_ABORT;
@ -916,8 +916,8 @@ next_job:
case XS_BUSY:
/* XXX - Reset and try again. */
printf("%s: select found SCSI bus busy, resetting...\n",
sc->sc_dev.dv_xname);
kprintf("%s: select found SCSI bus busy, resetting...\n",
sc->sc_dev.dv_xname);
ncr5380_reset_scsibus(sc);
/* fallthrough */
case XS_SELTIMEOUT:
@ -968,8 +968,8 @@ next_job:
*/
#ifdef NCR5380_DEBUG
if (ncr5380_debug & NCR_DBG_CMDS) {
printf("ncr5380_sched: begin, target=%d, LUN=%d\n",
xs->sc_link->target, xs->sc_link->lun);
kprintf("ncr5380_sched: begin, target=%d, LUN=%d\n",
xs->sc_link->target, xs->sc_link->lun);
ncr5380_show_scsi_cmd(xs);
}
#endif
@ -983,7 +983,7 @@ next_job:
#ifdef DIAGNOSTIC
if ((xs->flags & (SCSI_DATA_IN | SCSI_DATA_OUT)) == 0) {
if (sc->sc_dataptr) {
printf("%s: ptr but no data in/out flags?\n",
kprintf("%s: ptr but no data in/out flags?\n",
sc->sc_dev.dv_xname);
NCR_BREAK();
sc->sc_dataptr = NULL;
@ -1093,8 +1093,8 @@ ncr5380_reselect(sc)
break;
/* Probably never get here... */
if (--timo <= 0) {
printf("%s: reselect, BSY stuck, bus=0x%x\n",
sc->sc_dev.dv_xname, bus);
kprintf("%s: reselect, BSY stuck, bus=0x%x\n",
sc->sc_dev.dv_xname, bus);
/* Not much we can do. Reset the bus. */
ncr5380_reset_scsibus(sc);
return;
@ -1122,8 +1122,8 @@ ncr5380_reselect(sc)
* selected as a target? (I/O == 0)
*/
if ((bus & SCI_BUS_IO) == 0) {
printf("%s: selected as target, data=0x%x\n",
sc->sc_dev.dv_xname, data);
kprintf("%s: selected as target, data=0x%x\n",
sc->sc_dev.dv_xname, data);
/* Not much we can do. Reset the bus. */
/* XXX: send some sort of message? */
ncr5380_reset_scsibus(sc);
@ -1140,8 +1140,8 @@ ncr5380_reselect(sc)
}
if ((data & 0x7F) != target_mask) {
/* No selecting ID? or >2 IDs on bus? */
printf("%s: bad reselect, data=0x%x\n",
sc->sc_dev.dv_xname, data);
kprintf("%s: bad reselect, data=0x%x\n",
sc->sc_dev.dv_xname, data);
return;
}
@ -1157,8 +1157,8 @@ ncr5380_reselect(sc)
if ((bus & SCI_BUS_SEL) == 0)
break; /* success */
if (--timo <= 0) {
printf("%s: reselect, SEL stuck, bus=0x%x\n",
sc->sc_dev.dv_xname, bus);
kprintf("%s: reselect, SEL stuck, bus=0x%x\n",
sc->sc_dev.dv_xname, bus);
NCR_BREAK();
/* assume connected (fail later if not) */
break;
@ -1179,15 +1179,15 @@ ncr5380_reselect(sc)
lun = 0;
/* Wait for REQ before reading bus phase. */
if (ncr5380_wait_req(sc)) {
printf("%s: reselect, no REQ\n",
sc->sc_dev.dv_xname);
kprintf("%s: reselect, no REQ\n",
sc->sc_dev.dv_xname);
/* Try to send an ABORT message. */
goto abort;
}
phase = SCI_BUS_PHASE(*sc->sci_bus_csr);
if (phase != PHASE_MSG_IN) {
printf("%s: reselect, phase=%d\n",
sc->sc_dev.dv_xname, phase);
kprintf("%s: reselect, phase=%d\n",
sc->sc_dev.dv_xname, phase);
goto abort;
}
@ -1197,8 +1197,8 @@ ncr5380_reselect(sc)
/* Peek at the message byte without consuming it! */
msg = *(sc->sci_data);
if ((msg & 0x80) == 0) {
printf("%s: reselect, not identify, msg=%d\n",
sc->sc_dev.dv_xname, msg);
kprintf("%s: reselect, not identify, msg=%d\n",
sc->sc_dev.dv_xname, msg);
goto abort;
}
lun = msg & 7;
@ -1243,8 +1243,8 @@ ncr5380_reselect(sc)
return;
}
printf("%s: phantom reselect: target=%d, LUN=%d\n",
sc->sc_dev.dv_xname, target, lun);
kprintf("%s: phantom reselect: target=%d, LUN=%d\n",
sc->sc_dev.dv_xname, target, lun);
abort:
/*
* Try to send an ABORT message. This makes us
@ -1699,8 +1699,8 @@ have_msg:
/* The ncr5380 can not do synchronous mode. */
goto reject;
default:
printf("%s: unrecognized MESSAGE EXTENDED; sending REJECT\n",
sc->sc_dev.dv_xname);
kprintf("%s: unrecognized MESSAGE EXTENDED; sending REJECT\n",
sc->sc_dev.dv_xname);
NCR_BREAK();
goto reject;
}
@ -1708,8 +1708,8 @@ have_msg:
default:
NCR_TRACE("msg_in: eh? imsg=0x%x\n", sc->sc_imess[0]);
printf("%s: unrecognized MESSAGE; sending REJECT\n",
sc->sc_dev.dv_xname);
kprintf("%s: unrecognized MESSAGE; sending REJECT\n",
sc->sc_dev.dv_xname);
NCR_BREAK();
/* fallthrough */
reject:
@ -1821,8 +1821,8 @@ nextmsg:
case SEND_IDENTIFY:
NCR_TRACE("msg_out: SEND_IDENTIFY\n", 0);
if (sr == NULL) {
printf("%s: SEND_IDENTIFY while not connected; sending NOOP\n",
sc->sc_dev.dv_xname);
kprintf("%s: SEND_IDENTIFY while not connected; sending NOOP\n",
sc->sc_dev.dv_xname);
NCR_BREAK();
goto noop;
}
@ -1869,8 +1869,8 @@ nextmsg:
break;
case 0:
printf("%s: unexpected MESSAGE OUT; sending NOOP\n",
sc->sc_dev.dv_xname);
kprintf("%s: unexpected MESSAGE OUT; sending NOOP\n",
sc->sc_dev.dv_xname);
NCR_BREAK();
noop:
NCR_TRACE("msg_out: send NOOP\n", 0);
@ -1879,8 +1879,8 @@ nextmsg:
break;
default:
printf("%s: weird MESSAGE OUT; sending NOOP\n",
sc->sc_dev.dv_xname);
kprintf("%s: weird MESSAGE OUT; sending NOOP\n",
sc->sc_dev.dv_xname);
NCR_BREAK();
goto noop;
}
@ -2005,8 +2005,8 @@ ncr5380_command(sc)
if (len != xs->cmdlen) {
#ifdef NCR5380_DEBUG
printf("ncr5380_command: short transfer: wanted %d got %d.\n",
xs->cmdlen, len);
kprintf("ncr5380_command: short transfer: wanted %d got %d.\n",
xs->cmdlen, len);
ncr5380_show_scsi_cmd(xs);
NCR_BREAK();
#endif
@ -2038,7 +2038,7 @@ ncr5380_data_xfer(sc, phase)
if (sr->sr_flags & SR_SENSE) {
NCR_TRACE("data_xfer: get sense, sr=0x%x\n", (long)sr);
if (phase != PHASE_DATA_IN) {
printf("%s: sense phase error\n", sc->sc_dev.dv_xname);
kprintf("%s: sense phase error\n", sc->sc_dev.dv_xname);
goto abort;
}
/* acknowledge phase change */
@ -2052,9 +2052,8 @@ ncr5380_data_xfer(sc, phase)
* When aborting a command, disallow any data phase.
*/
if (sc->sc_state & NCR_ABORTING) {
printf("%s: aborting, but phase=%s (reset)\n",
sc->sc_dev.dv_xname,
phase_names[phase & 7]);
kprintf("%s: aborting, but phase=%s (reset)\n",
sc->sc_dev.dv_xname, phase_names[phase & 7]);
return ACT_RESET_BUS; /* XXX */
}
@ -2062,15 +2061,14 @@ ncr5380_data_xfer(sc, phase)
expected_phase = (xs->flags & SCSI_DATA_OUT) ?
PHASE_DATA_OUT : PHASE_DATA_IN;
if (phase != expected_phase) {
printf("%s: data phase error\n",
sc->sc_dev.dv_xname);
kprintf("%s: data phase error\n", sc->sc_dev.dv_xname);
goto abort;
}
/* Make sure we have some data to move. */
if (sc->sc_datalen <= 0) {
printf("%s: can not transfer more data\n",
sc->sc_dev.dv_xname);
kprintf("%s: can not transfer more data\n",
sc->sc_dev.dv_xname);
goto abort;
}
@ -2132,7 +2130,7 @@ ncr5380_status(sc)
if (len) {
sr->sr_status = status;
} else {
printf("ncr5380_status: none?\n");
kprintf("ncr5380_status: none?\n");
}
return ACT_CONTINUE;
@ -2181,7 +2179,7 @@ next_phase:
if (!SCI_BUSY(sc)) {
/* Unexpected disconnect */
printf("ncr5380_machine: unexpected disconnect.\n");
kprintf("ncr5380_machine: unexpected disconnect.\n");
xs->error = XS_DRIVER_STUFFUP;
act_flags |= (ACT_DISCONNECT | ACT_CMD_DONE);
goto do_actions;
@ -2198,13 +2196,13 @@ next_phase:
break;
if (--timo <= 0) {
if (sc->sc_state & NCR_ABORTING) {
printf("%s: no REQ while aborting, reset\n",
sc->sc_dev.dv_xname);
kprintf("%s: no REQ while aborting, reset\n",
sc->sc_dev.dv_xname);
act_flags |= ACT_RESET_BUS;
goto do_actions;
}
printf("%s: no REQ for next phase, abort\n",
sc->sc_dev.dv_xname);
kprintf("%s: no REQ for next phase, abort\n",
sc->sc_dev.dv_xname);
sc->sc_state |= NCR_ABORTING;
ncr_sched_msgout(sc, SEND_ABORT);
goto next_phase;
@ -2254,7 +2252,7 @@ next_phase:
break;
default:
printf("ncr5380_machine: Unexpected phase 0x%x\n", phase);
kprintf("ncr5380_machine: Unexpected phase 0x%x\n", phase);
sc->sc_state |= NCR_ABORTING;
ncr_sched_msgout(sc, SEND_ABORT);
goto next_phase;
@ -2299,8 +2297,7 @@ do_actions:
* XXX - better place to check?
*/
if (*(sc->sci_csr) & SCI_CSR_PERR) {
printf("%s: parity error!\n",
sc->sc_dev.dv_xname);
kprintf("%s: parity error!\n", sc->sc_dev.dv_xname);
/* XXX: sc->sc_state |= NCR_ABORTING; */
ncr_sched_msgout(sc, SEND_PARITY_ERROR);
}
@ -2318,9 +2315,8 @@ do_actions:
* The error code XS_TIMEOUT allows retries.
*/
sc->sc_state |= NCR_ABORTING;
printf("%s: reset SCSI bus for TID=%d LUN=%d\n",
sc->sc_dev.dv_xname,
sr->sr_target, sr->sr_lun);
kprintf("%s: reset SCSI bus for TID=%d LUN=%d\n",
sc->sc_dev.dv_xname, sr->sr_target, sr->sr_lun);
ncr5380_reset_scsibus(sc);
}
@ -2329,9 +2325,9 @@ do_actions:
/* Need to call scsi_done() */
/* XXX: from the aic6360 driver, but why? */
if (sc->sc_datalen < 0) {
printf("%s: %d extra bytes from %d:%d\n",
sc->sc_dev.dv_xname, -sc->sc_datalen,
sr->sr_target, sr->sr_lun);
kprintf("%s: %d extra bytes from %d:%d\n",
sc->sc_dev.dv_xname, -sc->sc_datalen,
sr->sr_target, sr->sr_lun);
sc->sc_datalen = 0;
}
xs->resid = sc->sc_datalen;
@ -2355,9 +2351,8 @@ do_actions:
delay(2);
}
/* Device is sitting on the bus! */
printf("%s: Target %d LUN %d stuck busy, resetting...\n",
sc->sc_dev.dv_xname,
sr->sr_target, sr->sr_lun);
kprintf("%s: Target %d LUN %d stuck busy, resetting...\n",
sc->sc_dev.dv_xname, sr->sr_target, sr->sr_lun);
ncr5380_reset_scsibus(sc);
busfree:
NCR_TRACE("machine: discon, waited %d\n",
@ -2406,20 +2401,18 @@ ncr5380_show_scsi_cmd(xs)
int i = 0;
if ( ! ( xs->flags & SCSI_RESET ) ) {
printf("si(%d:%d:%d)-",
xs->sc_link->scsibus,
xs->sc_link->target,
xs->sc_link->lun);
kprintf("si(%d:%d:%d)-",
xs->sc_link->scsibus, xs->sc_link->target,
xs->sc_link->lun);
while (i < xs->cmdlen) {
if (i) printf(",");
printf("%x",b[i++]);
if (i) kprintf(",");
kprintf("%x",b[i++]);
}
printf("-\n");
kprintf("-\n");
} else {
printf("si(%d:%d:%d)-RESET-\n",
xs->sc_link->scsibus,
xs->sc_link->target,
xs->sc_link->lun);
kprintf("si(%d:%d:%d)-RESET-\n",
xs->sc_link->scsibus, xs->sc_link->target,
xs->sc_link->lun);
}
}
@ -2431,10 +2424,10 @@ ncr5380_show_sense(xs)
u_char *b = (u_char *)&xs->sense;
int i;
printf("sense:");
kprintf("sense:");
for (i = 0; i < sizeof(xs->sense); i++)
printf(" %02x", b[i]);
printf("\n");
kprintf(" %02x", b[i]);
kprintf("\n");
}
int ncr5380_traceidx = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: smc90cx6.c,v 1.17 1996/05/07 01:43:18 thorpej Exp $ */
/* $NetBSD: smc90cx6.c,v 1.18 1996/10/10 22:18:39 christos Exp $ */
/*
* Copyright (c) 1994, 1995 Ignatios Souvatzis
@ -225,7 +225,7 @@ bah_zbus_attach(parent, self, aux)
int s, linkaddress;
#if (defined(BAH_DEBUG) && (BAH_DEBUG > 2))
printf("\n%s: attach(0x%x, 0x%x, 0x%x)\n",
kprintf("\n%s: attach(0x%x, 0x%x, 0x%x)\n",
sc->sc_dev.dv_xname, parent, self, aux);
#endif
s = splhigh();
@ -248,10 +248,10 @@ bah_zbus_attach(parent, self, aux)
linkaddress = sc->sc_base->dipswitches;
#ifdef BAHTIMINGS
printf(": link addr 0x%02x(%ld), with timer\n",
kprintf(": link addr 0x%02x(%ld), with timer\n",
linkaddress, linkaddress);
#else
printf(": link addr 0x%02x(%ld)\n", linkaddress, linkaddress);
kprintf(": link addr 0x%02x(%ld)\n", linkaddress, linkaddress);
#endif
sc->sc_arccom.ac_anaddr = linkaddress;
@ -341,7 +341,7 @@ bah_reset(sc)
ifp = &sc->sc_arccom.ac_if;
#ifdef BAH_DEBUG
printf("%s: reset\n", sc->sc_dev.dv_xname);
kprintf("%s: reset\n", sc->sc_dev.dv_xname);
#endif
/* stop hardware in case it still runs */
@ -360,7 +360,7 @@ bah_reset(sc)
linkaddress = sc->sc_base->dipswitches;
#if defined(BAH_DEBUG) && (BAH_DEBUG > 2)
printf("%s: reset: card reset, link addr = 0x%02x (%ld)\n",
kprintf("%s: reset: card reset, link addr = 0x%02x (%ld)\n",
sc->sc_dev.dv_xname, linkaddress, linkaddress);
#endif
sc->sc_arccom.ac_anaddr = linkaddress;
@ -374,14 +374,14 @@ bah_reset(sc)
sc->sc_base->command = ARC_CONF(CONF_LONG);
#ifdef BAH_DEBUG
printf("%s: reset: chip configured, status=0x%02x\n",
kprintf("%s: reset: chip configured, status=0x%02x\n",
sc->sc_dev.dv_xname, sc->sc_base->status);
#endif
sc->sc_base->command = ARC_CLR(CLR_POR|CLR_RECONFIG);
#ifdef BAH_DEBUG
printf("%s: reset: bits cleared, status=0x%02x\n",
kprintf("%s: reset: bits cleared, status=0x%02x\n",
sc->sc_dev.dv_xname, sc->sc_base->status);
#endif
@ -397,7 +397,7 @@ bah_reset(sc)
sc->sc_base->status = sc->sc_intmask;
#ifdef BAH_DEBUG
printf("%s: reset: started receiver, status=0x%02x\n",
kprintf("%s: reset: started receiver, status=0x%02x\n",
sc->sc_dev.dv_xname, sc->sc_base->status);
#endif
@ -543,7 +543,7 @@ bah_start(ifp)
sc = ifp->if_softc;
#if defined(BAH_DEBUG) && (BAH_DEBUG > 3)
printf("%s: start(0x%x)\n", sc->sc_dev.dv_xname, ifp);
kprintf("%s: start(0x%x)\n", sc->sc_dev.dv_xname, ifp);
#endif
if ((ifp->if_flags & IFF_RUNNING) == 0)
@ -578,7 +578,7 @@ bah_start(ifp)
#ifdef BAH_DEBUG
m = m_pullup(m,3); /* gcc does structure padding */
printf("%s: start: filling %ld from %ld to %ld type %ld\n",
kprintf("%s: start: filling %ld from %ld to %ld type %ld\n",
sc->sc_dev.dv_xname, buffer, mtod(m, u_char *)[0],
mtod(m, u_char *)[1], mtod(m, u_char *)[2]);
#else
@ -650,7 +650,7 @@ bah_start(ifp)
ifp->if_flags |= IFF_OACTIVE;
} else {
#ifdef BAH_DEBUG
printf("%s: start: starting transmitter on buffer %d\n",
kprintf("%s: start: starting transmitter on buffer %d\n",
sc->sc_dev.dv_xname, buffer);
#endif
/* Transmitter was off, start it */
@ -903,7 +903,7 @@ cleanup:
sc->sc_base->status = sc->sc_intmask;
#ifdef BAH_DEBUG
printf("%s: srint: restarted rx on buf %ld\n",
kprintf("%s: srint: restarted rx on buf %ld\n",
sc->sc_dev.dv_xname, buffer);
#endif
}
@ -986,7 +986,7 @@ bah_tint(sc, isr)
#endif
#if defined(BAH_DEBUG) && (BAH_DEBUG > 1)
printf("%s: tint: starting tx on buffer %d, status 0x%02x\n",
kprintf("%s: tint: starting tx on buffer %d, status 0x%02x\n",
sc->sc_dev.dv_xname, buffer, sc->sc_base->status);
#endif
} else {
@ -997,7 +997,7 @@ bah_tint(sc, isr)
ifp->if_timer = 0;
#ifdef BAH_DEBUG
printf("%s: tint: no more buffers to send, status 0x%02x\n",
kprintf("%s: tint: no more buffers to send, status 0x%02x\n",
sc->sc_dev.dv_xname, sc->sc_base->status);
#endif
}
@ -1028,7 +1028,7 @@ bahintr(sc)
return (0);
#if defined(BAH_DEBUG) && (BAH_DEBUG>1)
printf("%s: intr: status 0x%02x, intmask 0x%02x\n",
kprintf("%s: intr: status 0x%02x, intmask 0x%02x\n",
sc->sc_dev.dv_xname, isr, sc->sc_intmask);
#endif
@ -1082,7 +1082,7 @@ bahintr(sc)
if (maskedisr & ARC_RI) {
#if defined(BAH_DEBUG) && (BAH_DEBUG > 1)
printf("%s: intr: hard rint, act %ld\n",
kprintf("%s: intr: hard rint, act %ld\n",
sc->sc_dev.dv_xname, sc->sc_rx_act);
#endif
@ -1114,7 +1114,7 @@ bahintr(sc)
/* we are in the RX intr, so mask is ok for RX */
#ifdef BAH_DEBUG
printf("%s: started rx for buffer %ld, status 0x%02x\n",
kprintf("%s: started rx for buffer %ld, status 0x%02x\n",
sc->sc_dev.dv_xname, sc->sc_rx_act,
sc->sc_base->status);
#endif
@ -1155,7 +1155,7 @@ bah_ioctl(ifp, command, data)
s = splnet();
#if defined(BAH_DEBUG) && (BAH_DEBUG > 2)
printf("%s: ioctl() called, cmd = 0x%x\n",
kprintf("%s: ioctl() called, cmd = 0x%x\n",
sc->sc_dev.dv_xname, command);
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: smc93cx6.c,v 1.2 1996/07/10 22:50:49 explorer Exp $ */
/* $NetBSD: smc93cx6.c,v 1.3 1996/10/10 22:18:40 christos Exp $ */
/*
* Interface for the 93C46/26/06 serial eeprom parts.
@ -167,15 +167,15 @@ read_seeprom(sd, buf, start_addr, count)
CLOCK_PULSE(sd, sd->sd_RDY);
}
#if 0
printf ("Serial EEPROM:");
kprintf ("Serial EEPROM:");
for (k = 0; k < count; k = k + 1) {
if (((k % 8) == 0) && (k != 0))
{
printf ("\n ");
kprintf ("\n ");
}
printf (" 0x%x", buf[k]);
kprintf (" 0x%x", buf[k]);
}
printf ("\n");
kprintf ("\n");
#endif
return (1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: z8530tty.c,v 1.10 1996/09/02 06:44:44 mycroft Exp $ */
/* $NetBSD: z8530tty.c,v 1.11 1996/10/10 22:18:41 christos Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@ -230,10 +230,10 @@ zstty_attach(parent, self, aux)
dev = makedev(ZSTTY_MAJOR, tty_unit);
if (zst->zst_swflags)
printf(" flags 0x%x", zst->zst_swflags);
kprintf(" flags 0x%x", zst->zst_swflags);
if (zst->zst_hwflags & ZS_HWFLAG_CONSOLE)
printf(" (console)");
kprintf(" (console)");
else {
#ifdef KGDB
/*
@ -251,7 +251,7 @@ zstty_attach(parent, self, aux)
}
#endif
}
printf("\n");
kprintf("\n");
tp = ttymalloc();
tp->t_dev = dev;