Commit c0e467ab authored by Tomasz Wlostowski's avatar Tomasz Wlostowski Committed by Grzegorz Daniluk

dev/minic.c: mark timed out TX timestamps as invalid

Signed-off-by: Grzegorz Daniluk's avatarGrzegorz Daniluk <grzegorz.daniluk@cern.ch>
parent 8d8a7340
......@@ -338,17 +338,24 @@ int minic_tx_frame(uint8_t * hdr, uint8_t * payload, uint32_t size,
uint32_t nsec;
/* wait for the timestamp */
for (i = 0; i < 1000; ++i) {
for (i = 0; i < 100; ++i) {
mcr = minic_readl(MINIC_REG_MCR);
if ((mcr & MINIC_MCR_TX_TS_READY) != 0) break;
timer_delay(1);
}
if (i == 1000)
ts_valid = 1;
if (i == 100)
{
mprintf("Warning: tx timestamp never became available\n");
ts_valid = 0;
}
ts_valid = (uint8_t)(minic_readl(MINIC_REG_TSR0)
& MINIC_TSR0_VALID);
if(ts_valid)
ts_valid = (uint8_t)(minic_readl(MINIC_REG_TSR0)
& MINIC_TSR0_VALID);
raw_ts = minic_readl(MINIC_REG_TSR1);
fid = MINIC_TSR0_FID_R(minic_readl(MINIC_REG_TSR0));
......
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