ptp: ixgbe: convert to the 64 bit get/set time methods.
authorRichard Cochran <richardcochran@gmail.com>
Sun, 29 Mar 2015 21:12:04 +0000 (23:12 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Mar 2015 16:01:18 +0000 (12:01 -0400)
This driver's clock is implemented using a timecounter, and so with
this patch the driver is ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c

index bd46f5d1c943b0aa674bd619b5df67dc9aa58d33..75b9e938728d61b765b13b86c41d440f12f76c85 100644 (file)
@@ -279,7 +279,7 @@ static int ixgbe_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
  * read the timecounter and return the correct value on ns,
  * after converting it into a struct timespec.
  */
-static int ixgbe_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
+static int ixgbe_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
 {
        struct ixgbe_adapter *adapter =
                container_of(ptp, struct ixgbe_adapter, ptp_caps);
@@ -306,7 +306,7 @@ static int ixgbe_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
  * wall timer value.
  */
 static int ixgbe_ptp_settime(struct ptp_clock_info *ptp,
-                            const struct timespec *ts)
+                            const struct timespec64 *ts)
 {
        struct ixgbe_adapter *adapter =
                container_of(ptp, struct ixgbe_adapter, ptp_caps);
@@ -407,7 +407,7 @@ void ixgbe_ptp_overflow_check(struct ixgbe_adapter *adapter)
 {
        bool timeout = time_is_before_jiffies(adapter->last_overflow_check +
                                             IXGBE_OVERFLOW_PERIOD);
-       struct timespec ts;
+       struct timespec64 ts;
 
        if (timeout) {
                ixgbe_ptp_gettime(&adapter->ptp_caps, &ts);
@@ -874,8 +874,8 @@ static int ixgbe_ptp_create_clock(struct ixgbe_adapter *adapter)
                adapter->ptp_caps.pps = 1;
                adapter->ptp_caps.adjfreq = ixgbe_ptp_adjfreq;
                adapter->ptp_caps.adjtime = ixgbe_ptp_adjtime;
-               adapter->ptp_caps.gettime = ixgbe_ptp_gettime;
-               adapter->ptp_caps.settime = ixgbe_ptp_settime;
+               adapter->ptp_caps.gettime64 = ixgbe_ptp_gettime;
+               adapter->ptp_caps.settime64 = ixgbe_ptp_settime;
                adapter->ptp_caps.enable = ixgbe_ptp_feature_enable;
                break;
        case ixgbe_mac_82599EB:
@@ -890,8 +890,8 @@ static int ixgbe_ptp_create_clock(struct ixgbe_adapter *adapter)
                adapter->ptp_caps.pps = 0;
                adapter->ptp_caps.adjfreq = ixgbe_ptp_adjfreq;
                adapter->ptp_caps.adjtime = ixgbe_ptp_adjtime;
-               adapter->ptp_caps.gettime = ixgbe_ptp_gettime;
-               adapter->ptp_caps.settime = ixgbe_ptp_settime;
+               adapter->ptp_caps.gettime64 = ixgbe_ptp_gettime;
+               adapter->ptp_caps.settime64 = ixgbe_ptp_settime;
                adapter->ptp_caps.enable = ixgbe_ptp_feature_enable;
                break;
        default: