if_xe.c (71999) | if_xe.c (72084) |
---|---|
1/*- 2 * Copyright (c) 1998, 1999 Scott Mitchell 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 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * $Id: if_xe.c,v 1.20 1999/06/13 19:17:40 scott Exp $ | 1/*- 2 * Copyright (c) 1998, 1999 Scott Mitchell 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 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * $Id: if_xe.c,v 1.20 1999/06/13 19:17:40 scott Exp $ |
27 * $FreeBSD: head/sys/dev/xe/if_xe.c 71999 2001-02-04 13:13:25Z phk $ | 27 * $FreeBSD: head/sys/dev/xe/if_xe.c 72084 2001-02-06 10:12:15Z phk $ |
28 */ 29 30/* 31 * XXX TODO XXX 32 * 33 * I've pushed this fairly far, but there are some things that need to be 34 * done here. I'm documenting them here in case I get destracted. -- imp 35 * --- 1549 unchanged lines hidden (view full) --- 1585 */ 1586static void 1587xe_setmulti(struct xe_softc *scp) { 1588 struct ifnet *ifp; 1589 struct ifmultiaddr *maddr; 1590 int count; 1591 1592 ifp = &scp->arpcom.ac_if; | 28 */ 29 30/* 31 * XXX TODO XXX 32 * 33 * I've pushed this fairly far, but there are some things that need to be 34 * done here. I'm documenting them here in case I get destracted. -- imp 35 * --- 1549 unchanged lines hidden (view full) --- 1585 */ 1586static void 1587xe_setmulti(struct xe_softc *scp) { 1588 struct ifnet *ifp; 1589 struct ifmultiaddr *maddr; 1590 int count; 1591 1592 ifp = &scp->arpcom.ac_if; |
1593 maddr = LIST_FIRST(&ifp->if_multiaddrs); | 1593 maddr = TAILQ_FIRST(&ifp->if_multiaddrs); |
1594 1595 /* Get length of multicast list */ | 1594 1595 /* Get length of multicast list */ |
1596 for (count = 0; maddr != NULL; maddr = LIST_NEXT(maddr, ifma_link), count++); | 1596 for (count = 0; maddr != NULL; maddr = TAILQ_NEXT(maddr, ifma_link), count++); |
1597 1598 if ((ifp->if_flags & IFF_PROMISC) || (ifp->if_flags & IFF_ALLMULTI) || (count > 9)) { 1599 /* 1600 * Go into promiscuous mode if either of the PROMISC or ALLMULTI flags are 1601 * set, or if we have been asked to deal with more than 9 multicast 1602 * addresses. To do this: set MPE and PME in SWC1 1603 */ 1604 XE_SELECT_PAGE(0x42); --- 33 unchanged lines hidden (view full) --- 1638 * XXX - it's probably right (despite my earlier comments to the contrary). 1639 */ 1640static void 1641xe_setaddrs(struct xe_softc *scp) { 1642 struct ifmultiaddr *maddr; 1643 u_int8_t *addr; 1644 u_int8_t page, slot, byte, i; 1645 | 1597 1598 if ((ifp->if_flags & IFF_PROMISC) || (ifp->if_flags & IFF_ALLMULTI) || (count > 9)) { 1599 /* 1600 * Go into promiscuous mode if either of the PROMISC or ALLMULTI flags are 1601 * set, or if we have been asked to deal with more than 9 multicast 1602 * addresses. To do this: set MPE and PME in SWC1 1603 */ 1604 XE_SELECT_PAGE(0x42); --- 33 unchanged lines hidden (view full) --- 1638 * XXX - it's probably right (despite my earlier comments to the contrary). 1639 */ 1640static void 1641xe_setaddrs(struct xe_softc *scp) { 1642 struct ifmultiaddr *maddr; 1643 u_int8_t *addr; 1644 u_int8_t page, slot, byte, i; 1645 |
1646 maddr = LIST_FIRST(&scp->arpcom.ac_if.if_multiaddrs); | 1646 maddr = TAILQ_FIRST(&scp->arpcom.ac_if.if_multiaddrs); |
1647 1648 XE_SELECT_PAGE(page = 0x50); 1649 1650 for (slot = 0, byte = 8; slot < 10; slot++) { 1651 1652 if (slot == 0) 1653 addr = (u_int8_t *)(&scp->arpcom.ac_enaddr); 1654 else { 1655 while (maddr != NULL && maddr->ifma_addr->sa_family != AF_LINK) | 1647 1648 XE_SELECT_PAGE(page = 0x50); 1649 1650 for (slot = 0, byte = 8; slot < 10; slot++) { 1651 1652 if (slot == 0) 1653 addr = (u_int8_t *)(&scp->arpcom.ac_enaddr); 1654 else { 1655 while (maddr != NULL && maddr->ifma_addr->sa_family != AF_LINK) |
1656 maddr = LIST_NEXT(maddr, ifma_link); | 1656 maddr = TAILQ_NEXT(maddr, ifma_link); |
1657 if (maddr != NULL) 1658 addr = LLADDR((struct sockaddr_dl *)maddr->ifma_addr); 1659 else 1660 addr = (u_int8_t *)(&scp->arpcom.ac_enaddr); 1661 } 1662 1663 for (i = 0; i < 6; i++, byte++) { 1664#if XE_DEBUG > 2 --- 588 unchanged lines hidden --- | 1657 if (maddr != NULL) 1658 addr = LLADDR((struct sockaddr_dl *)maddr->ifma_addr); 1659 else 1660 addr = (u_int8_t *)(&scp->arpcom.ac_enaddr); 1661 } 1662 1663 for (i = 0; i < 6; i++, byte++) { 1664#if XE_DEBUG > 2 --- 588 unchanged lines hidden --- |