version 1.32.4.3, 1997/08/29 18:47:07 |
version 1.32.4.4, 1997/09/27 01:57:29 |
|
|
u_int16_t status; |
u_int16_t status; |
int ret = 0; |
int ret = 0; |
|
|
|
if (!sc->enabled) |
|
return(0); |
|
|
for (;;) { |
for (;;) { |
bus_space_write_2(iot, ioh, EP_COMMAND, C_INTR_LATCH); |
bus_space_write_2(iot, ioh, EP_COMMAND, C_INTR_LATCH); |
|
|
Line 1429 epioctl(ifp, cmd, data) |
|
Line 1432 epioctl(ifp, cmd, data) |
|
switch (cmd) { |
switch (cmd) { |
|
|
case SIOCSIFADDR: |
case SIOCSIFADDR: |
|
if (sc->enable && !sc->enabled) { |
|
if ((*sc->enable)(sc->able_arg)) { |
|
printf("%s: device enable failed\n", |
|
sc->sc_dev.dv_xname); |
|
error = EIO; |
|
break; |
|
} |
|
sc->enabled = 1; |
|
} |
|
/* epinit is called just below */ |
ifp->if_flags |= IFF_UP; |
ifp->if_flags |= IFF_UP; |
|
|
switch (ifa->ifa_addr->sa_family) { |
switch (ifa->ifa_addr->sa_family) { |
#ifdef INET |
#ifdef INET |
case AF_INET: |
case AF_INET: |
Line 1475 epioctl(ifp, cmd, data) |
|
Line 1487 epioctl(ifp, cmd, data) |
|
*/ |
*/ |
epstop(sc); |
epstop(sc); |
ifp->if_flags &= ~IFF_RUNNING; |
ifp->if_flags &= ~IFF_RUNNING; |
|
if (sc->disable && sc->enabled) { |
|
sc->enabled = 0; |
|
(*sc->disable)(sc->able_arg); |
|
} |
} else if ((ifp->if_flags & IFF_UP) != 0 && |
} else if ((ifp->if_flags & IFF_UP) != 0 && |
(ifp->if_flags & IFF_RUNNING) == 0) { |
(ifp->if_flags & IFF_RUNNING) == 0) { |
/* |
/* |
* If interface is marked up and it is stopped, then |
* If interface is marked up and it is stopped, then |
* start it. |
* start it. |
*/ |
*/ |
|
if (sc->enable && !sc->enabled) { |
|
if ((*sc->enable)(sc->able_arg)) { |
|
printf("%s: device enable failed\n", |
|
sc->sc_dev.dv_xname); |
|
error = EIO; |
|
break; |
|
} |
|
sc->enabled = 1; |
|
} |
epinit(sc); |
epinit(sc); |
} else { |
} else { |
/* |
/* |
Line 1575 epshutdown(arg) |
|
Line 1600 epshutdown(arg) |
|
{ |
{ |
register struct ep_softc *sc = arg; |
register struct ep_softc *sc = arg; |
|
|
epstop(sc); |
if (sc->enabled) { |
ep_complete_cmd(sc, EP_COMMAND, GLOBAL_RESET); |
epstop(sc); |
|
ep_complete_cmd(sc, EP_COMMAND, GLOBAL_RESET); |
|
} |
} |
} |
|
|
/* |
/* |