Changeset 174
- Timestamp:
- Sep 2, 2010, 3:29:02 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freebsd-mos-driver/if_mos.c
r173 r174 569 569 struct mos_softc *sc = uether_getsc(ue); 570 570 struct ifnet *ifp = uether_getifp(ue); 571 //struct ether_multi *enm;572 571 struct ifmultiaddr *ifma; 572 573 573 u_int32_t h = 0; 574 574 u_int8_t rxmode; 575 575 u_int8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 576 int allmulti = 0; 576 577 577 578 MOS_LOCK_ASSERT(sc, MA_OWNED); … … 579 580 rxmode = mos_reg_read_1(sc, MOS_CTL); 580 581 581 if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { 582 allmulti: 583 rxmode |= MOS_CTL_ALLMULTI; 584 mos_reg_write_1(sc, MOS_CTL, rxmode); 585 return; 586 } else 587 rxmode &= ~MOS_CTL_ALLMULTI; 588 589 /* now program new ones */ 582 if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) 583 allmulti = 1; 584 585 /* get all new ones */ 590 586 if_maddr_rlock(ifp); 591 587 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { 592 if (ifma->ifma_addr->sa_family != AF_LINK) 593 goto allmulti; 588 if (ifma->ifma_addr->sa_family != AF_LINK) { 589 allmulti = 1; 590 continue; 591 }; 594 592 h = ether_crc32_be(LLADDR((struct sockaddr_dl *) 595 593 ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; … … 599 597 if_maddr_runlock(ifp); 600 598 601 ifp->if_flags &= ~IFF_ALLMULTI; 602 mos_write_mcast(sc, (void *)&hashtbl); 603 mos_reg_write_1(sc, MOS_CTL, rxmode); 604 return; 599 /* now program new ones */ 600 if (allmulti == 1) { 601 rxmode |= MOS_CTL_ALLMULTI; 602 mos_reg_write_1(sc, MOS_CTL, rxmode); 603 } else { 604 rxmode &= ~MOS_CTL_ALLMULTI; 605 ifp->if_flags &= ~IFF_ALLMULTI; 606 mos_write_mcast(sc, (void *)&hashtbl); 607 mos_reg_write_1(sc, MOS_CTL, rxmode); 608 } 605 609 } 606 610
Note:
See TracChangeset
for help on using the changeset viewer.