aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorAkeem G. Abodunrin <akeem.g.abodunrin@intel.com>2011-09-08 16:39:48 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-10-13 01:50:21 -0400
commitca2e3e7ec98937e12df4bbdcc9a367b8768290ce (patch)
treef87b8951918418d92f944c9dc5f730f6f1e2e7c3 /drivers/net/ethernet
parentbed45a6ed51d00007f5eb6d75560218ddcecfe51 (diff)
igb: Loopback functionality supports for i350 devices
This patch adds VMDq loopback pf support for i350 devices. The patch is necessary since the register that enabled loopback was moved and renamed from DTXSWC to TXSWC. Signed-off-by: "Akeem G. Abodunrin" <akeem.g.abodunrin@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.c29
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_regs.h1
2 files changed, 24 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 3771bd20f437..6580cea796c5 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -1580,14 +1580,31 @@ void igb_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
1580 **/ 1580 **/
1581void igb_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable) 1581void igb_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable)
1582{ 1582{
1583 u32 dtxswc = rd32(E1000_DTXSWC); 1583 u32 dtxswc;
1584
1585 switch (hw->mac.type) {
1586 case e1000_82576:
1587 dtxswc = rd32(E1000_DTXSWC);
1588 if (enable)
1589 dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN;
1590 else
1591 dtxswc &= ~E1000_DTXSWC_VMDQ_LOOPBACK_EN;
1592 wr32(E1000_DTXSWC, dtxswc);
1593 break;
1594 case e1000_i350:
1595 dtxswc = rd32(E1000_TXSWC);
1596 if (enable)
1597 dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN;
1598 else
1599 dtxswc &= ~E1000_DTXSWC_VMDQ_LOOPBACK_EN;
1600 wr32(E1000_TXSWC, dtxswc);
1601 break;
1602 default:
1603 /* Currently no other hardware supports loopback */
1604 break;
1605 }
1584 1606
1585 if (enable)
1586 dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN;
1587 else
1588 dtxswc &= ~E1000_DTXSWC_VMDQ_LOOPBACK_EN;
1589 1607
1590 wr32(E1000_DTXSWC, dtxswc);
1591} 1608}
1592 1609
1593/** 1610/**
diff --git a/drivers/net/ethernet/intel/igb/e1000_regs.h b/drivers/net/ethernet/intel/igb/e1000_regs.h
index 0990f6d860c7..0a860bc1198e 100644
--- a/drivers/net/ethernet/intel/igb/e1000_regs.h
+++ b/drivers/net/ethernet/intel/igb/e1000_regs.h
@@ -318,6 +318,7 @@
318#define E1000_RPLOLR 0x05AF0 /* Replication Offload - RW */ 318#define E1000_RPLOLR 0x05AF0 /* Replication Offload - RW */
319#define E1000_UTA 0x0A000 /* Unicast Table Array - RW */ 319#define E1000_UTA 0x0A000 /* Unicast Table Array - RW */
320#define E1000_IOVTCL 0x05BBC /* IOV Control Register */ 320#define E1000_IOVTCL 0x05BBC /* IOV Control Register */
321#define E1000_TXSWC 0x05ACC /* Tx Switch Control */
321/* These act per VF so an array friendly macro is used */ 322/* These act per VF so an array friendly macro is used */
322#define E1000_P2VMAILBOX(_n) (0x00C00 + (4 * (_n))) 323#define E1000_P2VMAILBOX(_n) (0x00C00 + (4 * (_n)))
323#define E1000_VMBMEM(_n) (0x00800 + (64 * (_n))) 324#define E1000_VMBMEM(_n) (0x00800 + (64 * (_n)))