diff options
author | phk <phk@FreeBSD.org> | 2001-02-03 16:29:10 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-02-03 16:29:10 +0000 |
commit | 408a00d7df90965db4085ccfd67356bf3f7c38ee (patch) | |
tree | 4ad9050dfc339204ebef2be568d2128e1bbf4da8 /sys/dev | |
parent | 2ef21ddcb983700a744a68bdc09d4328d1af0d71 (diff) | |
download | FreeBSD-src-408a00d7df90965db4085ccfd67356bf3f7c38ee.zip FreeBSD-src-408a00d7df90965db4085ccfd67356bf3f7c38ee.tar.gz |
Use LIST_FOREACH() to traverse ifp->if_multiaddrs list, instead of
<sys/queue.h> implementation details.
Created with: /usr/sbin/sed
Reviewed with: /sbin/md5
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/dc/if_dc.c | 12 | ||||
-rw-r--r-- | sys/dev/fxp/if_fxp.c | 3 | ||||
-rw-r--r-- | sys/dev/lnc/if_lnc.c | 3 | ||||
-rw-r--r-- | sys/dev/ray/if_ray.c | 6 | ||||
-rw-r--r-- | sys/dev/sf/if_sf.c | 3 | ||||
-rw-r--r-- | sys/dev/sk/if_sk.c | 3 | ||||
-rw-r--r-- | sys/dev/snc/dp83932.c | 3 | ||||
-rw-r--r-- | sys/dev/ti/if_ti.c | 3 | ||||
-rw-r--r-- | sys/dev/usb/if_aue.c | 3 | ||||
-rw-r--r-- | sys/dev/usb/if_cue.c | 3 | ||||
-rw-r--r-- | sys/dev/usb/if_kue.c | 3 | ||||
-rw-r--r-- | sys/dev/vr/if_vr.c | 3 | ||||
-rw-r--r-- | sys/dev/wi/if_wi.c | 3 |
13 files changed, 17 insertions, 34 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 0745fde..f66e65d 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -1051,8 +1051,7 @@ void dc_setfilt_21143(sc) else DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; h = dc_crc_le(sc, @@ -1123,8 +1122,7 @@ void dc_setfilt_admtek(sc) return; /* now program new ones */ - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_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)); @@ -1192,8 +1190,7 @@ void dc_setfilt_asix(sc) return; /* now program new ones */ - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_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)); @@ -1247,8 +1244,7 @@ void dc_setfilt_xircom(sc) else DC_CLRBIT(sc, DC_NETCFG, DC_NETCFG_RX_ALLMULTI); - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_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/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index b472e5b..0149221 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -1907,8 +1907,7 @@ fxp_mc_setup(sc) nmcasts = 0; if (!sc->all_mcasts) { - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (nmcasts >= MAXMCADDR) { diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c index e402799..f41c4ff 100644 --- a/sys/dev/lnc/if_lnc.c +++ b/sys/dev/lnc/if_lnc.c @@ -245,8 +245,7 @@ lnc_setladrf(struct lnc_softc *sc) */ bzero(sc->init_block->ladrf, MULTICAST_FILTER_LEN); - for (ifma = ifp->if_multiaddrs.lh_first; ifma; - ifma = ifma->ifma_link.le_next) { + LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 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 f00d740..2563daf 100644 --- a/sys/dev/ray/if_ray.c +++ b/sys/dev/ray/if_ray.c @@ -2421,8 +2421,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. */ - for (ifma = ifp->if_multiaddrs.lh_first, count = 0; ifma != NULL; - ifma = ifma->ifma_link.le_next, count++) + LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) if (count == 0) { ray_com_runq_done(sc); return; @@ -2440,8 +2439,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; - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_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 b7f6d36..ff01bf0 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -449,8 +449,7 @@ static void sf_setmulti(sc) } else { i = 1; /* First find the tail of the list. */ - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_link.le_next == NULL) break; } diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index f09df99..a0dc45a 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -558,8 +558,7 @@ static void sk_setmulti(sc_if) } else { i = 1; /* First find the tail of the list. */ - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_link.le_next == NULL) break; } diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c index 9ccab41..496cc3a 100644 --- a/sys/dev/snc/dp83932.c +++ b/sys/dev/snc/dp83932.c @@ -678,8 +678,7 @@ camprogram(sc) ifp->if_flags &= ~IFF_ALLMULTI; /* Loop through multicast addresses */ - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_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 9b29e09..cb28d01 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -1081,8 +1081,7 @@ static void ti_setmulti(sc) } /* Now program new ones. */ - for (ifma = ifp->if_multiaddrs.lh_first; - ifma != NULL; ifma = ifma->ifma_link.le_next) { + LIST_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 9804573..01f9d2d 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -538,8 +538,7 @@ Static void aue_setmulti(sc) csr_write_1(sc, AUE_MAR0 + i, 0); /* now program new ones */ - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_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 6b71b48..9a03646 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -382,8 +382,7 @@ Static void cue_setmulti(sc) sc->cue_mctab[i] = 0; /* now program new ones */ - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_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 4d89b70..d907c01 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -336,8 +336,7 @@ Static void kue_setmulti(sc) sc->kue_rxfilt &= ~KUE_RXFILT_ALLMULTI; - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_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 9e5ee21..8ea9944 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -530,8 +530,7 @@ static void vr_setmulti(sc) CSR_WRITE_4(sc, VR_MAR1, 0); /* now program new ones */ - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_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 37f4f1b..7fad2de 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -1035,8 +1035,7 @@ static void wi_setmulti(sc) return; } - for (ifma = ifp->if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (i < 16) { |