Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2932126pxp; Tue, 8 Mar 2022 05:00:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFmHhSadUhyZ+NQb9kNKZtFUDgNpdk+vek6fu1OTp+DJDEamMAuwj4AjMrWBZu4whs519c X-Received: by 2002:a17:90b:3a8e:b0:1bf:7fb5:af06 with SMTP id om14-20020a17090b3a8e00b001bf7fb5af06mr4564677pjb.7.1646744425219; Tue, 08 Mar 2022 05:00:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646744425; cv=none; d=google.com; s=arc-20160816; b=ZA4E80gdhQ88pIRrs1nOhho/0YvNVqbJ1CIVYrL92z1cJoGCnB2/rsATtO2IkaihNc NUUig/wbvjJjnxpP2j5KMwbrtUqRBg3EHNkocSD24qxTYpZEt9Rk43IrElqf+4fCMW3f 41NzvcjeWBzMAkQ+Vw5xoeOZ33IJAKi6TV4QOUc+hd5XlX8TyHy/zwBbyx21Yi3Frt9j 2rUDV5zRbiIKS0/PphsKovysaFcBvH9iD8dOSPbyOZre8YPPvp1tnZ+k7Hu4bvMO/0RC pXJeJw4pO8eBqnLOvYizloegUyjULNktLoG8X7HM3x8TCHwGzPND0TVsWjB1mh0iH7vQ 3iPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=a8d71Ce3A05nxlaVi/lF3agYj3YUsYK/dk2yXSVwt+I=; b=wwb5ax6SC1yCuFJaViXR1I+5Rn48WCtCKne50mszmHmMOBsyBnIAI/ChMr5uSPWe5f 1E+QGkUW7IamP2ObnUHHe3B1KQqBJCrdXrDKytaC6bXU8atbYlUyhMjhPzPHd4SkGXYz MQnGKANttkMMaoGOXIL9mlL3LyCHYh5G/1uxmvVU7EZ/NNUoO3kez5sfwIa0s1XrS3Jw lapRSRm8/1fRlpBh6qUFCRK3Lscu0IdfEjyU5CaIDnqTxr0V47i02xT3z6YHdRyQ+QjA RyuNwiNuXKBlO5dWEd7U/Q/tkDb52ME8TKkQ2b2QyHQaIzyLFf/wumxSH/CD9axDLFrO 2UYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a654207000000b00378ef4d76f4si15592108pgq.492.2022.03.08.05.00.08; Tue, 08 Mar 2022 05:00:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240612AbiCHCSG (ORCPT + 70 others); Mon, 7 Mar 2022 21:18:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237280AbiCHCSF (ORCPT ); Mon, 7 Mar 2022 21:18:05 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F64BB7EF for ; Mon, 7 Mar 2022 18:17:10 -0800 (PST) X-UUID: 8f080972773848b4a9f790e683cd4bb9-20220308 X-UUID: 8f080972773848b4a9f790e683cd4bb9-20220308 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 36811383; Tue, 08 Mar 2022 10:16:48 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Tue, 8 Mar 2022 10:16:47 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 8 Mar 2022 10:16:47 +0800 From: MeiChia Chiu To: Johannes Berg CC: Ryder Lee , Shayne Chen , Evelyn Tsai , , , MeiChia Chiu Subject: [PATCH] mac80211: correct legacy rates check in ieee80211_calc_rx_airtime Date: Tue, 8 Mar 2022 10:16:45 +0800 Message-ID: <20220308021645.16272-1-MeiChia.Chiu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org There are no legacy rates on 60GHz or sub-1Ghz band, so modify the check. Signed-off-by: Ryder Lee Signed-off-by: MeiChia Chiu --- net/mac80211/airtime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/airtime.c b/net/mac80211/airtime.c index 26d2f8ba7029..c0e58eb7c7fb 100644 --- a/net/mac80211/airtime.c +++ b/net/mac80211/airtime.c @@ -477,7 +477,9 @@ u32 ieee80211_calc_rx_airtime(struct ieee80211_hw *hw, bool sp = status->enc_flags & RX_ENC_FLAG_SHORTPRE; bool cck; - if (WARN_ON_ONCE(status->band > NL80211_BAND_5GHZ)) + /* on 60GHz or sub-1Ghz band, there are no legacy rates */ + if (WARN_ON_ONCE(status->band == NL80211_BAND_60GHZ || + status->band == NL80211_BAND_S1GHZ)) return 0; sband = hw->wiphy->bands[status->band]; -- 2.18.0