1/* $NetBSD: ieee8023ad_lacp.c,v 1.3 2005/12/11 12:24:54 christos Exp $ */ 2 3/*- 4 * Copyright (c)2005 YAMAMOTO Takashi, 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/net/ieee8023ad_lacp.c 169327 2007-05-07 00:18:56Z thompsa $"); |
31 32#include <sys/param.h> 33#include <sys/callout.h> 34#include <sys/mbuf.h> 35#include <sys/systm.h> 36#include <sys/malloc.h> 37#include <sys/kernel.h> /* hz */ 38#include <sys/socket.h> /* for net/if.h */ --- 409 unchanged lines hidden (view full) --- 448 M_DEVBUF, M_NOWAIT|M_ZERO); 449 if (lp == NULL) 450 return (ENOMEM); 451 452 lgp->lp_psc = (caddr_t)lp; 453 lp->lp_ifp = ifp; 454 lp->lp_lagg = lgp; 455 lp->lp_lsc = lsc; |
456 lp->lp_ifma = rifma; |
457 458 LIST_INSERT_HEAD(&lsc->lsc_ports, lp, lp_next); 459 460 lacp_fill_actorinfo(lp, &lp->lp_actor); 461 lp->lp_state = 462 (active ? LACP_STATE_ACTIVITY : 0) | 463 (fast ? LACP_STATE_TIMEOUT : 0); 464 lp->lp_aggregator = NULL; 465 lacp_linkstate(lgp); 466 lacp_sm_rx_set_expired(lp); 467 468 return (0); 469} 470 471void 472lacp_port_destroy(struct lagg_port *lgp) 473{ 474 struct lacp_port *lp = LACP_PORT(lgp); |
475 int i; |
476 477 LAGG_LOCK_ASSERT(lgp->lp_lagg); 478 479 for (i = 0; i < LACP_NTIMER; i++) { 480 LACP_TIMER_DISARM(lp, i); 481 } 482 483 lacp_disable_collecting(lp); 484 lacp_disable_distributing(lp); 485 lacp_unselect(lp); 486 lgp->lp_flags &= ~LAGG_PORT_DISABLED; 487 |
488 if_delmulti_ifma(lp->lp_ifma); |
489 |
490 LIST_REMOVE(lp, lp_next); 491 free(lp, M_DEVBUF); 492} 493 494int 495lacp_port_isactive(struct lagg_port *lgp) 496{ 497 struct lacp_port *lp = LACP_PORT(lgp); --- 1267 unchanged lines hidden --- |