Commit dae8d308 authored by Jacob Keller's avatar Jacob Keller Committed by Thadeu Lima de Souza Cascardo

igb: implement igb_ptp_suspend

BugLink: http://bugs.launchpad.net/bugs/1662763

Make igb_ptp_stop take advantage of this new function to reduce code
duplication.
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit e3f2350d)
Signed-off-by: default avatarAceLan Kao <acelan.kao@canonical.com>
Acked-by: default avatarTim Gardner <tim.gardner@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
parent dda4a1d8
...@@ -536,6 +536,7 @@ void igb_set_fw_version(struct igb_adapter *); ...@@ -536,6 +536,7 @@ void igb_set_fw_version(struct igb_adapter *);
void igb_ptp_init(struct igb_adapter *adapter); void igb_ptp_init(struct igb_adapter *adapter);
void igb_ptp_stop(struct igb_adapter *adapter); void igb_ptp_stop(struct igb_adapter *adapter);
void igb_ptp_reset(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_hang(struct igb_adapter *adapter);
void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb); 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, void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,
......
...@@ -1124,12 +1124,13 @@ void igb_ptp_init(struct igb_adapter *adapter) ...@@ -1124,12 +1124,13 @@ void igb_ptp_init(struct igb_adapter *adapter)
} }
/** /**
* igb_ptp_stop - Disable PTP device and stop the overflow check. * igb_ptp_suspend - Disable PTP work items and prepare for suspend
* @adapter: Board private structure. * @adapter: Board private structure
* *
* This function stops the PTP support and cancels the delayed work. * This function stops the overflow check work and PTP Tx timestamp work, and
**/ * will prepare the device for OS suspend.
void igb_ptp_stop(struct igb_adapter *adapter) */
void igb_ptp_suspend(struct igb_adapter *adapter)
{ {
switch (adapter->hw.mac.type) { switch (adapter->hw.mac.type) {
case e1000_82576: case e1000_82576:
...@@ -1152,6 +1153,17 @@ void igb_ptp_stop(struct igb_adapter *adapter) ...@@ -1152,6 +1153,17 @@ void igb_ptp_stop(struct igb_adapter *adapter)
adapter->ptp_tx_skb = NULL; adapter->ptp_tx_skb = NULL;
clear_bit_unlock(__IGB_PTP_TX_IN_PROGRESS, &adapter->state); 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) { if (adapter->ptp_clock) {
ptp_clock_unregister(adapter->ptp_clock); ptp_clock_unregister(adapter->ptp_clock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment