[rtems commit] network: Delete unused in4_cksum()
Sebastian Huber
sebh at rtems.org
Fri Apr 22 07:28:44 UTC 2016
Module: rtems
Branch: master
Commit: c6cb9bad75cbe6cc5ea7895a7d4317168275e5b6
Changeset: http://git.rtems.org/rtems/commit/?id=c6cb9bad75cbe6cc5ea7895a7d4317168275e5b6
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Apr 22 08:52:41 2016 +0200
network: Delete unused in4_cksum()
---
cpukit/libnetworking/netinet/in_cksum_arm.h | 41 -------------------------
cpukit/libnetworking/netinet/in_cksum_nios2.h | 44 ---------------------------
cpukit/libnetworking/netinet/in_cksum_sparc.h | 40 ------------------------
3 files changed, 125 deletions(-)
diff --git a/cpukit/libnetworking/netinet/in_cksum_arm.h b/cpukit/libnetworking/netinet/in_cksum_arm.h
index 74a3c68..d884a0f 100644
--- a/cpukit/libnetworking/netinet/in_cksum_arm.h
+++ b/cpukit/libnetworking/netinet/in_cksum_arm.h
@@ -234,44 +234,3 @@ in_cksum(
cksum =in_cksum_internal(m, 0, len, 0);
return cksum;
}
-
-int
-in4_cksum(
- struct mbuf *m,
- u_int8_t nxt,
- int off,
- int len )
-{
- u_int sum = 0;
-
- if (nxt != 0) {
- /* for ADD macros */
- register u_int tmp1, tmp2, tmp3, tmp4;
- u_char *w;
- struct ipovly ipov;
- /* pseudo header */
- if (off < sizeof(struct ipovly))
- panic("in4_cksum: offset too short");
- if (m->m_len < sizeof(struct ip))
- panic("in4_cksum: bad mbuf chain");
-
- bzero(&ipov, sizeof(ipov));
- ipov.ih_len = htons(len);
- ipov.ih_pr = nxt;
- ipov.ih_src = mtod(m, struct ip *)->ip_src;
- ipov.ih_dst = mtod(m, struct ip *)->ip_dst;
- w = (u_char *)&ipov;
-
- /* assumes sizeof(ipov) == 20 */
- ADD16;
- ADD4;
- }
- /* skip unnecessary part */
- while (m && off > 0) {
- if (m->m_len > off)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
- return (in_cksum_internal(m, off, len, sum));
-}
diff --git a/cpukit/libnetworking/netinet/in_cksum_nios2.h b/cpukit/libnetworking/netinet/in_cksum_nios2.h
index 8382f11..1b34a28 100644
--- a/cpukit/libnetworking/netinet/in_cksum_nios2.h
+++ b/cpukit/libnetworking/netinet/in_cksum_nios2.h
@@ -246,47 +246,3 @@ in_cksum (
{
return in_cksum_internal ( m, 0, len, 0 );
}
-
-int
-in4_cksum (
- struct mbuf *m,
- u_int8_t nxt,
- int off,
- int len )
-{
- u_int sum = 0;
-
- if ( nxt != 0 )
- {
- struct ipovly ipov;
- /* pseudo header */
- if (off < sizeof(struct ipovly))
- panic("in4_cksum: offset too short");
- if (m->m_len < sizeof(struct ip))
- panic("in4_cksum: bad mbuf chain");
-
- bzero(&ipov, sizeof(ipov));
- ipov.ih_len = htons(len);
- ipov.ih_pr = nxt;
- ipov.ih_src = mtod(m, struct ip *)->ip_src;
- ipov.ih_dst = mtod(m, struct ip *)->ip_dst;
- u_char * w = (u_char *)&ipov;
-
- if ( sizeof(ipov) != 20 )
- panic( "in4_cksum: sizeof(ipov) != 20" );
- sum = _NIOS2_Add_ones_complement_16 ( sum, (uint32_t *) w );
- w += 16;
- sum = _NIOS2_Add_ones_complement_4 ( sum, (uint32_t *) w );
- }
- /* skip unnecessary part */
- while (m && off > 0)
- {
- if (m->m_len > off)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
- return (in_cksum_internal(m, off, len, sum));
-}
-
-
diff --git a/cpukit/libnetworking/netinet/in_cksum_sparc.h b/cpukit/libnetworking/netinet/in_cksum_sparc.h
index 7bd7bc6..5864b6a 100644
--- a/cpukit/libnetworking/netinet/in_cksum_sparc.h
+++ b/cpukit/libnetworking/netinet/in_cksum_sparc.h
@@ -266,43 +266,3 @@ in_cksum(struct mbuf *m, int len)
return (in_cksum_internal(m, 0, len, 0));
}
-
-int
-in4_cksum(struct mbuf *m, uint8_t nxt, int off, int len)
-{
- u_char *w;
- u_int sum = 0;
- struct ipovly ipov;
-
- /*
- * Declare two temporary registers for use by the asm code. We
- * allow the compiler to pick which specific machine registers to
- * use, instead of hard-coding this in the asm code above.
- */
- u_int tmp1, tmp2;
-
- if (nxt != 0) {
- /* pseudo header */
- memset(&ipov, 0, sizeof(ipov));
- ipov.ih_len = htons(len);
- ipov.ih_pr = nxt;
- ipov.ih_src = mtod(m, struct ip *)->ip_src;
- ipov.ih_dst = mtod(m, struct ip *)->ip_dst;
- w = (u_char *)&ipov;
- /* assumes sizeof(ipov) == 20 */
- ADD16;
- w += 16;
- ADD4;
- }
-
- /* skip unnecessary part */
- while (m && off > 0) {
- if (m->m_len > off)
- break;
- off -= m->m_len;
- m = m->m_next;
- }
-
- return (in_cksum_internal(m, off, len, sum));
-}
-
More information about the vc
mailing list