From patchwork Fri Mar 4 12:31:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 609081 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 p24CVmmR028296 for ; Fri, 4 Mar 2011 12:31:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759409Ab1CDMbu (ORCPT ); Fri, 4 Mar 2011 07:31:50 -0500 Received: from mail-bw0-f46.google.com ([209.85.214.46]:44382 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758609Ab1CDMbt (ORCPT ); Fri, 4 Mar 2011 07:31:49 -0500 Received: by mail-bw0-f46.google.com with SMTP id 15so2003024bwz.19 for ; Fri, 04 Mar 2011 04:31:48 -0800 (PST) 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 :in-reply-to:references; bh=YhP3fAI1ks/9YBMig/567FCQZoqcgYCeUWiqq7bjDgM=; b=G+2li9xcy/zmF20HwU/UeJBrbXDCp0eLDXXq0YWzVJ45JSvye0T7B5Rf+KFdOh+8jz 9bsMzPLlgxVyRV4LlUQEHZjbZR95CDtGm9K1gOz9FE6iht82mtXkdbBKaPkS8WotJVd0 UIIPNIYz9B+5Oc2/UZZ1XnnkgYjD7x088lKQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=iqk1i18eTDzEpaNOj0+PBgRXG7q/LZTnT7nH/CgbmoLipzgls/XJkFVpajfeLNTEaH QlGL9if28ir5FTl5J+TaUKHcPjB+4H4a9J1FLbwpXGJgGcx923Uu5dEfNM/GWXqIbzqU 9CYgtF0CGQD4kXHToYBivZjA6sWVB0z8KcdNg= Received: by 10.204.127.88 with SMTP id f24mr532331bks.54.1299241908746; Fri, 04 Mar 2011 04:31:48 -0800 (PST) Received: from localhost.localdomain (p5495ACF2.dip.t-dialin.net [84.149.172.242]) by mx.google.com with ESMTPS id l1sm377141bkl.13.2011.03.04.04.31.46 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 04:31:47 -0800 (PST) From: Helmut Schaa To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, johannes@sipsolutions.net, nbd@openwrt.org, Helmut Schaa Subject: [PATCH 2/2] mac80211: Shortcut minstrel_ht rate setup for non-MRR capable devices Date: Fri, 4 Mar 2011 13:31:32 +0100 Message-Id: <1299241892-6719-2-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1299241892-6719-1-git-send-email-helmut.schaa@googlemail.com> References: <1299241892-6719-1-git-send-email-helmut.schaa@googlemail.com> 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]); Fri, 04 Mar 2011 12:31:56 +0000 (UTC) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 775cf15..6010a5b 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -603,19 +603,29 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, sample = true; minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx, txrc, true, false); - minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate, - txrc, false, false); info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; } else { minstrel_ht_set_rate(mp, mi, &ar[0], mi->max_tp_rate, txrc, false, false); - minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate2, - txrc, false, true); } - minstrel_ht_set_rate(mp, mi, &ar[2], mi->max_prob_rate, txrc, false, !sample); - ar[3].count = 0; - ar[3].idx = -1; + if (mp->has_mrr) { + if (sample_idx >= 0) + minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate, + txrc, false, false); + else + minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate2, + txrc, false, true); + + minstrel_ht_set_rate(mp, mi, &ar[2], mi->max_prob_rate, txrc, false, !sample); + + ar[3].count = 0; + ar[3].idx = -1; + } else { + /* Not using MRR, only use the first rate */ + ar[1].count = 0; + ar[1].idx = -1; + } mi->total_packets++;