summaryrefslogtreecommitdiff
path: root/src/device/usbd.c
diff options
context:
space:
mode:
authorPeter Lawrence <[email protected]>2020-03-02 21:15:01 -0600
committerPeter Lawrence <[email protected]>2020-03-02 21:15:01 -0600
commitfee79d746604f671483f5872337ea366f2d2c1a2 (patch)
treeee71a19c377efb01ec3891eb01ae86f0c4a76420 /src/device/usbd.c
parent43025b2ae395b6f3c3ed725e3c4b31f15786d65e (diff)
add CDC-ECM/RNDIS/CDC-EEM network device class with example
Diffstat (limited to 'src/device/usbd.c')
-rw-r--r--src/device/usbd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 68c5c5160..32a89889e 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -181,6 +181,24 @@ static usbd_class_driver_t const _usbd_driver[] =
.sof = NULL
},
#endif
+
+ #if CFG_TUD_NET
+ {
+ .class_code =
+#if CFG_TUD_NET == OPT_NET_RNDIS
+ TUD_RNDIS_ITF_CLASS,
+#else
+ TUSB_CLASS_CDC,
+#endif
+ .init = netd_init,
+ .reset = netd_reset,
+ .open = netd_open,
+ .control_request = netd_control_request,
+ .control_complete = netd_control_complete,
+ .xfer_cb = netd_xfer_cb,
+ .sof = NULL
+ },
+ #endif
};
enum { USBD_CLASS_DRIVER_COUNT = TU_ARRAY_SIZE(_usbd_driver) };