if_ed.c (20407) | if_ed.c (21666) |
---|---|
1/* 2 * Copyright (c) 1995, David Greenman 3 * 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 --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/* 2 * Copyright (c) 1995, David Greenman 3 * 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 --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $Id: if_ed.c,v 1.110 1996/12/10 07:29:39 davidg Exp $ | 27 * $Id: if_ed.c,v 1.111 1996/12/13 21:28:19 wollman Exp $ |
28 */ 29 30/* 31 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet 32 * adapters. By David Greenman, 29-April-1993 33 * 34 * Currently supports the Western Digital/SMC 8003 and 8013 series, 35 * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, --- 2632 unchanged lines hidden (view full) --- 2668 } 2669 } else if (sc->vendor == ED_VENDOR_HP) 2670 ed_hpp_set_physical_link(sc); 2671 break; 2672 2673 case SIOCADDMULTI: 2674 case SIOCDELMULTI: 2675 /* | 28 */ 29 30/* 31 * Device driver for National Semiconductor DS8390/WD83C690 based ethernet 32 * adapters. By David Greenman, 29-April-1993 33 * 34 * Currently supports the Western Digital/SMC 8003 and 8013 series, 35 * the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000, --- 2632 unchanged lines hidden (view full) --- 2668 } 2669 } else if (sc->vendor == ED_VENDOR_HP) 2670 ed_hpp_set_physical_link(sc); 2671 break; 2672 2673 case SIOCADDMULTI: 2674 case SIOCDELMULTI: 2675 /* |
2676 * Update out multicast list. | 2676 * Multicast list has changed; set the hardware filter 2677 * accordingly. |
2677 */ | 2678 */ |
2678 error = (command == SIOCADDMULTI) ? 2679 ether_addmulti(ifr, &sc->arpcom) : 2680 ether_delmulti(ifr, &sc->arpcom); 2681 2682 if (error == ENETRESET) { 2683 2684 /* 2685 * Multicast list has changed; set the hardware filter 2686 * accordingly. 2687 */ 2688 ed_setrcr(sc); 2689 error = 0; 2690 } | 2679 ed_setrcr(sc); 2680 error = 0; |
2691 break; 2692 2693 default: 2694 error = EINVAL; 2695 } 2696 (void) splx(s); 2697 return (error); 2698} --- 716 unchanged lines hidden (view full) --- 3415 */ 3416static void 3417ds_getmcaf(sc, mcaf) 3418 struct ed_softc *sc; 3419 u_long *mcaf; 3420{ 3421 register u_int index; 3422 register u_char *af = (u_char *) mcaf; | 2681 break; 2682 2683 default: 2684 error = EINVAL; 2685 } 2686 (void) splx(s); 2687 return (error); 2688} --- 716 unchanged lines hidden (view full) --- 3405 */ 3406static void 3407ds_getmcaf(sc, mcaf) 3408 struct ed_softc *sc; 3409 u_long *mcaf; 3410{ 3411 register u_int index; 3412 register u_char *af = (u_char *) mcaf; |
3423 register struct ether_multi *enm; 3424 register struct ether_multistep step; | 3413 struct ifmultiaddr *ifma; |
3425 3426 mcaf[0] = 0; 3427 mcaf[1] = 0; 3428 | 3414 3415 mcaf[0] = 0; 3416 mcaf[1] = 0; 3417 |
3429 ETHER_FIRST_MULTI(step, &sc->arpcom, enm); 3430 while (enm != NULL) { 3431 if (bcmp(enm->enm_addrlo, enm->enm_addrhi, 6) != 0) { 3432 mcaf[0] = 0xffffffff; 3433 mcaf[1] = 0xffffffff; 3434 return; 3435 } 3436 index = ds_crc(enm->enm_addrlo) >> 26; | 3418 for (ifma = sc->arpcom.ac_if.if_multiaddrs.lh_first; ifma; 3419 ifma = ifma->ifma_link.le_next) { 3420 if (ifma->ifma_addr->sa_family != AF_LINK) 3421 continue; 3422 index = ds_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)) 3423 >> 26; |
3437 af[index >> 3] |= 1 << (index & 7); | 3424 af[index >> 3] |= 1 << (index & 7); |
3438 3439 ETHER_NEXT_MULTI(step, enm); | |
3440 } 3441} | 3425 } 3426} |