]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ath: add support to get the detected radar specifications
authorSriram R <srirrama@codeaurora.org>
Tue, 15 May 2018 09:09:48 +0000 (14:39 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 25 May 2018 10:15:21 +0000 (13:15 +0300)
This enables ath10k/ath9k drivers to collect the specifications of the
radar type once it is detected by the dfs pattern detector unit.
Usage of the collected info is specific to driver implementation.
For example, collected radar info could be used by the host driver
to send to co-processors for additional processing/validation.

Note: 'radar_detector_specs' data containing the specifications of
different radar types which was private within dfs_pattern_detector/
dfs_pri_detector is now shared with drivers as well for making use
of this information.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/wmi.c
drivers/net/wireless/ath/ath9k/dfs.c
drivers/net/wireless/ath/dfs_pattern_detector.c
drivers/net/wireless/ath/dfs_pattern_detector.h
drivers/net/wireless/ath/dfs_pri_detector.h

index 46fb96ee585209f441f85b880c51817857db6e0e..1bccac002e978172421db50e8805063231cc1b3c 100644 (file)
@@ -3757,7 +3757,7 @@ static void ath10k_dfs_radar_report(struct ath10k *ar,
 
        ATH10K_DFS_STAT_INC(ar, pulses_detected);
 
-       if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe)) {
+       if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe, NULL)) {
                ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
                           "dfs no pulse pattern detected, yet\n");
                return;
index c8844f55574cb0550abaaa27ba762544da58e173..acb9602aa464feaeceec0469b3f07f43767329ac 100644 (file)
@@ -277,7 +277,7 @@ ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe)
        DFS_STAT_INC(sc, pulses_processed);
        if (pd == NULL)
                return;
-       if (!pd->add_pulse(pd, pe))
+       if (!pd->add_pulse(pd, pe, NULL))
                return;
        DFS_STAT_INC(sc, radar_detected);
        ieee80211_radar_detected(sc->hw);
index 448b83eea810b07d0e77bec464d1353b77ae2021..d52b31b45df7d1fd20f301573e7e5f0379df02b5 100644 (file)
@@ -268,7 +268,8 @@ static void dpd_exit(struct dfs_pattern_detector *dpd)
 }
 
 static bool
-dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event)
+dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event,
+             struct radar_detector_specs *rs)
 {
        u32 i;
        struct channel_detector *cd;
@@ -294,6 +295,8 @@ dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event)
                struct pri_detector *pd = cd->detectors[i];
                struct pri_sequence *ps = pd->add_pulse(pd, event);
                if (ps != NULL) {
+                       if (rs != NULL)
+                               memcpy(rs, pd->rs, sizeof(*rs));
                        ath_dbg(dpd->common, DFS,
                                "DFS: radar found on freq=%d: id=%d, pri=%d, "
                                "count=%d, count_false=%d\n",
index 92be3530e9b5e4a36538b10594aab5f39a9c2847..18db6f4f3568c870c38414364f972265b01e5f23 100644 (file)
@@ -97,7 +97,8 @@ struct dfs_pattern_detector {
        bool (*set_dfs_domain)(struct dfs_pattern_detector *dpd,
                           enum nl80211_dfs_regions region);
        bool (*add_pulse)(struct dfs_pattern_detector *dpd,
-                         struct pulse_event *pe);
+                         struct pulse_event *pe,
+                         struct radar_detector_specs *rs);
 
        struct ath_dfs_pool_stats (*get_stats)(struct dfs_pattern_detector *dpd);
        enum nl80211_dfs_regions region;
index 79f0fff4d1e662d065a4afb43ebde80d83eaa96c..86339f2b4d3a9ea2b6ae490940e1e99ed955705a 100644 (file)
@@ -62,8 +62,9 @@ struct pri_detector {
             (*add_pulse)(struct pri_detector *de, struct pulse_event *e);
        void (*reset)    (struct pri_detector *de, u64 ts);
 
-/* private: internal use only */
        const struct radar_detector_specs *rs;
+
+/* private: internal use only */
        u64 last_ts;
        struct list_head sequences;
        struct list_head pulses;