From owner-svn-src-all@freebsd.org Sun Mar 1 17:27:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 222A1246878; Sun, 1 Mar 2020 17:27:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48VqwM5yGDz4c6C; Sun, 1 Mar 2020 17:27:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A2336FDD; Sun, 1 Mar 2020 17:27:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 021HRUuv076650; Sun, 1 Mar 2020 17:27:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 021HRU5G076569; Sun, 1 Mar 2020 17:27:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202003011727.021HRU5G076569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 1 Mar 2020 17:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358486 - head/sys/dev/bce X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/bce X-SVN-Commit-Revision: 358486 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2020 17:27:32 -0000 Author: imp Date: Sun Mar 1 17:27:30 2020 New Revision: 358486 URL: https://svnweb.freebsd.org/changeset/base/358486 Log: 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... Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcereg.h Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Sun Mar 1 17:27:25 2020 (r358485) +++ head/sys/dev/bce/if_bce.c Sun Mar 1 17:27:30 2020 (r358486) @@ -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 Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Sun Mar 1 17:27:25 2020 (r358485) +++ head/sys/dev/bce/if_bcereg.h Sun Mar 1 17:27:30 2020 (r358486) @@ -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,23 +578,7 @@ 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