Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jun 2011 04:14:59 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222668 - head/sys/dev/ath
Message-ID:  <201106040414.p544ExZO093320@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sat Jun  4 04:14:59 2011
New Revision: 222668
URL: http://svn.freebsd.org/changeset/base/222668

Log:
  A few changes to make radar detection implementable in a hal_dfs/
  module.
  
  * If sc->sc_dodfs is set to 1 by the ath_dfs_radar_enable(),
    set the relevant rx filter bit to begin receiving radar PHY
    errors. The HAL code already knows how to set the relevant
    error mask register to enable radar events.
  
  * Add a missing call to ath_dfs_radar_enable() after ath_hal_reset()
  
  * change ath_dfs_process_phyerr() to take a const char *buf for now,
    rather than a descriptor. This way it can get access to the packet
    buffer contents.

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_athdfs.h
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Sat Jun  4 04:00:40 2011	(r222667)
+++ head/sys/dev/ath/if_ath.c	Sat Jun  4 04:14:59 2011	(r222668)
@@ -1261,6 +1261,10 @@ ath_resume(struct ath_softc *sc)
 	    sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan,
 	    AH_FALSE, &status);
 	ath_reset_keycache(sc);
+
+	/* Let DFS at it in case it's a DFS channel */
+	ath_dfs_radar_enable(sc, ic->ic_curchan);
+
 	if (sc->sc_resume_up) {
 		if (ic->ic_opmode == IEEE80211_M_STA) {
 			ath_init(sc);
@@ -2013,6 +2017,10 @@ ath_calcrxfilter(struct ath_softc *sc)
 	if (ic->ic_opmode == IEEE80211_M_MONITOR)
 		rfilt |= HAL_RX_FILTER_CONTROL;
 
+	if (sc->sc_dodfs) {
+		rfilt |= HAL_RX_FILTER_PHYRADAR;
+	}
+
 	/*
 	 * Enable RX of compressed BAR frames only when doing
 	 * 802.11n. Required for A-MPDU.
@@ -3465,7 +3473,7 @@ ath_rx_proc(void *arg, int npending)
 			if (rs->rs_status & HAL_RXERR_PHY) {
 				sc->sc_stats.ast_rx_phyerr++;
 				/* Process DFS radar events */
-				ath_dfs_process_phy_err(sc, ds, tsf, rs);
+				ath_dfs_process_phy_err(sc, mtod(m, char *), tsf, rs);
 
 				/* Be suitably paranoid about receiving phy errors out of the stats array bounds */
 				if (rs->rs_phyerr < 64)

Modified: head/sys/dev/ath/if_athdfs.h
==============================================================================
--- head/sys/dev/ath/if_athdfs.h	Sat Jun  4 04:00:40 2011	(r222667)
+++ head/sys/dev/ath/if_athdfs.h	Sat Jun  4 04:14:59 2011	(r222668)
@@ -35,7 +35,7 @@ extern	int ath_dfs_attach(struct ath_sof
 extern	int ath_dfs_detach(struct ath_softc *sc);
 extern	void ath_dfs_radar_enable(struct ath_softc *,
     struct ieee80211_channel *chan);
-extern	void ath_dfs_process_phy_err(struct ath_softc *sc, struct ath_desc *ds,
+extern	void ath_dfs_process_phy_err(struct ath_softc *sc, const char *buf,
     uint64_t tsf, struct ath_rx_status *rxstat);
 extern	int ath_dfs_process_radar_event(struct ath_softc *sc,
     struct ieee80211_channel *chan);

Modified: head/sys/dev/ath/if_athvar.h
==============================================================================
--- head/sys/dev/ath/if_athvar.h	Sat Jun  4 04:00:40 2011	(r222667)
+++ head/sys/dev/ath/if_athvar.h	Sat Jun  4 04:14:59 2011	(r222668)
@@ -360,6 +360,7 @@ struct ath_softc {
 
 	/* DFS related state */
 	void			*sc_dfs;	/* Used by an optional DFS module */
+	int			sc_dodfs;	/* Whether to enable DFS rx filter bits */
 	struct task		sc_dfstask;	/* DFS processing task */
 };
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106040414.p544ExZO093320>