s = splimp();
s = splnet();
sk_ioctl(struct ifnet *ifp, u_long command, caddr_t data){	struct sk_if_softc *sc_if = ifp->if_softc;	struct sk_softc *sc = sc_if->sk_softc;	struct ifreq *ifr = (struct ifreq *) data;	struct ifaddr *ifa = (struct ifaddr *) data;	struct mii_data *mii;	int s, error = 0;	s = splimp();	if ((error = ether_ioctl(ifp, &sc_if->arpcom, command, data)) > 0) {		splx(s);		return error;	}	switch(command) {	case SIOCSIFADDR:		ifp->if_flags |= IFF_UP;		switch (ifa->ifa_addr->sa_family) {#ifdef INET		case AF_INET:			sk_init(sc_if);			arp_ifinit(&sc_if->arpcom, ifa);			break;#endif /* INET */		default:			sk_init(sc_if);			break;		}		break;	case SIOCSIFMTU:		if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU_JUMBO)			error = EINVAL;		else if (ifp->if_mtu != ifr->ifr_mtu)			ifp->if_mtu = ifr->ifr_mtu;		break;	case SIOCSIFFLAGS:		if (ifp->if_flags & IFF_UP) {			if (ifp->if_flags & IFF_RUNNING &&			    ifp->if_flags & IFF_PROMISC &&			    !(sc_if->sk_if_flags & IFF_PROMISC)) {				switch(sc->sk_type) {				case SK_GENESIS:					SK_XM_SETBIT_4(sc_if, XM_MODE,					    XM_MODE_RX_PROMISC);					break;				case SK_YUKON:				case SK_YUKON_LITE:				case SK_YUKON_LP:					SK_YU_CLRBIT_2(sc_if, YUKON_RCR,					    YU_RCR_UFLEN | YU_RCR_MUFLEN);					break;				}				sk_setmulti(sc_if);			} else if (ifp->if_flags & IFF_RUNNING &&			    !(ifp->if_flags & IFF_PROMISC) &&			    sc_if->sk_if_flags & IFF_PROMISC) {				switch(sc->sk_type) {				case SK_GENESIS:					SK_XM_CLRBIT_4(sc_if, XM_MODE,					    XM_MODE_RX_PROMISC);					break;				case SK_YUKON:				case SK_YUKON_LITE:				case SK_YUKON_LP:					SK_YU_SETBIT_2(sc_if, YUKON_RCR,					    YU_RCR_UFLEN | YU_RCR_MUFLEN);					break;				}				sk_setmulti(sc_if);			} else				sk_init(sc_if);		} else {			if (ifp->if_flags & IFF_RUNNING)				sk_stop(sc_if);		}		sc_if->sk_if_flags = ifp->if_flags;		error = 0;		break;	case SIOCADDMULTI:	case SIOCDELMULTI:		error = (command == SIOCADDMULTI) ?		    ether_addmulti(ifr, &sc_if->arpcom) :		    ether_delmulti(ifr, &sc_if->arpcom);		if (error == ENETRESET) {			/*			 * Multicast list has changed; set the hardware			 * filter accordingly.			 */			if (ifp->if_flags & IFF_RUNNING)				sk_setmulti(sc_if);			error = 0;		}		break;	case SIOCGIFMEDIA:	case SIOCSIFMEDIA:		mii = &sc_if->sk_mii;		error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);		break;	default:		error = EINVAL;		break;	}	splx(s);	return(error);}