All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mt7601u: don't warn about devices without per-rate power table
@ 2015-06-10 18:10 Jakub Kicinski
  2015-06-15  9:51 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Kicinski @ 2015-06-10 18:10 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, Jakub Kicinski

From: Jakub Kicinski <kubakici@wp.pl>

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: Jakub Kicinski <kubakici@wp.pl>
---
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(+)

diff --git a/drivers/net/wireless/mediatek/mt7601u/eeprom.c b/drivers/net/wireless/mediatek/mt7601u/eeprom.c
index ce3837f270f0..8d8ee0344f7b 100644
--- a/drivers/net/wireless/mediatek/mt7601u/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt7601u/eeprom.c
@@ -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 */
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: mt7601u: don't warn about devices without per-rate power table
  2015-06-10 18:10 [PATCH] mt7601u: don't warn about devices without per-rate power table Jakub Kicinski
@ 2015-06-15  9:51 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-06-15  9:51 UTC (permalink / raw)
  To: Jakub Kici?ski; +Cc: linux-wireless, Jakub Kicinski


> From: Jakub Kicinski <kubakici@wp.pl>
> 
> 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: Jakub Kicinski <kubakici@wp.pl>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-15  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 18:10 [PATCH] mt7601u: don't warn about devices without per-rate power table Jakub Kicinski
2015-06-15  9:51 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.