git: da6ae2cf1750 - main - rtwm: purge EOL release compatibility

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sat, 04 Feb 2023 16:20:36 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=da6ae2cf17501da968976b095d2a744045ccb870

commit da6ae2cf17501da968976b095d2a744045ccb870
Author:     Elliott Mitchell <ehem+freebsd@m5p.com>
AuthorDate: 2022-06-23 00:53:47 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-02-04 16:13:10 +0000

    rtwm: purge EOL release compatibility
    
    Remove FreeBSD 11 support
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/603
    Differential Revision: https://reviews.freebsd.org/D35560
---
 sys/dev/rtwn/if_rtwn_cam.c      | 19 -------------------
 sys/dev/rtwn/rtl8188e/r88e_rx.c | 13 -------------
 sys/dev/rtwn/rtl8192c/r92c_fw.c | 13 -------------
 sys/dev/rtwn/rtl8812a/r12a_rx.c | 13 -------------
 4 files changed, 58 deletions(-)

diff --git a/sys/dev/rtwn/if_rtwn_cam.c b/sys/dev/rtwn/if_rtwn_cam.c
index 6ee630533675..febb93fa97fd 100644
--- a/sys/dev/rtwn/if_rtwn_cam.c
+++ b/sys/dev/rtwn/if_rtwn_cam.c
@@ -117,11 +117,7 @@ rtwn_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k,
 
 	if (&vap->iv_nw_keys[0] <= k &&
 	    k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) {
-#if __FreeBSD_version > 1200018
 		*keyix = ieee80211_crypto_get_key_wepidx(vap, k);
-#else
-		*keyix = k - vap->iv_nw_keys;
-#endif
 		if (sc->sc_hwcrypto != RTWN_CRYPTO_FULL)
 			k->wk_flags |= IEEE80211_KEY_SWCRYPT;
 		else {
@@ -176,15 +172,9 @@ rtwn_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k,
 	}
 	RTWN_UNLOCK(sc);
 	if (i == sc->cam_entry_limit) {
-#if __FreeBSD_version > 1200008
 		/* XXX check and remove keys with the same MAC address */
 		k->wk_flags |= IEEE80211_KEY_SWCRYPT;
 		*keyix = 0;
-#else
-		device_printf(sc->sc_dev,
-		    "%s: no free space in the key table\n", __func__);
-		return (0);
-#endif
 	}
 
 end:
@@ -322,16 +312,7 @@ rtwn_process_key(struct ieee80211vap *vap, const struct ieee80211_key *k,
 
 	if (&vap->iv_nw_keys[0] <= k &&
 	    k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]) {
-#if __FreeBSD_version <= 1200008
-		struct ieee80211_key *k1 = &vap->iv_nw_keys[k->wk_keyix];
-
-		if (sc->sc_hwcrypto != RTWN_CRYPTO_FULL) {
-			k1->wk_flags |= IEEE80211_KEY_SWCRYPT;
-			return (k->wk_cipher->ic_setkey(k1));
-		} else {
-#else
 		if (sc->sc_hwcrypto == RTWN_CRYPTO_FULL) {
-#endif
 			struct rtwn_vap *rvp = RTWN_VAP(vap);
 
 			RTWN_LOCK(sc);
diff --git a/sys/dev/rtwn/rtl8188e/r88e_rx.c b/sys/dev/rtwn/rtl8188e/r88e_rx.c
index 16510839bd44..ec6174e3df00 100644
--- a/sys/dev/rtwn/rtl8188e/r88e_rx.c
+++ b/sys/dev/rtwn/rtl8188e/r88e_rx.c
@@ -77,9 +77,7 @@ r88e_classify_intr(struct rtwn_softc *sc, void *buf, int len)
 void
 r88e_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
 {
-#if __FreeBSD_version >= 1200012
 	struct ieee80211_ratectl_tx_status txs;
-#endif
 	struct r88e_tx_rpt_ccx *rpt;
 	struct ieee80211_node *ni;
 	uint8_t macid;
@@ -120,7 +118,6 @@ r88e_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
 		    (rpt->rptb1 & R88E_RPTB1_PKT_OK) ? "" : " not",
 		    ntries);
 
-#if __FreeBSD_version >= 1200012
 		txs.flags = IEEE80211_RATECTL_STATUS_LONG_RETRY |
 			    IEEE80211_RATECTL_STATUS_FINAL_RATE;
 		txs.long_retries = ntries;
@@ -139,16 +136,6 @@ r88e_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
 		else
 			txs.status = IEEE80211_RATECTL_TX_FAIL_UNSPECIFIED;
 		ieee80211_ratectl_tx_complete(ni, &txs);
-#else
-		struct ieee80211vap *vap = ni->ni_vap;
-		if (rpt->rptb1 & R88E_RPTB1_PKT_OK) {
-			ieee80211_ratectl_tx_complete(vap, ni,
-			    IEEE80211_RATECTL_TX_SUCCESS, &ntries, NULL);
-		} else {
-			ieee80211_ratectl_tx_complete(vap, ni,
-			    IEEE80211_RATECTL_TX_FAILURE, &ntries, NULL);
-		}
-#endif
 	} else {
 		RTWN_DPRINTF(sc, RTWN_DEBUG_INTR, "%s: macid %u, ni is NULL\n",
 		    __func__, macid);
diff --git a/sys/dev/rtwn/rtl8192c/r92c_fw.c b/sys/dev/rtwn/rtl8192c/r92c_fw.c
index 7ad6d7d2dfe6..be284ff91c61 100644
--- a/sys/dev/rtwn/rtl8192c/r92c_fw.c
+++ b/sys/dev/rtwn/rtl8192c/r92c_fw.c
@@ -364,9 +364,7 @@ r92c_set_rssi(struct rtwn_softc *sc)
 static void
 r92c_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
 {
-#if __FreeBSD_version >= 1200012
 	struct ieee80211_ratectl_tx_status txs;
-#endif
 	struct r92c_c2h_tx_rpt *rpt;
 	struct ieee80211_node *ni;
 	uint8_t macid;
@@ -412,7 +410,6 @@ r92c_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
 		    (rpt->rptb7 & R92C_RPTB7_PKT_OK) ? "" : " not",
 		    ntries);
 
-#if __FreeBSD_version >= 1200012
 		txs.flags = IEEE80211_RATECTL_STATUS_LONG_RETRY;
 		txs.long_retries = ntries;
 		if (rpt->rptb7 & R92C_RPTB7_PKT_OK)
@@ -424,16 +421,6 @@ r92c_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
 		else
 			txs.status = IEEE80211_RATECTL_TX_FAIL_UNSPECIFIED;
 		ieee80211_ratectl_tx_complete(ni, &txs);
-#else
-		struct ieee80211vap *vap = ni->ni_vap;
-		if (rpt->rptb7 & R92C_RPTB7_PKT_OK) {
-			ieee80211_ratectl_tx_complete(vap, ni,
-			    IEEE80211_RATECTL_TX_SUCCESS, &ntries, NULL);
-		} else {
-			ieee80211_ratectl_tx_complete(vap, ni,
-			    IEEE80211_RATECTL_TX_FAILURE, &ntries, NULL);
-		}
-#endif
 	} else {
 		RTWN_DPRINTF(sc, RTWN_DEBUG_INTR, "%s: macid %u, ni is NULL\n",
 		    __func__, macid);
diff --git a/sys/dev/rtwn/rtl8812a/r12a_rx.c b/sys/dev/rtwn/rtl8812a/r12a_rx.c
index 98e0cabdff7c..ebe299214e98 100644
--- a/sys/dev/rtwn/rtl8812a/r12a_rx.c
+++ b/sys/dev/rtwn/rtl8812a/r12a_rx.c
@@ -66,9 +66,7 @@ __FBSDID("$FreeBSD$");
 void
 r12a_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
 {
-#if __FreeBSD_version >= 1200012
 	struct ieee80211_ratectl_tx_status txs;
-#endif
 	struct r12a_c2h_tx_rpt *rpt;
 	struct ieee80211_node *ni;
 	int ntries;
@@ -108,7 +106,6 @@ r12a_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
 		    (rpt->txrptb0 & (R12A_TXRPTB0_RETRY_OVER |
 		    R12A_TXRPTB0_LIFE_EXPIRE)) ? " not" : "", ntries);
 
-#if __FreeBSD_version >= 1200012
 		txs.flags = IEEE80211_RATECTL_STATUS_LONG_RETRY |
 			    IEEE80211_RATECTL_STATUS_FINAL_RATE;
 		txs.long_retries = ntries;
@@ -125,16 +122,6 @@ r12a_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len)
 		else
 			txs.status = IEEE80211_RATECTL_TX_SUCCESS;
 		ieee80211_ratectl_tx_complete(ni, &txs);
-#else
-		struct ieee80211vap *vap = ni->ni_vap;
-		if (rpt->txrptb0 & R12A_TXRPTB0_RETRY_OVER) {
-			ieee80211_ratectl_tx_complete(vap, ni,
-			    IEEE80211_RATECTL_TX_FAILURE, &ntries, NULL);
-		} else {
-			ieee80211_ratectl_tx_complete(vap, ni,
-			    IEEE80211_RATECTL_TX_SUCCESS, &ntries, NULL);
-		}
-#endif
 	} else {
 		RTWN_DPRINTF(sc, RTWN_DEBUG_INTR,
 		    "%s: macid %u, ni is NULL\n", __func__, rpt->macid);