Lines Matching refs:ifp

76 #define IFP2NG(ifp)  ((ifp)->if_l2com)  argument
80 struct ifnet *ifp; /* associated interface */ member
92 extern void (*ng_ether_input_p)(struct ifnet *ifp, struct mbuf **mp);
93 extern void (*ng_ether_input_orphan_p)(struct ifnet *ifp, struct mbuf *m);
94 extern int (*ng_ether_output_p)(struct ifnet *ifp, struct mbuf **mp);
95 extern void (*ng_ether_attach_p)(struct ifnet *ifp);
96 extern void (*ng_ether_detach_p)(struct ifnet *ifp);
97 extern void (*ng_ether_link_state_p)(struct ifnet *ifp, int state);
100 static void ng_ether_input(struct ifnet *ifp, struct mbuf **mp);
101 static void ng_ether_input_orphan(struct ifnet *ifp, struct mbuf *m);
102 static int ng_ether_output(struct ifnet *ifp, struct mbuf **mp);
103 static void ng_ether_attach(struct ifnet *ifp);
104 static void ng_ether_detach(struct ifnet *ifp);
105 static void ng_ether_link_state(struct ifnet *ifp, int state);
245 ng_ether_input(struct ifnet *ifp, struct mbuf **mp) in ng_ether_input() argument
247 const node_p node = IFP2NG(ifp); in ng_ether_input()
262 ng_ether_input_orphan(struct ifnet *ifp, struct mbuf *m) in ng_ether_input_orphan() argument
264 const node_p node = IFP2NG(ifp); in ng_ether_input_orphan()
281 ng_ether_output(struct ifnet *ifp, struct mbuf **mp) in ng_ether_output() argument
283 const node_p node = IFP2NG(ifp); in ng_ether_output()
303 ng_ether_attach(struct ifnet *ifp) in ng_ether_attach() argument
316 ng_ether_sanitize_ifname(ifp->if_xname, name); in ng_ether_attach()
323 KASSERT(!IFP2NG(ifp), ("%s: node already exists?", __func__)); in ng_ether_attach()
326 __func__, "create node", ifp->if_xname); in ng_ether_attach()
334 __func__, "allocate memory", ifp->if_xname); in ng_ether_attach()
339 priv->ifp = ifp; in ng_ether_attach()
340 IFP2NG(ifp) = node; in ng_ether_attach()
341 priv->hwassist = ifp->if_hwassist; in ng_ether_attach()
353 ng_ether_detach(struct ifnet *ifp) in ng_ether_detach() argument
355 const node_p node = IFP2NG(ifp); in ng_ether_detach()
358 taskqueue_drain(taskqueue_swi, &ifp->if_linktask); in ng_ether_detach()
365 IFP2NG(ifp) = NULL; in ng_ether_detach()
366 priv->ifp = NULL; /* XXX race if interrupted an output packet */ in ng_ether_detach()
375 ng_ether_link_state(struct ifnet *ifp, int state) in ng_ether_link_state() argument
377 const node_p node = IFP2NG(ifp); in ng_ether_link_state()
410 ng_ether_ifnet_arrival_event(void *arg __unused, struct ifnet *ifp) in ng_ether_ifnet_arrival_event() argument
416 if (ifp->if_type != IFT_ETHER && in ng_ether_ifnet_arrival_event()
417 ifp->if_type != IFT_L2VLAN && in ng_ether_ifnet_arrival_event()
418 ifp->if_type != IFT_BRIDGE) in ng_ether_ifnet_arrival_event()
424 node = IFP2NG(ifp); in ng_ether_ifnet_arrival_event()
429 ng_ether_sanitize_ifname(ifp->if_xname, name); in ng_ether_ifnet_arrival_event()
482 priv->ifp->if_hwassist = 0; in ng_ether_newhook()
510 strlcpy(resp->data, priv->ifp->if_xname, IFNAMSIZ); in ng_ether_rcvmsg()
518 *((u_int32_t *)resp->data) = priv->ifp->if_index; in ng_ether_rcvmsg()
526 bcopy(IF_LLADDR(priv->ifp), in ng_ether_rcvmsg()
535 error = if_setlladdr(priv->ifp, in ng_ether_rcvmsg()
557 if ((error = ifpromisc(priv->ifp, want)) != 0) in ng_ether_rcvmsg()
602 ifma = if_findmulti(priv->ifp, in ng_ether_rcvmsg()
608 error = if_addmulti(priv->ifp, in ng_ether_rcvmsg()
627 error = if_delmulti(priv->ifp, in ng_ether_rcvmsg()
632 ng_ether_detach(priv->ifp); in ng_ether_rcvmsg()
669 struct ifnet *const ifp = priv->ifp; in ng_ether_rcv_lower() local
676 if (!((ifp->if_flags & IFF_UP) && in ng_ether_rcv_lower()
677 (ifp->if_drv_flags & IFF_DRV_RUNNING))) { in ng_ether_rcv_lower()
699 bcopy(IF_LLADDR(ifp), in ng_ether_rcv_lower()
705 return ether_output_frame(ifp, m); in ng_ether_rcv_lower()
717 struct ifnet *ifp = priv->ifp; in ng_ether_rcv_upper() local
731 m->m_pkthdr.rcvif = ifp; in ng_ether_rcv_upper()
734 if (ifp->if_bridge) { in ng_ether_rcv_upper()
735 BRIDGE_INPUT(ifp, m); in ng_ether_rcv_upper()
741 ether_demux(ifp, m); in ng_ether_rcv_upper()
760 if (priv->ifp != NULL) in ng_ether_shutdown()
761 IFP2NG(priv->ifp) = NULL; in ng_ether_shutdown()
767 (void)ifpromisc(priv->ifp, 0); in ng_ether_shutdown()
785 if (priv->ifp != NULL) /* restore h/w csum */ in ng_ether_disconnect()
786 priv->ifp->if_hwassist = priv->hwassist; in ng_ether_disconnect()
863 struct ifnet *ifp; in vnet_ng_ether_init() local
871 CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { in vnet_ng_ether_init()
872 if (ifp->if_type == IFT_ETHER || in vnet_ng_ether_init()
873 ifp->if_type == IFT_L2VLAN || in vnet_ng_ether_init()
874 ifp->if_type == IFT_BRIDGE) in vnet_ng_ether_init()
875 ng_ether_attach(ifp); in vnet_ng_ether_init()