From be46071b5c1041a5b9d7c03e7fdba6a88c0c56c9 Mon Sep 17 00:00:00 2001 From: EunBong Song Date: Tue, 4 Apr 2017 14:29:09 +0900 Subject: [PATCH] net: remove NET_ARCH_CHKSUM NET_ARCH_CHKSUM is a Nuttx uIP legacy feature and not used anymore. This patch removes all related codes with NET_ARCH_CHKSUM. Change-Id: Ia8e033e95c72731466efb63561fea41c30545b79 Signed-off-by: EunBong Song --- build/configs/artik053/nettest/defconfig | 1 - .../configs/sidk_s5jt200/sidk_tash_wlan/defconfig | 1 - os/include/tinyara/net/netdev.h | 48 ---------------------- os/net/Kconfig | 1 - os/net/utils/Kconfig | 18 -------- os/net/utils/utils.h | 36 ---------------- 6 files changed, 105 deletions(-) delete mode 100644 os/net/utils/Kconfig diff --git a/build/configs/artik053/nettest/defconfig b/build/configs/artik053/nettest/defconfig index 43031d6..ea20ff7 100644 --- a/build/configs/artik053/nettest/defconfig +++ b/build/configs/artik053/nettest/defconfig @@ -731,7 +731,6 @@ CONFIG_NET_IPv4=y # Network Device Operations # # CONFIG_NETDEV_PHY_IOCTL is not set -# CONFIG_NET_ARCH_CHKSUM is not set # # Routing Table Configuration diff --git a/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig b/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig index 9edfdf1..905064e 100755 --- a/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig +++ b/build/configs/sidk_s5jt200/sidk_tash_wlan/defconfig @@ -732,7 +732,6 @@ CONFIG_NET_IPv4=y # Network Device Operations # # CONFIG_NETDEV_PHY_IOCTL is not set -# CONFIG_NET_ARCH_CHKSUM is not set # # Routing Table Configuration diff --git a/os/include/tinyara/net/netdev.h b/os/include/tinyara/net/netdev.h index 40b29f0..43bfbb7 100644 --- a/os/include/tinyara/net/netdev.h +++ b/os/include/tinyara/net/netdev.h @@ -395,54 +395,6 @@ int netdev_carrier_on(FAR struct net_driver_s *dev); int netdev_carrier_off(FAR struct net_driver_s *dev); /**************************************************************************** - * Name: net_chksum - * - * Description: - * Calculate the Internet checksum over a buffer. - * - * The Internet checksum is the one's complement of the one's complement - * sum of all 16-bit words in the buffer. - * - * See RFC1071. - * - * If CONFIG_NET_ARCH_CHKSUM is defined, then this function must be - * provided by architecture-specific logic. - * - * Input Parameters: - * - * buf - A pointer to the buffer over which the checksum is to be computed. - * - * len - The length of the buffer over which the checksum is to be computed. - * - * Returned Value: - * The Internet checksum of the buffer. - * - ****************************************************************************/ - -uint16_t net_chksum(FAR uint16_t *data, uint16_t len); - -/**************************************************************************** - * Name: ipv4_chksum - * - * Description: - * Calculate the IPv4 header checksum of the packet header in d_buf. - * - * The IPv4 header checksum is the Internet checksum of the 20 bytes of - * the IPv4 header. - * - * If CONFIG_NET_ARCH_CHKSUM is defined, then this function must be - * provided by architecture-specific logic. - * - * Returned Value: - * The IPv4 header checksum of the IPv4 header in the d_buf buffer. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_IPv4 -uint16_t ipv4_chksum(FAR struct net_driver_s *dev); -#endif - -/**************************************************************************** * Name: ipv6_chksum * * Description: diff --git a/os/net/Kconfig b/os/net/Kconfig index 4961074..6f6a8d1 100644 --- a/os/net/Kconfig +++ b/os/net/Kconfig @@ -123,7 +123,6 @@ config NET_IPv4 endmenu # Internet Protocol Selection source net/netdev/Kconfig -source net/utils/Kconfig source net/route/Kconfig endif # NET diff --git a/os/net/utils/Kconfig b/os/net/utils/Kconfig deleted file mode 100644 index f76a97f..0000000 --- a/os/net/utils/Kconfig +++ /dev/null @@ -1,18 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt -# - -config NET_ARCH_CHKSUM - bool "Architecture-specific net_chksum()" - default n - ---help--- - Define if you architecture provided an optimized version of - functions with the following prototypes: - - uint16_t net_chksum(FAR uint16_t *data, uint16_t len) - uint16_t ipv4_chksum(FAR struct net_driver_s *dev) - uint16_t tcp_ipv4_chksum(FAR struct net_driver_s *dev); - uint16_t tcp_ipv6_chksum(FAR struct net_driver_s *dev); - uint16_t udp_ipv4_chksum(FAR struct net_driver_s *dev); - uint16_t udp_ipv6_chksum(FAR struct net_driver_s *dev); diff --git a/os/net/utils/utils.h b/os/net/utils/utils.h index 2ee7f22..3e955e4 100644 --- a/os/net/utils/utils.h +++ b/os/net/utils/utils.h @@ -172,42 +172,6 @@ unsigned int net_timeval2dsec(FAR struct timeval *tv); void net_ipv6_pref2mask(uint8_t preflen, net_ipv6addr_t mask); #endif -/**************************************************************************** - * Name: tcp_chksum, tcp_ipv4_chksum, and tcp_ipv6_chksum - * - * Description: - * Calculate the TCP checksum of the packet in d_buf and d_appdata. - * - * The TCP checksum is the Internet checksum of data contents of the - * TCP segment, and a pseudo-header as defined in RFC793. - * - * Note: The d_appdata pointer that points to the packet data may - * point anywhere in memory, so it is not possible to simply calculate - * the Internet checksum of the contents of the d_buf buffer. - * - * Returned Value: - * The TCP checksum of the TCP segment in d_buf and pointed to by - * d_appdata. - * - ****************************************************************************/ - -#ifdef CONFIG_NET_IPv4 -uint16_t tcp_ipv4_chksum(FAR struct net_driver_s *dev); -#endif - -#ifdef CONFIG_NET_IPv6 -/* REVIST: Is this used? */ -uint16_t tcp_ipv6_chksum(FAR struct net_driver_s *dev); -#endif - -#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) -uint16_t tcp_chksum(FAR struct net_driver_s *dev); -#elif defined(CONFIG_NET_IPv4) -#define tcp_chksum(d) tcp_ipv4_chksum(d) -#else /* if defined(CONFIG_NET_IPv6) */ -#define tcp_chksum(d) tcp_ipv6_chksum(d) -#endif - #undef EXTERN #ifdef __cplusplus } -- 2.7.4