kmod-sched-cake: bump to 20180827
[openwrt/staging/wigyori.git] / package / kernel / mac80211 / patches / 380-0007-ath-add-support-to-get-the-detected-radar-specificat.patch
1 From f40105e6747892e8edab94020567c158c9bec0df Mon Sep 17 00:00:00 2001
2 From: Sriram R <srirrama@codeaurora.org>
3 Date: Tue, 15 May 2018 14:39:48 +0530
4 Subject: [PATCH] ath: add support to get the detected radar specifications
5
6 This enables ath10k/ath9k drivers to collect the specifications of the
7 radar type once it is detected by the dfs pattern detector unit.
8 Usage of the collected info is specific to driver implementation.
9 For example, collected radar info could be used by the host driver
10 to send to co-processors for additional processing/validation.
11
12 Note: 'radar_detector_specs' data containing the specifications of
13 different radar types which was private within dfs_pattern_detector/
14 dfs_pri_detector is now shared with drivers as well for making use
15 of this information.
16
17 Signed-off-by: Sriram R <srirrama@codeaurora.org>
18 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
19 ---
20 drivers/net/wireless/ath/ath10k/wmi.c | 2 +-
21 drivers/net/wireless/ath/ath9k/dfs.c | 2 +-
22 drivers/net/wireless/ath/dfs_pattern_detector.c | 5 ++++-
23 drivers/net/wireless/ath/dfs_pattern_detector.h | 3 ++-
24 drivers/net/wireless/ath/dfs_pri_detector.h | 3 ++-
25 5 files changed, 10 insertions(+), 5 deletions(-)
26
27 --- a/drivers/net/wireless/ath/ath10k/wmi.c
28 +++ b/drivers/net/wireless/ath/ath10k/wmi.c
29 @@ -3712,7 +3712,7 @@ static void ath10k_dfs_radar_report(stru
30
31 ATH10K_DFS_STAT_INC(ar, pulses_detected);
32
33 - if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe)) {
34 + if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe, NULL)) {
35 ath10k_dbg(ar, ATH10K_DBG_REGULATORY,
36 "dfs no pulse pattern detected, yet\n");
37 return;
38 --- a/drivers/net/wireless/ath/ath9k/dfs.c
39 +++ b/drivers/net/wireless/ath/ath9k/dfs.c
40 @@ -279,7 +279,7 @@ ath9k_dfs_process_radar_pulse(struct ath
41 DFS_STAT_INC(sc, pulses_processed);
42 if (pd == NULL)
43 return;
44 - if (!pd->add_pulse(pd, pe))
45 + if (!pd->add_pulse(pd, pe, NULL))
46 return;
47 DFS_STAT_INC(sc, radar_detected);
48 ieee80211_radar_detected(sc->hw);
49 --- a/drivers/net/wireless/ath/dfs_pattern_detector.c
50 +++ b/drivers/net/wireless/ath/dfs_pattern_detector.c
51 @@ -268,7 +268,8 @@ static void dpd_exit(struct dfs_pattern_
52 }
53
54 static bool
55 -dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event)
56 +dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event,
57 + struct radar_detector_specs *rs)
58 {
59 u32 i;
60 struct channel_detector *cd;
61 @@ -294,6 +295,8 @@ dpd_add_pulse(struct dfs_pattern_detecto
62 struct pri_detector *pd = cd->detectors[i];
63 struct pri_sequence *ps = pd->add_pulse(pd, event);
64 if (ps != NULL) {
65 + if (rs != NULL)
66 + memcpy(rs, pd->rs, sizeof(*rs));
67 ath_dbg(dpd->common, DFS,
68 "DFS: radar found on freq=%d: id=%d, pri=%d, "
69 "count=%d, count_false=%d\n",
70 --- a/drivers/net/wireless/ath/dfs_pattern_detector.h
71 +++ b/drivers/net/wireless/ath/dfs_pattern_detector.h
72 @@ -97,7 +97,8 @@ struct dfs_pattern_detector {
73 bool (*set_dfs_domain)(struct dfs_pattern_detector *dpd,
74 enum nl80211_dfs_regions region);
75 bool (*add_pulse)(struct dfs_pattern_detector *dpd,
76 - struct pulse_event *pe);
77 + struct pulse_event *pe,
78 + struct radar_detector_specs *rs);
79
80 struct ath_dfs_pool_stats (*get_stats)(struct dfs_pattern_detector *dpd);
81 enum nl80211_dfs_regions region;
82 --- a/drivers/net/wireless/ath/dfs_pri_detector.h
83 +++ b/drivers/net/wireless/ath/dfs_pri_detector.h
84 @@ -62,8 +62,9 @@ struct pri_detector {
85 (*add_pulse)(struct pri_detector *de, struct pulse_event *e);
86 void (*reset) (struct pri_detector *de, u64 ts);
87
88 -/* private: internal use only */
89 const struct radar_detector_specs *rs;
90 +
91 +/* private: internal use only */
92 u64 last_ts;
93 struct list_head sequences;
94 struct list_head pulses;