]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
igb: implement igb_ptp_suspend
authorJacob Keller <jacob.e.keller@intel.com>
Mon, 13 Feb 2017 02:12:10 +0000 (10:12 +0800)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Wed, 8 Mar 2017 13:35:47 +0000 (10:35 -0300)
BugLink: http://bugs.launchpad.net/bugs/1662763
Make igb_ptp_stop take advantage of this new function to reduce code
duplication.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit e3f2350de829eb0c3349f416feed81c0a3ac0732)
Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/net/ethernet/intel/igb/igb.h
drivers/net/ethernet/intel/igb/igb_ptp.c

index 707ae5c297eabd8fa52c57fc27255c7778173e9b..5077c4d3219f7f60f7b8af768acb8144da8c4a3c 100644 (file)
@@ -536,6 +536,7 @@ void igb_set_fw_version(struct igb_adapter *);
 void igb_ptp_init(struct igb_adapter *adapter);
 void igb_ptp_stop(struct igb_adapter *adapter);
 void igb_ptp_reset(struct igb_adapter *adapter);
+void igb_ptp_suspend(struct igb_adapter *adapter);
 void igb_ptp_rx_hang(struct igb_adapter *adapter);
 void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb);
 void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,
index c44df87c38de233578c531e13ea7cb9ef211ceb7..5314f9f6e5d0d60ae4ef99d369e65d05a869deea 100644 (file)
@@ -1124,12 +1124,13 @@ void igb_ptp_init(struct igb_adapter *adapter)
 }
 
 /**
- * igb_ptp_stop - Disable PTP device and stop the overflow check.
- * @adapter: Board private structure.
+ * igb_ptp_suspend - Disable PTP work items and prepare for suspend
+ * @adapter: Board private structure
  *
- * This function stops the PTP support and cancels the delayed work.
- **/
-void igb_ptp_stop(struct igb_adapter *adapter)
+ * This function stops the overflow check work and PTP Tx timestamp work, and
+ * will prepare the device for OS suspend.
+ */
+void igb_ptp_suspend(struct igb_adapter *adapter)
 {
        switch (adapter->hw.mac.type) {
        case e1000_82576:
@@ -1152,6 +1153,17 @@ void igb_ptp_stop(struct igb_adapter *adapter)
                adapter->ptp_tx_skb = NULL;
                clear_bit_unlock(__IGB_PTP_TX_IN_PROGRESS, &adapter->state);
        }
+}
+
+/**
+ * igb_ptp_stop - Disable PTP device and stop the overflow check.
+ * @adapter: Board private structure.
+ *
+ * This function stops the PTP support and cancels the delayed work.
+ **/
+void igb_ptp_stop(struct igb_adapter *adapter)
+{
+       igb_ptp_suspend(adapter);
 
        if (adapter->ptp_clock) {
                ptp_clock_unregister(adapter->ptp_clock);