Skip to contentSkip to conversation

mt7601u: don't warn about devices without per-rate power table

PATCH Applied Jakub Kicinski 2 participants 2 messages Jun 10, 2015 – Jun 15, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mt7601u: don't warn about devices without per-rate power table

From: Jakub Kicinski <[email protected]>

We expect EEPROM per-rate power table to be filled with s6 values and warn user if values are invalid. However, there appear to be devices which don't have this section of EEPROM initialized. In such case we should ignore the values and leave the driver power tables set to zero.

Note that vendor driver doesn't care about this case but mt76x2 skips 0xff per value. We take mt76x2's approach.

---
Kalle, I tried my best with patchwork settings but if my name still contains a question mark on this submission you can go ahead and apply automatically anyway. The patch itself does not have any hairy characters and Johannes said on IRC yesterday that pwclient ends up doing the right thing in this case.
---
drivers/net/wireless/mediatek/mt7601u/eeprom.c | 4 ++++

 1 file changed, 4 insertions(+)
drivers/net/wireless/mediatek/mt7601u/eeprom.c +4 -0
index ce3837f270f0..8d8ee0344f7b 100644
@@ -277,6 +277,10 @@ mt7601u_extra_power_over_mac(struct mt7601u_dev *dev)
 static void
 mt7601u_set_power_rate(struct power_per_rate *rate, s8 delta, u8 value)
 {
+	/* Invalid? Note: vendor driver does not handle this */
+	if (value == 0xff)
+		return;
+
 	rate->raw = s6_validate(value);
 	rate->bw20 = s6_to_int(value);
 	/* Note: vendor driver does cap the value to s6 right away */
Signature · 1 line
2.1.0
Applied
#1 lore raw
Quoted 9 lines

From: Jakub Kicinski <[email protected]>

We expect EEPROM per-rate power table to be filled with s6 values and warn user if values are invalid. However, there appear to be devices which don't have this section of EEPROM initialized. In such case we should ignore the values and leave the driver power tables set to zero.

Quoted 4 lines

Note that vendor driver doesn't care about this case but mt76x2 skips 0xff per value. We take mt76x2's approach.

Thanks, applied to wireless-drivers-next.git. And your name looked correct in git log even though I used patchwork to apply your patch.

Kalle Valo