developer | 27b5525 | 2022-09-05 19:09:45 +0800 | [diff] [blame^] | 1 | From ebe0cc8b9878e72143f0e24fea00ba2b474cdd6b Mon Sep 17 00:00:00 2001 |
developer | e8c82b2 | 2022-08-09 14:58:55 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Tue, 26 Jul 2022 16:04:53 +0800 |
developer | 27b5525 | 2022-09-05 19:09:45 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 8/8] mt76: mt7915: set the first antenna to detect radar for |
developer | e8c82b2 | 2022-08-09 14:58:55 +0800 | [diff] [blame] | 5 | MT7915 |
| 6 | |
| 7 | The default value of listening antenna set by FW might be different in |
| 8 | MT7915. As most of our cooperated labs use the first antenna to verify |
| 9 | the radar detection function, manually set the value by a mcu command. |
| 10 | |
| 11 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 12 | --- |
developer | 27b5525 | 2022-09-05 19:09:45 +0800 | [diff] [blame^] | 13 | mt7915/mac.c | 15 +++++++++++++++ |
| 14 | mt7915/mt7915.h | 1 + |
developer | e8c82b2 | 2022-08-09 14:58:55 +0800 | [diff] [blame] | 15 | 2 files changed, 16 insertions(+) |
| 16 | |
| 17 | diff --git a/mt7915/mac.c b/mt7915/mac.c |
developer | 27b5525 | 2022-09-05 19:09:45 +0800 | [diff] [blame^] | 18 | index 31d1138..a1d5c15 100644 |
developer | e8c82b2 | 2022-08-09 14:58:55 +0800 | [diff] [blame] | 19 | --- a/mt7915/mac.c |
| 20 | +++ b/mt7915/mac.c |
developer | 27b5525 | 2022-09-05 19:09:45 +0800 | [diff] [blame^] | 21 | @@ -1817,6 +1817,13 @@ static int mt7915_dfs_start_rdd(struct mt7915_dev *dev, int chain) |
developer | e8c82b2 | 2022-08-09 14:58:55 +0800 | [diff] [blame] | 22 | 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 | } |
developer | 27b5525 | 2022-09-05 19:09:45 +0800 | [diff] [blame^] | 35 | @@ -1937,6 +1944,14 @@ stop: |
developer | e8c82b2 | 2022-08-09 14:58:55 +0800 | [diff] [blame] | 36 | 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 | |
| 50 | diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h |
developer | 27b5525 | 2022-09-05 19:09:45 +0800 | [diff] [blame^] | 51 | index 54ef2a1..836a7f1 100644 |
developer | e8c82b2 | 2022-08-09 14:58:55 +0800 | [diff] [blame] | 52 | --- a/mt7915/mt7915.h |
| 53 | +++ b/mt7915/mt7915.h |
developer | 27b5525 | 2022-09-05 19:09:45 +0800 | [diff] [blame^] | 54 | @@ -359,6 +359,7 @@ enum mt7915_rdd_cmd { |
developer | e8c82b2 | 2022-08-09 14:58:55 +0800 | [diff] [blame] | 55 | 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 | -- |
developer | 27b5525 | 2022-09-05 19:09:45 +0800 | [diff] [blame^] | 63 | 2.18.0 |
developer | e8c82b2 | 2022-08-09 14:58:55 +0800 | [diff] [blame] | 64 | |