All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH v4 1/5] igb: introduce ptp_flags variable and use it to replace IGB_FLAG_PTP
@ 2016-05-24 20:56 Jacob Keller
  2016-05-24 20:56 ` [Intel-wired-lan] [PATCH v4 2/5] igb: introduce IGB_PTP_OVERFLOW_CHECK flag Jacob Keller
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Jacob Keller @ 2016-05-24 20:56 UTC (permalink / raw)
  To: intel-wired-lan

Upcoming patches will introduce new PTP specific flags. To avoid
cluttering the normal flags variable, introduce PTP specific "ptp_flags"
variable for this purpose, and move IGB_FLAG_PTP to become
IGB_PTP_ENABLED.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/igb/igb.h     | 5 ++++-
 drivers/net/ethernet/intel/igb/igb_ptp.c | 7 ++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index b9609afa5ca3..1e18a9eb16e0 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -445,6 +445,7 @@ struct igb_adapter {
 	unsigned long ptp_tx_start;
 	unsigned long last_rx_ptp_check;
 	unsigned long last_rx_timestamp;
+	unsigned int ptp_flags;
 	spinlock_t tmreg_lock;
 	struct cyclecounter cc;
 	struct timecounter tc;
@@ -474,12 +475,14 @@ struct igb_adapter {
 	u16 eee_advert;
 };
 
+/* flags controlling PTP/1588 function */
+#define IGB_PTP_ENABLED		BIT(0)
+
 #define IGB_FLAG_HAS_MSI		BIT(0)
 #define IGB_FLAG_DCA_ENABLED		BIT(1)
 #define IGB_FLAG_QUAD_PORT_A		BIT(2)
 #define IGB_FLAG_QUEUE_PAIRS		BIT(3)
 #define IGB_FLAG_DMAC			BIT(4)
-#define IGB_FLAG_PTP			BIT(5)
 #define IGB_FLAG_RSS_FIELD_IPV4_UDP	BIT(6)
 #define IGB_FLAG_RSS_FIELD_IPV6_UDP	BIT(7)
 #define IGB_FLAG_WOL_SUPPORTED		BIT(8)
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index f097c5a8ab93..504102ba4bfb 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -684,6 +684,7 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter)
 	u32 tsyncrxctl = rd32(E1000_TSYNCRXCTL);
 	unsigned long rx_event;
 
+	/* Other hardware uses per-packet timestamps */
 	if (hw->mac.type != e1000_82576)
 		return;
 
@@ -1156,7 +1157,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
 	} else {
 		dev_info(&adapter->pdev->dev, "added PHC on %s\n",
 			 adapter->netdev->name);
-		adapter->flags |= IGB_FLAG_PTP;
+		adapter->ptp_flags |= IGB_PTP_ENABLED;
 	}
 }
 
@@ -1194,7 +1195,7 @@ void igb_ptp_stop(struct igb_adapter *adapter)
 		ptp_clock_unregister(adapter->ptp_clock);
 		dev_info(&adapter->pdev->dev, "removed PHC on %s\n",
 			 adapter->netdev->name);
-		adapter->flags &= ~IGB_FLAG_PTP;
+		adapter->ptp_flags &= ~IGB_PTP_ENABLED;
 	}
 }
 
@@ -1209,7 +1210,7 @@ void igb_ptp_reset(struct igb_adapter *adapter)
 	struct e1000_hw *hw = &adapter->hw;
 	unsigned long flags;
 
-	if (!(adapter->flags & IGB_FLAG_PTP))
+	if (!(adapter->ptp_flags & IGB_PTP_ENABLED))
 		return;
 
 	/* reset the tstamp_config */
-- 
2.8.2.820.gd1c5f70


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-05-27 22:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-24 20:56 [Intel-wired-lan] [PATCH v4 1/5] igb: introduce ptp_flags variable and use it to replace IGB_FLAG_PTP Jacob Keller
2016-05-24 20:56 ` [Intel-wired-lan] [PATCH v4 2/5] igb: introduce IGB_PTP_OVERFLOW_CHECK flag Jacob Keller
2016-05-27 22:24   ` Brown, Aaron F
2016-05-24 20:56 ` [Intel-wired-lan] [PATCH v4 3/5] igb: re-use igb_ptp_reset in igb_ptp_init Jacob Keller
2016-05-27 22:24   ` Brown, Aaron F
2016-05-24 20:56 ` [Intel-wired-lan] [PATCH v4 4/5] igb: implement igb_ptp_suspend Jacob Keller
2016-05-27 22:24   ` Brown, Aaron F
2016-05-24 20:56 ` [Intel-wired-lan] [PATCH v4 5/5] igb: call igb_ptp_suspend during suspend/resume cycle Jacob Keller
2016-05-27 22:25   ` Brown, Aaron F
2016-05-24 20:57 ` [Intel-wired-lan] [PATCH v4 1/5] igb: introduce ptp_flags variable and use it to replace IGB_FLAG_PTP Keller, Jacob E
2016-05-24 23:37 ` Brown, Aaron F
2016-05-25 20:08   ` Keller, Jacob E
2016-05-27 22:23 ` Brown, Aaron F

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.