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 */
 };
 
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to