Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22c12752 authored by Lior Levy's avatar Lior Levy Committed by Jeff Kirsher
Browse files

igb: fix i350 anti spoofing config



Fix a problem in i350 where anti spoofing configuration was written into a
wrong register.

Signed-off-by: default avatarLior Levy <lior.levy@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent a1f6c6b1
Loading
Loading
Loading
Loading
+19 −14
Original line number Original line Diff line number Diff line
@@ -1818,27 +1818,32 @@ out:
 **/
 **/
void igb_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
void igb_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
{
{
	u32 dtxswc;
	u32 reg_val, reg_offset;


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

	reg_val = rd32(reg_offset);
	if (enable) {
	if (enable) {
			dtxswc |= (E1000_DTXSWC_MAC_SPOOF_MASK |
		reg_val |= (E1000_DTXSWC_MAC_SPOOF_MASK |
			     E1000_DTXSWC_VLAN_SPOOF_MASK);
			     E1000_DTXSWC_VLAN_SPOOF_MASK);
		/* The PF can spoof - it has to in order to
		/* The PF can spoof - it has to in order to
			 * support emulation mode NICs */
		 * support emulation mode NICs
			dtxswc ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
		 */
		reg_val ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
	} else {
	} else {
			dtxswc &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
		reg_val &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
			     E1000_DTXSWC_VLAN_SPOOF_MASK);
			     E1000_DTXSWC_VLAN_SPOOF_MASK);
	}
	}
		wr32(E1000_DTXSWC, dtxswc);
	wr32(reg_offset, reg_val);
		break;
	default:
		break;
	}
}
}


/**
/**