From patchwork Fri Jul 11 00:01:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eliad Peller X-Patchwork-Id: 4528951 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A75AC9F37C for ; Fri, 11 Jul 2014 00:02:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D03C8201DE for ; Fri, 11 Jul 2014 00:02:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 004E3201C0 for ; Fri, 11 Jul 2014 00:02:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751474AbaGKAB7 (ORCPT ); Thu, 10 Jul 2014 20:01:59 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:37428 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441AbaGKAB5 (ORCPT ); Thu, 10 Jul 2014 20:01:57 -0400 Received: by mail-wi0-f178.google.com with SMTP id f8so524367wiw.5 for ; Thu, 10 Jul 2014 17:01:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=C8NKk6byva5L4uIDnVlCcbDQQIuRKNTiS+BcvPXeWRw=; b=AgFb70lw2xV/9WeI7dULBtU4OFCJKd1vsOoDEmRplXKIqL6myIZUf0CKkRaPXJJwc0 78IG8fcBev5aay66QzkR0YFkGhRDPEgwha9z5s0coP/kkbLza7ZVI2vxW+9Hf6b4Cwhk zKSCvaxlWUfZmRBSBijhnlBABpx9Oh7noSkpb5S2EitJvRoUexlL9KqQrMqAI05nQbYR GBg0Ctw7g0f8GXFpHGerVUoHftLD1mLs6XY/QWKvOWPFflHUkv4b9oISxT35pnvOQPIQ Yyjj0fbnpFgGQEG9fbcCnasHVBUdFwVqXISg5VPtAQURMLUty06TjaTU6YLtBfTB53JL kV7g== X-Gm-Message-State: ALoCoQlT8IEJ/H1ZAVhWT5dX7WBMocCywnWkhSZ2TlCffU0zUzgIjUiKZR3EIOAW1+6lH2WUuXpr X-Received: by 10.180.19.1 with SMTP id a1mr380693wie.16.1405036915949; Thu, 10 Jul 2014 17:01:55 -0700 (PDT) Received: from localhost.localdomain (46-116-157-102.bb.netvision.net.il. [46.116.157.102]) by mx.google.com with ESMTPSA id 19sm1426848wjz.3.2014.07.10.17.01.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 17:01:55 -0700 (PDT) From: Eliad Peller To: "John W. Linville" Cc: Subject: [PATCH 03/14] wl18xx: fix last tx rate calculation Date: Fri, 11 Jul 2014 03:01:28 +0300 Message-Id: <1405036899-27396-4-git-send-email-eliad@wizery.com> X-Mailer: git-send-email 1.8.5.1.109.g3d252a9 In-Reply-To: <1405036899-27396-1-git-send-email-eliad@wizery.com> References: <1405036899-27396-1-git-send-email-eliad@wizery.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The last tx rate calculation didn't take into account the different indices of 11a and 11g rates tables. Add the required alignment (count only from the first 11a rate in case of 11a) Signed-off-by: Eliad Peller --- drivers/net/wireless/ti/wl18xx/tx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ti/wl18xx/tx.c b/drivers/net/wireless/ti/wl18xx/tx.c index be1ebd5..3406ffb 100644 --- a/drivers/net/wireless/ti/wl18xx/tx.c +++ b/drivers/net/wireless/ti/wl18xx/tx.c @@ -30,7 +30,7 @@ static void wl18xx_get_last_tx_rate(struct wl1271 *wl, struct ieee80211_vif *vif, - struct ieee80211_tx_rate *rate) + u8 band, struct ieee80211_tx_rate *rate) { u8 fw_rate = wl->fw_status->counters.tx_last_rate; @@ -43,6 +43,8 @@ void wl18xx_get_last_tx_rate(struct wl1271 *wl, struct ieee80211_vif *vif, if (fw_rate <= CONF_HW_RATE_INDEX_54MBPS) { rate->idx = fw_rate; + if (band == IEEE80211_BAND_5GHZ) + rate->idx -= CONF_HW_RATE_INDEX_6MBPS; rate->flags = 0; } else { rate->flags = IEEE80211_TX_RC_MCS; @@ -102,7 +104,8 @@ static void wl18xx_tx_complete_packet(struct wl1271 *wl, u8 tx_stat_byte) * first pass info->control.vif while it's valid, and then fill out * the info->status structures */ - wl18xx_get_last_tx_rate(wl, info->control.vif, &info->status.rates[0]); + wl18xx_get_last_tx_rate(wl, info->control.vif, + info->band, &info->status.rates[0]); info->status.rates[0].count = 1; /* no data about retries */ info->status.ack_signal = -1;