summaryrefslogtreecommitdiff
path: root/src/class/net/net_device.h
diff options
context:
space:
mode:
authorPeter Lawrence <[email protected]>2021-08-03 11:28:44 -0500
committerPeter Lawrence <[email protected]>2021-09-25 17:05:58 -0500
commit03d7988df3f491515389751a8cf4baecafb155fc (patch)
tree4bafbe8ff80854c387b90afc7414c20495632a1d /src/class/net/net_device.h
parent958cf2cfbaf1ddb67f31ff5920630304189d7c0c (diff)
add NCM driver in a compatible manner : hathach/tinyusb#550
Diffstat (limited to 'src/class/net/net_device.h')
-rw-r--r--src/class/net/net_device.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/class/net/net_device.h b/src/class/net/net_device.h
index f030f3077..e6cdc8b8b 100644
--- a/src/class/net/net_device.h
+++ b/src/class/net/net_device.h
@@ -38,6 +38,22 @@
#define CFG_TUD_NET_MTU 1514
#endif
+#ifndef CFG_TUD_NCM_IN_NTB_MAX_SIZE
+#define CFG_TUD_NCM_IN_NTB_MAX_SIZE 3200
+#endif
+
+#ifndef CFG_TUD_NCM_OUT_NTB_MAX_SIZE
+#define CFG_TUD_NCM_OUT_NTB_MAX_SIZE 3200
+#endif
+
+#ifndef CFG_TUD_NCM_MAX_DATAGRAMS_PER_NTB
+#define CFG_TUD_NCM_MAX_DATAGRAMS_PER_NTB 8
+#endif
+
+#ifndef CFG_TUD_NCM_ALIGNMENT
+#define CFG_TUD_NCM_ALIGNMENT 4
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -63,11 +79,14 @@ extern const uint8_t tud_network_mac_address[6];
void tud_network_recv_renew(void);
// poll network driver for its ability to accept another packet to transmit
-bool tud_network_can_xmit(void);
+bool tud_network_can_xmit(uint16_t size);
// if network_can_xmit() returns true, network_xmit() can be called once
void tud_network_xmit(void *ref, uint16_t arg);
+// callback to client providing optional indication of internal state of network driver
+void tud_network_link_state_cb(bool state);
+
//--------------------------------------------------------------------+
// INTERNAL USBD-CLASS DRIVER API
//--------------------------------------------------------------------+