blob: 35595d0b3566c027e7744ca67927eba34a19acbe [file] [log] [blame]
developer27b55252022-09-05 19:09:45 +08001From ebe0cc8b9878e72143f0e24fea00ba2b474cdd6b Mon Sep 17 00:00:00 2001
developere8c82b22022-08-09 14:58:55 +08002From: Shayne Chen <shayne.chen@mediatek.com>
3Date: Tue, 26 Jul 2022 16:04:53 +0800
developer27b55252022-09-05 19:09:45 +08004Subject: [PATCH 8/8] mt76: mt7915: set the first antenna to detect radar for
developere8c82b22022-08-09 14:58:55 +08005 MT7915
6
7The default value of listening antenna set by FW might be different in
8MT7915. As most of our cooperated labs use the first antenna to verify
9the radar detection function, manually set the value by a mcu command.
10
11Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
12---
developer27b55252022-09-05 19:09:45 +080013 mt7915/mac.c | 15 +++++++++++++++
14 mt7915/mt7915.h | 1 +
developere8c82b22022-08-09 14:58:55 +080015 2 files changed, 16 insertions(+)
16
17diff --git a/mt7915/mac.c b/mt7915/mac.c
developer27b55252022-09-05 19:09:45 +080018index 31d1138..a1d5c15 100644
developere8c82b22022-08-09 14:58:55 +080019--- a/mt7915/mac.c
20+++ b/mt7915/mac.c
developer27b55252022-09-05 19:09:45 +080021@@ -1817,6 +1817,13 @@ static int mt7915_dfs_start_rdd(struct mt7915_dev *dev, int chain)
developere8c82b22022-08-09 14:58:55 +080022 if (err < 0)
23 return err;
24
25+ if (is_mt7915(&dev->mt76)) {
26+ err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_SET_WF_ANT, chain,
27+ 0, dev->dbdc_support ? 2 : 0);
28+ if (err < 0)
29+ return err;
30+ }
31+
32 return mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_DET_MODE, chain,
33 MT_RX_SEL0, 1);
34 }
developer27b55252022-09-05 19:09:45 +080035@@ -1937,6 +1944,14 @@ stop:
developere8c82b22022-08-09 14:58:55 +080036 if (err < 0)
37 return err;
38
39+ if (is_mt7915(&dev->mt76)) {
40+ err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_SET_WF_ANT,
41+ phy->band_idx, 0,
42+ dev->dbdc_support ? 2 : 0);
43+ if (err < 0)
44+ return err;
45+ }
46+
47 mt7915_dfs_stop_radar_detector(phy);
48 phy->mt76->dfs_state = MT_DFS_STATE_DISABLED;
49
50diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
developer27b55252022-09-05 19:09:45 +080051index 54ef2a1..836a7f1 100644
developere8c82b22022-08-09 14:58:55 +080052--- a/mt7915/mt7915.h
53+++ b/mt7915/mt7915.h
developer27b55252022-09-05 19:09:45 +080054@@ -359,6 +359,7 @@ enum mt7915_rdd_cmd {
developere8c82b22022-08-09 14:58:55 +080055 RDD_DET_MODE,
56 RDD_RADAR_EMULATE,
57 RDD_START_TXQ = 20,
58+ RDD_SET_WF_ANT = 30,
59 RDD_CAC_START = 50,
60 RDD_CAC_END,
61 RDD_NORMAL_START,
62--
developer27b55252022-09-05 19:09:45 +0800632.18.0
developere8c82b22022-08-09 14:58:55 +080064