[riot-notifications] [RIOT-OS/RIOT] drivers/stm32_eth: add RX timestamps (#15610)

benpicco notifications at github.com
Mon Jan 25 22:48:26 CET 2021


@benpicco commented on this pull request.



> -        rx_curr = rx_curr->desc_next;
-    }
-
-    if ((size + ETHERNET_FCS_LEN - 1) % ETH_RX_BUFFER_SIZE < ETHERNET_FCS_LEN) {
-        /* one additional rx descriptor was needed only for the FCS, hand that
-         * back to the DMA as well */
+    while (1) {
+        /* there can be more DMA descriptors than needed for holding the Ethernet
+         * payload, as the 4 byte FCS will also be stored by DMA */
+        if (remain) {
+            size_t chunk = MIN(remain, ETH_RX_BUFFER_SIZE);
+            memcpy(buf, rx_curr->buffer_addr, chunk);
+            buf += chunk;
+            remain -= chunk;
+        }
+        if (rx_curr->status & RX_DESC_STAT_LS) {

Just add a short note, makes this block easier to understand on the first read.
(you can squash directly) 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15610#discussion_r564066203
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210125/a9352ac0/attachment-0001.htm>


More information about the notifications mailing list