Commit 925e35bd authored by Tomasz Wlostowski's avatar Tomasz Wlostowski Committed by Alessandro Rubini

NIC: PPSG/nanosecond part merging bufix

parent ec9fa52e
......@@ -324,7 +324,7 @@ static void __wrn_rx_descriptor(struct wrn_dev *wrn, int desc)
wrn_ppsg_read_time(wrn, &counter_ppsg, &utc);
if(counter_ppsg < ts_r)
if(counter_ppsg < REFCLK_FREQ/4 && ts_r > 3*REFCLK_FREQ/4)
utc--;
hwts->hwtstamp.tv.sec = (s32)utc & 0x7fffffff;
......
......@@ -14,6 +14,8 @@
/* Our host CPU is this one, no way out of it */
#include <mach/at91sam9263.h>
#define REFCLK_FREQ 125000000
/* The interrupt is one of those managed by our WRVIC device */
#define WRN_IRQ_BASE 192
#define WRN_IRQ_PPSG (WRN_IRQ_BASE + 0)
......
......@@ -38,7 +38,7 @@ void wrn_tstamp_find_skb(struct wrn_dev *wrn, int desc)
/* so we found the skb, do the timestamping magic */
hwts = skb_hwtstamps(skb);
wrn_ppsg_read_time(wrn, &counter_ppsg, &utc);
if(counter_ppsg < wrn->ts_buf[i].ts)
if(counter_ppsg > 3*REFCLK_FREQ/4 && wrn->ts_buf[i].ts < REFCLK_FREQ/4)
utc--;
hwts->hwtstamp.tv.sec = (s32)utc & 0x7fffffff;
......@@ -61,8 +61,8 @@ static int record_tstamp(struct wrn_dev *wrn, u32 ts, u32 idreg)
u32 utc, counter_ppsg; /* PPS generator nanosecond counter */
int i; /* FIXME: use list for faster access */
printk("%s: Got TS: %x pid %d fid %d\n", __func__,
ts, port_id, frame_id);
/*printk("%s: Got TS: %x pid %d fid %d\n", __func__,
ts, port_id, frame_id);*/
/* First of all look if the skb is already pending */
for (i = 0; i < WRN_NR_DESC; i++)
......@@ -70,7 +70,7 @@ static int record_tstamp(struct wrn_dev *wrn, u32 ts, u32 idreg)
break;
if (i < WRN_NR_DESC) {
printk("%s: found\n", __func__);
/*printk("%s: found\n", __func__);*/
skb = wrn->skb_desc[i].skb;
hwts = skb_hwtstamps(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