FreeBSD/sys/dev/e1000/if_em.c
/*
** em_flush_rx_ring - remove all descriptors from the rx_ring
**
** Mark all descriptors in the RX ring as consumed and disable the rx ring
*/
remove all descriptors from the rx_ring
Mark all descriptors in the RX ring as consumed and disable the rx ring
remove all descriptors from the rx_ring Mark all descriptors in the RX ring as consumed and disable the rx ring
static void
em_flush_rx_ring(struct adapter *adapter)
{
	struct e1000_hw	*hw = &adapter->hw;
	u32		rctl, rxdctl;
	rctl = E1000_READ_REG(hw, E1000_RCTL);
	E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN);
	E1000_WRITE_FLUSH(hw);
	usec_delay(150);
	rxdctl = E1000_READ_REG(hw, E1000_RXDCTL(0));
	rxdctl &= 0xffffc000;
	rxdctl |= (0x1F | (1 << 8) | E1000_RXDCTL_THRESH_UNIT_DESC);
	E1000_WRITE_REG(hw, E1000_RXDCTL(0), rxdctl);
	E1000_WRITE_REG(hw, E1000_RCTL, rctl | E1000_RCTL_EN);
	E1000_WRITE_FLUSH(hw);
	usec_delay(150);
	E1000_WRITE_REG(hw, E1000_RCTL, rctl & ~E1000_RCTL_EN);
}
static void em_flush_rx_ring ( struct adapter * adapter ) { struct e1000_hw * hw = & adapter -> hw ; u32 rctl , rxdctl ; rctl = E1000_READ_REG ( hw , E1000_RCTL ) ; E1000_WRITE_REG ( hw , E1000_RCTL , rctl & ~ E1000_RCTL_EN ) ; E1000_WRITE_FLUSH ( hw ) ; usec_delay ( 150 ) ; rxdctl = E1000_READ_REG ( hw , E1000_RXDCTL ( 0 ) ) ; rxdctl &= 0xffffc000 ; rxdctl |= ( 0x1F | ( 1 << 8 ) | E1000_RXDCTL_THRESH_UNIT_DESC ) ; E1000_WRITE_REG ( hw , E1000_RXDCTL ( 0 ) , rxdctl ) ; E1000_WRITE_REG ( hw , E1000_RCTL , rctl | E1000_RCTL_EN ) ; E1000_WRITE_FLUSH ( hw ) ; usec_delay ( 150 ) ; E1000_WRITE_REG ( hw , E1000_RCTL , rctl & ~ E1000_RCTL_EN ) ; }
em_flush_rx_ring - remove all descriptors from the rx_ring
Mark all descriptors in the RX ring as consumed and disable the rx ring
em_flush_rx_ring - remove all descriptors from the rx_ring Mark all descriptors in the RX ring as consumed and disable the rx ring
/* zero the lower 14 bits (prefetch and host thresholds) */ /*
	 * update thresholds: prefetch threshold to 31, host threshold to 1
	 * and make sure the granularity is "descriptors" and not "cache lines"
	 */ /* momentarily enable the RX ring for the changes to take effect */