version 1.15, 2007/10/19 12:01:08 |
version 1.16, 2008/04/05 19:16:49 |
Line 256 dmcattach(struct device *parent, struct |
|
Line 256 dmcattach(struct device *parent, struct |
|
sc->sc_ioh = ua->ua_ioh; |
sc->sc_ioh = ua->ua_ioh; |
sc->sc_dmat = ua->ua_dmat; |
sc->sc_dmat = ua->ua_dmat; |
|
|
strcpy(sc->sc_if.if_xname, sc->sc_dev.dv_xname); |
strlcpy(sc->sc_if.if_xname, device_xname(&sc->sc_dev), IFNAMSIZ); |
sc->sc_if.if_mtu = DMCMTU; |
sc->sc_if.if_mtu = DMCMTU; |
sc->sc_if.if_init = dmcinit; |
sc->sc_if.if_init = dmcinit; |
sc->sc_if.if_output = dmcoutput; |
sc->sc_if.if_output = dmcoutput; |
Line 272 dmcattach(struct device *parent, struct |
|
Line 272 dmcattach(struct device *parent, struct |
|
&sc->sc_tintrcnt); |
&sc->sc_tintrcnt); |
uba_reset_establish(dmcreset, &sc->sc_dev); |
uba_reset_establish(dmcreset, &sc->sc_dev); |
evcnt_attach_dynamic(&sc->sc_rintrcnt, EVCNT_TYPE_INTR, ua->ua_evcnt, |
evcnt_attach_dynamic(&sc->sc_rintrcnt, EVCNT_TYPE_INTR, ua->ua_evcnt, |
sc->sc_dev.dv_xname, "intr"); |
device_xname(&sc->sc_dev), "intr"); |
evcnt_attach_dynamic(&sc->sc_tintrcnt, EVCNT_TYPE_INTR, ua->ua_evcnt, |
evcnt_attach_dynamic(&sc->sc_tintrcnt, EVCNT_TYPE_INTR, ua->ua_evcnt, |
sc->sc_dev.dv_xname, "intr"); |
device_xname(&sc->sc_dev), "intr"); |
|
|
if_attach(&sc->sc_if); |
if_attach(&sc->sc_if); |
} |
} |
Line 338 dmcinit(struct ifnet *ifp) |
|
Line 338 dmcinit(struct ifnet *ifp) |
|
(void *)device_parent(&sc->sc_dev), |
(void *)device_parent(&sc->sc_dev), |
sizeof(struct dmc_header) + DMCMTU, |
sizeof(struct dmc_header) + DMCMTU, |
sc->sc_ifr, NRCV, sc->sc_ifw, NXMT) == 0) { |
sc->sc_ifr, NRCV, sc->sc_ifw, NXMT) == 0) { |
printf("%s: can't allocate uba resources\n", |
aprint_error_dev(&sc->sc_dev, "can't allocate uba resources\n"); |
sc->sc_dev.dv_xname); |
|
ifp->if_flags &= ~IFF_UP; |
ifp->if_flags &= ~IFF_UP; |
return 0; |
return 0; |
} |
} |
Line 503 dmcrint(void *arg) |
|
Line 502 dmcrint(void *arg) |
|
int n; |
int n; |
|
|
if ((qp = sc->sc_qactive) == (struct dmc_command *) 0) { |
if ((qp = sc->sc_qactive) == (struct dmc_command *) 0) { |
printf("%s: dmcrint no command\n", sc->sc_dev.dv_xname); |
printf("%s: dmcrint no command\n", device_xname(&sc->sc_dev)); |
return; |
return; |
} |
} |
while (DMC_RBYTE(DMC_BSEL0) & DMC_RDYI) { |
while (DMC_RBYTE(DMC_BSEL0) & DMC_RDYI) { |
Line 590 dmcxint(void *a) |
|
Line 589 dmcxint(void *a) |
|
if (rp >= &sc->sc_rbufs[NRCV]) |
if (rp >= &sc->sc_rbufs[NRCV]) |
panic("dmc rcv"); |
panic("dmc rcv"); |
if ((rp->flags & DBUF_DMCS) == 0) |
if ((rp->flags & DBUF_DMCS) == 0) |
printf("%s: done unalloc rbuf\n", |
aprint_error_dev(&sc->sc_dev, "done unalloc rbuf\n"); |
sc->sc_dev.dv_xname); |
|
|
|
len = (arg & DMC_CCOUNT) - sizeof (struct dmc_header); |
len = (arg & DMC_CCOUNT) - sizeof (struct dmc_header); |
if (len < 0 || len > DMCMTU) { |
if (len < 0 || len > DMCMTU) { |
ifp->if_ierrors++; |
ifp->if_ierrors++; |
#ifdef DMCDEBUG |
#ifdef DMCDEBUG |
printd("%s: bad rcv pkt addr 0x%x len 0x%x\n", |
printd("%s: bad rcv pkt addr 0x%x len 0x%x\n", |
sc->sc_dev.dv_xname, pkaddr, len); |
device_xname(&sc->sc_dev), pkaddr, len); |
#endif |
#endif |
goto setup; |
goto setup; |
} |
} |
Line 667 dmcxint(void *a) |
|
Line 665 dmcxint(void *a) |
|
ifxp++; |
ifxp++; |
} |
} |
if (rp >= &sc->sc_xbufs[NXMT]) { |
if (rp >= &sc->sc_xbufs[NXMT]) { |
printf("%s: bad packet address 0x%x\n", |
aprint_error_dev(&sc->sc_dev, "bad packet address 0x%x\n", |
sc->sc_dev.dv_xname, pkaddr); |
pkaddr); |
break; |
break; |
} |
} |
if ((rp->flags & DBUF_DMCS) == 0) |
if ((rp->flags & DBUF_DMCS) == 0) |
printf("%s: unallocated packet 0x%x\n", |
aprint_error_dev(&sc->sc_dev, "unallocated packet 0x%x\n", |
sc->sc_dev.dv_xname, pkaddr); |
pkaddr); |
/* mark buffer free */ |
/* mark buffer free */ |
if_ubaend(&sc->sc_ifuba, ifxp); |
if_ubaend(&sc->sc_ifuba, ifxp); |
rp->flags &= ~DBUF_DMCS; |
rp->flags &= ~DBUF_DMCS; |
Line 701 dmcxint(void *a) |
|
Line 699 dmcxint(void *a) |
|
buf, sizeof(buf)); |
buf, sizeof(buf)); |
log(LOG_ERR, |
log(LOG_ERR, |
"%s: fatal error, flags=%s\n", |
"%s: fatal error, flags=%s\n", |
sc->sc_dev.dv_xname, buf); |
device_xname(&sc->sc_dev), buf); |
} |
} |
dmcrestart(sc); |
dmcrestart(sc); |
break; |
break; |
Line 734 dmcxint(void *a) |
|
Line 732 dmcxint(void *a) |
|
#ifdef DMCDEBUG |
#ifdef DMCDEBUG |
bitmask_snprintf(arg, CNTLO_BITS, buf, sizeof(buf)); |
bitmask_snprintf(arg, CNTLO_BITS, buf, sizeof(buf)); |
printd("%s: soft error, flags=%s\n", |
printd("%s: soft error, flags=%s\n", |
sc->sc_dev.dv_xname, buf); |
device_xname(&sc->sc_dev), buf); |
#endif |
#endif |
if ((sc->sc_flag & DMC_RESTART) == 0) { |
if ((sc->sc_flag & DMC_RESTART) == 0) { |
/* |
/* |
Line 750 dmcxint(void *a) |
|
Line 748 dmcxint(void *a) |
|
|
|
default: |
default: |
printf("%s: bad control %o\n", |
printf("%s: bad control %o\n", |
sc->sc_dev.dv_xname, cmd); |
device_xname(&sc->sc_dev), cmd); |
break; |
break; |
} |
} |
} |
} |
Line 881 dmcrestart(struct dmc_softc *sc) |
|
Line 879 dmcrestart(struct dmc_softc *sc) |
|
|
|
#ifdef DMCDEBUG |
#ifdef DMCDEBUG |
/* dump base table */ |
/* dump base table */ |
printf("%s base table:\n", sc->sc_dev.dv_xname); |
printf("%s base table:\n", device_xname(&sc->sc_dev)); |
for (i = 0; i < sizeof (struct dmc_base); i++) |
for (i = 0; i < sizeof (struct dmc_base); i++) |
printf("%o\n" ,dmc_base[unit].d_base[i]); |
printf("%o\n" ,dmc_base[unit].d_base[i]); |
#endif |
#endif |
Line 896 dmcrestart(struct dmc_softc *sc) |
|
Line 894 dmcrestart(struct dmc_softc *sc) |
|
; |
; |
/* Did the timer expire or did the DMR finish? */ |
/* Did the timer expire or did the DMR finish? */ |
if ((DMC_RBYTE(DMC_BSEL1) & DMC_RUN) == 0) { |
if ((DMC_RBYTE(DMC_BSEL1) & DMC_RUN) == 0) { |
log(LOG_ERR, "%s: M820 Test Failed\n", sc->sc_dev.dv_xname); |
log(LOG_ERR, "%s: M820 Test Failed\n", device_xname(&sc->sc_dev)); |
return; |
return; |
} |
} |
|
|
Line 949 dmctimeout(struct ifnet *ifp) |
|
Line 947 dmctimeout(struct ifnet *ifp) |
|
bitmask_snprintf(DMC_RBYTE(DMC_BSEL2) & 0xff, DMC2BITS, |
bitmask_snprintf(DMC_RBYTE(DMC_BSEL2) & 0xff, DMC2BITS, |
buf2, sizeof(buf2)); |
buf2, sizeof(buf2)); |
log(LOG_ERR, "%s: output timeout, bsel0=%s bsel2=%s\n", |
log(LOG_ERR, "%s: output timeout, bsel0=%s bsel2=%s\n", |
sc->sc_dev.dv_xname, buf1, buf2); |
device_xname(&sc->sc_dev), buf1, buf2); |
dmcrestart(sc); |
dmcrestart(sc); |
} |
} |
} |
} |