FreeBSD/sys/dev/e1000/if_lem.c
/*********************************************************************
 *  Multicast Update
 *
 *  This routine is called whenever multicast address list is updated.
 *
 **********************************************************************/
Multicast Update
This routine is called whenever multicast address list is updated.
Multicast Update This routine is called whenever multicast address list is updated .
static void
lem_set_multi(struct adapter *adapter)
{
	if_t ifp = adapter->ifp;
	u32 reg_rctl = 0;
	u8  *mta; 
	int mcnt = 0;
	IOCTL_DEBUGOUT("lem_set_multi: begin");
	mta = adapter->mta;
	bzero(mta, sizeof(u8) * ETH_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES);
	if (adapter->hw.mac.type == e1000_82542 && 
	    adapter->hw.revision_id == E1000_REVISION_2) {
		reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL);
		if (adapter->hw.bus.pci_cmd_word & CMD_MEM_WRT_INVALIDATE)
			e1000_pci_clear_mwi(&adapter->hw);
		reg_rctl |= E1000_RCTL_RST;
		E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl);
		msec_delay(5);
	}
	if_multiaddr_array(ifp, mta, &mcnt, MAX_NUM_MULTICAST_ADDRESSES);
	if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) {
		reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL);
		reg_rctl |= E1000_RCTL_MPE;
		E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl);
	} else
		e1000_update_mc_addr_list(&adapter->hw, mta, mcnt);
	if (adapter->hw.mac.type == e1000_82542 && 
	    adapter->hw.revision_id == E1000_REVISION_2) {
		reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL);
		reg_rctl &= ~E1000_RCTL_RST;
		E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl);
		msec_delay(5);
		if (adapter->hw.bus.pci_cmd_word & CMD_MEM_WRT_INVALIDATE)
			e1000_pci_set_mwi(&adapter->hw);
	}
}
static void lem_set_multi ( struct adapter * adapter ) { if_t ifp = adapter -> ifp ; u32 reg_rctl = 0 ; u8 * mta ; int mcnt = 0 ; IOCTL_DEBUGOUT ( " " ) ; mta = adapter -> mta ; bzero ( mta , sizeof ( u8 ) * ETH_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES ) ; if ( adapter -> hw . mac . type == e1000_82542 && adapter -> hw . revision_id == E1000_REVISION_2 ) { reg_rctl = E1000_READ_REG ( & adapter -> hw , E1000_RCTL ) ; if ( adapter -> hw . bus . pci_cmd_word & CMD_MEM_WRT_INVALIDATE ) e1000_pci_clear_mwi ( & adapter -> hw ) ; reg_rctl |= E1000_RCTL_RST ; E1000_WRITE_REG ( & adapter -> hw , E1000_RCTL , reg_rctl ) ; msec_delay ( 5 ) ; } if_multiaddr_array ( ifp , mta , & mcnt , MAX_NUM_MULTICAST_ADDRESSES ) ; if ( mcnt >= MAX_NUM_MULTICAST_ADDRESSES ) { reg_rctl = E1000_READ_REG ( & adapter -> hw , E1000_RCTL ) ; reg_rctl |= E1000_RCTL_MPE ; E1000_WRITE_REG ( & adapter -> hw , E1000_RCTL , reg_rctl ) ; } else e1000_update_mc_addr_list ( & adapter -> hw , mta , mcnt ) ; if ( adapter -> hw . mac . type == e1000_82542 && adapter -> hw . revision_id == E1000_REVISION_2 ) { reg_rctl = E1000_READ_REG ( & adapter -> hw , E1000_RCTL ) ; reg_rctl &= ~ E1000_RCTL_RST ; E1000_WRITE_REG ( & adapter -> hw , E1000_RCTL , reg_rctl ) ; msec_delay ( 5 ) ; if ( adapter -> hw . bus . pci_cmd_word & CMD_MEM_WRT_INVALIDATE ) e1000_pci_set_mwi ( & adapter -> hw ) ; } }
Multicast Update
  This routine is called whenever multicast address list is updated.
Multicast Update This routine is called whenever multicast address list is updated .
/* Multicast array memory */