Lines Matching refs:ifp
114 typedef int (if_set_bpf_tap_func)(struct ifnet *ifp, int mode, bpf_callback_func * func);
359 static int vlan_input(ifnet_t ifp, protocol_family_t protocol,
361 static int vlan_output(struct ifnet *ifp, struct mbuf *m);
362 static int vlan_ioctl(ifnet_t ifp, u_int32_t cmd, void * addr);
363 static int vlan_set_bpf_tap(ifnet_t ifp, bpf_tap_mode mode,
365 static int vlan_attach_protocol(struct ifnet *ifp);
366 static int vlan_detach_protocol(struct ifnet *ifp);
367 static int vlan_setmulti(struct ifnet *ifp);
368 static int vlan_unconfig(struct ifnet *ifp);
369 static int vlan_config(struct ifnet * ifp, struct ifnet * p, int tag);
370 static void vlan_if_free(struct ifnet * ifp);
372 static void vlan_if_detach(struct ifnet * ifp);
373 static int vlan_new_mtu(struct ifnet * ifp, int mtu);
380 static void interface_link_event(struct ifnet * ifp, u_long event_code);
383 extern void dlil_input_packet_list(struct ifnet *ifp, struct mbuf *m);
417 siocgifdevmtu(struct ifnet * ifp, struct ifdevmtu * ifdm_p)
423 error = ifnet_ioctl(ifp, 0,SIOCGIFDEVMTU, &ifr);
431 siocsifaltmtu(struct ifnet * ifp, int mtu)
437 return (ifnet_ioctl(ifp, 0, SIOCSIFALTMTU, &ifr));
441 vlan_bpf_output(struct ifnet * ifp, struct mbuf * m,
445 (*func)(ifp, m);
451 vlan_bpf_input(struct ifnet * ifp, struct mbuf * m,
462 (*func)(ifp, m);
494 struct ifnet * ifp = vlp->vlp_ifp;
495 printf("vlan_parent_release(%s%d)\n", ifnet_name(ifp),
496 ifnet_unit(ifp));
526 struct ifnet * ifp = vlp->vlp_ifp;
528 printf("%s%d: %s msleep\n", ifnet_name(ifp), ifnet_unit(ifp), msg);
536 struct ifnet * ifp = vlp->vlp_ifp;
538 printf("%s%d: %s woke up\n", ifnet_name(ifp), ifnet_unit(ifp), msg);
559 struct ifnet * ifp = vlp->vlp_ifp;
561 printf("%s%d: %s wakeup\n", ifnet_name(ifp), ifnet_unit(ifp), msg);
576 vlan_setmulti(struct ifnet * ifp)
584 ifv = (ifvlan_ref)ifnet_softc(ifp);
600 ifv = (ifvlan_ref)ifnet_softc(ifp);
616 error = multicast_list_program(&ifv->ifv_multicast, ifp, p);
787 ifnet_t ifp;
798 /* use the interface name as the unique id for ifp recycle */
824 error = ifnet_allocate(&vlan_init, &ifp);
833 ifnet_set_link_mib_data(ifp, &ifv->ifv_mib, sizeof ifv->ifv_mib);
837 ifnet_set_offload(ifp, 0);
838 ifnet_set_addrlen(ifp, ETHER_ADDR_LEN); /* XXX ethernet specific */
839 ifnet_set_baudrate(ifp, 0);
840 ifnet_set_hdrlen(ifp, ETHER_VLAN_ENCAP_LEN);
842 error = ifnet_attach(ifp, NULL);
844 ifnet_release(ifp);
848 ifv->ifv_ifp = ifp;
851 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
865 vlan_if_detach(struct ifnet * ifp)
867 ifnet_detach(ifp);
872 vlan_clone_destroy(struct ifnet *ifp)
877 ifv = ifnet_softc(ifp);
878 if (ifv == NULL || ifnet_type(ifp) != IFT_L2VLAN) {
888 vlan_if_detach(ifp);
893 vlan_set_bpf_tap(ifnet_t ifp, bpf_tap_mode mode, bpf_packet_func func)
898 ifv = ifnet_softc(ifp);
927 vlan_output(struct ifnet * ifp, struct mbuf * m)
946 ifv = (ifvlan_ref)ifnet_softc(ifp);
960 (void)ifnet_stat_increment_out(ifp, 1, m->m_pkthdr.len, 0);
966 vlan_bpf_output(ifp, m, bpf_func);
971 ifp->if_collisions++;
988 printf("%s%d: unable to prepend VLAN header\n", ifnet_name(ifp),
989 ifnet_unit(ifp));
990 ifp->if_oerrors++;
997 printf("%s%d: unable to pullup VLAN header\n", ifnet_name(ifp),
998 ifnet_unit(ifp));
999 ifp->if_oerrors++;
1024 struct ifnet * ifp = NULL;
1078 ifp = ifv->ifv_ifp;
1082 || (ifnet_flags(ifp) & IFF_UP) == 0) {
1102 m->m_pkthdr.rcvif = ifp;
1104 (void)ifnet_stat_increment_in(ifp, 1,
1106 vlan_bpf_input(ifp, m, bpf_func, frame_header, ETHER_HDR_LEN,
1109 dlil_input_packet_list(ifp, m);
1122 vlan_config(struct ifnet * ifp, struct ifnet * p, int tag)
1140 ifv = (ifvlan_ref)ifnet_softc(ifp);
1165 ifv = (ifvlan_ref)ifnet_softc(ifp);
1216 error = multicast_list_program(&ifv->ifv_multicast, ifp, p);
1226 ifnet_set_lladdr_and_type(ifp, ifnet_lladdr(p), ETHER_ADDR_LEN, IFT_ETHER);
1245 ifnet_set_mtu(ifp, ETHERMTU - ifv->ifv_mtufudge);
1253 ifnet_set_flags(ifp, parent_flags,
1262 ifnet_set_offload(ifp, IF_HWASSIST_CSUM_FLAGS(ifnet_offload(p)));
1265 ifnet_set_flags(ifp, IFF_RUNNING, IFF_RUNNING);
1305 vlan_link_event(struct ifnet * ifp, struct ifnet * p)
1319 interface_link_event(ifp, event);
1325 vlan_unconfig(struct ifnet * ifp)
1335 ifv = (ifvlan_ref)ifnet_softc(ifp);
1347 ifv = (ifvlan_ref)ifnet_softc(ifp);
1368 (void)vlan_new_mtu(ifp, ETHERMTU - ifv->ifv_mtufudge);
1381 ifnet_set_lladdr_and_type(ifp, NULL, 0, IFT_L2VLAN);
1389 ifnet_set_mtu(ifp, 0);
1390 ifnet_set_flags(ifp, 0,
1392 ifnet_set_offload(ifp, 0);
1417 vlan_set_promisc(struct ifnet * ifp)
1424 ifv = (ifvlan_ref)ifnet_softc(ifp);
1434 if ((ifnet_flags(ifp) & IFF_PROMISC) != 0) {
1455 vlan_new_mtu(struct ifnet * ifp, int mtu)
1466 ifv = (ifvlan_ref)ifnet_softc(ifp);
1490 ifnet_set_mtu(ifp, mtu);
1496 vlan_set_mtu(struct ifnet * ifp, int mtu)
1506 ifv = (ifvlan_ref)ifnet_softc(ifp);
1523 ifv = (ifvlan_ref)ifnet_softc(ifp);
1538 error = vlan_new_mtu(ifp, mtu);
1549 vlan_ioctl(ifnet_t ifp, u_int32_t cmd, void * data)
1563 if (ifnet_type(ifp) != IFT_L2VLAN) {
1571 ifnet_set_flags(ifp, IFF_UP, IFF_UP);
1577 ifv = (ifvlan_ref)ifnet_softc(ifp);
1623 ifv = (ifvlan_ref)ifnet_softc(ifp);
1632 devmtu_p->ifdm_current = ifnet_mtu(ifp);
1646 error = vlan_set_mtu(ifp, ifr->ifr_mtu);
1677 error = vlan_config(ifp, p, vlr.vlr_tag);
1683 (void)vlan_set_promisc(ifp);
1686 vlan_link_event(ifp, p);
1689 ifv = (ifvlan_ref)ifnet_softc(ifp);
1695 error = vlan_unconfig(ifp);
1698 interface_link_event(ifp, KEV_DL_LINK_OFF);
1706 ifv = (ifvlan_ref)ifnet_softc(ifp);
1729 error = vlan_set_promisc(ifp);
1734 error = vlan_setmulti(ifp);
1743 vlan_if_free(struct ifnet * ifp)
1747 if (ifp == NULL) {
1751 ifv = (ifvlan_ref)ifnet_softc(ifp);
1757 ifnet_release(ifp);
1811 interface_link_event(struct ifnet * ifp, u_long event_code)
1824 event.header.event_data[0] = ifnet_family(ifp);
1825 event.unit = (u_long) ifnet_unit(ifp);
1826 strncpy(event.if_name, ifnet_name(ifp), IFNAMSIZ);
1827 ifnet_event(ifp, &event.header);
1854 vlan_attach_protocol(struct ifnet *ifp)
1862 error = ifnet_attach_protocol(ifp, PF_VLAN, ®);
1865 ifnet_name(ifp), ifnet_unit(ifp), error);
1876 vlan_detach_protocol(struct ifnet *ifp)
1880 error = ifnet_detach_protocol(ifp, PF_VLAN);
1883 ifnet_name(ifp), ifnet_unit(ifp), error);
1897 vlan_attach_inet(struct ifnet *ifp, protocol_family_t protocol_family)
1899 return (ether_attach_inet(ifp, protocol_family));
1903 vlan_detach_inet(struct ifnet *ifp, protocol_family_t protocol_family)
1905 ether_detach_inet(ifp, protocol_family);
1910 vlan_attach_inet6(struct ifnet *ifp, protocol_family_t protocol_family)
1912 return (ether_attach_inet6(ifp, protocol_family));
1916 vlan_detach_inet6(struct ifnet *ifp, protocol_family_t protocol_family)
1918 ether_detach_inet6(ifp, protocol_family);
1923 vlan_attach_at(struct ifnet *ifp, protocol_family_t protocol_family)
1925 return (ether_attach_at(ifp, protocol_family));
1929 vlan_detach_at(struct ifnet *ifp, protocol_family_t protocol_family)
1931 ether_detach_at(ifp, protocol_family);