| 769 | } |
| 770 | |
| 771 | void |
| 772 | lacp_attach(struct lagg_softc *sc) |
| 773 | { |
| 774 | struct lacp_softc *lsc; |
| 775 | |
| 776 | lsc = malloc(sizeof(struct lacp_softc), M_DEVBUF, M_WAITOK | M_ZERO); |
| 777 | |
| 778 | sc->sc_psc = lsc; |
| 779 | lsc->lsc_softc = sc; |
| 780 | |
| 781 | lsc->lsc_hashkey = m_ether_tcpip_hash_init(); |
| 782 | lsc->lsc_active_aggregator = NULL; |
| 783 | lsc->lsc_strict_mode = VNET(lacp_default_strict_mode); |
| 784 | LACP_LOCK_INIT(lsc); |
| 785 | TAILQ_INIT(&lsc->lsc_aggregators); |
| 786 | LIST_INIT(&lsc->lsc_ports); |
| 787 | |
| 788 | callout_init_mtx(&lsc->lsc_transit_callout, &lsc->lsc_mtx, 0); |
| 789 | callout_init_mtx(&lsc->lsc_callout, &lsc->lsc_mtx, 0); |
| 790 | |
| 791 | /* if the lagg is already up then do the same */ |
| 792 | if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) |
| 793 | lacp_init(sc); |
| 794 | } |
| 795 | |
| 796 | void |
| 797 | lacp_detach(void *psc) |
no test coverage detected