Commit e3343d0f authored by Ryder Lee's avatar Ryder Lee Committed by Felix Fietkau

mt76: mt7615: update radar parameters

Patch radar parameters to match the SDK to avoid possible false alarms.
Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 798bffd8
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#define to_rssi(field, rxv) ((FIELD_GET(field, rxv) - 220) / 2) #define to_rssi(field, rxv) ((FIELD_GET(field, rxv) - 220) / 2)
static const struct mt7615_dfs_radar_spec etsi_radar_specs = { static const struct mt7615_dfs_radar_spec etsi_radar_specs = {
.pulse_th = { 40, -10, -80, 800, 3360, 128, 5200 }, .pulse_th = { 110, -10, -80, 40, 5200, 128, 5200 },
.radar_pattern = { .radar_pattern = {
[5] = { 1, 0, 6, 32, 28, 0, 17, 990, 5010, 1, 1 }, [5] = { 1, 0, 6, 32, 28, 0, 17, 990, 5010, 1, 1 },
[6] = { 1, 0, 9, 32, 28, 0, 27, 615, 5010, 1, 1 }, [6] = { 1, 0, 9, 32, 28, 0, 27, 615, 5010, 1, 1 },
...@@ -34,7 +34,7 @@ static const struct mt7615_dfs_radar_spec etsi_radar_specs = { ...@@ -34,7 +34,7 @@ static const struct mt7615_dfs_radar_spec etsi_radar_specs = {
}; };
static const struct mt7615_dfs_radar_spec fcc_radar_specs = { static const struct mt7615_dfs_radar_spec fcc_radar_specs = {
.pulse_th = { 40, -10, -80, 800, 3360, 128, 5200 }, .pulse_th = { 110, -10, -80, 40, 5200, 128, 5200 },
.radar_pattern = { .radar_pattern = {
[0] = { 1, 0, 9, 32, 28, 0, 13, 508, 3076, 1, 1 }, [0] = { 1, 0, 9, 32, 28, 0, 13, 508, 3076, 1, 1 },
[1] = { 1, 0, 12, 32, 28, 0, 17, 140, 240, 1, 1 }, [1] = { 1, 0, 12, 32, 28, 0, 17, 140, 240, 1, 1 },
...@@ -45,7 +45,7 @@ static const struct mt7615_dfs_radar_spec fcc_radar_specs = { ...@@ -45,7 +45,7 @@ static const struct mt7615_dfs_radar_spec fcc_radar_specs = {
}; };
static const struct mt7615_dfs_radar_spec jp_radar_specs = { static const struct mt7615_dfs_radar_spec jp_radar_specs = {
.pulse_th = { 40, -10, -80, 800, 3360, 128, 5200 }, .pulse_th = { 110, -10, -80, 40, 5200, 128, 5200 },
.radar_pattern = { .radar_pattern = {
[0] = { 1, 0, 8, 32, 28, 0, 13, 508, 3076, 1, 1 }, [0] = { 1, 0, 8, 32, 28, 0, 13, 508, 3076, 1, 1 },
[1] = { 1, 0, 12, 32, 28, 0, 17, 140, 240, 1, 1 }, [1] = { 1, 0, 12, 32, 28, 0, 17, 140, 240, 1, 1 },
...@@ -2047,14 +2047,12 @@ mt7615_dfs_init_radar_specs(struct mt7615_phy *phy) ...@@ -2047,14 +2047,12 @@ mt7615_dfs_init_radar_specs(struct mt7615_phy *phy)
{ {
const struct mt7615_dfs_radar_spec *radar_specs; const struct mt7615_dfs_radar_spec *radar_specs;
struct mt7615_dev *dev = phy->dev; struct mt7615_dev *dev = phy->dev;
int err, i; int err, i, lpn = 500;
switch (dev->mt76.region) { switch (dev->mt76.region) {
case NL80211_DFS_FCC: case NL80211_DFS_FCC:
radar_specs = &fcc_radar_specs; radar_specs = &fcc_radar_specs;
err = mt7615_mcu_set_fcc5_lpn(dev, 8); lpn = 8;
if (err < 0)
return err;
break; break;
case NL80211_DFS_ETSI: case NL80211_DFS_ETSI:
radar_specs = &etsi_radar_specs; radar_specs = &etsi_radar_specs;
...@@ -2066,6 +2064,11 @@ mt7615_dfs_init_radar_specs(struct mt7615_phy *phy) ...@@ -2066,6 +2064,11 @@ mt7615_dfs_init_radar_specs(struct mt7615_phy *phy)
return -EINVAL; return -EINVAL;
} }
/* avoid FCC radar detection in non-FCC region */
err = mt7615_mcu_set_fcc5_lpn(dev, lpn);
if (err < 0)
return err;
for (i = 0; i < ARRAY_SIZE(radar_specs->radar_pattern); i++) { for (i = 0; i < ARRAY_SIZE(radar_specs->radar_pattern); i++) {
err = mt7615_mcu_set_radar_th(dev, i, err = mt7615_mcu_set_radar_th(dev, i,
&radar_specs->radar_pattern[i]); &radar_specs->radar_pattern[i]);
......
...@@ -430,6 +430,10 @@ mt7615_mcu_rx_radar_detected(struct mt7615_dev *dev, struct sk_buff *skb) ...@@ -430,6 +430,10 @@ mt7615_mcu_rx_radar_detected(struct mt7615_dev *dev, struct sk_buff *skb)
r = (struct mt7615_mcu_rdd_report *)skb->data; r = (struct mt7615_mcu_rdd_report *)skb->data;
if (!dev->radar_pattern.n_pulses && !r->long_detected &&
!r->constant_prf_detected && !r->staggered_prf_detected)
return;
if (r->band_idx && dev->mt76.phy2) if (r->band_idx && dev->mt76.phy2)
mphy = dev->mt76.phy2; mphy = dev->mt76.phy2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment