Commit 8d012374 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by Kalle Valo

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

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.
Signed-off-by: default avatarJakub Kicinski <kubakici@wp.pl>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 3bdb4a4e
...@@ -277,6 +277,10 @@ mt7601u_extra_power_over_mac(struct mt7601u_dev *dev) ...@@ -277,6 +277,10 @@ mt7601u_extra_power_over_mac(struct mt7601u_dev *dev)
static void static void
mt7601u_set_power_rate(struct power_per_rate *rate, s8 delta, u8 value) 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->raw = s6_validate(value);
rate->bw20 = s6_to_int(value); rate->bw20 = s6_to_int(value);
/* Note: vendor driver does cap the value to s6 right away */ /* Note: vendor driver does cap the value to s6 right away */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment