From patchwork Sun Sep 16 20:29:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gertjan van Wingerde X-Patchwork-Id: 1463281 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B399A40135 for ; Sun, 16 Sep 2012 20:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752806Ab2IPU37 (ORCPT ); Sun, 16 Sep 2012 16:29:59 -0400 Received: from cpsmtpb-ews01.kpnxchange.com ([213.75.39.4]:1917 "EHLO cpsmtpb-ews01.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752619Ab2IPU35 (ORCPT ); Sun, 16 Sep 2012 16:29:57 -0400 Received: from cpsps-ews02.kpnxchange.com ([10.94.84.169]) by cpsmtpb-ews01.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 16 Sep 2012 22:29:55 +0200 Received: from CPSMTPM-CMT109.kpnxchange.com ([195.121.3.28]) by cpsps-ews02.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Sun, 16 Sep 2012 22:29:55 +0200 Received: from wingerd.gvw.nl ([86.87.118.224]) by CPSMTPM-CMT109.kpnxchange.com with Microsoft SMTPSVC(7.0.6002.18264); Sun, 16 Sep 2012 22:29:55 +0200 Received: by wingerd.gvw.nl (Postfix, from userid 1026) id 16CD720178D; Sun, 16 Sep 2012 22:29:55 +0200 (CEST) From: Gertjan van Wingerde To: , "John W. Linville" Cc: , Ivo van Doorn , Helmut Schaa , Gertjan van Wingerde Subject: [PATCH 2/5] rt2x00: rt2800 - Fix default vgc values for RT3572 Date: Sun, 16 Sep 2012 22:29:50 +0200 Message-Id: <1347827393-26948-3-git-send-email-gwingerde@gmail.com> X-Mailer: git-send-email 1.7.11.1 In-Reply-To: <1347827393-26948-2-git-send-email-gwingerde@gmail.com> References: <1347827393-26948-1-git-send-email-gwingerde@gmail.com> <1347827393-26948-2-git-send-email-gwingerde@gmail.com> X-OriginalArrivalTime: 16 Sep 2012 20:29:55.0265 (UTC) FILETIME=[08609310:01CD944A] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Align with the values used by the RT3572 Ralink vendor driver v2.5.0.0. Signed-off-by: Gertjan van Wingerde Acked-by: Ivo van Doorn diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index cec4a99..17b8a28 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c @@ -2904,16 +2904,21 @@ static u8 rt2800_get_default_vgc(struct rt2x00_dev *rt2x00dev) rt2x00_rt(rt2x00dev, RT3090) || rt2x00_rt(rt2x00dev, RT3290) || rt2x00_rt(rt2x00dev, RT3390) || + rt2x00_rt(rt2x00dev, RT3572) || rt2x00_rt(rt2x00dev, RT5390) || rt2x00_rt(rt2x00dev, RT5392)) vgc = 0x1c + (2 * rt2x00dev->lna_gain); else vgc = 0x2e + rt2x00dev->lna_gain; } else { /* 5GHZ band */ - if (!test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags)) - vgc = 0x32 + (rt2x00dev->lna_gain * 5) / 3; - else - vgc = 0x3a + (rt2x00dev->lna_gain * 5) / 3; + if (rt2x00_rt(rt2x00dev, RT3572)) + vgc = 0x22 + (rt2x00dev->lna_gain * 5) / 3; + else { + if (!test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags)) + vgc = 0x32 + (rt2x00dev->lna_gain * 5) / 3; + else + vgc = 0x3a + (rt2x00dev->lna_gain * 5) / 3; + } } return vgc;