From 0263711ba362e36d6dcdcd2461c1a7ad7cf5098c Mon Sep 17 00:00:00 2001 From: Nicolas Cavallari Date: Thu, 10 Nov 2022 16:39:50 +0100 Subject: [PATCH] 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 Signed-off-by: Felix Fietkau --- mt7915/eeprom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c index e2482c65..83bced0c 100644 --- a/mt7915/eeprom.c +++ b/mt7915/eeprom.c @@ -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;