aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ath
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2017-01-27 01:17:00 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2017-01-27 01:17:00 +0000
commit46be12ae133af76e256e11f0e5595aa2270d13c2 (patch)
tree88220bd983c072ca29f06626752981400ce09bb5 /sys/dev/ath
parenta196ef645ab92bd5aa98581f0bf43f54ae45a4fa (diff)
Notes
Diffstat (limited to 'sys/dev/ath')
-rw-r--r--sys/dev/ath/if_ath.c103
1 files changed, 103 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 477f88c44898..e88f7fc0b4ec 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -634,6 +634,17 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
#endif
/*
+ * Force the chip awake during setup, just to keep
+ * the HAL/driver power tracking happy.
+ *
+ * There are some methods (eg ath_hal_setmac())
+ * that poke the hardware.
+ */
+ ATH_LOCK(sc);
+ ath_power_setpower(sc, HAL_PM_AWAKE, 1);
+ ATH_UNLOCK(sc);
+
+ /*
* Setup the DMA/EDMA functions based on the current
* hardware support.
*
@@ -1010,6 +1021,28 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
sc->sc_rx_lnamixer = ath_hal_hasrxlnamixer(ah);
sc->sc_hasdivcomb = ath_hal_hasdivantcomb(ah);
+ /*
+ * Some WB335 cards do not support antenna diversity. Since
+ * we use a hardcoded value for AR9565 instead of using the
+ * EEPROM/OTP data, remove the combining feature from
+ * the HW capabilities bitmap.
+ */
+ /*
+ * XXX TODO: check reference driver and ath9k for what to do
+ * here for WB335. I think we have to actually disable the
+ * LNA div processing in the HAL and instead use the hard
+ * coded values; and then use BT diversity.
+ *
+ * .. but also need to setup MCI too for WB335..
+ */
+#if 0
+ if (sc->sc_pci_devinfo & (ATH9K_PCI_AR9565_1ANT | ATH9K_PCI_AR9565_2ANT)) {
+ device_printf(sc->sc_dev, "%s: WB335: disabling LNA mixer diversity\n",
+ __func__);
+ sc->sc_dolnadiv = 0;
+ }
+#endif
+
if (ath_hal_hasfastframes(ah))
ic->ic_caps |= IEEE80211_C_FF;
wmodes = ath_hal_getwirelessmodes(ah);
@@ -1351,6 +1384,7 @@ bad2:
ath_desc_free(sc);
ath_txdma_teardown(sc);
ath_rxdma_teardown(sc);
+
bad:
if (ah)
ath_hal_detach(ah);
@@ -3611,6 +3645,8 @@ ath_mode_init(struct ath_softc *sc)
struct ath_hal *ah = sc->sc_ah;
u_int32_t rfilt;
+ /* XXX power state? */
+
/* configure rx filter */
rfilt = ath_calcrxfilter(sc);
ath_hal_setrxfilter(ah, rfilt);
@@ -5654,6 +5690,56 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
*/
IEEE80211_LOCK_ASSERT(ic);
+ /*
+ * XXX TODO: if nstate is _S_CAC, then we should disable
+ * ACK processing until CAC is completed.
+ */
+
+ /*
+ * XXX TODO: if we're on a passive channel, then we should
+ * not allow any ACKs or self-generated frames until we hear
+ * a beacon. Unfortunately there isn't a notification from
+ * net80211 so perhaps we could slot that particular check
+ * into the mgmt receive path and just ensure that we clear
+ * it on RX of beacons in passive mode (and only clear it
+ * once, obviously.)
+ */
+
+ /*
+ * XXX TODO: net80211 should be tracking whether channels
+ * have heard beacons and are thus considered "OK" for
+ * transmitting - and then inform the driver about this
+ * state change. That way if we hear an AP go quiet
+ * (and nothing else is beaconing on a channel) the
+ * channel can go back to being passive until another
+ * beacon is heard.
+ */
+
+ /*
+ * XXX TODO: if nstate is _S_CAC, then we should disable
+ * ACK processing until CAC is completed.
+ */
+
+ /*
+ * XXX TODO: if we're on a passive channel, then we should
+ * not allow any ACKs or self-generated frames until we hear
+ * a beacon. Unfortunately there isn't a notification from
+ * net80211 so perhaps we could slot that particular check
+ * into the mgmt receive path and just ensure that we clear
+ * it on RX of beacons in passive mode (and only clear it
+ * once, obviously.)
+ */
+
+ /*
+ * XXX TODO: net80211 should be tracking whether channels
+ * have heard beacons and are thus considered "OK" for
+ * transmitting - and then inform the driver about this
+ * state change. That way if we hear an AP go quiet
+ * (and nothing else is beaconing on a channel) the
+ * channel can go back to being passive until another
+ * beacon is heard.
+ */
+
if (nstate == IEEE80211_S_RUN) {
/* NB: collect bss node again, it may have changed */
ieee80211_free_node(ni);
@@ -5675,6 +5761,14 @@ ath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
case IEEE80211_M_HOSTAP:
case IEEE80211_M_IBSS:
case IEEE80211_M_MBSS:
+
+ /*
+ * TODO: Enable ACK processing (ie, clear AR_DIAG_ACK_DIS.)
+ * For channels that are in CAC, we may have disabled
+ * this during CAC to ensure we don't ACK frames
+ * sent to us.
+ */
+
/*
* Allocate and setup the beacon frame.
*
@@ -6279,6 +6373,15 @@ ath_dfs_tasklet(void *p, int npending)
*/
if (ath_dfs_process_radar_event(sc, sc->sc_curchan)) {
/* DFS event found, initiate channel change */
+
+ /*
+ * XXX TODO: immediately disable ACK processing
+ * on the current channel. This would be done
+ * by setting AR_DIAG_ACK_DIS (AR5212; may be
+ * different for others) until we are out of
+ * CAC.
+ */
+
/*
* XXX doesn't currently tell us whether the event
* XXX was found in the primary or extension