3 @@ -797,7 +797,6 @@ ath_attach(u_int16_t devid, struct net_d
7 - sc->sc_setdefantenna = ath_setdefantenna;
8 sc->sc_rc = ieee80211_rate_attach(sc, ratectl);
9 if (sc->sc_rc == NULL) {
11 @@ -2623,9 +2622,6 @@ ath_init(struct net_device *dev)
15 - /* Set the default RX antenna; it may get lost on reset. */
16 - ath_setdefantenna(sc, sc->sc_defant);
19 * Setup the hardware after reset: the key cache
20 * is filled as needed and the receive engine is
21 @@ -3018,7 +3014,6 @@ ath_reset(struct net_device *dev)
23 ath_update_txpow(sc); /* update tx power state */
25 - ath_setdefantenna(sc, sc->sc_defant);
26 if (ath_startrecv(sc) != 0) /* restart recv */
27 EPRINTF(sc, "Unable to start receive logic.\n");
29 @@ -5352,27 +5347,6 @@ ath_beacon_send(struct ath_softc *sc, in
30 } else if ((sc->sc_updateslot == COMMIT) && (sc->sc_slotupdate == slot))
31 ath_setslottime(sc); /* commit change to hardware */
33 - if ((!sc->sc_stagbeacons || slot == 0) && (!sc->sc_diversity)) {
34 - unsigned int otherant;
36 - * Check recent per-antenna transmit statistics and flip
37 - * the default rx antenna if noticeably more frames went out
38 - * on the non-default antenna. Only do this if rx diversity
40 - * XXX assumes 2 antennae
42 - otherant = sc->sc_defant & 1 ? 2 : 1;
43 - if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] +
45 - DPRINTF(sc, ATH_DEBUG_BEACON,
46 - "Flip default antenna to %u, %u > %u\n",
47 - otherant, sc->sc_ant_tx[otherant],
48 - sc->sc_ant_tx[sc->sc_defant]);
49 - ath_setdefantenna(sc, otherant);
51 - sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0;
56 * Stop any current DMA and put the new frame(s) on the queue.
57 @@ -6733,9 +6707,8 @@ ath_setdefantenna(struct ath_softc *sc,
59 struct ath_hal *ah = sc->sc_ah;
61 - /* XXX block beacon interrupts */
62 - ath_hal_setdiversity(ah, (sc->sc_diversity != 0));
63 ath_hal_setdefantenna(ah, antenna);
64 + ath_hal_setantennaswitch(ah, sc->sc_diversity ? 0 : sc->sc_defant);
65 if (sc->sc_defant != antenna)
66 sc->sc_stats.ast_ant_defswitch++;
67 sc->sc_defant = antenna;
68 @@ -11154,7 +11127,7 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
71 sc->sc_diversity = val;
72 - ath_hal_setdiversity(ah, val);
73 + ath_setdefantenna(sc, sc->sc_defant);
75 case ATH_TXINTRPERIOD:
79 @@ -640,7 +640,6 @@ struct ath_softc {
80 spinlock_t sc_hal_lock; /* hardware access lock */
81 struct ath_ratectrl *sc_rc; /* tx rate control support */
82 struct ath_tx99 *sc_tx99; /* tx99 support */
83 - void (*sc_setdefantenna)(struct ath_softc *, u_int);
84 const struct ath_hw_detect *sc_hwinfo;
86 unsigned int sc_invalid:1; /* being detached */