wifi: mt76: mt7915: fix antenna selection with bad eeprom.

If the nss value is zero in the eeprom, set it to the max.
This eeprom fragment from a mt7915 DBDC shows the problem:

00000190: 24 24 08 00 28 00 00 15 00 00 00 00 00 00 00 00

Fixes: 51a87540232c ("wifi: mt76: mt7915: rework eeprom tx paths and streams init")
Signed-off-by: Nicolas Cavallari <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Nicolas Cavallari
2022-11-11 11:38:25 +01:00
committed by Felix Fietkau
parent 1e9060420c
commit 0263711ba3
+2
View File
@@ -208,6 +208,8 @@ void mt7915_eeprom_parse_hw_cap(struct mt7915_dev *dev,
nss_max = 2;
}
if (!nss)
nss = nss_max;
nss = min_t(u8, min_t(u8, nss_max, nss), path);
mphy->chainmask = BIT(path) - 1;