Lines Matching defs:ifp

653 static int bond_input(ifnet_t ifp, protocol_family_t protocol, mbuf_t m,
655 static int bond_output(struct ifnet *ifp, struct mbuf *m);
656 static int bond_ioctl(struct ifnet *ifp, u_long cmd, void * addr);
657 static int bond_set_bpf_tap(struct ifnet * ifp, bpf_tap_mode mode,
659 static int bond_attach_protocol(struct ifnet *ifp);
660 static int bond_detach_protocol(struct ifnet *ifp);
661 static int bond_setmulti(struct ifnet *ifp);
662 static int bond_add_interface(struct ifnet * ifp, struct ifnet * port_ifp);
664 static void bond_if_free(struct ifnet * ifp);
671 static void interface_link_event(struct ifnet * ifp, u_int32_t event_code);
674 siocsifmtu(struct ifnet * ifp, int mtu)
680 return (ifnet_ioctl(ifp, 0, SIOCSIFMTU, &ifr));
684 siocgifdevmtu(struct ifnet * ifp, struct ifdevmtu * ifdm_p)
690 error = ifnet_ioctl(ifp, 0, SIOCGIFDEVMTU, &ifr);
863 interface_media_info(struct ifnet * ifp)
870 if (ifnet_ioctl(ifp, 0, SIOCGIFMEDIA, &ifmr) == 0) {
880 if_siflladdr(struct ifnet * ifp, const struct ether_addr * ea_p)
891 return (ifnet_ioctl(ifp, 0, SIOCSIFLLADDR, &ifr));
919 struct ifnet * ifp;
931 ifp = NULL;
935 ifp = ifunit(ifname);
936 if (ifp != NULL) {
941 if (ifp != NULL) {
942 b = bond_globals_create(0x8000, (lacp_system_ref)ifnet_lladdr(ifp));
952 if (ifp == NULL) {
962 bond_bpf_vlan(struct ifnet * ifp, struct mbuf * m,
981 (*func)(ifp, vl_m);
988 bond_bpf_output(struct ifnet * ifp, struct mbuf * m,
997 bond_bpf_vlan(ifp, m, eh_p, m->m_pkthdr.vlan_tag, func);
1001 (*func)(ifp, m);
1008 bond_bpf_input(ifnet_t ifp, mbuf_t m, const struct ether_header * eh_p,
1013 bond_bpf_vlan(ifp, m, eh_p, m->m_pkthdr.vlan_tag, func);
1018 (*func)(ifp, m);
1033 bond_setmulti(struct ifnet * ifp)
1041 ifb = ifnet_softc(ifp);
1062 ifp, port_ifp);
1118 ifnet_t ifp;
1137 /* use the interface name as the unique id for ifp recycle */
1163 error = ifnet_allocate(&bond_init, &ifp);
1170 ifb->ifb_ifp = ifp;
1171 ifnet_set_offload(ifp, 0);
1172 ifnet_set_addrlen(ifp, ETHER_ADDR_LEN); /* XXX ethernet specific */
1173 ifnet_set_flags(ifp, IFF_BROADCAST | IFF_MULTICAST | IFF_SIMPLEX, 0xffff);
1174 ifnet_set_baudrate(ifp, 0);
1175 ifnet_set_mtu(ifp, 0);
1177 error = ifnet_attach(ifp, NULL);
1179 ifnet_release(ifp);
1191 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
1228 bond_if_detach(struct ifnet * ifp)
1232 error = ifnet_detach(ifp);
1235 ifnet_name(ifp), ifnet_unit(ifp), error);
1242 bond_clone_destroy(struct ifnet * ifp)
1247 ifb = ifnet_softc(ifp);
1248 if (ifb == NULL || ifnet_type(ifp) != IFT_IEEE8023ADLAG) {
1258 bond_if_detach(ifp);
1263 bond_set_bpf_tap(struct ifnet * ifp, bpf_tap_mode mode, bpf_packet_func func)
1268 ifb = ifnet_softc(ifp);
1471 bond_output(struct ifnet * ifp, struct mbuf * m)
1507 ifb = ifnet_softc(ifp);
1518 (void)ifnet_stat_increment_out(ifp, 1,
1522 (void)ifnet_stat_increment_out(ifp, 1, m->m_pkthdr.len, 0);
1524 bond_bpf_output(ifp, m, bpf_func);
1665 struct ifnet * ifp;
1731 ifp = ifb->ifb_ifp;
1736 (void)ifnet_stat_increment_in(ifp, 1,
1741 (void)ifnet_stat_increment_in(ifp, 1,
1744 m->m_pkthdr.rcvif = ifp;
1745 bond_bpf_input(ifp, m, eh_p, bpf_func);
1747 dlil_input_packet_list(ifp, m);
1971 bond_device_mtu(struct ifnet * ifp, ifbond_ref ifb)
1973 return (((int)ifnet_mtu(ifp) > ifb->ifb_altmtu)
1974 ? (int)ifnet_mtu(ifp) : ifb->ifb_altmtu);
1978 bond_add_interface(struct ifnet * ifp, struct ifnet * port_ifp)
1996 ifb = (ifbond_ref)ifnet_softc(ifp);
2004 devmtu = bond_device_mtu(ifp, ifb);
2044 ifnet_set_offload(ifp, ifnet_offload(port_ifp));
2045 ifnet_set_flags(ifp, IFF_RUNNING, IFF_RUNNING);
2053 ifp_offload = ifnet_offload(ifp);
2068 ifnet_set_offload(ifp, offload);
2081 if (ifnet_mtu(ifp) == 0) {
2082 ifnet_set_mtu(ifp, ETHERMTU);
2089 ifnet_set_lladdr_and_type(ifp, ifnet_lladdr(port_ifp), ETHER_ADDR_LEN,
2111 devmtu = bond_device_mtu(ifp, ifb);
2122 error = multicast_list_program(&p->po_multicast, ifp, port_ifp);
2142 (const struct ether_addr *)ifnet_lladdr(ifp));
2191 interface_link_event(ifp, event_code);
2203 ifnet_set_lladdr_and_type(ifp, NULL, 0, IFT_IEEE8023ADLAG);
2236 ifnet_set_eflags(ifp, 0, IFEF_BOND);
2239 ifnet_set_mtu(ifp, 0);
2240 ifnet_set_offload(ifp, 0);
2258 struct ifnet * ifp;
2299 ifp = ifb->ifb_ifp;
2302 ifnet_set_flags(ifp, 0, IFF_RUNNING);
2306 ifnet_set_offload(ifp, 0);
2307 ifnet_set_mtu(ifp, 0);
2310 && bcmp(&p->po_saved_addr, ifnet_lladdr(ifp),
2335 ifnet_set_lladdr_and_type(ifp, NULL, 0, IFT_IEEE8023ADLAG);
2344 ifnet_set_lladdr_and_type(ifp,
2353 (const struct ether_addr *) ifnet_lladdr(ifp));
2383 interface_link_event(ifp, event_code);
2447 bond_set_mode(struct ifnet * ifp, int mode)
2454 ifb = (ifbond_ref)ifnet_softc(ifp);
2497 interface_link_event(ifp, event_code);
2577 bond_set_promisc(__unused struct ifnet *ifp)
2626 bond_set_mtu(struct ifnet * ifp, int mtu, int isdevmtu)
2636 ifb = (ifbond_ref)ifnet_softc(ifp);
2645 if (ifnet_softc(ifp) == NULL || ifbond_flags_if_detaching(ifb)) {
2660 new_max = (mtu > (int)ifnet_mtu(ifp)) ? mtu : (int)ifnet_mtu(ifp);
2665 old_max = ((int)ifnet_mtu(ifp) > ifb->ifb_altmtu)
2666 ? (int)ifnet_mtu(ifp) : ifb->ifb_altmtu;
2682 ifnet_set_mtu(ifp, mtu);
2696 bond_ioctl(struct ifnet *ifp, u_long cmd, void * data)
2707 if (ifnet_type(ifp) != IFT_IEEE8023ADLAG) {
2715 ifnet_set_flags(ifp, IFF_UP, IFF_UP);
2721 ifb = (ifbond_ref)ifnet_softc(ifp);
2761 ifb = (ifbond_ref)ifnet_softc(ifp);
2767 ifr->ifr_devmtu.ifdm_current = bond_device_mtu(ifp, ifb);
2775 ifb = (ifbond_ref)ifnet_softc(ifp);
2786 error = bond_set_mtu(ifp, ifr->ifr_mtu, 1);
2790 error = bond_set_mtu(ifp, ifr->ifr_mtu, 0);
2825 error = bond_add_interface(ifp, port_ifp);
2829 ifb = (ifbond_ref)ifnet_softc(ifp);
2859 error = bond_set_mode(ifp, ibr.ibr_ibru.ibru_int_val);
2882 ifb = (ifbond_ref)ifnet_softc(ifp);
2902 error = bond_set_promisc(ifp);
2908 error = bond_setmulti(ifp);
2917 bond_if_free(struct ifnet * ifp)
2921 if (ifp == NULL) {
2925 ifb = (ifbond_ref)ifnet_softc(ifp);
2932 ifnet_release(ifp);
3057 interface_link_event(struct ifnet * ifp, u_int32_t event_code)
3071 event.header.event_data[0] = ifnet_family(ifp);
3072 event.unit = (u_int32_t) ifnet_unit(ifp);
3073 strncpy(event.if_name, ifnet_name(ifp), IFNAMSIZ);
3074 ifnet_event(ifp, &event.header);
3089 bond_attach_protocol(struct ifnet *ifp)
3099 error = ifnet_attach_protocol(ifp, PF_BOND, &reg);
3102 ifnet_name(ifp), ifnet_unit(ifp), error);
3113 bond_detach_protocol(struct ifnet *ifp)
3117 error = ifnet_detach_protocol(ifp, PF_BOND);
3120 ifnet_name(ifp), ifnet_unit(ifp), error);
3128 extern int ether_attach_inet(ifnet_t ifp, protocol_family_t protocol_family);
3129 extern void ether_detach_inet(ifnet_t ifp, protocol_family_t protocol_family);
3130 extern int ether_attach_inet6(ifnet_t ifp, protocol_family_t protocol_family);
3131 extern void ether_detach_inet6(ifnet_t ifp, protocol_family_t protocol_family);
3132 extern int ether_attach_at(ifnet_t ifp, protocol_family_t protocol_family);
3133 extern void ether_detach_at(ifnet_t ifp, protocol_family_t protocol_family);