On Sun, Mar 26, 2023 at 05:17:36PM +1100, Jonathan Gray wrote: > there is no need to sync with FreeBSD
ok stsp > Index: sys/dev/ic/ath.c > =================================================================== > RCS file: /cvs/src/sys/dev/ic/ath.c,v > retrieving revision 1.123 > diff -u -p -r1.123 ath.c > --- sys/dev/ic/ath.c 21 Apr 2022 21:03:02 -0000 1.123 > +++ sys/dev/ic/ath.c 26 Mar 2023 06:00:43 -0000 > @@ -308,11 +308,6 @@ ath_attach(u_int16_t devid, struct ath_s > 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_s > 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 fla > 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, > 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 p > 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 p > m = NULL; > } > } > -#endif > return m; > } > > Index: sys/dev/ic/athvar.h > =================================================================== > RCS file: /cvs/src/sys/dev/ic/athvar.h,v > retrieving revision 1.35 > diff -u -p -r1.35 athvar.h > --- sys/dev/ic/athvar.h 11 Oct 2020 07:05:28 -0000 1.35 > +++ sys/dev/ic/athvar.h 26 Mar 2023 05:19:55 -0000 > @@ -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), \ > >