aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igb/igb_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2011-08-26 03:46:55 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-10-13 01:46:24 -0400
commit06218a8dbf046c0e9ba51dcbe1ce980a10a0be42 (patch)
treee01d679630a2570f7381a0c16d485826545de3d6 /drivers/net/ethernet/intel/igb/igb_main.c
parentc74d588e2addd9a13cca49a4d9172e0e2948448f (diff)
igb: Fix features that are currently 82580 only and should also be i350
This change allows support for per packet timesync and global device reset on the i350 adapter. These features were supported on both 82580 and i350 however it looks like several checks where not updated and as such the i350 support was not enabled. Signed-off-by: Alexander Duyck <alexander.h.duyck@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/ethernet/intel/igb/igb_main.c')
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index efc367bddc47..fee771b4d332 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -563,7 +563,7 @@ static cycle_t igb_read_clock(const struct cyclecounter *tc)
563 * the lowest register is SYSTIMR instead of SYSTIML. However we never 563 * the lowest register is SYSTIMR instead of SYSTIML. However we never
564 * adjusted TIMINCA so SYSTIMR will just read as all 0s so ignore it. 564 * adjusted TIMINCA so SYSTIMR will just read as all 0s so ignore it.
565 */ 565 */
566 if (hw->mac.type == e1000_82580) { 566 if (hw->mac.type >= e1000_82580) {
567 stamp = rd32(E1000_SYSTIMR) >> 8; 567 stamp = rd32(E1000_SYSTIMR) >> 8;
568 shift = IGB_82580_TSYNC_SHIFT; 568 shift = IGB_82580_TSYNC_SHIFT;
569 } 569 }
@@ -1367,7 +1367,7 @@ static void igb_irq_enable(struct igb_adapter *adapter)
1367 struct e1000_hw *hw = &adapter->hw; 1367 struct e1000_hw *hw = &adapter->hw;
1368 1368
1369 if (adapter->msix_entries) { 1369 if (adapter->msix_entries) {
1370 u32 ims = E1000_IMS_LSC | E1000_IMS_DOUTSYNC; 1370 u32 ims = E1000_IMS_LSC | E1000_IMS_DOUTSYNC | E1000_IMS_DRSTA;
1371 u32 regval = rd32(E1000_EIAC); 1371 u32 regval = rd32(E1000_EIAC);
1372 wr32(E1000_EIAC, regval | adapter->eims_enable_mask); 1372 wr32(E1000_EIAC, regval | adapter->eims_enable_mask);
1373 regval = rd32(E1000_EIAM); 1373 regval = rd32(E1000_EIAM);
@@ -1377,9 +1377,6 @@ static void igb_irq_enable(struct igb_adapter *adapter)
1377 wr32(E1000_MBVFIMR, 0xFF); 1377 wr32(E1000_MBVFIMR, 0xFF);
1378 ims |= E1000_IMS_VMMB; 1378 ims |= E1000_IMS_VMMB;
1379 } 1379 }
1380 if (adapter->hw.mac.type == e1000_82580)
1381 ims |= E1000_IMS_DRSTA;
1382
1383 wr32(E1000_IMS, ims); 1380 wr32(E1000_IMS, ims);
1384 } else { 1381 } else {
1385 wr32(E1000_IMS, IMS_ENABLE_MASK | 1382 wr32(E1000_IMS, IMS_ENABLE_MASK |
@@ -3112,7 +3109,7 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
3112 srrctl |= (PAGE_SIZE / 2) >> E1000_SRRCTL_BSIZEPKT_SHIFT; 3109 srrctl |= (PAGE_SIZE / 2) >> E1000_SRRCTL_BSIZEPKT_SHIFT;
3113#endif 3110#endif
3114 srrctl |= E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS; 3111 srrctl |= E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS;
3115 if (hw->mac.type == e1000_82580) 3112 if (hw->mac.type >= e1000_82580)
3116 srrctl |= E1000_SRRCTL_TIMESTAMP; 3113 srrctl |= E1000_SRRCTL_TIMESTAMP;
3117 /* Only set Drop Enable if we are supporting multiple queues */ 3114 /* Only set Drop Enable if we are supporting multiple queues */
3118 if (adapter->vfs_allocated_count || adapter->num_rx_queues > 1) 3115 if (adapter->vfs_allocated_count || adapter->num_rx_queues > 1)
@@ -4463,7 +4460,7 @@ static void igb_tx_timeout(struct net_device *netdev)
4463 /* Do the reset outside of interrupt context */ 4460 /* Do the reset outside of interrupt context */
4464 adapter->tx_timeout_count++; 4461 adapter->tx_timeout_count++;
4465 4462
4466 if (hw->mac.type == e1000_82580) 4463 if (hw->mac.type >= e1000_82580)
4467 hw->dev_spec._82575.global_device_reset = true; 4464 hw->dev_spec._82575.global_device_reset = true;
4468 4465
4469 schedule_work(&adapter->reset_task); 4466 schedule_work(&adapter->reset_task);
@@ -5581,7 +5578,7 @@ static void igb_systim_to_hwtstamp(struct igb_adapter *adapter,
5581 * The 82580 starts with 1ns at bit 0 in RX/TXSTMPL, shift this up to 5578 * The 82580 starts with 1ns at bit 0 in RX/TXSTMPL, shift this up to
5582 * 24 to match clock shift we setup earlier. 5579 * 24 to match clock shift we setup earlier.
5583 */ 5580 */
5584 if (adapter->hw.mac.type == e1000_82580) 5581 if (adapter->hw.mac.type >= e1000_82580)
5585 regval <<= IGB_82580_TSYNC_SHIFT; 5582 regval <<= IGB_82580_TSYNC_SHIFT;
5586 5583
5587 ns = timecounter_cyc2time(&adapter->clock, regval); 5584 ns = timecounter_cyc2time(&adapter->clock, regval);
@@ -6276,7 +6273,7 @@ static int igb_hwtstamp_ioctl(struct net_device *netdev,
6276 * timestamped, so enable timestamping in all packets as 6273 * timestamped, so enable timestamping in all packets as
6277 * long as one rx filter was configured. 6274 * long as one rx filter was configured.
6278 */ 6275 */
6279 if ((hw->mac.type == e1000_82580) && tsync_rx_ctl) { 6276 if ((hw->mac.type >= e1000_82580) && tsync_rx_ctl) {
6280 tsync_rx_ctl = E1000_TSYNCRXCTL_ENABLED; 6277 tsync_rx_ctl = E1000_TSYNCRXCTL_ENABLED;
6281 tsync_rx_ctl |= E1000_TSYNCRXCTL_TYPE_ALL; 6278 tsync_rx_ctl |= E1000_TSYNCRXCTL_TYPE_ALL;
6282 } 6279 }