Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Use ether_crc32_le().



details:   https://anonhg.NetBSD.org/src/rev/1977f666f151
branches:  trunk
changeset: 486064:1977f666f151
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri May 12 16:41:59 2000 +0000

description:
Use ether_crc32_le().

diffstat:

 sys/dev/pci/if_sip.c |  20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diffs (43 lines):

diff -r cfdca63e114c -r 1977f666f151 sys/dev/pci/if_sip.c
--- a/sys/dev/pci/if_sip.c      Fri May 12 16:22:36 2000 +0000
+++ b/sys/dev/pci/if_sip.c      Fri May 12 16:41:59 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sip.c,v 1.10 2000/03/23 22:23:03 mycroft Exp $      */
+/*     $NetBSD: if_sip.c,v 1.11 2000/05/12 16:41:59 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1999 Network Computer, Inc.
@@ -1758,16 +1758,9 @@
        struct ethercom *ec = &sc->sc_ethercom;
        struct ifnet *ifp = &sc->sc_ethercom.ec_if;
        struct ether_multi *enm;
+       u_int8_t *cp;
        struct ether_multistep step;
-       u_int8_t *cp;
        u_int32_t crc, mchash[8];
-       int len;
-       static const u_int32_t crctab[] = {
-               0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac,
-               0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c,
-               0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c,
-               0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c
-       };
 
        /*
         * Initialize the prototype RFCR.
@@ -1805,13 +1798,8 @@
                        goto allmulti;
                }
 
-               cp = enm->enm_addrlo;
-               crc = 0xffffffff;
-               for (len = sizeof(enm->enm_addrlo); --len >= 0;) {
-                       crc ^= *cp++;
-                       crc = (crc >> 4) ^ crctab[crc & 0xf];
-                       crc = (crc >> 4) ^ crctab[crc & 0xf];
-               }
+               crc = ether_crc32_le(enm->enm_addrlo, ETHER_ADDR_LEN);
+
                /* Just want the 7 most significant bits. */
                crc >>= 25;
 



Home | Main Index | Thread Index | Old Index