version 1.1.4.3, 2002/10/10 18:41:37 |
version 1.2, 2001/11/13 07:11:24 |
Line 187 static int dmcoutput(struct ifnet *, st |
|
Line 187 static int dmcoutput(struct ifnet *, st |
|
struct rtentry *); |
struct rtentry *); |
static void dmcreset(struct device *); |
static void dmcreset(struct device *); |
|
|
CFATTACH_DECL(dmc, sizeof(struct dmc_softc), |
struct cfattach dmc_ca = { |
dmcmatch, dmcattach, NULL, NULL); |
sizeof(struct dmc_softc), dmcmatch, dmcattach |
|
}; |
|
|
/* flags */ |
/* flags */ |
#define DMC_RUNNING 0x01 /* device initialized */ |
#define DMC_RUNNING 0x01 /* device initialized */ |
Line 268 dmcattach(struct device *parent, struct |
|
Line 269 dmcattach(struct device *parent, struct |
|
sc->sc_if.if_watchdog = dmctimeout; |
sc->sc_if.if_watchdog = dmctimeout; |
sc->sc_if.if_flags = IFF_POINTOPOINT; |
sc->sc_if.if_flags = IFF_POINTOPOINT; |
sc->sc_if.if_softc = sc; |
sc->sc_if.if_softc = sc; |
IFQ_SET_READY(&sc->sc_if.if_snd); |
|
|
|
uba_intr_establish(ua->ua_icookie, ua->ua_cvec, dmcrint, sc, |
uba_intr_establish(ua->ua_icookie, ua->ua_cvec, dmcrint, sc, |
&sc->sc_rintrcnt); |
&sc->sc_rintrcnt); |
Line 438 dmcstart(struct ifnet *ifp) |
|
Line 438 dmcstart(struct ifnet *ifp) |
|
for (rp = &sc->sc_xbufs[0]; rp < &sc->sc_xbufs[NXMT]; rp++ ) { |
for (rp = &sc->sc_xbufs[0]; rp < &sc->sc_xbufs[NXMT]; rp++ ) { |
/* find an available buffer */ |
/* find an available buffer */ |
if ((rp->flags & DBUF_DMCS) == 0) { |
if ((rp->flags & DBUF_DMCS) == 0) { |
IFQ_DEQUEUE(&sc->sc_if.if_snd, m); |
IF_DEQUEUE(&sc->sc_if.if_snd, m); |
if (m == 0) |
if (m == 0) |
return; |
return; |
/* mark it dmcs */ |
/* mark it dmcs */ |
Line 773 dmcoutput(struct ifnet *ifp, struct mbuf |
|
Line 773 dmcoutput(struct ifnet *ifp, struct mbuf |
|
int type, error, s; |
int type, error, s; |
struct mbuf *m = m0; |
struct mbuf *m = m0; |
struct dmc_header *dh; |
struct dmc_header *dh; |
ALTQ_DECL(struct altq_pktattr pktattr;) |
|
|
|
if ((ifp->if_flags & IFF_UP) == 0) { |
if ((ifp->if_flags & IFF_UP) == 0) { |
error = ENETDOWN; |
error = ENETDOWN; |
goto bad; |
goto bad; |
} |
} |
|
|
IFQ_CLASSIFY(&ifp->if_snd, m, dst->sa_family, &pktattr); |
|
|
|
switch (dst->sa_family) { |
switch (dst->sa_family) { |
#ifdef INET |
#ifdef INET |
case AF_INET: |
case AF_INET: |
Line 818 dmcoutput(struct ifnet *ifp, struct mbuf |
|
Line 815 dmcoutput(struct ifnet *ifp, struct mbuf |
|
* not yet active. |
* not yet active. |
*/ |
*/ |
s = splnet(); |
s = splnet(); |
IFQ_ENQUEUE(&ifp->if_snd, m, &pktattr, error); |
if (IF_QFULL(&ifp->if_snd)) { |
if (error) { |
IF_DROP(&ifp->if_snd); |
/* mbuf is already freed */ |
m_freem(m); |
splx(s); |
splx(s); |
return (error); |
return (ENOBUFS); |
} |
} |
|
IF_ENQUEUE(&ifp->if_snd, m); |
dmcstart(ifp); |
dmcstart(ifp); |
splx(s); |
splx(s); |
return (0); |
return (0); |