From patchwork Wed Jun 10 18:10:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kici?ski X-Patchwork-Id: 6583981 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8754AC0020 for ; Wed, 10 Jun 2015 18:10:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD35320582 for ; Wed, 10 Jun 2015 18:10:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4A012057E for ; Wed, 10 Jun 2015 18:10:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754482AbbFJSKl (ORCPT ); Wed, 10 Jun 2015 14:10:41 -0400 Received: from mx4.wp.pl ([212.77.101.11]:7765 "EHLO mx4.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752742AbbFJSKj (ORCPT ); Wed, 10 Jun 2015 14:10:39 -0400 Received: (wp-smtpd smtp.wp.pl 14886 invoked from network); 10 Jun 2015 20:10:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1433959824; bh=44dWH2j2VWoqIJ+oQ6Y8P/NMi4AJ6x+tirpfApYw69s=; h=From:To:Cc:Subject; b=NQ4Hu5Si2yZiimsIrfjYmeQz7kUvcY6K5tjftpGIoZtkwYKm7mYMShb/4NNa5ltw2 YCxI0SfRL6hX+qPgYiPiB26ou9yrQFBYo7b2lvHFkYyVMAfGtffKiwPC9Lq0VLD7ak bodxezjsnTxf+Hx63TsYO0NzexFmnp2rISeocyN8= Received: from 89-69-164-220.dynamic.chello.pl (HELO north.moorray.no-ip.org) (moorray3@[89.69.164.220]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 10 Jun 2015 20:10:23 +0200 Received: by north.moorray.no-ip.org (sSMTP sendmail emulation); Wed, 10 Jun 2015 20:10:23 +0200 From: Jakub Kicinski To: Kalle Valo Cc: linux-wireless , Jakub Kicinski Subject: [PATCH] mt7601u: don't warn about devices without per-rate power table Date: Wed, 10 Jun 2015 20:10:09 +0200 Message-Id: <1433959809-919-1-git-send-email-moorray3@wp.pl> X-Mailer: git-send-email 2.1.0 X-WP-DKIM-Status: good (id: wp.pl) X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [4WO0] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jakub Kicinski 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 --- 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 */