summaryrefslogtreecommitdiffstatsabout
path: root/SylixOS
diff options
context:
space:
mode:
authorHanhui <hanhui@acoinfo.com>2020-11-10 15:09:33 (GMT)
committer Hanhui <hanhui@acoinfo.com>2020-11-10 15:09:33 (GMT)
commit13ec4332870a830bacee6c67425dfe6eff5af255 (patch)
tree1c6f51c2bcf03e58b26441447f42172bbaa67d25 /SylixOS
parente6a5485c9a3dadff6e3ece8d703d44d3a5d432a8 (diff)
downloadlibsylixos-13ec4332870a830bacee6c67425dfe6eff5af255.zip
libsylixos-13ec4332870a830bacee6c67425dfe6eff5af255.tar.gz
libsylixos-13ec4332870a830bacee6c67425dfe6eff5af255.tar.bz2
Fixed net interface loop receive event lost error.
Diffstat (limited to 'SylixOS')
-rw-r--r--SylixOS/include/linux/version.h2
-rw-r--r--SylixOS/include/network/lwip/netif.h3
-rw-r--r--SylixOS/net/lwip/src/core/netif.c15
3 files changed, 13 insertions, 7 deletions
diff --git a/SylixOS/include/linux/version.h b/SylixOS/include/linux/version.h
index 624120b..034c933 100644
--- a/SylixOS/include/linux/version.h
+++ b/SylixOS/include/linux/version.h
@@ -6,6 +6,6 @@
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
#endif
-#define LINUX_VERSION_CODE KERNEL_VERSION(3, 4, 0)
+#define LINUX_VERSION_CODE KERNEL_VERSION(4, 4, 4)
#endif /* __LINUX_VERSION_H */
diff --git a/SylixOS/include/network/lwip/netif.h b/SylixOS/include/network/lwip/netif.h
index be686c1..9721505 100644
--- a/SylixOS/include/network/lwip/netif.h
+++ b/SylixOS/include/network/lwip/netif.h
@@ -390,6 +390,9 @@ struct netif {
/* List of packets to be queued for ourselves. */
struct pbuf *loop_first;
struct pbuf *loop_last;
+#if LWIP_NETIF_LOOPBACK_MULTITHREADING /* SylixOS Add this to fixed loop event lost bug */
+ u8_t loop_schedule;
+#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */
#if LWIP_LOOPBACK_MAX_PBUFS
u16_t loop_cnt_current;
#endif /* LWIP_LOOPBACK_MAX_PBUFS */
diff --git a/SylixOS/net/lwip/src/core/netif.c b/SylixOS/net/lwip/src/core/netif.c
index ecfd78c..cb8fc4a 100644
--- a/SylixOS/net/lwip/src/core/netif.c
+++ b/SylixOS/net/lwip/src/core/netif.c
@@ -362,6 +362,9 @@ netif_add(struct netif *netif,
#if ENABLE_LOOPBACK
netif->loop_first = NULL;
netif->loop_last = NULL;
+#if LWIP_NETIF_LOOPBACK_MULTITHREADING /* SylixOS Add this to fixed loop event lost bug */
+ netif->loop_schedule = 0;
+#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */
#endif /* ENABLE_LOOPBACK */
/* remember netif specific state information data */
@@ -1196,9 +1199,7 @@ netif_loop_output(struct netif *netif, struct pbuf *p)
struct netif *stats_if = netif;
#endif /* LWIP_HAVE_LOOPIF */
#endif /* MIB2_STATS */
-#if LWIP_NETIF_LOOPBACK_MULTITHREADING
- u8_t schedule_poll = 0;
-#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */
+ /* SylixOS Remove local schedule loop flag variable */
SYS_ARCH_DECL_PROTECT(lev);
LWIP_ASSERT("netif_loop_output: invalid netif", netif != NULL);
@@ -1253,7 +1254,7 @@ netif_loop_output(struct netif *netif, struct pbuf *p)
netif->loop_last = last;
#if LWIP_NETIF_LOOPBACK_MULTITHREADING
/* No existing packets queued, schedule poll */
- schedule_poll = 1;
+ netif->loop_schedule = 1; /* SylixOS fixed loop event lost bug */
#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */
}
SYS_ARCH_UNPROTECT(lev);
@@ -1264,8 +1265,10 @@ netif_loop_output(struct netif *netif, struct pbuf *p)
#if LWIP_NETIF_LOOPBACK_MULTITHREADING
/* For multithreading environment, schedule a call to netif_poll */
- if (schedule_poll) {
- tcpip_try_callback((tcpip_callback_fn)netif_poll, netif);
+ if (netif->loop_schedule) { /* SylixOS fixed loop event lost bug */
+ if (tcpip_try_callback((tcpip_callback_fn)netif_poll, netif) == ERR_OK) {
+ netif->loop_schedule = 0;
+ }
}
#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */