Commit d56fc319 authored by Benoit Rat's avatar Benoit Rat

using timespec64 to compile for kernel 5.15

parent 76dbb335
......@@ -18,6 +18,7 @@
#include <linux/spinlock.h>
#include <linux/net_tstamp.h>
#include <linux/version.h>
#include <linux/time.h>
#include <asm/unaligned.h>
#include "wr-nic.h"
......@@ -367,7 +368,7 @@ static void __wrn_rx_descriptor(struct wrn_dev *wrn, int desc)
int epnum, off, len;
u32 ts_r, ts_f;
struct skb_shared_hwtstamps *hwts;
struct timespec ts;
struct timespec64 ts;
u32 counter_ppsg; /* PPS generator nanosecond counter */
u32 utc;
s32 cntr_diff;
......@@ -434,7 +435,7 @@ static void __wrn_rx_descriptor(struct wrn_dev *wrn, int desc)
ts.tv_sec |= 0x80000000;
ts.tv_nsec = ts_r * NSEC_PER_TICK;
pr_debug("Timestamp: %li:%li, ahead = %d\n",
pr_debug("Timestamp: %lli:%li, ahead = %d\n",
ts.tv_sec & 0x7fffffff,
ts.tv_nsec & 0x7fffffff,
ts.tv_sec & 0x80000000 ? 1 : 0);
......@@ -448,7 +449,7 @@ static void __wrn_rx_descriptor(struct wrn_dev *wrn, int desc)
/* If the timestamp was reported as incorrect, pass 0 instead */
if (!(r1 & NIC_RX1_D1_TS_INCORRECT)) {
hwts = skb_hwtstamps(skb);
hwts->hwtstamp = timespec_to_ktime(ts);
hwts->hwtstamp = timespec64_to_ktime(ts);
}
skb->protocol = eth_type_trans(skb, dev);
......
......@@ -21,7 +21,7 @@ void wrn_tx_tstamp_skb(struct wrn_dev *wrn, int desc)
struct skb_shared_hwtstamps *hwts;
struct wrn_desc_pending *d = wrn->skb_desc + desc;
struct sk_buff *skb = d->skb;
struct timespec ts;
struct timespec64 ts;
u32 counter_ppsg; /* PPS generator nanosecond counter */
u32 utc;
......@@ -39,7 +39,7 @@ void wrn_tx_tstamp_skb(struct wrn_dev *wrn, int desc)
ts.tv_nsec = d->cycles * NSEC_PER_TICK;
if (!(d->valid & TS_INVALID)) {
hwts = skb_hwtstamps(skb);
hwts->hwtstamp = timespec_to_ktime(ts);
hwts->hwtstamp = timespec64_to_ktime(ts);
skb_tstamp_tx(skb, hwts);
}
dev_kfree_skb_irq(skb);
......@@ -55,7 +55,7 @@ static int record_tstamp(struct wrn_dev *wrn, u32 tsval, u32 idreg, u32 r2)
int frame_id = TXTSU_TSF_R1_FID_R(idreg);
int ts_incorrect = r2 & TXTSU_TSF_R2_INCORRECT;
struct skb_shared_hwtstamps *hwts;
struct timespec ts;
struct timespec64 ts;
struct sk_buff *skb;
u32 utc, counter_ppsg; /* PPS generator nanosecond counter */
int i;
......@@ -84,7 +84,7 @@ static int record_tstamp(struct wrn_dev *wrn, u32 tsval, u32 idreg, u32 r2)
/* Provide the timestamp only if 100% sure about its correctness */
if (!ts_incorrect) {
hwts = skb_hwtstamps(skb);
hwts->hwtstamp = timespec_to_ktime(ts);
hwts->hwtstamp = timespec64_to_ktime(ts);
skb_tstamp_tx(skb, hwts);
}
dev_kfree_skb_irq(skb);
......
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