mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7996: add sanity checks for background radar trigger
Check if background radar is enabled or not before manually triggering it, and also add more checks in radar detected event. Signed-off-by: StanleyYP Wang <[email protected]> Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
f70cb4f050
commit
5f1bf88652
@@ -225,6 +225,11 @@ mt7996_radar_trigger(void *data, u64 val)
|
||||
if (val > MT_RX_SEL2)
|
||||
return -EINVAL;
|
||||
|
||||
if (val == MT_RX_SEL2 && !dev->rdd2_phy) {
|
||||
dev_err(dev->mt76.dev, "Background radar is not enabled\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return mt7996_mcu_rdd_cmd(dev, RDD_RADAR_EMULATE,
|
||||
val, 0, 0);
|
||||
}
|
||||
|
||||
+4
-1
@@ -355,7 +355,10 @@ mt7996_mcu_rx_radar_detected(struct mt7996_dev *dev, struct sk_buff *skb)
|
||||
if (r->band_idx >= ARRAY_SIZE(dev->mt76.phys))
|
||||
return;
|
||||
|
||||
if (dev->rdd2_phy && r->band_idx == MT_RX_SEL2)
|
||||
if (r->band_idx == MT_RX_SEL2 && !dev->rdd2_phy)
|
||||
return;
|
||||
|
||||
if (r->band_idx == MT_RX_SEL2)
|
||||
mphy = dev->rdd2_phy->mt76;
|
||||
else
|
||||
mphy = dev->mt76.phys[r->band_idx];
|
||||
|
||||
Reference in New Issue
Block a user