diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2001-02-06 10:12:15 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2001-02-06 10:12:15 +0000 |
commit | 6817526d14cbd2812ff570e7a0b8b5905ab98b1b (patch) | |
tree | 625adfe0fc45dc854cabadf252ed23af4a4d1fad /sys/dev | |
parent | 2cdd9c0332ec8dea64ef2429b1722945f2df5128 (diff) | |
download | src-6817526d14cbd2812ff570e7a0b8b5905ab98b1b.tar.gz src-6817526d14cbd2812ff570e7a0b8b5905ab98b1b.zip |
Convert if_multiaddrs from LIST to TAILQ so that it can be traversed
backwards in the three drivers which want to do that.
Reviewed by: mikeh
Notes
Notes:
svn path=/head/; revision=72084
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/awi/awi.c | 2 | ||||
-rw-r--r-- | sys/dev/dc/if_dc.c | 8 | ||||
-rw-r--r-- | sys/dev/de/if_de.c | 6 | ||||
-rw-r--r-- | sys/dev/ed/if_ed.c | 2 | ||||
-rw-r--r-- | sys/dev/fe/if_fe.c | 2 | ||||
-rw-r--r-- | sys/dev/fxp/if_fxp.c | 2 | ||||
-rw-r--r-- | sys/dev/ie/if_ie.c | 2 | ||||
-rw-r--r-- | sys/dev/lnc/if_lnc.c | 2 | ||||
-rw-r--r-- | sys/dev/pdq/pdq_ifsubr.c | 4 | ||||
-rw-r--r-- | sys/dev/ray/if_ray.c | 4 | ||||
-rw-r--r-- | sys/dev/sf/if_sf.c | 9 | ||||
-rw-r--r-- | sys/dev/sk/if_sk.c | 9 | ||||
-rw-r--r-- | sys/dev/sn/if_sn.c | 2 | ||||
-rw-r--r-- | sys/dev/snc/dp83932.c | 2 | ||||
-rw-r--r-- | sys/dev/ti/if_ti.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/if_aue.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/if_cue.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/if_kue.c | 2 | ||||
-rw-r--r-- | sys/dev/vr/if_vr.c | 2 | ||||
-rw-r--r-- | sys/dev/wi/if_wi.c | 2 | ||||
-rw-r--r-- | sys/dev/wl/if_wl.c | 2 | ||||
-rw-r--r-- | sys/dev/xe/if_xe.c | 8 |
22 files changed, 32 insertions, 46 deletions
diff --git a/sys/dev/awi/awi.c b/sys/dev/awi/awi.c index 77e22a64bbe9..4dab87bbcc6d 100644 --- a/sys/dev/awi/awi.c +++ b/sys/dev/awi/awi.c @@ -791,7 +791,7 @@ awi_init(sc) #ifdef __FreeBSD__ if (ifp->if_amcount != 0) goto set_mib; - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (n == AWI_GROUP_ADDR_SIZE) diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index f66e65d91023..7e57daeac0d6 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1051,7 +1051,7 @@ void dc_setfilt_21143(sc) else DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = dc_crc_le(sc, @@ -1122,7 +1122,7 @@ void dc_setfilt_admtek(sc) return; /* now program new ones */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); @@ -1190,7 +1190,7 @@ void dc_setfilt_asix(sc) return; /* now program new ones */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = dc_crc_be(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); @@ -1244,7 +1244,7 @@ void dc_setfilt_xircom(sc) else DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = dc_crc_le(sc, diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 714947bc3473..4f41a34da555 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -3012,7 +3012,7 @@ tulip_addr_filter( #endif multicnt = 0; - LIST_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family == AF_LINK) multicnt++; @@ -3040,7 +3040,7 @@ tulip_addr_filter( */ bzero(sc->tulip_setupdata, sizeof(sc->tulip_setupdata)); - LIST_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3090,7 +3090,7 @@ tulip_addr_filter( /* * Else can get perfect filtering for 16 addresses. */ - LIST_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &sc->tulip_if.if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; addrp = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index a8979aaf0c80..2c0967c74732 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -3286,7 +3286,7 @@ ds_getmcaf(sc, mcaf) mcaf[0] = 0; mcaf[1] = 0; - LIST_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; index = ds_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)) diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index a670a90533cf..c11cbc6fcd8f 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -2120,7 +2120,7 @@ fe_mcaf ( struct fe_softc *sc ) struct ifmultiaddr *ifma; filter = fe_filter_nothing; - LIST_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; index = fe_hash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 0149221d60e1..8cc34ffdb906 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -1907,7 +1907,7 @@ fxp_mc_setup(sc) nmcasts = 0; if (!sc->all_mcasts) { - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (nmcasts >= MAXMCADDR) { diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c index ccc1f54cdca5..caed7d8ae9fb 100644 --- a/sys/dev/ie/if_ie.c +++ b/sys/dev/ie/if_ie.c @@ -2150,7 +2150,7 @@ ie_mc_reset(int unit) * Step through the list of addresses. */ ie->mcast_count = 0; - LIST_FOREACH(ifma, &ie->arpcom.ac_if.if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ie->arpcom.ac_if.if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c index f41c4ffbf986..50310656ef02 100644 --- a/sys/dev/lnc/if_lnc.c +++ b/sys/dev/lnc/if_lnc.c @@ -245,7 +245,7 @@ lnc_setladrf(struct lnc_softc *sc) */ bzero(sc->init_block->ladrf, MULTICAST_FILTER_LEN); - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; diff --git a/sys/dev/pdq/pdq_ifsubr.c b/sys/dev/pdq/pdq_ifsubr.c index 3c437a8e78cf..32f2097b0145 100644 --- a/sys/dev/pdq/pdq_ifsubr.c +++ b/sys/dev/pdq/pdq_ifsubr.c @@ -227,8 +227,8 @@ pdq_os_addr_fill( pdq_softc_t *sc = (pdq_softc_t *) pdq->pdq_os_ctx; struct ifmultiaddr *ifma; - for (ifma = LIST_FIRST(&sc->sc_if.if_multiaddrs); ifma && num_addrs > 0; - ifma = LIST_NEXT(ifma, ifma_link)) { + for (ifma = TAILQ_FIRST(&sc->sc_if.if_multiaddrs); ifma && num_addrs > 0; + ifma = TAILQ_NEXT(ifma, ifma_link)) { char *mcaddr; if (ifma->ifma_addr->sa_family != AF_LINK) continue; diff --git a/sys/dev/ray/if_ray.c b/sys/dev/ray/if_ray.c index ea6a5ccad6c3..d28eb2d5a3ec 100644 --- a/sys/dev/ray/if_ray.c +++ b/sys/dev/ray/if_ray.c @@ -2420,7 +2420,7 @@ ray_mcast(struct ray_softc *sc, struct ray_comq_entry *com) * The multicast list is only 16 items long so use promiscuous * mode and don't bother updating the multicast list. */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) if (count == 0) { ray_com_runq_done(sc); return; @@ -2438,7 +2438,7 @@ ray_mcast(struct ray_softc *sc, struct ray_comq_entry *com) SRAM_WRITE_FIELD_1(sc, com->c_ccs, ray_cmd_update_mcast, c_nmcast, count); bufp = RAY_HOST_TO_ECF_BASE; - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { SRAM_WRITE_REGION( sc, bufp, diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index fbaac994506b..2e1cacfee44c 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -448,14 +448,7 @@ static void sf_setmulti(sc) SF_SETBIT(sc, SF_RXFILT, SF_RXFILT_ALLMULTI); } else { i = 1; - /* First find the tail of the list. */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (LIST_NEXT(ifma, ifma_link) == NULL) - break; - } - /* Now traverse the list backwards. */ - for (; ifma != NULL && ifma != (void *)&ifp->if_multiaddrs; - ifma = (struct ifmultiaddr *)ifma->ifma_link.le_prev) { + TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; /* diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index a6dba7966aa2..960b98b203f9 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -557,14 +557,7 @@ static void sk_setmulti(sc_if) hashes[1] = 0xFFFFFFFF; } else { i = 1; - /* First find the tail of the list. */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (LIST_NEXT(ifma, ifma_link) == NULL) - break; - } - /* Now traverse the list backwards. */ - for (; ifma != NULL && ifma != (void *)&ifp->if_multiaddrs; - ifma = (struct ifmultiaddr *)ifma->ifma_link.le_prev) { + TAILQ_FOREACH_REVERSE(ifma, &ifp->if_multiaddrs, ifmultihead, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; /* diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index bd5e172b65e2..50a0f086c2c7 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -1461,7 +1461,7 @@ sn_getmcf(struct arpcom *ac, u_char *mcf) bzero(mcf, MCFSZ); - LIST_FOREACH(ifma, &ac->ac_if.if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ac->ac_if.if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) return 0; index = smc_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)) & 0x3f; diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c index 496cc3a5f6d5..70da6498b1fc 100644 --- a/sys/dev/snc/dp83932.c +++ b/sys/dev/snc/dp83932.c @@ -678,7 +678,7 @@ camprogram(sc) ifp->if_flags &= ~IFF_ALLMULTI; /* Loop through multicast addresses */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (mcount == MAXCAM) { diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index 1d52547e29be..b13f1ba79dba 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -1081,7 +1081,7 @@ static void ti_setmulti(sc) } /* Now program new ones. */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; mc = malloc(sizeof(struct ti_mc_entry), M_DEVBUF, M_NOWAIT); diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index 50856e661936..81fcd149eb55 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -538,7 +538,7 @@ Static void aue_setmulti(sc) csr_write_1(sc, AUE_MAR0 + i, 0); /* now program new ones */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = aue_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index 9a0364616ac0..039502298bed 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -382,7 +382,7 @@ Static void cue_setmulti(sc) sc->cue_mctab[i] = 0; /* now program new ones */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = cue_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index d907c0126a62..33fca8ebca16 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -336,7 +336,7 @@ Static void kue_setmulti(sc) sc->kue_rxfilt &= ~KUE_RXFILT_ALLMULTI; - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; /* diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index 8ea9944ec5dc..0f44a1dbbcd0 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -530,7 +530,7 @@ static void vr_setmulti(sc) CSR_WRITE_4(sc, VR_MAR1, 0); /* now program new ones */ - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = vr_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index 7fad2dea3588..06fa656a07f8 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -1035,7 +1035,7 @@ static void wi_setmulti(sc) return; } - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (i < 16) { diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index b52762c86c17..afa82ff24a78 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/if_wl.c @@ -2060,7 +2060,7 @@ wlconfig(int unit) outw(PIOP1(base), AC_MCSETUP|AC_CW_EL); /* ac_command */ outw(PIOR1(base), OFFSET_CU + 8); #if defined(__FreeBSD__) && __FreeBSD_version >= 300000 - LIST_FOREACH(ifma, &sc->wl_if.if_multiaddrs, ifma_link) { + TAILQ_FOREACH(ifma, &sc->wl_if.if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c index d0e1dd22b222..ee7283436538 100644 --- a/sys/dev/xe/if_xe.c +++ b/sys/dev/xe/if_xe.c @@ -1590,10 +1590,10 @@ xe_setmulti(struct xe_softc *scp) { int count; ifp = &scp->arpcom.ac_if; - maddr = LIST_FIRST(&ifp->if_multiaddrs); + maddr = TAILQ_FIRST(&ifp->if_multiaddrs); /* Get length of multicast list */ - for (count = 0; maddr != NULL; maddr = LIST_NEXT(maddr, ifma_link), count++); + for (count = 0; maddr != NULL; maddr = TAILQ_NEXT(maddr, ifma_link), count++); if ((ifp->if_flags & IFF_PROMISC) || (ifp->if_flags & IFF_ALLMULTI) || (count > 9)) { /* @@ -1643,7 +1643,7 @@ xe_setaddrs(struct xe_softc *scp) { u_int8_t *addr; u_int8_t page, slot, byte, i; - maddr = LIST_FIRST(&scp->arpcom.ac_if.if_multiaddrs); + maddr = TAILQ_FIRST(&scp->arpcom.ac_if.if_multiaddrs); XE_SELECT_PAGE(page = 0x50); @@ -1653,7 +1653,7 @@ xe_setaddrs(struct xe_softc *scp) { addr = (u_int8_t *)(&scp->arpcom.ac_enaddr); else { while (maddr != NULL && maddr->ifma_addr->sa_family != AF_LINK) - maddr = LIST_NEXT(maddr, ifma_link); + maddr = TAILQ_NEXT(maddr, ifma_link); if (maddr != NULL) addr = LLADDR((struct sockaddr_dl *)maddr->ifma_addr); else |