2009-04-07 16:13:25 +00:00
|
|
|
--- a/ath/if_ath.c
|
|
|
|
+++ b/ath/if_ath.c
|
2009-05-07 10:10:06 +00:00
|
|
|
@@ -797,7 +797,6 @@ ath_attach(u_int16_t devid, struct net_d
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
- sc->sc_setdefantenna = ath_setdefantenna;
|
|
|
|
sc->sc_rc = ieee80211_rate_attach(sc, ratectl);
|
|
|
|
if (sc->sc_rc == NULL) {
|
|
|
|
error = EIO;
|
2009-05-31 02:25:32 +00:00
|
|
|
@@ -2624,9 +2623,6 @@ ath_init(struct net_device *dev)
|
2009-05-07 10:10:06 +00:00
|
|
|
ath_radar_update(sc);
|
|
|
|
ath_rp_flush(sc);
|
|
|
|
|
|
|
|
- /* Set the default RX antenna; it may get lost on reset. */
|
|
|
|
- ath_setdefantenna(sc, sc->sc_defant);
|
|
|
|
-
|
|
|
|
/*
|
|
|
|
* Setup the hardware after reset: the key cache
|
|
|
|
* is filled as needed and the receive engine is
|
2009-05-31 02:25:32 +00:00
|
|
|
@@ -3019,7 +3015,6 @@ ath_reset(struct net_device *dev)
|
2009-05-07 10:10:06 +00:00
|
|
|
ath_setintmit(sc);
|
|
|
|
ath_update_txpow(sc); /* update tx power state */
|
|
|
|
ath_radar_update(sc);
|
|
|
|
- ath_setdefantenna(sc, sc->sc_defant);
|
|
|
|
if (ath_startrecv(sc) != 0) /* restart recv */
|
|
|
|
EPRINTF(sc, "Unable to start receive logic.\n");
|
|
|
|
if (sc->sc_softled)
|
2009-05-31 02:25:32 +00:00
|
|
|
@@ -5353,27 +5348,6 @@ ath_beacon_send(struct ath_softc *sc, in
|
2009-04-07 16:13:25 +00:00
|
|
|
} else if ((sc->sc_updateslot == COMMIT) && (sc->sc_slotupdate == slot))
|
|
|
|
ath_setslottime(sc); /* commit change to hardware */
|
|
|
|
|
|
|
|
- if ((!sc->sc_stagbeacons || slot == 0) && (!sc->sc_diversity)) {
|
|
|
|
- unsigned int otherant;
|
|
|
|
- /*
|
|
|
|
- * Check recent per-antenna transmit statistics and flip
|
|
|
|
- * the default rx antenna if noticeably more frames went out
|
|
|
|
- * on the non-default antenna. Only do this if rx diversity
|
|
|
|
- * is off.
|
|
|
|
- * XXX assumes 2 antennae
|
|
|
|
- */
|
|
|
|
- otherant = sc->sc_defant & 1 ? 2 : 1;
|
|
|
|
- if (sc->sc_ant_tx[otherant] > sc->sc_ant_tx[sc->sc_defant] +
|
|
|
|
- ATH_ANTENNA_DIFF) {
|
|
|
|
- DPRINTF(sc, ATH_DEBUG_BEACON,
|
|
|
|
- "Flip default antenna to %u, %u > %u\n",
|
|
|
|
- otherant, sc->sc_ant_tx[otherant],
|
|
|
|
- sc->sc_ant_tx[sc->sc_defant]);
|
|
|
|
- ath_setdefantenna(sc, otherant);
|
|
|
|
- }
|
|
|
|
- sc->sc_ant_tx[1] = sc->sc_ant_tx[2] = 0;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (bfaddr != 0) {
|
|
|
|
/*
|
|
|
|
* Stop any current DMA and put the new frame(s) on the queue.
|
2009-05-31 02:25:32 +00:00
|
|
|
@@ -6734,9 +6708,8 @@ ath_setdefantenna(struct ath_softc *sc,
|
2009-05-07 10:10:06 +00:00
|
|
|
{
|
|
|
|
struct ath_hal *ah = sc->sc_ah;
|
|
|
|
|
|
|
|
- /* XXX block beacon interrupts */
|
|
|
|
- ath_hal_setdiversity(ah, (sc->sc_diversity != 0));
|
|
|
|
ath_hal_setdefantenna(ah, antenna);
|
2009-07-14 16:07:26 +00:00
|
|
|
+ ath_hal_setantennaswitch(ah, sc->sc_diversity ? 0 : antenna);
|
2009-05-07 10:10:06 +00:00
|
|
|
if (sc->sc_defant != antenna)
|
|
|
|
sc->sc_stats.ast_ant_defswitch++;
|
|
|
|
sc->sc_defant = antenna;
|
2009-09-09 00:17:13 +00:00
|
|
|
@@ -11160,7 +11133,7 @@ ATH_SYSCTL_DECL(ath_sysctl_halparam, ctl
|
2009-05-07 10:10:06 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
sc->sc_diversity = val;
|
|
|
|
- ath_hal_setdiversity(ah, val);
|
|
|
|
+ ath_setdefantenna(sc, sc->sc_defant);
|
|
|
|
break;
|
|
|
|
case ATH_TXINTRPERIOD:
|
|
|
|
/* XXX: validate? */
|
|
|
|
--- a/ath/if_athvar.h
|
|
|
|
+++ b/ath/if_athvar.h
|
|
|
|
@@ -640,7 +640,6 @@ struct ath_softc {
|
|
|
|
spinlock_t sc_hal_lock; /* hardware access lock */
|
|
|
|
struct ath_ratectrl *sc_rc; /* tx rate control support */
|
|
|
|
struct ath_tx99 *sc_tx99; /* tx99 support */
|
|
|
|
- void (*sc_setdefantenna)(struct ath_softc *, u_int);
|
|
|
|
const struct ath_hw_detect *sc_hwinfo;
|
|
|
|
|
|
|
|
unsigned int sc_invalid:1; /* being detached */
|