summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-02-10 02:27:57 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-02-10 02:27:57 +0000
commite01fb95bd1e3e13014c879051bee97bc28d668e5 (patch)
treef74a5144022dce973674d6b5de64d3bb3c168ca0
parent61a0d7ed7d0b88ae23d5b890ec4f3f3acc47bfb2 (diff)
Move HASH_BITS constant to if_skreg.h as SK_HASH_BITS. Remove unused
code and an unnecessary comment, No functional change. From brad@.
-rw-r--r--sys/dev/pci/if_msk.c6
-rw-r--r--sys/dev/pci/if_sk.c13
-rw-r--r--sys/dev/pci/if_skreg.h4
3 files changed, 8 insertions, 15 deletions
diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c
index 15bab1229ad..7aad083258c 100644
--- a/sys/dev/pci/if_msk.c
+++ b/sys/dev/pci/if_msk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_msk.c,v 1.43 2007/02/03 12:50:26 kettenis Exp $ */
+/* $OpenBSD: if_msk.c,v 1.44 2007/02/10 02:27:56 krw Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -348,8 +348,6 @@ msk_miibus_statchg(struct device *dev)
SK_YU_READ_2(((struct sk_if_softc *)dev), YUKON_GPCR)));
}
-#define HASH_BITS 6
-
void
msk_setfilt(struct sk_if_softc *sc_if, caddr_t addr, int slot)
{
@@ -392,7 +390,7 @@ allmulti:
goto allmulti;
}
h = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN) &
- ((1 << HASH_BITS) - 1);
+ ((1 << SK_HASH_BITS) - 1);
if (h < 32)
hashes[0] |= (1 << h);
else
diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c
index e5669104ebe..223491723c6 100644
--- a/sys/dev/pci/if_sk.c
+++ b/sys/dev/pci/if_sk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sk.c,v 1.137 2007/02/03 12:50:26 kettenis Exp $ */
+/* $OpenBSD: if_sk.c,v 1.138 2007/02/10 02:27:56 krw Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -398,15 +398,13 @@ sk_marv_miibus_statchg(struct device *dev)
SK_YU_READ_2(((struct sk_if_softc *)dev), YUKON_GPCR)));
}
-#define HASH_BITS 6
-
u_int32_t
sk_xmac_hash(caddr_t addr)
{
u_int32_t crc;
crc = ether_crc32_le(addr, ETHER_ADDR_LEN);
- return (~crc & ((1 << HASH_BITS) - 1));
+ return (~crc & ((1 << SK_HASH_BITS) - 1));
}
u_int32_t
@@ -415,7 +413,7 @@ sk_yukon_hash(caddr_t addr)
u_int32_t crc;
crc = ether_crc32_be(addr, ETHER_ADDR_LEN);
- return (crc & ((1 << HASH_BITS) - 1));
+ return (crc & ((1 << SK_HASH_BITS) - 1));
}
void
@@ -1221,7 +1219,6 @@ sk_attach(struct device *parent, struct device *self, void *aux)
sc_if->sk_mii.mii_writereg = sk_xmac_miibus_writereg;
sc_if->sk_mii.mii_statchg = sk_xmac_miibus_statchg;
} else {
- /* Yukon/Yukon-2 */
sc_if->sk_mii.mii_readreg = sk_marv_miibus_readreg;
sc_if->sk_mii.mii_writereg = sk_marv_miibus_writereg;
sc_if->sk_mii.mii_statchg = sk_marv_miibus_statchg;
@@ -2662,10 +2659,6 @@ sk_init(void *xsc_if)
if (SK_IS_YUKON(sc)) {
u_int16_t reg = SK_YU_READ_2(sc_if, YUKON_GPCR);
reg |= YU_GPCR_TXEN | YU_GPCR_RXEN;
-#if 0
- /* XXX disable 100Mbps and full duplex mode? */
- reg &= ~(YU_GPCR_SPEED | YU_GPCR_DPLX_DIS);
-#endif
SK_YU_WRITE_2(sc_if, YUKON_GPCR, reg);
}
diff --git a/sys/dev/pci/if_skreg.h b/sys/dev/pci/if_skreg.h
index fbd9f3534a7..a6d69faaa1d 100644
--- a/sys/dev/pci/if_skreg.h
+++ b/sys/dev/pci/if_skreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_skreg.h,v 1.41 2006/11/23 21:56:32 kettenis Exp $ */
+/* $OpenBSD: if_skreg.h,v 1.42 2007/02/10 02:27:56 krw Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -2171,3 +2171,5 @@ struct msk_status_desc {
#define XM_RESAB_FDMODESEL 0x0020
#define XM_RESAB_HDMODESEL 0x0040
#define XM_RESAB_PAUSEBITS 0x0180
+
+#define SK_HASH_BITS 6