if(!RX_DESC_VALID(desc_hdr))/* invalid descriptor? Weird, the RX_ADDR seems to be saying something different. Ignore the packet and purge the RX buffer. */
if(!RX_DESC_VALID(desc_hdr)){
{
/*
dev_info(nic->dev,"%s: weird, invalid RX descriptor (%x, head %x)",__func__,desc_hdr,(unsignedint)rx_head-1);
* invalid descriptor? Weird, the RX_ADDR seems
* to be saying something different. Ignore the packet
// fixme: we need to pass the phase value somehow for RX timestamps. For the time being, we pass the R-F counter difference on the MSB of UTC (instead of sign value), so the PTP can detect the valid counter
/* fixme: we need to pass the phase value somehow
* for RX timestamps. For the time being, we pass
* the R-F counter difference on the MSB of UTC
hwts->hwtstamp.tv.sec=(s32)utc&0x7fffffff;
* (instead of sign value), so the PTP can detect
* the valid counter
*/
hwts->hwtstamp.tv.sec=(s32)utc&0x7fffffff;
cntr_diff=(counter_r&F_COUNTER_MASK)-counter_f;
cntr_diff=(counter_r&F_COUNTER_MASK)-counter_f;
/* the bit says the rising edge cnter is 1tick ahead */
if(cntr_diff==1||cntr_diff==(-F_COUNTER_MASK))
if(cntr_diff==1||cntr_diff==(-F_COUNTER_MASK))
hwts->hwtstamp.tv.sec|=0x80000000;// indicated that the rising edge counter is one tick ahead
hwts->hwtstamp.tv.sec|=0x80000000;
hwts->hwtstamp.tv.nsec=counter_r*8;
hwts->hwtstamp.tv.nsec=counter_r*8;
}
}
...
@@ -398,16 +414,12 @@ static int minic_rx_frame(struct wr_minic *nic)
...
@@ -398,16 +414,12 @@ static int minic_rx_frame(struct wr_minic *nic)