From patchwork Mon Mar 21 14:07:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 648011 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2LE9xwp020601 for ; Mon, 21 Mar 2011 14:09:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753453Ab1CUOJ4 (ORCPT ); Mon, 21 Mar 2011 10:09:56 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:45278 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753450Ab1CUOJ4 (ORCPT ); Mon, 21 Mar 2011 10:09:56 -0400 Received: by bwz15 with SMTP id 15so5040302bwz.19 for ; Mon, 21 Mar 2011 07:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=ABl8wl/KOd30+sSZlFTm6FEqlh4NOzXM+VH21d7muKI=; b=xbUCoKcRTyFG6/Y7MiblR7nASpDbuN2sYgyDDsmN8Q/h5/26jauK1NzM4xTK5lyMLX Uh43mdmdaAPPLHLTBTaKk4vvPsl88uS159uXJqm9dyQwnrhpnbm4vHjVJeP1IlL/4w9x wLVW/LttNo/rRAquSHCZlj0DDg6DB7v92O93w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=k1FoOknPWXKUERBN7g1/sNRCMHOj6zF0T+8UIJyyro8e1wasIe9Y6Kx0m8M4wthcT5 CThPVviZNRa0Syd+tUwVlJ4pZBsMW2SXJvxNSqhuKXraJ9/kH3Z6ZRUpvzS6jTcBSDGP IWXr4dWb21ZJdTflDlh+AhkiMmJtN4YxvgGe4= Received: by 10.204.19.18 with SMTP id y18mr3655832bka.179.1300716593971; Mon, 21 Mar 2011 07:09:53 -0700 (PDT) Received: from localhost.localdomain (p5495B77C.dip.t-dialin.net [84.149.183.124]) by mx.google.com with ESMTPS id x6sm493627bkv.12.2011.03.21.07.09.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Mar 2011 07:09:52 -0700 (PDT) From: Helmut Schaa To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net, Helmut Schaa Subject: [PATCH] mac80211: Minor optimization in tx status handling Date: Mon, 21 Mar 2011 15:07:55 +0100 Message-Id: <1300716475-9830-1-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.7.3.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 21 Mar 2011 14:09:59 +0000 (UTC) diff --git a/net/mac80211/status.c b/net/mac80211/status.c index b936dd2..3ed3c83 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -189,16 +189,19 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) bool acked; for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { - /* the HW cannot have attempted that rate */ - if (i >= hw->max_report_rates) { + if (info->status.rates[i].idx < 0) { + break; + } else if (i >= hw->max_report_rates) { + /* the HW cannot have attempted that rate */ info->status.rates[i].idx = -1; info->status.rates[i].count = 0; - } else if (info->status.rates[i].idx >= 0) { - rates_idx = i; + break; } retry_count += info->status.rates[i].count; } + rates_idx = i - 1; + if (retry_count < 0) retry_count = 0;