Lines Matching defs:ifp
651 static int bond_input(ifnet_t ifp, protocol_family_t protocol, mbuf_t m,
653 static int bond_output(struct ifnet *ifp, struct mbuf *m);
654 static int bond_ioctl(struct ifnet *ifp, u_int32_t cmd, void * addr);
655 static int bond_set_bpf_tap(struct ifnet * ifp, bpf_tap_mode mode,
657 static int bond_attach_protocol(struct ifnet *ifp);
658 static int bond_detach_protocol(struct ifnet *ifp);
659 static int bond_setmulti(struct ifnet *ifp);
660 static int bond_add_interface(struct ifnet * ifp, struct ifnet * port_ifp);
662 static void bond_if_free(struct ifnet * ifp);
669 static void interface_link_event(struct ifnet * ifp, u_long event_code);
672 siocsifmtu(struct ifnet * ifp, int mtu)
678 return (ifnet_ioctl(ifp, 0, SIOCSIFMTU, &ifr));
682 siocgifdevmtu(struct ifnet * ifp, struct ifdevmtu * ifdm_p)
688 error = ifnet_ioctl(ifp, 0, SIOCGIFDEVMTU, &ifr);
860 interface_media_info(struct ifnet * ifp)
867 if (ifnet_ioctl(ifp, 0, SIOCGIFMEDIA, &ifmr) == 0) {
889 ifp_get_ifaddr(struct ifnet * ifp)
891 return (ifindex_get_ifaddr(ifnet_index(ifp)));
895 ifp_get_sdl(struct ifnet * ifp)
899 ifa = ifp_get_ifaddr(ifp);
904 if_siflladdr(struct ifnet * ifp, const struct ether_addr * ea_p)
916 snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s%d", ifnet_name(ifp),
917 ifnet_unit(ifp));
919 return (ifnet_ioctl(ifp, 0, SIOCSIFLLADDR, &ifr));
950 struct ifnet * ifp;
962 ifp = NULL;
966 /* XXX ifunit() needs to return a reference on the ifp */
967 ifp = ifunit(ifname);
968 if (ifp != NULL) {
973 if (ifp != NULL) {
974 b = bond_globals_create(0x8000, (lacp_system_ref)ifnet_lladdr(ifp));
984 if (ifp == NULL) {
994 bond_bpf_vlan(struct ifnet * ifp, struct mbuf * m,
1013 (*func)(ifp, vl_m);
1020 bond_bpf_output(struct ifnet * ifp, struct mbuf * m,
1029 bond_bpf_vlan(ifp, m, eh_p, m->m_pkthdr.vlan_tag, func);
1033 (*func)(ifp, m);
1040 bond_bpf_input(ifnet_t ifp, mbuf_t m, const struct ether_header * eh_p,
1045 bond_bpf_vlan(ifp, m, eh_p, m->m_pkthdr.vlan_tag, func);
1050 (*func)(ifp, m);
1065 bond_setmulti(struct ifnet * ifp)
1073 ifb = ifnet_softc(ifp);
1094 ifp, port_ifp);
1148 ifnet_t ifp;
1167 /* use the interface name as the unique id for ifp recycle */
1193 error = ifnet_allocate(&bond_init, &ifp);
1200 ifb->ifb_ifp = ifp;
1201 ifnet_set_offload(ifp, 0);
1202 ifnet_set_addrlen(ifp, ETHER_ADDR_LEN); /* XXX ethernet specific */
1203 ifnet_set_flags(ifp, IFF_BROADCAST | IFF_MULTICAST | IFF_SIMPLEX, 0xffff);
1204 ifnet_set_baudrate(ifp, 0);
1205 ifnet_set_mtu(ifp, 0);
1207 error = ifnet_attach(ifp, NULL);
1209 ifnet_release(ifp);
1221 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
1258 bond_if_detach(struct ifnet * ifp)
1262 error = ifnet_detach(ifp);
1265 ifnet_name(ifp), ifnet_unit(ifp), error);
1272 bond_clone_destroy(struct ifnet * ifp)
1277 ifb = ifnet_softc(ifp);
1278 if (ifb == NULL || ifnet_type(ifp) != IFT_IEEE8023ADLAG) {
1288 bond_if_detach(ifp);
1293 bond_set_bpf_tap(struct ifnet * ifp, bpf_tap_mode mode, bpf_packet_func func)
1298 ifb = ifnet_softc(ifp);
1501 bond_output(struct ifnet * ifp, struct mbuf * m)
1535 ifb = ifnet_softc(ifp);
1546 (void)ifnet_stat_increment_out(ifp, 1,
1550 (void)ifnet_stat_increment_out(ifp, 1, m->m_pkthdr.len, 0);
1552 bond_bpf_output(ifp, m, bpf_func);
1683 struct ifnet * ifp;
1749 ifp = ifb->ifb_ifp;
1754 (void)ifnet_stat_increment_in(ifp, 1,
1759 (void)ifnet_stat_increment_in(ifp, 1,
1762 m->m_pkthdr.rcvif = ifp;
1763 bond_bpf_input(ifp, m, eh_p, bpf_func);
1765 dlil_input_packet_list(ifp, m);
1989 bond_device_mtu(struct ifnet * ifp, ifbond_ref ifb)
1991 return (((int)ifnet_mtu(ifp) > ifb->ifb_altmtu)
1992 ? (int)ifnet_mtu(ifp) : ifb->ifb_altmtu);
1996 bond_add_interface(struct ifnet * ifp, struct ifnet * port_ifp)
2014 ifb = (ifbond_ref)ifnet_softc(ifp);
2022 devmtu = bond_device_mtu(ifp, ifb);
2062 ifnet_set_offload(ifp, ifnet_offload(port_ifp));
2063 ifnet_set_flags(ifp, IFF_RUNNING, IFF_RUNNING);
2071 ifp_offload = ifnet_offload(ifp);
2086 ifnet_set_offload(ifp, offload);
2099 if (ifnet_mtu(ifp) == 0) {
2100 ifnet_set_mtu(ifp, ETHERMTU);
2107 ifnet_set_lladdr_and_type(ifp, ifnet_lladdr(port_ifp), ETHER_ADDR_LEN,
2129 devmtu = bond_device_mtu(ifp, ifb);
2140 error = multicast_list_program(&p->po_multicast, ifp, port_ifp);
2160 (const struct ether_addr *)ifnet_lladdr(ifp));
2209 interface_link_event(ifp, event_code);
2221 ifnet_set_lladdr_and_type(ifp, NULL, 0, IFT_IEEE8023ADLAG);
2254 ifnet_set_eflags(ifp, 0, IFEF_BOND);
2257 ifnet_set_mtu(ifp, 0);
2258 ifnet_set_offload(ifp, 0);
2276 struct ifnet * ifp;
2317 ifp = ifb->ifb_ifp;
2320 ifnet_set_flags(ifp, 0, IFF_RUNNING);
2324 ifnet_set_offload(ifp, 0);
2325 ifnet_set_mtu(ifp, 0);
2328 && bcmp(&p->po_saved_addr, ifnet_lladdr(ifp),
2353 ifnet_set_lladdr_and_type(ifp, NULL, 0, IFT_IEEE8023ADLAG);
2362 ifnet_set_lladdr_and_type(ifp,
2371 (const struct ether_addr *) ifnet_lladdr(ifp));
2401 interface_link_event(ifp, event_code);
2465 bond_set_mode(struct ifnet * ifp, int mode)
2472 ifb = (ifbond_ref)ifnet_softc(ifp);
2515 interface_link_event(ifp, event_code);
2595 bond_set_promisc(__unused struct ifnet *ifp)
2599 ifbond_ref ifb = ifnet_softc(ifp);
2602 if ((ifnet_flags(ifp) & IFF_PROMISC) != 0) {
2662 bond_set_mtu(struct ifnet * ifp, int mtu, int isdevmtu)
2672 ifb = (ifbond_ref)ifnet_softc(ifp);
2681 if (ifnet_softc(ifp) == NULL || ifbond_flags_if_detaching(ifb)) {
2696 new_max = (mtu > (int)ifnet_mtu(ifp)) ? mtu : (int)ifnet_mtu(ifp);
2701 old_max = ((int)ifnet_mtu(ifp) > ifb->ifb_altmtu)
2702 ? (int)ifnet_mtu(ifp) : ifb->ifb_altmtu;
2718 ifnet_set_mtu(ifp, mtu);
2732 bond_ioctl(struct ifnet *ifp, u_int32_t cmd, void * data)
2743 if (ifnet_type(ifp) != IFT_IEEE8023ADLAG) {
2751 ifnet_set_flags(ifp, IFF_UP, IFF_UP);
2757 ifb = (ifbond_ref)ifnet_softc(ifp);
2797 ifb = (ifbond_ref)ifnet_softc(ifp);
2803 ifr->ifr_devmtu.ifdm_current = bond_device_mtu(ifp, ifb);
2811 ifb = (ifbond_ref)ifnet_softc(ifp);
2822 error = bond_set_mtu(ifp, ifr->ifr_mtu, 1);
2826 error = bond_set_mtu(ifp, ifr->ifr_mtu, 0);
2839 /* XXX ifunit() needs to return a reference on the ifp */
2862 error = bond_add_interface(ifp, port_ifp);
2866 ifb = (ifbond_ref)ifnet_softc(ifp);
2896 error = bond_set_mode(ifp, ibr.ibr_ibru.ibru_int_val);
2919 ifb = (ifbond_ref)ifnet_softc(ifp);
2939 error = bond_set_promisc(ifp);
2945 error = bond_setmulti(ifp);
2954 bond_if_free(struct ifnet * ifp)
2958 if (ifp == NULL) {
2962 ifb = (ifbond_ref)ifnet_softc(ifp);
2969 ifnet_release(ifp);
3070 interface_link_event(struct ifnet * ifp, u_long event_code)
3083 event.header.event_data[0] = ifnet_family(ifp);
3084 event.unit = (u_long) ifnet_unit(ifp);
3085 strncpy(event.if_name, ifnet_name(ifp), IFNAMSIZ);
3086 ifnet_event(ifp, &event.header);
3101 bond_attach_protocol(struct ifnet *ifp)
3110 error = ifnet_attach_protocol(ifp, PF_BOND, ®);
3113 ifnet_name(ifp), ifnet_unit(ifp), error);
3124 bond_detach_protocol(struct ifnet *ifp)
3128 error = ifnet_detach_protocol(ifp, PF_BOND);
3131 ifnet_name(ifp), ifnet_unit(ifp), error);
3139 extern int ether_attach_inet(ifnet_t ifp, protocol_family_t protocol_family);
3140 extern void ether_detach_inet(ifnet_t ifp, protocol_family_t protocol_family);
3141 extern int ether_attach_inet6(ifnet_t ifp, protocol_family_t protocol_family);
3142 extern void ether_detach_inet6(ifnet_t ifp, protocol_family_t protocol_family);
3143 extern int ether_attach_at(ifnet_t ifp, protocol_family_t protocol_family);
3144 extern void ether_detach_at(ifnet_t ifp, protocol_family_t protocol_family);