summaryrefslogtreecommitdiffstats
path: root/sys/dev/dc
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-10-23 16:57:38 +0000
committerimp <imp@FreeBSD.org>2003-10-23 16:57:38 +0000
commitbc5c50d57bd423d0e534232aada4178f22e6b300 (patch)
tree256be4322db2472446ac99e9121ca508fd471010 /sys/dev/dc
parent16ef5239b2e9f3bd097c3a6e24090345636b20cd (diff)
downloadFreeBSD-src-bc5c50d57bd423d0e534232aada4178f22e6b300.zip
FreeBSD-src-bc5c50d57bd423d0e534232aada4178f22e6b300.tar.gz
Const poison crc routines (why these aren't centralized, I'm not sure).
Diffstat (limited to 'sys/dev/dc')
-rw-r--r--sys/dev/dc/if_dc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c
index b120f43..f6ebbb3 100644
--- a/sys/dev/dc/if_dc.c
+++ b/sys/dev/dc/if_dc.c
@@ -264,8 +264,8 @@ static void dc_miibus_statchg (device_t);
static void dc_miibus_mediainit (device_t);
static void dc_setcfg (struct dc_softc *, int);
-static u_int32_t dc_crc_le (struct dc_softc *, caddr_t);
-static u_int32_t dc_crc_be (caddr_t);
+static u_int32_t dc_crc_le (struct dc_softc *, const uint8_t *);
+static u_int32_t dc_crc_be (const uint8_t *);
static void dc_setfilt_21143 (struct dc_softc *);
static void dc_setfilt_asix (struct dc_softc *);
static void dc_setfilt_admtek (struct dc_softc *);
@@ -1022,9 +1022,9 @@ dc_miibus_mediainit(device_t dev)
#define DC_BITS_64 6
static u_int32_t
-dc_crc_le(struct dc_softc *sc, caddr_t addr)
+dc_crc_le(struct dc_softc *sc, const uint8_t *addr)
{
- u_int32_t idx, bit, data, crc;
+ uint32_t idx, bit, data, crc;
/* Compute CRC for the address value. */
crc = 0xFFFFFFFF; /* initial value */
@@ -1062,11 +1062,11 @@ dc_crc_le(struct dc_softc *sc, caddr_t addr)
* Calculate CRC of a multicast group address, return the lower 6 bits.
*/
static u_int32_t
-dc_crc_be(caddr_t addr)
+dc_crc_be(const uint8_t *addr)
{
- u_int32_t crc, carry;
+ uint32_t crc, carry;
int i, j;
- u_int8_t c;
+ uint8_t c;
/* Compute CRC for the address value. */
crc = 0xFFFFFFFF; /* initial value */
@@ -1140,7 +1140,7 @@ dc_setfilt_21143(struct dc_softc *sc)
}
if (ifp->if_flags & IFF_BROADCAST) {
- h = dc_crc_le(sc, (caddr_t)ifp->if_broadcastaddr);
+ h = dc_crc_le(sc, ifp->if_broadcastaddr);
sp[h >> 4] |= htole32(1 << (h & 0xF));
}
@@ -1330,7 +1330,7 @@ dc_setfilt_xircom(struct dc_softc *sc)
}
if (ifp->if_flags & IFF_BROADCAST) {
- h = dc_crc_le(sc, (caddr_t)ifp->if_broadcastaddr);
+ h = dc_crc_le(sc, ifp->if_broadcastaddr);
sp[h >> 4] |= htole32(1 << (h & 0xF));
}
OpenPOWER on IntegriCloud