summaryrefslogtreecommitdiff
path: root/src/class/net
diff options
context:
space:
mode:
authorZixun LI <[email protected]>2025-11-25 10:59:43 +0100
committerZixun LI <[email protected]>2025-11-25 10:59:43 +0100
commitdc083e4d9c87658498a3bd0b527d25bc88dd1ed6 (patch)
tree0523e934e5a1b1fe8331b28990ddf2e2f4478077 /src/class/net
parente59b2c40fc9e655918629d73cc8c54b86b4a70c1 (diff)
parentfee2d2a034d65aa625bc1a8b32c3b7a51292a39f (diff)
Merge remote-tracking branch 'tinyusb/master' into n6_build
Signed-off-by: Zixun LI <[email protected]>
Diffstat (limited to 'src/class/net')
-rw-r--r--src/class/net/ecm_rndis_device.c8
-rw-r--r--src/class/net/ncm.h4
-rw-r--r--src/class/net/ncm_device.c14
-rw-r--r--src/class/net/net_device.h13
4 files changed, 20 insertions, 19 deletions
diff --git a/src/class/net/ecm_rndis_device.c b/src/class/net/ecm_rndis_device.c
index 299eb97c8..eaa82c187 100644
--- a/src/class/net/ecm_rndis_device.c
+++ b/src/class/net/ecm_rndis_device.c
@@ -35,8 +35,6 @@
#include "net_device.h"
#include "rndis_protocol.h"
-extern void rndis_class_set_handler(uint8_t *data, int size); /* found in ./misc/networking/rndis_reports.c */
-
#define CFG_TUD_NET_PACKET_PREFIX_LEN sizeof(rndis_data_packet_t)
#define CFG_TUD_NET_PACKET_SUFFIX_LEN 0
@@ -84,12 +82,12 @@ static bool can_xmit;
static bool ecm_link_is_up = true; // Store link state for ECM mode
void tud_network_recv_renew(void) {
- usbd_edpt_xfer(0, _netd_itf.ep_out, _netd_epbuf.rx, NETD_PACKET_SIZE);
+ usbd_edpt_xfer(0, _netd_itf.ep_out, _netd_epbuf.rx, NETD_PACKET_SIZE, false);
}
static void do_in_xfer(uint8_t *buf, uint16_t len) {
can_xmit = false;
- usbd_edpt_xfer(0, _netd_itf.ep_in, buf, len);
+ usbd_edpt_xfer(0, _netd_itf.ep_in, buf, len, false);
}
void netd_report(uint8_t *buf, uint16_t len) {
@@ -102,7 +100,7 @@ void netd_report(uint8_t *buf, uint16_t len) {
}
memcpy(_netd_epbuf.notify, buf, len);
- usbd_edpt_xfer(rhport, _netd_itf.ep_notif, _netd_epbuf.notify, len);
+ usbd_edpt_xfer(rhport, _netd_itf.ep_notif, _netd_epbuf.notify, len, false);
}
//--------------------------------------------------------------------+
diff --git a/src/class/net/ncm.h b/src/class/net/ncm.h
index 0245a87f2..8989fe0b4 100644
--- a/src/class/net/ncm.h
+++ b/src/class/net/ncm.h
@@ -25,8 +25,8 @@
* This file is part of the TinyUSB stack.
*/
-#ifndef _TUSB_NCM_H_
-#define _TUSB_NCM_H_
+#ifndef TUSB_NCM_H_
+#define TUSB_NCM_H_
#include "common/tusb_common.h"
diff --git a/src/class/net/ncm_device.c b/src/class/net/ncm_device.c
index 02833c5f1..3e19b5f3a 100644
--- a/src/class/net/ncm_device.c
+++ b/src/class/net/ncm_device.c
@@ -50,10 +50,6 @@
#if (CFG_TUD_ENABLED && CFG_TUD_NCM)
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdio.h>
-
#include "device/usbd.h"
#include "device/usbd_pvt.h"
@@ -205,7 +201,7 @@ static void notification_xmit(uint8_t rhport, bool force_next) {
uint16_t notif_len = sizeof(notify_speed_change.header) + notify_speed_change.header.wLength;
ncm_epbuf.epnotif = notify_speed_change;
- usbd_edpt_xfer(rhport, ncm_interface.ep_notif, (uint8_t*) &ncm_epbuf.epnotif, notif_len);
+ usbd_edpt_xfer(rhport, ncm_interface.ep_notif, (uint8_t*) &ncm_epbuf.epnotif, notif_len, false);
ncm_interface.notification_xmit_state = NOTIFICATION_CONNECTED;
ncm_interface.notification_xmit_is_running = true;
@@ -227,7 +223,7 @@ static void notification_xmit(uint8_t rhport, bool force_next) {
uint16_t notif_len = sizeof(notify_connected.header) + notify_connected.header.wLength;
ncm_epbuf.epnotif = notify_connected;
- usbd_edpt_xfer(rhport, ncm_interface.ep_notif, (uint8_t *) &ncm_epbuf.epnotif, notif_len);
+ usbd_edpt_xfer(rhport, ncm_interface.ep_notif, (uint8_t *) &ncm_epbuf.epnotif, notif_len, false);
ncm_interface.notification_xmit_state = NOTIFICATION_DONE;
ncm_interface.notification_xmit_is_running = true;
@@ -331,7 +327,7 @@ static bool xmit_insert_required_zlp(uint8_t rhport, uint32_t xferred_bytes) {
TU_LOG_DRV("xmit_insert_required_zlp! (%u)\n", (unsigned) xferred_bytes);
// start transmission of the ZLP
- usbd_edpt_xfer(rhport, ncm_interface.ep_in, NULL, 0);
+ usbd_edpt_xfer(rhport, ncm_interface.ep_in, NULL, 0, false);
return true;
} // xmit_insert_required_zlp
@@ -377,7 +373,7 @@ static void xmit_start_if_possible(uint8_t rhport) {
}
// Kick off an endpoint transfer
- usbd_edpt_xfer(0, ncm_interface.ep_in, ncm_interface.xmit_tinyusb_ntb->data, ncm_interface.xmit_tinyusb_ntb->nth.wBlockLength);
+ usbd_edpt_xfer(0, ncm_interface.ep_in, ncm_interface.xmit_tinyusb_ntb->data, ncm_interface.xmit_tinyusb_ntb->nth.wBlockLength, false);
} // xmit_start_if_possible
/**
@@ -526,7 +522,7 @@ static void recv_try_to_start_new_reception(uint8_t rhport) {
// initiate transfer
TU_LOG_DRV(" start reception\n");
- bool r = usbd_edpt_xfer(rhport, ncm_interface.ep_out, ncm_interface.recv_tinyusb_ntb->data, CFG_TUD_NCM_OUT_NTB_MAX_SIZE);
+ bool r = usbd_edpt_xfer(rhport, ncm_interface.ep_out, ncm_interface.recv_tinyusb_ntb->data, CFG_TUD_NCM_OUT_NTB_MAX_SIZE, false);
if (!r) {
recv_put_ntb_into_free_list(ncm_interface.recv_tinyusb_ntb);
ncm_interface.recv_tinyusb_ntb = NULL;
diff --git a/src/class/net/net_device.h b/src/class/net/net_device.h
index fff2623b7..96c03fd61 100644
--- a/src/class/net/net_device.h
+++ b/src/class/net/net_device.h
@@ -25,8 +25,8 @@
* This file is part of the TinyUSB stack.
*/
-#ifndef _TUSB_NET_DEVICE_H_
-#define _TUSB_NET_DEVICE_H_
+#ifndef TUSB_NET_DEVICE_H_
+#define TUSB_NET_DEVICE_H_
#include <stdint.h>
#include "class/cdc/cdc.h"
@@ -56,6 +56,13 @@ typedef enum
#endif
//--------------------------------------------------------------------+
+// Implemented by Application
+//--------------------------------------------------------------------+
+#if CFG_TUD_ECM_RNDIS
+extern void rndis_class_set_handler(uint8_t *data, int size);
+#endif
+
+//--------------------------------------------------------------------+
// Application API
//--------------------------------------------------------------------+
@@ -107,4 +114,4 @@ void netd_report (uint8_t *buf, uint16_t len);
}
#endif
-#endif /* _TUSB_NET_DEVICE_H_ */
+#endif /* TUSB_NET_DEVICE_H_ */