summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2019-03-14 20:23:36 +0800
committerGitHub <[email protected]>2019-03-14 20:23:36 +0800
commit656d20362b4a7a891171d3d444641aadda6b1a21 (patch)
treea8d07d0e0de5111927dfa9ed7916188f7454aeea /components
parent38ffaf806c6e00042918631671372d00c10ee7e3 (diff)
parentbb97c76b5937864736d7fdb029bc0731c8cabf68 (diff)
Merge pull request #2449 from qgyhd1234/checksum
[components][lwip]添加 LWIP 硬件校验和选项,修改 STM32 系列和 rt1052 系列以太网驱动,支持硬件校验和
Diffstat (limited to 'components')
-rw-r--r--components/net/Kconfig4
-rw-r--r--components/net/lwip-1.4.1/src/lwipopts.h12
-rw-r--r--components/net/lwip-2.0.2/src/lwipopts.h12
-rw-r--r--components/net/lwip-2.1.0/src/lwipopts.h12
4 files changed, 40 insertions, 0 deletions
diff --git a/components/net/Kconfig b/components/net/Kconfig
index cef3ceacd3..cfeaca5a51 100644
--- a/components/net/Kconfig
+++ b/components/net/Kconfig
@@ -261,6 +261,10 @@ config RT_USING_LWIP
bool "Enable lwIP statistics"
default n
+ config RT_LWIP_USING_HW_CHECKSUM
+ bool "Enable hardware checksum"
+ default n
+
menuconfig RT_LWIP_DEBUG
bool "Enable lwIP Debugging Options"
default n
diff --git a/components/net/lwip-1.4.1/src/lwipopts.h b/components/net/lwip-1.4.1/src/lwipopts.h
index a5c0e20cbd..dd59acd589 100644
--- a/components/net/lwip-1.4.1/src/lwipopts.h
+++ b/components/net/lwip-1.4.1/src/lwipopts.h
@@ -374,6 +374,18 @@
#define ARP_TABLE_SIZE 10
#define ARP_QUEUEING 1
+/* ---------- Checksum options ---------- */
+#ifdef RT_LWIP_USING_HW_CHECKSUM
+#define CHECKSUM_GEN_IP 0
+#define CHECKSUM_GEN_UDP 0
+#define CHECKSUM_GEN_TCP 0
+#define CHECKSUM_GEN_ICMP 0
+#define CHECKSUM_CHECK_IP 0
+#define CHECKSUM_CHECK_UDP 0
+#define CHECKSUM_CHECK_TCP 0
+#define CHECKSUM_CHECK_ICMP 0
+#endif
+
/* ---------- IP options ---------- */
/* Define IP_FORWARD to 1 if you wish to have the ability to forward
IP packets across network interfaces. If you are going to run lwIP
diff --git a/components/net/lwip-2.0.2/src/lwipopts.h b/components/net/lwip-2.0.2/src/lwipopts.h
index 07901c3fa1..f90ef1a825 100644
--- a/components/net/lwip-2.0.2/src/lwipopts.h
+++ b/components/net/lwip-2.0.2/src/lwipopts.h
@@ -383,6 +383,18 @@
#define ARP_TABLE_SIZE 10
#define ARP_QUEUEING 1
+/* ---------- Checksum options ---------- */
+#ifdef RT_LWIP_USING_HW_CHECKSUM
+#define CHECKSUM_GEN_IP 0
+#define CHECKSUM_GEN_UDP 0
+#define CHECKSUM_GEN_TCP 0
+#define CHECKSUM_GEN_ICMP 0
+#define CHECKSUM_CHECK_IP 0
+#define CHECKSUM_CHECK_UDP 0
+#define CHECKSUM_CHECK_TCP 0
+#define CHECKSUM_CHECK_ICMP 0
+#endif
+
/* ---------- IP options ---------- */
/* Define IP_FORWARD to 1 if you wish to have the ability to forward
IP packets across network interfaces. If you are going to run lwIP
diff --git a/components/net/lwip-2.1.0/src/lwipopts.h b/components/net/lwip-2.1.0/src/lwipopts.h
index 4e65fd65ba..405e95ce64 100644
--- a/components/net/lwip-2.1.0/src/lwipopts.h
+++ b/components/net/lwip-2.1.0/src/lwipopts.h
@@ -390,6 +390,18 @@
#define ARP_TABLE_SIZE 10
#define ARP_QUEUEING 1
+/* ---------- Checksum options ---------- */
+#ifdef RT_LWIP_USING_HW_CHECKSUM
+#define CHECKSUM_GEN_IP 0
+#define CHECKSUM_GEN_UDP 0
+#define CHECKSUM_GEN_TCP 0
+#define CHECKSUM_GEN_ICMP 0
+#define CHECKSUM_CHECK_IP 0
+#define CHECKSUM_CHECK_UDP 0
+#define CHECKSUM_CHECK_TCP 0
+#define CHECKSUM_CHECK_ICMP 0
+#endif
+
/* ---------- IP options ---------- */
/* Define IP_FORWARD to 1 if you wish to have the ability to forward
IP packets across network interfaces. If you are going to run lwIP