} break;  case SIOCSIFMTU: if (ifr->ifr_mtu > ETHERMTU || ifr->ifr_mtu < ETHERMIN) { error = EINVAL; } else if (ifp->if_mtu != ifr->ifr_mtu) { ifp->if_mtu = ifr->ifr_mtu;
dp8390_ioctl(ifp, cmd, data)	struct ifnet *ifp;	u_long cmd;	caddr_t data;{	struct dp8390_softc *sc = ifp->if_softc;	struct ifaddr *ifa = (struct ifaddr *) data;	struct ifreq *ifr = (struct ifreq *) data;	int s, error = 0;	s = splnet();	switch (cmd) {	case SIOCSIFADDR:		if ((error = dp8390_enable(sc)) != 0)			break;		ifp->if_flags |= IFF_UP;		switch (ifa->ifa_addr->sa_family) {#ifdef INET		case AF_INET:			dp8390_init(sc);			arp_ifinit(&sc->sc_arpcom, ifa);			break;#endif#ifdef NS			/* XXX - This code is probably wrong. */		case AF_NS:		    {			struct ns_addr *ina = &IA_SNS(ifa)->sns_addr;			if (ns_nullhost(*ina))				ina->x_host =				    *(union ns_host *)LLADDR(ifp->if_sadl);			else				bcopy(ina->x_host.c_host, LLADDR(ifp->if_sadl),				    ETHER_ADDR_LEN);			/* Set new address. */			dp8390_init(sc);			break;		    }#endif		default:			dp8390_init(sc);			break;		}		break;	case SIOCSIFFLAGS:		if ((ifp->if_flags & IFF_UP) == 0 &&		    (ifp->if_flags & IFF_RUNNING) != 0) {			/*			 * If interface is marked down and it is running, then			 * stop it.			 */			dp8390_stop(sc);			ifp->if_flags &= ~IFF_RUNNING;			dp8390_disable(sc);		} else if ((ifp->if_flags & IFF_UP) != 0 &&		    (ifp->if_flags & IFF_RUNNING) == 0) {			/*			 * If interface is marked up and it is stopped, then			 * start it.			 */			if ((error = dp8390_enable(sc)) != 0)				break;			dp8390_init(sc);		} else if ((ifp->if_flags & IFF_UP) != 0) {			/*			 * Reset the interface to pick up changes in any other			 * flags that affect hardware registers.			 */			dp8390_stop(sc);			dp8390_init(sc);		}		break;	case SIOCADDMULTI:	case SIOCDELMULTI:		if (sc->sc_enabled == 0) {			error = EIO;			break;		}		/* Update our multicast list. */		error = (cmd == SIOCADDMULTI) ?		    ether_addmulti(ifr, &sc->sc_arpcom) :		    ether_delmulti(ifr, &sc->sc_arpcom);		if (error == ENETRESET) {			/*			 * Multicast list has changed; set the hardware filter			 * accordingly.			 */			dp8390_stop(sc);	/* XXX for ds_setmcaf? */			dp8390_init(sc);			error = 0;		}		break;	case SIOCGIFMEDIA:	case SIOCSIFMEDIA:		error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd);		break;	default:		error = EINVAL;		break;	}	splx(s);	return (error);}