diff options
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e/ptp.c')
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/ptp.c | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c index 065f8c80d4f2..fb1a914a3ad4 100644 --- a/drivers/net/ethernet/intel/e1000e/ptp.c +++ b/drivers/net/ethernet/intel/e1000e/ptp.c | |||
@@ -1,30 +1,23 @@ | |||
1 | /******************************************************************************* | 1 | /* Intel PRO/1000 Linux driver |
2 | 2 | * Copyright(c) 1999 - 2014 Intel Corporation. | |
3 | Intel PRO/1000 Linux driver | 3 | * |
4 | Copyright(c) 1999 - 2013 Intel Corporation. | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | 5 | * under the terms and conditions of the GNU General Public License, | |
6 | This program is free software; you can redistribute it and/or modify it | 6 | * version 2, as published by the Free Software Foundation. |
7 | under the terms and conditions of the GNU General Public License, | 7 | * |
8 | version 2, as published by the Free Software Foundation. | 8 | * This program is distributed in the hope it will be useful, but WITHOUT |
9 | 9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
10 | This program is distributed in the hope it will be useful, but WITHOUT | 10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 11 | * more details. |
12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 12 | * |
13 | more details. | 13 | * The full GNU General Public License is included in this distribution in |
14 | 14 | * the file called "COPYING". | |
15 | You should have received a copy of the GNU General Public License along with | 15 | * |
16 | this program; if not, write to the Free Software Foundation, Inc., | 16 | * Contact Information: |
17 | 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | 17 | * Linux NICS <linux.nics@intel.com> |
18 | 18 | * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> | |
19 | The full GNU General Public License is included in this distribution in | 19 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
20 | the file called "COPYING". | 20 | */ |
21 | |||
22 | Contact Information: | ||
23 | Linux NICS <linux.nics@intel.com> | ||
24 | e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> | ||
25 | Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
26 | |||
27 | *******************************************************************************/ | ||
28 | 21 | ||
29 | /* PTP 1588 Hardware Clock (PHC) | 22 | /* PTP 1588 Hardware Clock (PHC) |
30 | * Derived from PTP Hardware Clock driver for Intel 82576 and 82580 (igb) | 23 | * Derived from PTP Hardware Clock driver for Intel 82576 and 82580 (igb) |
@@ -47,6 +40,7 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) | |||
47 | ptp_clock_info); | 40 | ptp_clock_info); |
48 | struct e1000_hw *hw = &adapter->hw; | 41 | struct e1000_hw *hw = &adapter->hw; |
49 | bool neg_adj = false; | 42 | bool neg_adj = false; |
43 | unsigned long flags; | ||
50 | u64 adjustment; | 44 | u64 adjustment; |
51 | u32 timinca, incvalue; | 45 | u32 timinca, incvalue; |
52 | s32 ret_val; | 46 | s32 ret_val; |
@@ -64,6 +58,8 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) | |||
64 | if (ret_val) | 58 | if (ret_val) |
65 | return ret_val; | 59 | return ret_val; |
66 | 60 | ||
61 | spin_lock_irqsave(&adapter->systim_lock, flags); | ||
62 | |||
67 | incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK; | 63 | incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK; |
68 | 64 | ||
69 | adjustment = incvalue; | 65 | adjustment = incvalue; |
@@ -77,6 +73,8 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta) | |||
77 | 73 | ||
78 | ew32(TIMINCA, timinca); | 74 | ew32(TIMINCA, timinca); |
79 | 75 | ||
76 | spin_unlock_irqrestore(&adapter->systim_lock, flags); | ||
77 | |||
80 | return 0; | 78 | return 0; |
81 | } | 79 | } |
82 | 80 | ||
@@ -191,6 +189,7 @@ static const struct ptp_clock_info e1000e_ptp_clock_info = { | |||
191 | .n_alarm = 0, | 189 | .n_alarm = 0, |
192 | .n_ext_ts = 0, | 190 | .n_ext_ts = 0, |
193 | .n_per_out = 0, | 191 | .n_per_out = 0, |
192 | .n_pins = 0, | ||
194 | .pps = 0, | 193 | .pps = 0, |
195 | .adjfreq = e1000e_phc_adjfreq, | 194 | .adjfreq = e1000e_phc_adjfreq, |
196 | .adjtime = e1000e_phc_adjtime, | 195 | .adjtime = e1000e_phc_adjtime, |