src/dpdk/drivers/net/e1000/base/e1000_82575.c
void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
{
	u32 reg_val, reg_offset;

	switch (hw->mac.type) {
	case e1000_82576:
		reg_offset = E1000_DTXSWC;
		break;
	case e1000_i350:
	case e1000_i354:
		reg_offset = E1000_TXSWC;
		break;
	default:
		return;
	}

	reg_val = E1000_READ_REG(hw, reg_offset);
	if (enable) {
		reg_val |= (E1000_DTXSWC_MAC_SPOOF_MASK |
			     E1000_DTXSWC_VLAN_SPOOF_MASK);
		/* The PF can spoof - it has to in order to
		 * support emulation mode NICs
		 */
		reg_val ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
	} else {
		reg_val &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
			     E1000_DTXSWC_VLAN_SPOOF_MASK);
	}
	E1000_WRITE_REG(hw, reg_offset, reg_val);
}
/**
 *  e1000_vmdq_set_anti_spoofing_pf - enable or disable anti-spoofing
 *  @hw: pointer to the hardware struct
 *  @enable: state to enter, either enabled or disabled
 *  @pf: Physical Function pool - do not set anti-spoofing for the PF
 *
 *  enables/disables L2 switch anti-spoofing functionality.
 **/
enable or disable anti-spoofing
@hw: pointer to the hardware struct
@enable: state to enter, either enabled or disabled
@pf: Physical Function pool - do not set anti-spoofing for the PF

enables/disables L2 switch anti-spoofing functionality.
enable or disable anti - spoofing @hw : pointer to the hardware struct @enable : state to enter either enabled or disabled @pf : Physical Function pool - do not set anti - spoofing for the PF enables / disables L2 switch anti - spoofing functionality .
void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
{
	u32 reg_val, reg_offset;
	switch (hw->mac.type) {
	case e1000_82576:
		reg_offset = E1000_DTXSWC;
		break;
	case e1000_i350:
	case e1000_i354:
		reg_offset = E1000_TXSWC;
		break;
	default:
		return;
	}
	reg_val = E1000_READ_REG(hw, reg_offset);
	if (enable) {
		reg_val |= (E1000_DTXSWC_MAC_SPOOF_MASK |
			     E1000_DTXSWC_VLAN_SPOOF_MASK);
		reg_val ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
	} else {
		reg_val &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
			     E1000_DTXSWC_VLAN_SPOOF_MASK);
	}
	E1000_WRITE_REG(hw, reg_offset, reg_val);
}
void e1000_vmdq_set_anti_spoofing_pf ( struct e1000_hw * hw , bool enable , int pf ) { u32 reg_val , reg_offset ; switch ( hw -> mac . type ) { case e1000_82576 : reg_offset = E1000_DTXSWC ; break ; case e1000_i350 : case e1000_i354 : reg_offset = E1000_TXSWC ; break ; default : return ; } reg_val = E1000_READ_REG ( hw , reg_offset ) ; if ( enable ) { reg_val |= ( E1000_DTXSWC_MAC_SPOOF_MASK | E1000_DTXSWC_VLAN_SPOOF_MASK ) ; reg_val ^= ( 1 << pf | 1 << ( pf + MAX_NUM_VFS ) ) ; } else { reg_val &= ~ ( E1000_DTXSWC_MAC_SPOOF_MASK | E1000_DTXSWC_VLAN_SPOOF_MASK ) ; } E1000_WRITE_REG ( hw , reg_offset , reg_val ) ; }
e1000_vmdq_set_anti_spoofing_pf - enable or disable anti-spoofing
  @hw: pointer to the hardware struct
  @enable: state to enter, either enabled or disabled
  @pf: Physical Function pool - do not set anti-spoofing for the PF
e1000_vmdq_set_anti_spoofing_pf - enable or disable anti - spoofing @hw : pointer to the hardware struct @enable : state to enter either enabled or disabled @pf : Physical Function pool - do not set anti - spoofing for the PF
/* The PF can spoof - it has to in order to
		 * support emulation mode NICs
		 */