diff options
-rw-r--r-- | sys/arch/sparc/dev/hme.c | 12 | ||||
-rw-r--r-- | sys/arch/sparc/dev/hmereg.h | 6 | ||||
-rw-r--r-- | sys/arch/sparc/dev/hmevar.h | 9 | ||||
-rw-r--r-- | sys/dev/ic/hme.c | 12 | ||||
-rw-r--r-- | sys/dev/ic/hmereg.h | 9 |
5 files changed, 11 insertions, 37 deletions
diff --git a/sys/arch/sparc/dev/hme.c b/sys/arch/sparc/dev/hme.c index d020ff8290b..b361dbc35a8 100644 --- a/sys/arch/sparc/dev/hme.c +++ b/sys/arch/sparc/dev/hme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hme.c,v 1.43 2004/08/08 19:01:20 brad Exp $ */ +/* $OpenBSD: hme.c,v 1.44 2004/09/28 00:21:23 brad Exp $ */ /* * Copyright (c) 1998 Jason L. Wright (jason@thought.net) @@ -69,10 +69,6 @@ #include <net/bpfdesc.h> #endif -#if NVLAN > 0 -#include <net/if_vlan_var.h> -#endif - #include <machine/autoconf.h> #include <sparc/cpu.h> #include <sparc/sparc/cpuvar.h> @@ -249,7 +245,7 @@ hmeattach(parent, self, aux) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST; sc->sc_if_flags = ifp->if_flags; - ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capabilities = IFCAP_VLAN_MTU; IFQ_SET_MAXLEN(&ifp->if_snd, HME_TX_RING_SIZE); IFQ_SET_READY(&ifp->if_snd); @@ -565,7 +561,7 @@ hmeinit(sc) sc->sc_arpcom.ac_enaddr[3]; cr->mac_addr2 = (sc->sc_arpcom.ac_enaddr[4] << 8) | sc->sc_arpcom.ac_enaddr[5]; - cr->tx_pkt_max = cr->rx_pkt_max = HME_MTU; + cr->tx_pkt_max = cr->rx_pkt_max = ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN; cr->jsize = HME_DEFAULT_JSIZE; cr->ipkt_gap1 = HME_DEFAULT_IPKT_GAP1; @@ -962,7 +958,7 @@ hme_mcreset(sc) for (j = 0; j < 8; j++) { if ((crc & 1) ^ (octet & 1)) { crc >>= 1; - crc ^= MC_POLY_LE; + crc ^= ETHER_CRC_POLY_LE; } else crc >>= 1; diff --git a/sys/arch/sparc/dev/hmereg.h b/sys/arch/sparc/dev/hmereg.h index 7ca3b6df891..e7d340624f2 100644 --- a/sys/arch/sparc/dev/hmereg.h +++ b/sys/arch/sparc/dev/hmereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hmereg.h,v 1.10 2003/11/03 07:01:33 david Exp $ */ +/* $OpenBSD: hmereg.h,v 1.11 2004/09/28 00:21:23 brad Exp $ */ /* * Copyright (c) 1998 Jason L. Wright (jason@thought.net) @@ -31,10 +31,6 @@ #define HME_DEFAULT_IPKT_GAP1 8 #define HME_DEFAULT_IPKT_GAP2 4 -#define MC_POLY_BE 0x04c11db7UL /* mcast crc, big endian */ -#define MC_POLY_LE 0xedb88320UL /* mcast crc, little endian */ - - /* global registers */ struct hme_gr { volatile u_int32_t reset; /* reset tx/rx */ diff --git a/sys/arch/sparc/dev/hmevar.h b/sys/arch/sparc/dev/hmevar.h index a6e6a749755..9b39ebfbf5d 100644 --- a/sys/arch/sparc/dev/hmevar.h +++ b/sys/arch/sparc/dev/hmevar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hmevar.h,v 1.10 2004/08/08 19:01:20 brad Exp $ */ +/* $OpenBSD: hmevar.h,v 1.11 2004/09/28 00:21:23 brad Exp $ */ /* * Copyright (c) 1998 Jason L. Wright (jason@thought.net) @@ -60,10 +60,3 @@ struct hme_softc { int sc_first_td, sc_last_td, sc_no_td; /* tx counters */ int sc_last_rd; /* rx counters */ }; - -#ifndef EVL_ENCAPLEN /* defined if NVLAN > 0 */ -#define EVL_ENCAPLEN 0 -#endif - -#define HME_MTU \ - (ETHERMTU + EVL_ENCAPLEN + sizeof(u_int32_t) + sizeof(struct ether_header)) diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c index ecfc99b537f..be104208907 100644 --- a/sys/dev/ic/hme.c +++ b/sys/dev/ic/hme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hme.c,v 1.32 2004/08/08 19:01:20 brad Exp $ */ +/* $OpenBSD: hme.c,v 1.33 2004/09/28 00:21:23 brad Exp $ */ /* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */ /*- @@ -78,10 +78,6 @@ #include <machine/bus.h> -#if NVLAN > 0 -#include <net/if_vlan_var.h> -#endif - #include <dev/ic/hmereg.h> #include <dev/ic/hmevar.h> @@ -241,7 +237,7 @@ hme_config(sc) IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST; sc->sc_if_flags = ifp->if_flags; IFQ_SET_READY(&ifp->if_snd); - ifp->if_capabilities |= IFCAP_VLAN_MTU; + ifp->if_capabilities = IFCAP_VLAN_MTU; /* Initialize ifmedia structures and MII info */ mii->mii_ifp = ifp; @@ -517,7 +513,7 @@ hme_init(sc) bus_space_write_4(t, mac, HME_MACI_FCCNT, 0); bus_space_write_4(t, mac, HME_MACI_EXCNT, 0); bus_space_write_4(t, mac, HME_MACI_LTCNT, 0); - bus_space_write_4(t, mac, HME_MACI_TXSIZE, HME_MTU); + bus_space_write_4(t, mac, HME_MACI_TXSIZE, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); /* Load station MAC address */ ea = sc->sc_enaddr; @@ -544,7 +540,7 @@ hme_init(sc) bus_space_write_4(t, etx, HME_ETXI_RSIZE, HME_TX_RING_SIZE); bus_space_write_4(t, erx, HME_ERXI_RING, sc->sc_rb.rb_rxddma); - bus_space_write_4(t, mac, HME_MACI_RXSIZE, HME_MTU); + bus_space_write_4(t, mac, HME_MACI_RXSIZE, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN); /* step 8. Global Configuration & Interrupt Mask */ bus_space_write_4(t, seb, HME_SEBI_IMASK, diff --git a/sys/dev/ic/hmereg.h b/sys/dev/ic/hmereg.h index 5a256ef2341..c37e138adf2 100644 --- a/sys/dev/ic/hmereg.h +++ b/sys/dev/ic/hmereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hmereg.h,v 1.6 2003/10/21 18:58:49 jmc Exp $ */ +/* $OpenBSD: hmereg.h,v 1.7 2004/09/28 00:21:23 brad Exp $ */ /* $NetBSD: hmereg.h,v 1.8 2001/04/30 12:22:42 bouyer Exp $ */ /*- @@ -305,10 +305,3 @@ struct hme_xd { (((sz) << 0) & HME_XD_TXLENMSK) #define HME_XD_DECODE_TSIZE(flags) \ (((flags) & HME_XD_TXLENMSK) >> 0) - -#ifndef EVL_ENCAPLEN /* defined if NVLAN > 0 */ -#define EVL_ENCAPLEN 0 -#endif - -#define HME_MTU \ - (ETHERMTU + EVL_ENCAPLEN + sizeof(u_int32_t) + sizeof(struct ether_header)) |