@@ -162,12 +162,18 @@ static err_t xcore_ethernetif_linkoutput(struct netif *netif, struct pbuf *p) {
162162
163163 n_bytes = 60 ;
164164 /* Start MAC transmit here */
165- xcore_netif_low_level_output (txbuf , n_bytes );
165+ if (p -> flags & PBUF_FLAG_TX_TIMESTAMP )
166+ p -> timestamp = xcore_netif_low_level_output_timed (txbuf , n_bytes );
167+ else
168+ xcore_netif_low_level_output (txbuf , n_bytes );
166169 } else {
167170 // NOTE: this is not expecting or setup to deal with pbuf chains
168171
169172 /* Start MAC transmit here */
170- xcore_netif_low_level_output (p -> payload , n_bytes );
173+ if (p -> flags & PBUF_FLAG_TX_TIMESTAMP )
174+ p -> timestamp = xcore_netif_low_level_output_timed (p -> payload , n_bytes );
175+ else
176+ xcore_netif_low_level_output (p -> payload , n_bytes );
171177 }
172178
173179#if ETH_PAD_SIZE
@@ -324,12 +330,14 @@ void xcore_timeout(xtcp_lwip_timeout_type timeout) {
324330 * interface.
325331 *
326332 */
327- void ethernetif_input (const uint8_t buffer [], int32_t n_bytes ) {
333+ void ethernetif_input (const uint8_t buffer [], int32_t n_bytes , uint32_t timestamp ) {
328334 /* move received packet into a new pbuf */
329335 struct pbuf * p = xcore_net_low_level_input (buffer , n_bytes );
330336
331337 /* if no packet could be read, silently ignore this */
332338 if (p != NULL ) {
339+ p -> timestamp = timestamp ;
340+
333341 /* pass all packets to ethernet_input, which decides what packets it supports */
334342 if (xcore_netif .input (p , & xcore_netif ) != ERR_OK ) {
335343
0 commit comments