diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-11-29 16:19:39 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-11-29 16:19:39 +0000 |
commit | f8b7a80e30517a2fe4374ede254d41d594b271f4 (patch) | |
tree | 22128b5794aa918606a95319ad946dfed1012bbf /sys | |
parent | 311e46e6eca3eaa3b17bdb8fe4f1a4d4fbe1b926 (diff) |
Merge in some tidying up bits from gem(4). From Brad.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_cas.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c index 7e967470523..ab8b150961f 100644 --- a/sys/dev/pci/if_cas.c +++ b/sys/dev/pci/if_cas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cas.c,v 1.28 2009/11/17 20:47:42 kettenis Exp $ */ +/* $OpenBSD: if_cas.c,v 1.29 2009/11/29 16:19:38 kettenis Exp $ */ /* * @@ -1050,8 +1050,8 @@ cas_init(struct ifnet *ifp) */ bus_space_write_4(t, h, CAS_RX_PAUSE_THRESH, (3 * sc->sc_rxfifosize / 256) | - ( (sc->sc_rxfifosize / 256) << 12)); - bus_space_write_4(t, h, CAS_RX_BLANKING, (6<<12)|6); + ((sc->sc_rxfifosize / 256) << 12)); + bus_space_write_4(t, h, CAS_RX_BLANKING, (6 << 12) | 6); /* step 11. Configure Media */ mii_mediachg(&sc->sc_mii); @@ -1089,21 +1089,19 @@ cas_init_regs(struct cas_softc *sc) /* These regs are not cleared on reset */ sc->sc_inited = 0; if (!sc->sc_inited) { - - /* Wooo. Magic values. */ - bus_space_write_4(t, h, CAS_MAC_IPG0, 0); - bus_space_write_4(t, h, CAS_MAC_IPG1, 8); - bus_space_write_4(t, h, CAS_MAC_IPG2, 4); + /* Load recommended values */ + bus_space_write_4(t, h, CAS_MAC_IPG0, 0x00); + bus_space_write_4(t, h, CAS_MAC_IPG1, 0x08); + bus_space_write_4(t, h, CAS_MAC_IPG2, 0x04); bus_space_write_4(t, h, CAS_MAC_MAC_MIN_FRAME, ETHER_MIN_LEN); /* Max frame and max burst size */ v = ETHER_MAX_LEN | (0x2000 << 16) /* Burst size */; bus_space_write_4(t, h, CAS_MAC_MAC_MAX_FRAME, v); - bus_space_write_4(t, h, CAS_MAC_PREAMBLE_LEN, 0x7); - bus_space_write_4(t, h, CAS_MAC_JAM_SIZE, 0x4); + bus_space_write_4(t, h, CAS_MAC_PREAMBLE_LEN, 0x07); + bus_space_write_4(t, h, CAS_MAC_JAM_SIZE, 0x04); bus_space_write_4(t, h, CAS_MAC_ATTEMPT_LIMIT, 0x10); - /* Dunno.... */ bus_space_write_4(t, h, CAS_MAC_CONTROL_TYPE, 0x8088); bus_space_write_4(t, h, CAS_MAC_RANDOM_SEED, ((sc->sc_arpcom.ac_enaddr[5]<<8)|sc->sc_arpcom.ac_enaddr[4])&0x3ff); |