| 619 | } |
| 620 | |
| 621 | static void |
| 622 | lagg_clone_destroy(struct ifnet *ifp) |
| 623 | { |
| 624 | struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; |
| 625 | struct lagg_port *lp; |
| 626 | |
| 627 | LAGG_XLOCK(sc); |
| 628 | sc->sc_destroying = 1; |
| 629 | lagg_stop(sc); |
| 630 | ifp->if_flags &= ~IFF_UP; |
| 631 | |
| 632 | EVENTHANDLER_DEREGISTER(vlan_config, sc->vlan_attach); |
| 633 | EVENTHANDLER_DEREGISTER(vlan_unconfig, sc->vlan_detach); |
| 634 | |
| 635 | /* Shutdown and remove lagg ports */ |
| 636 | while ((lp = CK_SLIST_FIRST(&sc->sc_ports)) != NULL) |
| 637 | lagg_port_destroy(lp, 1); |
| 638 | |
| 639 | /* Unhook the aggregation protocol */ |
| 640 | lagg_proto_detach(sc); |
| 641 | LAGG_XUNLOCK(sc); |
| 642 | |
| 643 | switch (ifp->if_type) { |
| 644 | case IFT_ETHER: |
| 645 | ifmedia_removeall(&sc->sc_media); |
| 646 | ether_ifdetach(ifp); |
| 647 | break; |
| 648 | case IFT_INFINIBAND: |
| 649 | infiniband_ifdetach(ifp); |
| 650 | break; |
| 651 | default: |
| 652 | break; |
| 653 | } |
| 654 | if_free(ifp); |
| 655 | |
| 656 | LAGG_LIST_LOCK(); |
| 657 | SLIST_REMOVE(&V_lagg_list, sc, lagg_softc, sc_entries); |
| 658 | LAGG_LIST_UNLOCK(); |
| 659 | |
| 660 | mtx_destroy(&sc->sc_mtx); |
| 661 | LAGG_SX_DESTROY(sc); |
| 662 | free(sc, M_LAGG); |
| 663 | } |
| 664 | |
| 665 | static void |
| 666 | lagg_capabilities(struct lagg_softc *sc) |
nothing calls this directly
no test coverage detected