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
This commit is contained in:
Poul-Henning Kamp 2001-02-03 16:29:10 +00:00
parent 22f2982675
commit 78d82c8c59
26 changed files with 35 additions and 70 deletions

View File

@ -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,

View File

@ -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) {

View File

@ -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;

View File

@ -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,

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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) {

View File

@ -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);

View File

@ -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));

View File

@ -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));

View File

@ -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;
/*

View File

@ -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));

View File

@ -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) {

View File

@ -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,

View File

@ -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) {

View File

@ -343,8 +343,7 @@ static void pcn_setmulti(sc)
pcn_csr_write(sc, PCN_CSR_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 = pcn_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));

View File

@ -719,8 +719,7 @@ static void rl_setmulti(sc)
CSR_WRITE_4(sc, RL_MAR4, 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 = rl_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));

View File

@ -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;
}

View File

@ -521,8 +521,7 @@ static void sis_setmulti_ns(sc)
CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0);
}
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 = sis_crc(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
@ -564,8 +563,7 @@ static void sis_setmulti_sis(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;
h = sis_crc(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr));

View File

@ -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;
}

View File

@ -588,8 +588,7 @@ static void ste_setmulti(sc)
CSR_WRITE_4(sc, STE_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 = ste_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));

View File

@ -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);

View File

@ -953,8 +953,7 @@ static void tl_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;
}

View File

@ -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));

View File

@ -641,8 +641,7 @@ static void wb_setmulti(sc)
CSR_WRITE_4(sc, WB_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 = wb_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));

View File

@ -808,8 +808,7 @@ static void xl_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)
mcnt++;
if (mcnt)
@ -852,8 +851,7 @@ static void xl_setmulti_hash(sc)
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_SET_HASH|i);
/* 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 = xl_calchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr));