if.c (167943) | if.c (168561) |
---|---|
1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if.c 8.5 (Berkeley) 1/9/95 | 1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if.c 8.5 (Berkeley) 1/9/95 |
30 * $FreeBSD: head/sys/net/if.c 167943 2007-03-27 16:11:28Z bms $ | 30 * $FreeBSD: head/sys/net/if.c 168561 2007-04-10 00:27:25Z thompsa $ |
31 */ 32 33#include "opt_compat.h" 34#include "opt_inet6.h" 35#include "opt_inet.h" 36#include "opt_mac.h" 37#include "opt_carp.h" 38 --- 52 unchanged lines hidden (view full) --- 91static int log_link_state_change = 1; 92 93SYSCTL_INT(_net_link, OID_AUTO, log_link_state_change, CTLFLAG_RW, 94 &log_link_state_change, 0, 95 "log interface link state change events"); 96 97void (*bstp_linkstate_p)(struct ifnet *ifp, int state); 98void (*ng_ether_link_state_p)(struct ifnet *ifp, int state); | 31 */ 32 33#include "opt_compat.h" 34#include "opt_inet6.h" 35#include "opt_inet.h" 36#include "opt_mac.h" 37#include "opt_carp.h" 38 --- 52 unchanged lines hidden (view full) --- 91static int log_link_state_change = 1; 92 93SYSCTL_INT(_net_link, OID_AUTO, log_link_state_change, CTLFLAG_RW, 94 &log_link_state_change, 0, 95 "log interface link state change events"); 96 97void (*bstp_linkstate_p)(struct ifnet *ifp, int state); 98void (*ng_ether_link_state_p)(struct ifnet *ifp, int state); |
99void (*trunk_linkstate_p)(struct ifnet *ifp, int state); |
|
99 100struct mbuf *(*tbr_dequeue_ptr)(struct ifaltq *, int) = NULL; 101 102/* 103 * XXX: Style; these should be sorted alphabetically, and unprototyped 104 * static functions should be prototyped. Currently they are sorted by 105 * declaration order. 106 */ --- 1266 unchanged lines hidden (view full) --- 1373#ifdef DEV_CARP 1374 if (ifp->if_carp) 1375 carp_carpdev_state(ifp->if_carp); 1376#endif 1377 if (ifp->if_bridge) { 1378 KASSERT(bstp_linkstate_p != NULL,("if_bridge bstp not loaded!")); 1379 (*bstp_linkstate_p)(ifp, link_state); 1380 } | 100 101struct mbuf *(*tbr_dequeue_ptr)(struct ifaltq *, int) = NULL; 102 103/* 104 * XXX: Style; these should be sorted alphabetically, and unprototyped 105 * static functions should be prototyped. Currently they are sorted by 106 * declaration order. 107 */ --- 1266 unchanged lines hidden (view full) --- 1374#ifdef DEV_CARP 1375 if (ifp->if_carp) 1376 carp_carpdev_state(ifp->if_carp); 1377#endif 1378 if (ifp->if_bridge) { 1379 KASSERT(bstp_linkstate_p != NULL,("if_bridge bstp not loaded!")); 1380 (*bstp_linkstate_p)(ifp, link_state); 1381 } |
1382 if (ifp->if_trunk) { 1383 KASSERT(trunk_linkstate_p != NULL,("if_trunk not loaded!")); 1384 (*trunk_linkstate_p)(ifp, link_state); 1385 } |
|
1381 1382 devctl_notify("IFNET", ifp->if_xname, 1383 (link_state == LINK_STATE_UP) ? "LINK_UP" : "LINK_DOWN", NULL); 1384 if (pending > 1) 1385 if_printf(ifp, "%d link states coalesced\n", pending); 1386 if (log_link_state_change) 1387 log(LOG_NOTICE, "%s: link state changed to %s\n", ifp->if_xname, 1388 (link_state == LINK_STATE_UP) ? "UP" : "DOWN" ); --- 1199 unchanged lines hidden (view full) --- 2588 switch (ifp->if_type) { 2589 case IFT_ETHER: 2590 case IFT_FDDI: 2591 case IFT_XETHER: 2592 case IFT_ISO88025: 2593 case IFT_L2VLAN: 2594 case IFT_BRIDGE: 2595 case IFT_ARCNET: | 1386 1387 devctl_notify("IFNET", ifp->if_xname, 1388 (link_state == LINK_STATE_UP) ? "LINK_UP" : "LINK_DOWN", NULL); 1389 if (pending > 1) 1390 if_printf(ifp, "%d link states coalesced\n", pending); 1391 if (log_link_state_change) 1392 log(LOG_NOTICE, "%s: link state changed to %s\n", ifp->if_xname, 1393 (link_state == LINK_STATE_UP) ? "UP" : "DOWN" ); --- 1199 unchanged lines hidden (view full) --- 2593 switch (ifp->if_type) { 2594 case IFT_ETHER: 2595 case IFT_FDDI: 2596 case IFT_XETHER: 2597 case IFT_ISO88025: 2598 case IFT_L2VLAN: 2599 case IFT_BRIDGE: 2600 case IFT_ARCNET: |
2601 case IFT_IEEE8023ADLAG: |
|
2596 bcopy(lladdr, LLADDR(sdl), len); 2597 break; 2598 default: 2599 return (ENODEV); 2600 } 2601 /* 2602 * If the interface is already up, we need 2603 * to re-init it in order to reprogram its --- 151 unchanged lines hidden --- | 2602 bcopy(lladdr, LLADDR(sdl), len); 2603 break; 2604 default: 2605 return (ENODEV); 2606 } 2607 /* 2608 * If the interface is already up, we need 2609 * to re-init it in order to reprogram its --- 151 unchanged lines hidden --- |