Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1523901pxj; Wed, 19 May 2021 07:52:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5PLMafcdfr0BoGFbBWQBVjS/JLOKAkNOLfjI0sBlJSpmh5oq442M2tUd7kplYQIXYjjpP X-Received: by 2002:a05:6402:3494:: with SMTP id v20mr14963573edc.169.1621435943643; Wed, 19 May 2021 07:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621435943; cv=none; d=google.com; s=arc-20160816; b=hmxP2bzC4QNL9wzCmdpnvcz/e+ExxIXiz7VkQB62XyLvJ92DkcxG6TfbWFivNoe7kz sVh75I1xyn8qZ530CgotDEqbUnmJmFQyNIr90cPehekij1bHWkqFqSpuJBHkavxGzybp X3PPoshql9gp5TzQwjtd8zqcgOhMOnF+rK7j8aL1zNVwXs8duDsPaWYF5eJS69Kl/Jv+ y/p3oOJIJRspkla5pFM4VdLJNZZd2saWDbRsJS5bQe11zNEQ8w3gJvfTxVX7HVxGhJXr jLQxF2HmV/EWx2/92N2ixVkViLKMi1V0XN0EJzgZpAle2k43oOX7P8cfSG0ECv1opA6G rZng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=EQwaRr4izRXeSl9ewV2nvT9GQpnDTkJsjSNH8ClVhIc=; b=KnNb11rlYMX01oxXCZqOp4lNlo+vBQ4H9Lipn7X8mpoYciGscFGGbjoCd2JYAFJR7D a9c5i6UHgN9oi0wnhlO4v24FUUDPubQJlyDSjszog2h8HbdmVvaaJljqFObwl/8U6ECR z5ot7NzEIr2v5vstlCfZ9brSrbAAkqcg9Kwbucg4fY2YZaQlly9AjlXvFtYu319lSTGq WYIMOIjvzlSaLqRu/G3ggt5ZGHK3cf+0WD1uPyyhS46wTLRqRWxbqSKC6LspQSJLZmqN 59QIa5enampUe6VvvAHRBtsuVEFit3KsF9VOn5PNgH7HIlhZrPSLJeCGVHVJ8j9qZTd4 fURQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si27445637edj.328.2021.05.19.07.51.54; Wed, 19 May 2021 07:52:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348329AbhERLJk (ORCPT + 99 others); Tue, 18 May 2021 07:09:40 -0400 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:45569 "EHLO outpost1.zedat.fu-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348290AbhERLJj (ORCPT ); Tue, 18 May 2021 07:09:39 -0400 Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.94) with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1lixaH-003tl1-32; Tue, 18 May 2021 13:08:21 +0200 Received: from a36t-ffs1.berlin.freifunk.net ([77.87.51.11] helo=mi.fu-berlin.de) by inpost2.zedat.fu-berlin.de (Exim 4.94) with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1lixaF-001ULR-SE; Tue, 18 May 2021 13:08:21 +0200 Received: by mi.fu-berlin.de (sSMTP sendmail emulation); Tue, 18 May 2021 13:08:19 +0200 From: Philipp Borgers To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Philipp Borgers Subject: [PATCH 2/2] mac80211: refactor rc_no_data_or_no_ack_use_min function Date: Tue, 18 May 2021 13:07:55 +0200 Message-Id: <20210518110755.43077-2-borgers@mi.fu-berlin.de> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210518110755.43077-1-borgers@mi.fu-berlin.de> References: <20210518110755.43077-1-borgers@mi.fu-berlin.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Original-Sender: borgers@mi.fu-berlin.de X-Originating-IP: 77.87.51.11 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Signed-off-by: Philipp Borgers --- net/mac80211/rate.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c index 4f5b35a0ea28..ae8d595aa2c2 100644 --- a/net/mac80211/rate.c +++ b/net/mac80211/rate.c @@ -294,18 +294,11 @@ void ieee80211_check_rate_mask(struct ieee80211_sub_if_data *sdata) sdata->rc_rateidx_mask[band] = (1 << sband->n_bitrates) - 1; } -static bool rc_no_data_or_no_ack_use_min(struct ieee80211_tx_rate_control *txrc) +static bool rc_no_data_or_no_ack_use_min(u32 flags, __le16 frame_control) { - struct sk_buff *skb = txrc->skb; - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - __le16 fc; - - fc = hdr->frame_control; - - return (info->flags & (IEEE80211_TX_CTL_NO_ACK | + return (flags & (IEEE80211_TX_CTL_NO_ACK | IEEE80211_TX_CTL_USE_MINRATE)) || - !ieee80211_is_data(fc); + !ieee80211_is_data(frame_control); } static void rc_send_low_basicrate(struct ieee80211_tx_rate *rate, @@ -396,12 +389,13 @@ static bool rate_control_send_low(struct ieee80211_sta *pubsta, struct sta_info *sta; int mcast_rate; bool use_basicrate = false; + __le16 frame_control = hdr->frame_control; - if (ieee80211_is_data(hdr->frame_control) && + if (ieee80211_is_data(frame_control) && (info->flags & IEEE80211_TX_CTL_NO_ACK)) return false; - if (!pubsta || rc_no_data_or_no_ack_use_min(txrc)) { + if (!pubsta || rc_no_data_or_no_ack_use_min(info->flags, frame_control)) { __rate_control_send_low(txrc->hw, sband, pubsta, info, txrc->rate_idx_mask); -- 2.31.1