1/*- 2 * 3 * Copyright (c) 1999-2001, Vitaly V Belekhov 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/netgraph/ng_eiface.c 241686 2012-10-18 13:57:24Z andre $ |
29 */ 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/errno.h> 34#include <sys/kernel.h> 35#include <sys/malloc.h> 36#include <sys/mbuf.h> --- 90 unchanged lines hidden (view full) --- 127/* 128 * Process an ioctl for the virtual interface 129 */ 130static int 131ng_eiface_ioctl(struct ifnet *ifp, u_long command, caddr_t data) 132{ 133 const priv_p priv = (priv_p)ifp->if_softc; 134 struct ifreq *const ifr = (struct ifreq *)data; |
135 int error = 0; |
136 137#ifdef DEBUG 138 ng_eiface_print_ioctl(ifp, command, data); 139#endif |
140 switch (command) { 141 142 /* These two are mostly handled at a higher layer */ 143 case SIOCSIFADDR: 144 error = ether_ioctl(ifp, command, data); 145 break; 146 case SIOCGIFADDR: 147 break; --- 39 unchanged lines hidden (view full) --- 187 case SIOCSIFPHYS: 188 error = EOPNOTSUPP; 189 break; 190 191 default: 192 error = EINVAL; 193 break; 194 } |
195 return (error); 196} 197 198static void 199ng_eiface_init(void *xsc) 200{ 201 priv_p sc = xsc; 202 struct ifnet *ifp = sc->ifp; |
203 |
204 ifp->if_drv_flags |= IFF_DRV_RUNNING; 205 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; |
206} 207 208/* 209 * We simply relay the packet to the "ether" hook, if it is connected. 210 * We have been through the netgraph locking and are guaranteed to 211 * be the only code running in this node at this time. 212 */ 213static void --- 466 unchanged lines hidden --- |