aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorCarolyn Wyborny <carolyn.wyborny@intel.com>2011-02-26 02:42:37 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-03-07 20:59:19 -0500
commit0a915b95d67f3bf63121c04aeb4eaebb183feb58 (patch)
tree4b197fc0e043e71e1b4817688c643c69fadb1d50 /drivers/net/igb
parenta1d76e10ae73348997f55efffc977e792d76a2c6 (diff)
igb: Add stats output for OS2BMC feature on i350 devices
This patch adds statistics output for OS2BMC feature which is configured by eeprom on capable devices. Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/e1000_defines.h1
-rw-r--r--drivers/net/igb/e1000_hw.h4
-rw-r--r--drivers/net/igb/e1000_regs.h7
-rw-r--r--drivers/net/igb/igb_ethtool.c9
-rw-r--r--drivers/net/igb/igb_main.c9
5 files changed, 29 insertions, 1 deletions
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
index ff46c91520af..92e11da25749 100644
--- a/drivers/net/igb/e1000_defines.h
+++ b/drivers/net/igb/e1000_defines.h
@@ -110,6 +110,7 @@
110/* Management Control */ 110/* Management Control */
111#define E1000_MANC_SMBUS_EN 0x00000001 /* SMBus Enabled - RO */ 111#define E1000_MANC_SMBUS_EN 0x00000001 /* SMBus Enabled - RO */
112#define E1000_MANC_ASF_EN 0x00000002 /* ASF Enabled - RO */ 112#define E1000_MANC_ASF_EN 0x00000002 /* ASF Enabled - RO */
113#define E1000_MANC_EN_BMC2OS 0x10000000 /* OSBMC is Enabled or not */
113/* Enable Neighbor Discovery Filtering */ 114/* Enable Neighbor Discovery Filtering */
114#define E1000_MANC_RCV_TCO_EN 0x00020000 /* Receive TCO Packets Enabled */ 115#define E1000_MANC_RCV_TCO_EN 0x00020000 /* Receive TCO Packets Enabled */
115#define E1000_MANC_BLK_PHY_RST_ON_IDE 0x00040000 /* Block phy resets */ 116#define E1000_MANC_BLK_PHY_RST_ON_IDE 0x00040000 /* Block phy resets */
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 281324e85980..eec9ed735588 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -248,6 +248,10 @@ struct e1000_hw_stats {
248 u64 scvpc; 248 u64 scvpc;
249 u64 hrmpc; 249 u64 hrmpc;
250 u64 doosync; 250 u64 doosync;
251 u64 o2bgptc;
252 u64 o2bspc;
253 u64 b2ospc;
254 u64 b2ogprc;
251}; 255};
252 256
253struct e1000_phy_stats { 257struct e1000_phy_stats {
diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h
index 3a6f8471aea2..61713548c027 100644
--- a/drivers/net/igb/e1000_regs.h
+++ b/drivers/net/igb/e1000_regs.h
@@ -328,4 +328,11 @@
328 328
329/* DMA Coalescing registers */ 329/* DMA Coalescing registers */
330#define E1000_PCIEMISC 0x05BB8 /* PCIE misc config register */ 330#define E1000_PCIEMISC 0x05BB8 /* PCIE misc config register */
331
332/* OS2BMC Registers */
333#define E1000_B2OSPC 0x08FE0 /* BMC2OS packets sent by BMC */
334#define E1000_B2OGPRC 0x04158 /* BMC2OS packets received by host */
335#define E1000_O2BGPTC 0x08FE4 /* OS2BMC packets received by BMC */
336#define E1000_O2BSPC 0x0415C /* OS2BMC packets transmitted by host */
337
331#endif 338#endif
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 61f7849cb5a7..78d420b4b2db 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -86,6 +86,10 @@ static const struct igb_stats igb_gstrings_stats[] = {
86 IGB_STAT("tx_smbus", stats.mgptc), 86 IGB_STAT("tx_smbus", stats.mgptc),
87 IGB_STAT("rx_smbus", stats.mgprc), 87 IGB_STAT("rx_smbus", stats.mgprc),
88 IGB_STAT("dropped_smbus", stats.mgpdc), 88 IGB_STAT("dropped_smbus", stats.mgpdc),
89 IGB_STAT("os2bmc_rx_by_bmc", stats.o2bgptc),
90 IGB_STAT("os2bmc_tx_by_bmc", stats.b2ospc),
91 IGB_STAT("os2bmc_tx_by_host", stats.o2bspc),
92 IGB_STAT("os2bmc_rx_by_host", stats.b2ogprc),
89}; 93};
90 94
91#define IGB_NETDEV_STAT(_net_stat) { \ 95#define IGB_NETDEV_STAT(_net_stat) { \
@@ -603,7 +607,10 @@ static void igb_get_regs(struct net_device *netdev,
603 regs_buff[548] = rd32(E1000_TDFT); 607 regs_buff[548] = rd32(E1000_TDFT);
604 regs_buff[549] = rd32(E1000_TDFHS); 608 regs_buff[549] = rd32(E1000_TDFHS);
605 regs_buff[550] = rd32(E1000_TDFPC); 609 regs_buff[550] = rd32(E1000_TDFPC);
606 610 regs_buff[551] = adapter->stats.o2bgptc;
611 regs_buff[552] = adapter->stats.b2ospc;
612 regs_buff[553] = adapter->stats.o2bspc;
613 regs_buff[554] = adapter->stats.b2ogprc;
607} 614}
608 615
609static int igb_get_eeprom_len(struct net_device *netdev) 616static int igb_get_eeprom_len(struct net_device *netdev)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index eef380af0537..3666b967846a 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -4560,6 +4560,15 @@ void igb_update_stats(struct igb_adapter *adapter,
4560 adapter->stats.mgptc += rd32(E1000_MGTPTC); 4560 adapter->stats.mgptc += rd32(E1000_MGTPTC);
4561 adapter->stats.mgprc += rd32(E1000_MGTPRC); 4561 adapter->stats.mgprc += rd32(E1000_MGTPRC);
4562 adapter->stats.mgpdc += rd32(E1000_MGTPDC); 4562 adapter->stats.mgpdc += rd32(E1000_MGTPDC);
4563
4564 /* OS2BMC Stats */
4565 reg = rd32(E1000_MANC);
4566 if (reg & E1000_MANC_EN_BMC2OS) {
4567 adapter->stats.o2bgptc += rd32(E1000_O2BGPTC);
4568 adapter->stats.o2bspc += rd32(E1000_O2BSPC);
4569 adapter->stats.b2ospc += rd32(E1000_B2OSPC);
4570 adapter->stats.b2ogprc += rd32(E1000_B2OGPRC);
4571 }
4563} 4572}
4564 4573
4565static irqreturn_t igb_msix_other(int irq, void *data) 4574static irqreturn_t igb_msix_other(int irq, void *data)