aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2010-05-10 10:59:51 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-13 02:31:10 -0400
commitcd791618c28f524598bcfa941d948b1126a2394a (patch)
treeab4de6ffe1f8c278499eb1d69a958eb7b7559942 /drivers
parent11b08be830078c1cc4af484d0f85c3a010319c97 (diff)
e1000e: initialize manageability (IPMI) pass-through in 82574/82583
82574/82583 uses different registers/bits to setup manageability filters than all other parts supported by e1000e; set them accordingly for IPMI pass-through. Rename the function to better reflect what it does. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/e1000e/defines.h5
-rw-r--r--drivers/net/e1000e/hw.h2
-rw-r--r--drivers/net/e1000e/netdev.c57
3 files changed, 55 insertions, 9 deletions
diff --git a/drivers/net/e1000e/defines.h b/drivers/net/e1000e/defines.h
index 7f760aa9efe5..227147f09af2 100644
--- a/drivers/net/e1000e/defines.h
+++ b/drivers/net/e1000e/defines.h
@@ -138,6 +138,11 @@
138/* Enable MNG packets to host memory */ 138/* Enable MNG packets to host memory */
139#define E1000_MANC_EN_MNG2HOST 0x00200000 139#define E1000_MANC_EN_MNG2HOST 0x00200000
140 140
141#define E1000_MANC2H_PORT_623 0x00000020 /* Port 0x26f */
142#define E1000_MANC2H_PORT_664 0x00000040 /* Port 0x298 */
143#define E1000_MDEF_PORT_623 0x00000800 /* Port 0x26f */
144#define E1000_MDEF_PORT_664 0x00000400 /* Port 0x298 */
145
141/* Receive Control */ 146/* Receive Control */
142#define E1000_RCTL_EN 0x00000002 /* enable */ 147#define E1000_RCTL_EN 0x00000002 /* enable */
143#define E1000_RCTL_SBP 0x00000004 /* store bad packet */ 148#define E1000_RCTL_SBP 0x00000004 /* store bad packet */
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index 8bdcd5f24eff..6f66c3721349 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -208,6 +208,8 @@ enum e1e_registers {
208 208
209 E1000_KMRNCTRLSTA = 0x00034, /* MAC-PHY interface - RW */ 209 E1000_KMRNCTRLSTA = 0x00034, /* MAC-PHY interface - RW */
210 E1000_MANC2H = 0x05860, /* Management Control To Host - RW */ 210 E1000_MANC2H = 0x05860, /* Management Control To Host - RW */
211 E1000_MDEF_BASE = 0x05890, /* Management Decision Filters */
212#define E1000_MDEF(_n) (E1000_MDEF_BASE + ((_n) * 4))
211 E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */ 213 E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */
212 E1000_GCR = 0x05B00, /* PCI-Ex Control */ 214 E1000_GCR = 0x05B00, /* PCI-Ex Control */
213 E1000_GCR2 = 0x05B64, /* PCI-Ex Control #2 */ 215 E1000_GCR2 = 0x05B64, /* PCI-Ex Control #2 */
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index ab79bec082f0..36473e6d07d6 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2526,10 +2526,10 @@ static void e1000_restore_vlan(struct e1000_adapter *adapter)
2526 } 2526 }
2527} 2527}
2528 2528
2529static void e1000_init_manageability(struct e1000_adapter *adapter) 2529static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
2530{ 2530{
2531 struct e1000_hw *hw = &adapter->hw; 2531 struct e1000_hw *hw = &adapter->hw;
2532 u32 manc, manc2h; 2532 u32 manc, manc2h, mdef, i, j;
2533 2533
2534 if (!(adapter->flags & FLAG_MNG_PT_ENABLED)) 2534 if (!(adapter->flags & FLAG_MNG_PT_ENABLED))
2535 return; 2535 return;
@@ -2543,10 +2543,49 @@ static void e1000_init_manageability(struct e1000_adapter *adapter)
2543 */ 2543 */
2544 manc |= E1000_MANC_EN_MNG2HOST; 2544 manc |= E1000_MANC_EN_MNG2HOST;
2545 manc2h = er32(MANC2H); 2545 manc2h = er32(MANC2H);
2546#define E1000_MNG2HOST_PORT_623 (1 << 5) 2546
2547#define E1000_MNG2HOST_PORT_664 (1 << 6) 2547 switch (hw->mac.type) {
2548 manc2h |= E1000_MNG2HOST_PORT_623; 2548 default:
2549 manc2h |= E1000_MNG2HOST_PORT_664; 2549 manc2h |= (E1000_MANC2H_PORT_623 | E1000_MANC2H_PORT_664);
2550 break;
2551 case e1000_82574:
2552 case e1000_82583:
2553 /*
2554 * Check if IPMI pass-through decision filter already exists;
2555 * if so, enable it.
2556 */
2557 for (i = 0, j = 0; i < 8; i++) {
2558 mdef = er32(MDEF(i));
2559
2560 /* Ignore filters with anything other than IPMI ports */
2561 if (mdef & !(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
2562 continue;
2563
2564 /* Enable this decision filter in MANC2H */
2565 if (mdef)
2566 manc2h |= (1 << i);
2567
2568 j |= mdef;
2569 }
2570
2571 if (j == (E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
2572 break;
2573
2574 /* Create new decision filter in an empty filter */
2575 for (i = 0, j = 0; i < 8; i++)
2576 if (er32(MDEF(i)) == 0) {
2577 ew32(MDEF(i), (E1000_MDEF_PORT_623 |
2578 E1000_MDEF_PORT_664));
2579 manc2h |= (1 << 1);
2580 j++;
2581 break;
2582 }
2583
2584 if (!j)
2585 e_warn("Unable to create IPMI pass-through filter\n");
2586 break;
2587 }
2588
2550 ew32(MANC2H, manc2h); 2589 ew32(MANC2H, manc2h);
2551 ew32(MANC, manc); 2590 ew32(MANC, manc);
2552} 2591}
@@ -2961,7 +3000,7 @@ static void e1000_configure(struct e1000_adapter *adapter)
2961 e1000_set_multi(adapter->netdev); 3000 e1000_set_multi(adapter->netdev);
2962 3001
2963 e1000_restore_vlan(adapter); 3002 e1000_restore_vlan(adapter);
2964 e1000_init_manageability(adapter); 3003 e1000_init_manageability_pt(adapter);
2965 3004
2966 e1000_configure_tx(adapter); 3005 e1000_configure_tx(adapter);
2967 e1000_setup_rctl(adapter); 3006 e1000_setup_rctl(adapter);
@@ -5104,7 +5143,7 @@ static int __e1000_resume(struct pci_dev *pdev)
5104 5143
5105 e1000e_reset(adapter); 5144 e1000e_reset(adapter);
5106 5145
5107 e1000_init_manageability(adapter); 5146 e1000_init_manageability_pt(adapter);
5108 5147
5109 if (netif_running(netdev)) 5148 if (netif_running(netdev))
5110 e1000e_up(adapter); 5149 e1000e_up(adapter);
@@ -5305,7 +5344,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
5305 struct net_device *netdev = pci_get_drvdata(pdev); 5344 struct net_device *netdev = pci_get_drvdata(pdev);
5306 struct e1000_adapter *adapter = netdev_priv(netdev); 5345 struct e1000_adapter *adapter = netdev_priv(netdev);
5307 5346
5308 e1000_init_manageability(adapter); 5347 e1000_init_manageability_pt(adapter);
5309 5348
5310 if (netif_running(netdev)) { 5349 if (netif_running(netdev)) {
5311 if (e1000e_up(adapter)) { 5350 if (e1000e_up(adapter)) {