FreeBSD/sys/dev/sn/if_sn.c
/*
 * Handle IOCTLS.  This function is completely stolen from if_ep.c
 * As with its progenitor, it does not handle hardware address
 * changes.
 */
Handle IOCTLS.  This function is completely stolen from if_ep.c
As with its progenitor, it does not handle hardware address
changes.
Handle IOCTLS . This function is completely stolen from if_ep . c As with its progenitor it does not handle hardware address changes .
static int
snioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
	struct sn_softc *sc = ifp->if_softc;
	int             error = 0;
	switch (cmd) {
	case SIOCSIFFLAGS:
		SN_LOCK(sc);
		if ((ifp->if_flags & IFF_UP) == 0 &&
		    ifp->if_drv_flags & IFF_DRV_RUNNING) {
			snstop(sc);
		} else {
			sninit_locked(sc);
		}
		SN_UNLOCK(sc);
		break;
	case SIOCADDMULTI:
	case SIOCDELMULTI:
		SN_LOCK(sc);
		sn_setmcast(sc);
		error = 0;
		SN_UNLOCK(sc);
		break;
	default:
		error = ether_ioctl(ifp, cmd, data);
		break;
	}
	return (error);
}
static int snioctl ( struct ifnet * ifp , u_long cmd , caddr_t data ) { struct sn_softc * sc = ifp -> if_softc ; int error = 0 ; switch ( cmd ) { case SIOCSIFFLAGS : SN_LOCK ( sc ) ; if ( ( ifp -> if_flags & IFF_UP ) == 0 && ifp -> if_drv_flags & IFF_DRV_RUNNING ) { snstop ( sc ) ; } else { sninit_locked ( sc ) ; } SN_UNLOCK ( sc ) ; break ; case SIOCADDMULTI : case SIOCDELMULTI : SN_LOCK ( sc ) ; sn_setmcast ( sc ) ; error = 0 ; SN_UNLOCK ( sc ) ; break ; default : error = ether_ioctl ( ifp , cmd , data ) ; break ; } return ( error ) ; }
Handle IOCTLS.
Handle IOCTLS .
/* reinitialize card on any parameter change */ /* update multicast filter list. */