From 44956221150f005cd079655a4cff1a9ba60a7a1e Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 26 Mar 2023 08:45:27 +0000 Subject: [PATCH] unifdef ok stsp@ --- sys/dev/ic/ath.c | 31 +------------------------------ sys/dev/ic/athvar.h | 27 +-------------------------- 2 files changed, 2 insertions(+), 56 deletions(-) diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c index 3a3b2364728..49113c59ab3 100644 --- a/sys/dev/ic/ath.c +++ b/sys/dev/ic/ath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ath.c,v 1.123 2022/04/21 21:03:02 stsp Exp $ */ +/* $OpenBSD: ath.c,v 1.124 2023/03/26 08:45:27 jsg Exp $ */ /* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */ /*- @@ -308,11 +308,6 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) timeout_set(&sc->sc_cal_to, ath_calibrate, sc); timeout_set(&sc->sc_rssadapt_to, ath_rssadapt_updatestats, sc); -#ifdef __FreeBSD__ - ATH_TXBUF_LOCK_INIT(sc); - ATH_TXQ_LOCK_INIT(sc); -#endif - ATH_TASK_INIT(&sc->sc_txtask, ath_tx_proc, sc); ATH_TASK_INIT(&sc->sc_rxtask, ath_rx_proc, sc); ATH_TASK_INIT(&sc->sc_rxorntask, ath_rxorn_proc, sc); @@ -352,9 +347,6 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) ifp->if_start = ath_start; ifp->if_watchdog = ath_watchdog; ifp->if_ioctl = ath_ioctl; -#ifndef __OpenBSD__ - ifp->if_stop = ath_stop; /* XXX */ -#endif ifq_set_maxlen(&ifp->if_snd, ATH_TXBUF * ATH_TXDESC); ic->ic_softc = sc; @@ -472,10 +464,6 @@ ath_detach(struct ath_softc *sc, int flags) if_detach(ifp); splx(s); -#ifdef __FreeBSD__ - ATH_TXBUF_LOCK_DESTROY(sc); - ATH_TXQ_LOCK_DESTROY(sc); -#endif return 0; } @@ -983,15 +971,6 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) break; case SIOCADDMULTI: case SIOCDELMULTI: -#ifdef __FreeBSD__ - /* - * The upper layer has already installed/removed - * the multicast address(es), just recalculate the - * multicast filter for the card. - */ - if (ifp->if_flags & IFF_RUNNING) - ath_mode_init(sc); -#endif error = (cmd == SIOCADDMULTI) ? ether_addmulti(ifr, &sc->sc_ic.ic_ac) : ether_delmulti(ifr, &sc->sc_ic.ic_ac); @@ -1189,13 +1168,6 @@ ath_getmbuf(int flags, int type, u_int pktlen) struct mbuf *m; KASSERT(pktlen <= MCLBYTES, ("802.11 packet too large: %u", pktlen)); -#ifdef __FreeBSD__ - if (pktlen <= MHLEN) { - MGETHDR(m, flags, type); - } else { - m = m_getcl(flags, type, M_PKTHDR); - } -#else MGETHDR(m, flags, type); if (m != NULL && pktlen > MHLEN) { MCLGET(m, flags); @@ -1204,7 +1176,6 @@ ath_getmbuf(int flags, int type, u_int pktlen) m = NULL; } } -#endif return m; } diff --git a/sys/dev/ic/athvar.h b/sys/dev/ic/athvar.h index c8924557629..2d42be4f76c 100644 --- a/sys/dev/ic/athvar.h +++ b/sys/dev/ic/athvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: athvar.h,v 1.35 2020/10/11 07:05:28 mpi Exp $ */ +/* $OpenBSD: athvar.h,v 1.36 2023/03/26 08:45:27 jsg Exp $ */ /* $NetBSD: athvar.h,v 1.10 2004/08/10 01:03:53 dyoung Exp $ */ /*- @@ -194,15 +194,11 @@ typedef struct ath_task { } ath_task_t; struct ath_softc { -#ifndef __FreeBSD__ struct device sc_dev; -#endif struct ieee80211com sc_ic; /* IEEE 802.11 common */ -#ifndef __FreeBSD__ int (*sc_enable)(struct ath_softc *); void (*sc_disable)(struct ath_softc *); void (*sc_power)(struct ath_softc *, int); -#endif int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int); void (*sc_node_free)(struct ieee80211com *, @@ -213,16 +209,10 @@ struct ath_softc { void (*sc_recv_mgmt)(struct ieee80211com *, struct mbuf *, struct ieee80211_node *, struct ieee80211_rxinfo *, int); -#ifdef __FreeBSD__ - device_t sc_dev; -#endif bus_space_tag_t sc_st; /* bus space tag */ bus_space_handle_t sc_sh; /* bus space handle */ bus_size_t sc_ss; /* bus space size */ bus_dma_tag_t sc_dmat; /* bus DMA tag */ -#ifdef __FreeBSD__ - struct mtx sc_mtx; /* master lock (recursive) */ -#endif struct ath_hal *sc_ah; /* Atheros HAL */ unsigned int sc_invalid : 1, /* disable hardware accesses */ sc_doani : 1, /* dynamic noise immunity */ @@ -274,13 +264,7 @@ struct ath_softc { u_int32_t *sc_txlink; /* link ptr in last TX desc */ int sc_tx_timer; /* transmit timeout */ TAILQ_HEAD(, ath_buf) sc_txbuf; /* transmit buffer */ -#ifdef __FreeBSD__ - struct mtx sc_txbuflock; /* txbuf lock */ -#endif TAILQ_HEAD(, ath_buf) sc_txq; /* transmitting queue */ -#ifdef __FreeBSD__ - struct mtx sc_txqlock; /* lock on txq and txlink */ -#endif ath_task_t sc_txtask; /* tx int processing */ u_int sc_bhalq; /* HAL q for outgoing beacons */ @@ -289,22 +273,15 @@ struct ath_softc { ath_task_t sc_swbatask; /* swba int processing */ ath_task_t sc_bmisstask; /* bmiss int processing */ -#ifdef __OpenBSD__ struct timeval sc_last_ch; struct timeout sc_cal_to; struct timeval sc_last_beacon; struct timeout sc_scan_to; struct timeout sc_rssadapt_to; -#else - struct callout sc_cal_ch; /* callout handle for cals */ - struct callout sc_scan_ch; /* callout handle for scan */ -#endif struct ath_stats sc_stats; /* interface statistics */ HAL_MIB_STATS sc_mib_stats; /* MIB counter statistics */ -#ifndef __FreeBSD__ u_int sc_flags; /* misc flags */ -#endif u_int8_t sc_broadcast_addr[IEEE80211_ADDR_LEN]; @@ -352,7 +329,6 @@ enum { /* * Wrapper code */ -#ifndef __FreeBSD__ #undef KASSERT #define KASSERT(cond, complaint) if (!(cond)) panic complaint @@ -361,7 +337,6 @@ enum { #define ATH_GPIO 0x0004 /* gpio device attached */ #define ATH_IS_ENABLED(sc) ((sc)->sc_flags & ATH_ENABLED) -#endif #define ATH_LOCK_INIT(_sc) \ mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \ -- 2.20.1