summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2002-05-07 19:29:00 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2002-05-07 19:29:00 +0000
commitd4099e9e53696672da0c15c51805e3335e2e4205 (patch)
tree947182b66019bbe10c1a8d47f52e98c1a2739707 /sys/dev
parent2ea3f7af298faeb6d751bb68c7d3a911fc39c0a2 (diff)
move ether_crc32_le to if_ethersubr.c. Add ether_crc32_be
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/lemac.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/sys/dev/ic/lemac.c b/sys/dev/ic/lemac.c
index 63452a50111..4d0a70559b3 100644
--- a/sys/dev/ic/lemac.c
+++ b/sys/dev/ic/lemac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lemac.c,v 1.2 2002/02/25 08:48:30 niklas Exp $ */
+/* $OpenBSD: lemac.c,v 1.3 2002/05/07 19:28:59 nate Exp $ */
/* $NetBSD: lemac.c,v 1.20 2001/06/13 10:46:02 wiz Exp $ */
/*-
@@ -77,9 +77,6 @@
#include <net/bpf.h>
#endif
-/* XXX Should be in if_ethersubr.c */
-u_int32_t ether_crc32_le(const u_int8_t *, size_t);
-
int lemac_ifioctl(struct ifnet *, u_long, caddr_t);
int lemac_ifmedia_change(struct ifnet *const);
void lemac_ifmedia_status(struct ifnet *const, struct ifmediareq *);
@@ -449,30 +446,6 @@ lemac_read_macaddr(unsigned char *hwaddr, const bus_space_tag_t iot,
return (0);
}
-/* XXX Should be moved to if_ethersubr.c */
-u_int32_t
-ether_crc32_le(const u_int8_t *buf, size_t len)
-{
- static const u_int32_t crctab[] = {
- 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac,
- 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c,
- 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c,
- 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c
- };
- u_int32_t crc;
- int i;
-
- crc = 0xffffffffU; /* initial value */
-
- for (i = 0; i < len; i++) {
- crc ^= buf[i];
- crc = (crc >> 4) ^ crctab[crc & 0xf];
- crc = (crc >> 4) ^ crctab[crc & 0xf];
- }
-
- return (crc);
-}
-
void
lemac_multicast_op(u_int16_t *mctbl, const u_char *mca, int enable)
{