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

Koen Zandberg notifications at github.com
Wed Jun 5 16:58:18 CEST 2019


bergzand commented on this pull request.



> +    cdcecm->notif = USBUS_CDCECM_NOTIF_LINK_UP;
+}
+
+static const usbus_handler_driver_t cdcecm_driver = {
+    .init = _init,
+    .event_handler = _event_handler,
+    .transfer_handler = _transfer_handler,
+    .setup_handler = _setup_handler,
+};
+
+static void _fill_ethernet(usbus_cdcecm_device_t *cdcecm)
+{
+    uint8_t ethernet[ETHERNET_ADDR_LEN];
+
+    luid_get(ethernet, ETHERNET_ADDR_LEN);
+    ethernet[0] |= 0x02;        /* locally administered address */

Taken from [here](https://github.com/RIOT-OS/RIOT/blob/master/drivers/enc28j60/enc28j60.c#L430), forces the ethernet mac locally administrated bit on as the MAC address is generated by the LUID module.

-- 
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/11077#discussion_r290784191
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190605/e25a0c39/attachment.html>


More information about the notifications mailing list