summaryrefslogtreecommitdiff
path: root/src/class/net
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-04-08 23:48:52 +0700
committerGitHub <[email protected]>2024-04-08 23:48:52 +0700
commit42decf28f1bf7512a4c3e7402c9daf83ee241191 (patch)
tree1a3ed93956a7d51d592d6ba4de6215725ec43c4c /src/class/net
parentd33fe38a6257bcdd60f51a57c9fd19ce2ad1f202 (diff)
parentbe25a3fc20339c27803e68cb1363f89ffe7a7c67 (diff)
Merge pull request #1835 from MasterQ32/otg_bringup
Implements deinit functions for host/device mode switch
Diffstat (limited to 'src/class/net')
-rw-r--r--src/class/net/ecm_rndis_device.c7
-rw-r--r--src/class/net/ncm_device.c4
-rw-r--r--src/class/net/net_device.h1
3 files changed, 10 insertions, 2 deletions
diff --git a/src/class/net/ecm_rndis_device.c b/src/class/net/ecm_rndis_device.c
index 762425732..f7a5fd225 100644
--- a/src/class/net/ecm_rndis_device.c
+++ b/src/class/net/ecm_rndis_device.c
@@ -132,11 +132,14 @@ void netd_report(uint8_t *buf, uint16_t len)
//--------------------------------------------------------------------+
// USBD Driver API
//--------------------------------------------------------------------+
-void netd_init(void)
-{
+void netd_init(void) {
tu_memclr(&_netd_itf, sizeof(_netd_itf));
}
+bool netd_deinit(void) {
+ return true;
+}
+
void netd_reset(uint8_t rhport)
{
(void) rhport;
diff --git a/src/class/net/ncm_device.c b/src/class/net/ncm_device.c
index 226c42c4e..f84bd9f73 100644
--- a/src/class/net/ncm_device.c
+++ b/src/class/net/ncm_device.c
@@ -260,6 +260,10 @@ void netd_init(void)
ncm_prepare_for_tx();
}
+bool netd_deinit(void) {
+ return true;
+}
+
void netd_reset(uint8_t rhport)
{
(void) rhport;
diff --git a/src/class/net/net_device.h b/src/class/net/net_device.h
index 399916355..da1a7b1e8 100644
--- a/src/class/net/net_device.h
+++ b/src/class/net/net_device.h
@@ -105,6 +105,7 @@ void tud_network_link_state_cb(bool state);
// INTERNAL USBD-CLASS DRIVER API
//--------------------------------------------------------------------+
void netd_init (void);
+bool netd_deinit (void);
void netd_reset (uint8_t rhport);
uint16_t netd_open (uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len);
bool netd_control_xfer_cb (uint8_t rhport, uint8_t stage, tusb_control_request_t const * request);