1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Const poison crc routines (why these aren't centralized, I'm not sure).

This commit is contained in:
Warner Losh 2003-10-23 16:57:38 +00:00
parent 97bf3cc2cc
commit 9d51aaa4e8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=121433
2 changed files with 18 additions and 18 deletions

View File

@ -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));
}

View File

@ -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));
}