From patchwork Mon Mar 4 18:27:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karl Beldan X-Patchwork-Id: 2213921 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 5483D3FCF2 for ; Mon, 4 Mar 2013 18:30:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757830Ab3CDSaF (ORCPT ); Mon, 4 Mar 2013 13:30:05 -0500 Received: from mail-we0-f175.google.com ([74.125.82.175]:44367 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757248Ab3CDSaE (ORCPT ); Mon, 4 Mar 2013 13:30:04 -0500 Received: by mail-we0-f175.google.com with SMTP id x8so4836247wey.6 for ; Mon, 04 Mar 2013 10:30:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=qKBs05XmSC4o+Z/vuCr/g7Z7UrQof/JvtY8u3VUdEQU=; b=bdszEnFYinjy9Mdzp67kXsLu8zeBpNZ9TCqCreYUeYRdVFAm5nRuUGcT82ea8mH7kJ bKAepFUfGukx8Kwi0TQdKt/N6EyaZ5hl4il+2GrfOKrNfPnO+4uBc9a0LPRH6DLjqLjD qJTcFJmQYGq8Biz7dMX1GUcmK+I/j+FGOLWQTpdLuHEjAMJBBkRULd2a75O70NwZ0QPX i+8iRGVeoFqcNTB9IBkPG458G7nfKYGVEIuWGTerf0R713veCJ/LpP+T8sW74ut7mmfQ TvMhQVOogzmtbva39Fc3I4vyH7EPdh/MgQJf20nW/7qYMxUQKkywcHxhKW+9X7t9ATSH v3rQ== X-Received: by 10.194.235.196 with SMTP id uo4mr33864129wjc.30.1362421803199; Mon, 04 Mar 2013 10:30:03 -0800 (PST) Received: from magnum.frso.rivierawaves.com (vpn.rivierawaves.com. [91.151.119.162]) by mx.google.com with ESMTPS id fv2sm17406081wib.6.2013.03.04.10.30.01 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Mar 2013 10:30:01 -0800 (PST) From: Karl Beldan To: Johannes Berg Cc: linux-wireless , Karl Beldan , Karl Beldan Subject: [PATCH v2 1/2] mac80211: get the rates masks from the txrc in rate_control_get_rate Date: Mon, 4 Mar 2013 19:27:14 +0100 Message-Id: <1362421635-28008-1-git-send-email-karl.beldan@gmail.com> X-Mailer: git-send-email 1.7.10.GIT Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Karl Beldan Currently it gets it from the sdata. This uses and updates the ad-hoc masks of the ieee80211_tx_rate_control instead of copying them. Signed-off-by: Karl Beldan --- net/mac80211/rate.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index dd88381..c1e5f25 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -435,8 +435,8 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata, struct ieee80211_sta *ista = NULL; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(txrc->skb); int i; - u32 mask; - u8 mcs_mask[IEEE80211_HT_MCS_MASK_LEN]; + u32 *mask; + u8 *mcs_mask; if (sta && test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) { ista = &sta->sta; @@ -459,14 +459,13 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata, * default mask (allow all rates) is used to save some processing for * the common case. */ - mask = sdata->rc_rateidx_mask[info->band]; - memcpy(mcs_mask, sdata->rc_rateidx_mcs_mask[info->band], - sizeof(mcs_mask)); - if (mask != (1 << txrc->sband->n_bitrates) - 1) { + mask = &txrc->rate_idx_mask; + mcs_mask = txrc->rate_idx_mcs_mask; + if (*mask != (1 << txrc->sband->n_bitrates) - 1) { if (sta) { /* Filter out rates that the STA does not support */ - mask &= sta->sta.supp_rates[info->band]; - for (i = 0; i < sizeof(mcs_mask); i++) + *mask &= sta->sta.supp_rates[info->band]; + for (i = 0; i < sizeof(txrc->rate_idx_mcs_mask); i++) mcs_mask[i] &= sta->sta.ht_cap.mcs.rx_mask[i]; } /* @@ -479,7 +478,7 @@ void rate_control_get_rate(struct ieee80211_sub_if_data *sdata, if (info->control.rates[i].idx < 0) break; rate_idx_match_mask(&info->control.rates[i], txrc, - mask, mcs_mask); + *mask, mcs_mask); } }