aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/netdev.c
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/net/e1000e/netdev.c
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/net/e1000e/netdev.c')
-rw-r--r--drivers/net/e1000e/netdev.c57
1 files changed, 48 insertions, 9 deletions
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)) {