mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7996: rework background radar check for mt7990
The MT7990 comes in 2T2R and 3T3R variants, with only the 2T2R supporting background radar. Signed-off-by: StanleyYP Wang <[email protected]> Signed-off-by: Shayne Chen <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
10c3ea97a8
commit
bc588ac3d1
@@ -376,3 +376,30 @@ s8 mt7996_eeprom_get_power_delta(struct mt7996_dev *dev, int band)
|
|||||||
|
|
||||||
return val & MT_EE_RATE_DELTA_SIGN ? delta : -delta;
|
return val & MT_EE_RATE_DELTA_SIGN ? delta : -delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool mt7996_eeprom_has_background_radar(struct mt7996_dev *dev)
|
||||||
|
{
|
||||||
|
switch (mt76_chip(&dev->mt76)) {
|
||||||
|
case MT7996_DEVICE_ID:
|
||||||
|
if (dev->var.type == MT7996_VAR_TYPE_233)
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case MT7992_DEVICE_ID:
|
||||||
|
if (dev->var.type == MT7992_VAR_TYPE_23)
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case MT7990_DEVICE_ID: {
|
||||||
|
u8 path, rx_path, nss, *eeprom = dev->mt76.eeprom.data;
|
||||||
|
|
||||||
|
mt7996_eeprom_parse_stream(eeprom, MT_BAND1, &path, &rx_path, &nss);
|
||||||
|
/* Disable background radar capability in 3T3R */
|
||||||
|
if (path == 3 || rx_path == 3)
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|||||||
+1
-1
@@ -476,7 +476,7 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)
|
|||||||
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0);
|
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0);
|
||||||
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER);
|
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER);
|
||||||
|
|
||||||
if (mt7996_has_background_radar(dev) &&
|
if (mt7996_eeprom_has_background_radar(dev) &&
|
||||||
(!mdev->dev->of_node ||
|
(!mdev->dev->of_node ||
|
||||||
!of_property_read_bool(mdev->dev->of_node,
|
!of_property_read_bool(mdev->dev->of_node,
|
||||||
"mediatek,disable-radar-background")))
|
"mediatek,disable-radar-background")))
|
||||||
|
|||||||
+1
-19
@@ -488,25 +488,6 @@ mt7996_band_valid(struct mt7996_dev *dev, u8 band)
|
|||||||
return band <= MT_BAND2;
|
return band <= MT_BAND2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool
|
|
||||||
mt7996_has_background_radar(struct mt7996_dev *dev)
|
|
||||||
{
|
|
||||||
switch (mt76_chip(&dev->mt76)) {
|
|
||||||
case MT7996_DEVICE_ID:
|
|
||||||
if (dev->var.type == MT7996_VAR_TYPE_233)
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
case MT7992_DEVICE_ID:
|
|
||||||
if (dev->var.type == MT7992_VAR_TYPE_23)
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct mt7996_phy *
|
static inline struct mt7996_phy *
|
||||||
mt7996_band_phy(struct mt7996_dev *dev, enum nl80211_band band)
|
mt7996_band_phy(struct mt7996_dev *dev, enum nl80211_band band)
|
||||||
{
|
{
|
||||||
@@ -570,6 +551,7 @@ int mt7996_eeprom_parse_hw_cap(struct mt7996_dev *dev, struct mt7996_phy *phy);
|
|||||||
int mt7996_eeprom_get_target_power(struct mt7996_dev *dev,
|
int mt7996_eeprom_get_target_power(struct mt7996_dev *dev,
|
||||||
struct ieee80211_channel *chan);
|
struct ieee80211_channel *chan);
|
||||||
s8 mt7996_eeprom_get_power_delta(struct mt7996_dev *dev, int band);
|
s8 mt7996_eeprom_get_power_delta(struct mt7996_dev *dev, int band);
|
||||||
|
bool mt7996_eeprom_has_background_radar(struct mt7996_dev *dev);
|
||||||
int mt7996_dma_init(struct mt7996_dev *dev);
|
int mt7996_dma_init(struct mt7996_dev *dev);
|
||||||
void mt7996_dma_reset(struct mt7996_dev *dev, bool force);
|
void mt7996_dma_reset(struct mt7996_dev *dev, bool force);
|
||||||
void mt7996_dma_prefetch(struct mt7996_dev *dev);
|
void mt7996_dma_prefetch(struct mt7996_dev *dev);
|
||||||
|
|||||||
Reference in New Issue
Block a user