[riot-notifications] [RIOT-OS/RIOT] usbus: Add CDC-ECM (Ethernet Control Model) function (#11077)

Koen Zandberg notifications at github.com
Wed Jun 5 17:03:17 CEST 2019

bergzand commented on this pull request.

> +    if (max_len && buf == NULL) {
+        _signal_rx_flush(cdcecm);
+        return cdcecm->len;
+    }
+    memcpy(buf, cdcecm->in_buf, max_len);
+    _signal_rx_flush(cdcecm);
+    return max_len;
+static int _init(netdev_t *netdev)
+    usbus_cdcecm_device_t *cdcecm = _netdev_to_cdcecm(netdev);
+    luid_get(cdcecm->mac_netdev, ETHERNET_ADDR_LEN);
+    cdcecm->mac_netdev[0] |= 0x02;      /* locally administered address */
+    cdcecm->mac_netdev[0] &= ~0x01;     /* unicast address */

Same as above, but now for the ethernet address on the host side

To explain, with ECM, we simulate a point to point link, on one side the host computer, on the other side the RIOT network interface. Both sides of the virtual network cable require a link layer address and with ECM the device specifies the host side link layer address via a descriptor. 

This bit generates and clamps the generated link layer address for the host side to indicate a locally administrated unicast link layer address.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190605/788131af/attachment.html>

More information about the notifications mailing list