aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/igb_ethtool.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index aa05f00966e2..65c538f8ab1d 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -1123,32 +1123,36 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
1123 *data = 0; 1123 *data = 0;
1124 1124
1125 /* Hook up test interrupt handler just for this test */ 1125 /* Hook up test interrupt handler just for this test */
1126 if (adapter->msix_entries) 1126 if (adapter->msix_entries) {
1127 /* NOTE: we don't test MSI-X interrupts here, yet */ 1127 if (request_irq(adapter->msix_entries[0].vector,
1128 return 0; 1128 &igb_test_intr, 0, netdev->name, adapter)) {
1129 *data = 1;
1130 return -1;
1131 }
1129 1132
1130 if (adapter->flags & IGB_FLAG_HAS_MSI) { 1133 } else if (adapter->flags & IGB_FLAG_HAS_MSI) {
1131 shared_int = false; 1134 shared_int = false;
1132 if (request_irq(irq, &igb_test_intr, 0, netdev->name, netdev)) { 1135 if (request_irq(irq,
1136 &igb_test_intr, 0, netdev->name, adapter)) {
1133 *data = 1; 1137 *data = 1;
1134 return -1; 1138 return -1;
1135 } 1139 }
1136 } else if (!request_irq(irq, &igb_test_intr, IRQF_PROBE_SHARED, 1140 } else if (!request_irq(irq, &igb_test_intr, IRQF_PROBE_SHARED,
1137 netdev->name, netdev)) { 1141 netdev->name, adapter)) {
1138 shared_int = false; 1142 shared_int = false;
1139 } else if (request_irq(irq, &igb_test_intr, IRQF_SHARED, 1143 } else if (request_irq(irq, &igb_test_intr, IRQF_SHARED,
1140 netdev->name, netdev)) { 1144 netdev->name, adapter)) {
1141 *data = 1; 1145 *data = 1;
1142 return -1; 1146 return -1;
1143 } 1147 }
1144 dev_info(&adapter->pdev->dev, "testing %s interrupt\n", 1148 dev_info(&adapter->pdev->dev, "testing %s interrupt\n",
1145 (shared_int ? "shared" : "unshared")); 1149 (shared_int ? "shared" : "unshared"));
1146 /* Disable all the interrupts */ 1150 /* Disable all the interrupts */
1147 wr32(E1000_IMC, 0xFFFFFFFF); 1151 wr32(E1000_IMC, ~0);
1148 msleep(10); 1152 msleep(10);
1149 1153
1150 /* Define all writable bits for ICS */ 1154 /* Define all writable bits for ICS */
1151 switch(hw->mac.type) { 1155 switch (hw->mac.type) {
1152 case e1000_82575: 1156 case e1000_82575:
1153 ics_mask = 0x37F47EDD; 1157 ics_mask = 0x37F47EDD;
1154 break; 1158 break;
@@ -1238,7 +1242,10 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
1238 msleep(10); 1242 msleep(10);
1239 1243
1240 /* Unhook test interrupt handler */ 1244 /* Unhook test interrupt handler */
1241 free_irq(irq, netdev); 1245 if (adapter->msix_entries)
1246 free_irq(adapter->msix_entries[0].vector, adapter);
1247 else
1248 free_irq(irq, adapter);
1242 1249
1243 return *data; 1250 return *data;
1244} 1251}