Remove all the compatibility hacks for systems that predate FreeBSD 8. Some of

these look to be cut and pasted from other drivers since this driver was
committed to FreeBSD 7-current and MFC'd to FreeBSD 6. The ones for FreeBSD 4
and 5 likely never were working...
This commit is contained in:
Warner Losh 2020-03-01 17:27:30 +00:00
parent 246da17ee5
commit 55e306cb12
2 changed files with 0 additions and 50 deletions

View File

@ -1407,14 +1407,8 @@ bce_attach(device_t dev)
ifp->if_capabilities = BCE_IF_CAPABILITIES;
}
#if __FreeBSD_version >= 800505
/*
* Introducing IFCAP_LINKSTATE didn't bump __FreeBSD_version
* so it's approximate value.
*/
if ((sc->bce_phy_flags & BCE_PHY_REMOTE_CAP_FLAG) != 0)
ifp->if_capabilities |= IFCAP_LINKSTATE;
#endif
ifp->if_capenable = ifp->if_capabilities;
@ -1490,13 +1484,8 @@ bce_attach(device_t dev)
/* Attach to the Ethernet interface list. */
ether_ifattach(ifp, sc->eaddr);
#if __FreeBSD_version < 500000
callout_init(&sc->bce_tick_callout);
callout_init(&sc->bce_pulse_callout);
#else
callout_init_mtx(&sc->bce_tick_callout, &sc->bce_mtx, 0);
callout_init_mtx(&sc->bce_pulse_callout, &sc->bce_mtx, 0);
#endif
/* Hookup IRQ last. */
rc = bus_setup_intr(dev, sc->bce_res_irq, INTR_TYPE_NET | INTR_MPSAFE,
@ -6801,14 +6790,9 @@ bce_rx_intr(struct bce_softc *sc)
DBRUN(sc->vlan_tagged_frames_rcvd++);
if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) {
DBRUN(sc->vlan_tagged_frames_stripped++);
#if __FreeBSD_version < 700000
VLAN_INPUT_TAG(ifp, m0,
l2fhdr->l2_fhdr_vlan_tag, continue);
#else
m0->m_pkthdr.ether_vtag =
l2fhdr->l2_fhdr_vlan_tag;
m0->m_flags |= M_VLANTAG;
#endif
} else {
/*
* bce(4) controllers can't disable VLAN

View File

@ -490,18 +490,6 @@ default: DBPRINT(sc, BCE_INSANE_PHY, \
#endif /* BCE_DEBUG */
#if __FreeBSD_version < 800054
#if defined(__i386__) || defined(__amd64__)
#define mb() __asm volatile("mfence" ::: "memory")
#define wmb() __asm volatile("sfence" ::: "memory")
#define rmb() __asm volatile("lfence" ::: "memory")
#else
#define mb()
#define rmb()
#define wmb()
#endif
#endif
/****************************************************************************/
/* Device identification definitions. */
/****************************************************************************/
@ -577,7 +565,6 @@ struct bce_type {
/****************************************************************************/
/* Byte order conversions. */
/****************************************************************************/
#if __FreeBSD_version >= 500000
#define bce_htobe16(x) htobe16(x)
#define bce_htobe32(x) htobe32(x)
#define bce_htobe64(x) htobe64(x)
@ -591,22 +578,6 @@ struct bce_type {
#define bce_le16toh(x) le16toh(x)
#define bce_le32toh(x) le32toh(x)
#define bce_le64toh(x) le64toh(x)
#else
#define bce_htobe16(x) (x)
#define bce_htobe32(x) (x)
#define bce_htobe64(x) (x)
#define bce_htole16(x) (x)
#define bce_htole32(x) (x)
#define bce_htole64(x) (x)
#define bce_be16toh(x) (x)
#define bce_be32toh(x) (x)
#define bce_be64toh(x) (x)
#define bce_le16toh(x) (x)
#define bce_le32toh(x) (x)
#define bce_le64toh(x) (x)
#endif
/****************************************************************************/
/* NVRAM Access */
@ -6336,14 +6307,9 @@ struct fw_info {
#define BCE_IF_HWASSIST (CSUM_TCP | CSUM_UDP)
#endif
#if __FreeBSD_version < 700000
#define BCE_IF_CAPABILITIES (IFCAP_VLAN_MTU | \
IFCAP_VLAN_HWTAGGING | IFCAP_HWCSUM | IFCAP_JUMBO_MTU)
#else
#define BCE_IF_CAPABILITIES (IFCAP_VLAN_MTU | \
IFCAP_VLAN_HWTAGGING | IFCAP_HWCSUM | \
IFCAP_JUMBO_MTU | IFCAP_VLAN_HWCSUM)
#endif
#define BCE_MIN_MTU 60
#define BCE_MIN_ETHER_MTU 64