Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp493360lqb; Wed, 17 Apr 2024 02:34:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVw2HJtu9ULllZuYsOOahqHr39V2od1gIXIj83JviVizPer4gnvREupLMKR2FQ59C73NZ6dHPHIR+ncnl/TWYXPUqRC2n/9XO5BfkLXQ== X-Google-Smtp-Source: AGHT+IEeF8IQ38sm0xzCmkf6ei9fEqAHD89qfwN7sjXp0VIQJj9bm9fx4IUyVKfwJowW4ymAVkik X-Received: by 2002:a17:90b:4c04:b0:2aa:aad7:e473 with SMTP id na4-20020a17090b4c0400b002aaaad7e473mr5648571pjb.22.1713346458196; Wed, 17 Apr 2024 02:34:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713346458; cv=pass; d=google.com; s=arc-20160816; b=tTZujmYVwqZ28e/7u0RWzkgi9jxkg62drOYtbbhmkIAuyaKoKjvLRiVSDLLK6HKjq+ j6g8PRMQmBb7x7PNjxoXOEfG9cAu7KNyIJqKg/OtkNvf8xIOPhmXpMPkCdRVIoUTBci1 9hBG4qTYJ87Vkfdxch+ZBbSavTMcWvwq8A2vrt4AOWmX/E5cD72iGkqULrE5Qe/7libo 5/3tYyl3/1b0Z6er7wO/sE3bwBroBgvDsRV7lFyVawdyW/Qxio0U2b2DCe5oVgHYdvWT MFANY67FKYC3Xxx4QCH0VkPm+wRSokuiTQlJ3pw/zoGux1slWg9U2MBLXZfOXc6Q1YoJ AteQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=WXHMgCoxkvQpet00Q19cxZJkOm1T4p+LzBOkMzDbXOE=; fh=DLT5iBRWpOafnPfrd6NN3t1fW7/rKFLbm+U57K/zUG8=; b=mA6A3SqYkYZVvhj5izVPtRpFeFc2ipq+MhuzqAims6oLDxFwidbd4R4vX8pCX3sy3Z UY4RHHVoxTp/9i4Ozs1tdVV5GABpIocaCxJGdQ/5/aSBiMbZIGYLwvpN0rFXtyYHY3Eq 0H+Lt2r/NOFX0iefAoSRrPNjujoyzWHOKahk2uci/f3i9hN8NB8w06ECvlvBa2BLfZLX S3WSaGp6SMjazcyfyW3R0hc0owzyj7yioMXFlbz9dVNT+JSpAAMkA/TlTtIFkZ/8MJZr q1+spCavhKQRcZnhy8hznVN9BTlcYRoxMilWvlQlEVi3or0awxmml660qRuZ9S2y/CoI LjbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Q0MiUKkD; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-wireless+bounces-6432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id on2-20020a17090b1d0200b0029dd94f9f8bsi1011134pjb.99.2024.04.17.02.34.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 02:34:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Q0MiUKkD; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-wireless+bounces-6432-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6432-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F1EAF283CAE for ; Wed, 17 Apr 2024 09:34:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E72011327E5; Wed, 17 Apr 2024 09:34:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Q0MiUKkD"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="c/A7I8SO" X-Original-To: linux-wireless@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A42112FB3E; Wed, 17 Apr 2024 09:34:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713346449; cv=none; b=o22FmE9wmRHlRH8gkwtP3o2zwJgfW7mhebbi9rv0vYd4ljHts65tOejNn0/AseVCQPk0WkT2dLiuRzkvedK5ehuKb++io7csUd/RT6Na0SInDZB/C1tHBR0MDcyQ7QikSeHaQF0H0qlp6u4iEFaJU0wsOXxjff9Q3e6rtB5Ap44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713346449; c=relaxed/simple; bh=kN90jndgiFO0MC3EhH/pmTsVnzp2fc8W39rYQDRB/HQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=leCwAaMOzwMF9WhS02B9qoX9yAvAd8oR7Ys4/JjqIyxe2upWUXXWS3IjJPn+Ygo0GRhfgA70fUOe9mAoHFAtEpfU4BOKShObQtj3pasUvSSEw/dVOLbtIjtU1wl070Syol2kpFcJQOLLwD2PU78r85yvGMrrha1zAZrpoU6HN/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Q0MiUKkD; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=c/A7I8SO; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Martin Kaistra DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1713346446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WXHMgCoxkvQpet00Q19cxZJkOm1T4p+LzBOkMzDbXOE=; b=Q0MiUKkDHTYfWXT3LH1rsuYBwNEsZ4h/JYly1ASppJC4iFAiFuILpgcvBOjj1U5I1T717p lqHS2225EGbzHpq7VfKBKFmjKefk7QdJMGq1//hkid1eun3rw4z+rkUbL0iKzEdjXONu2U Plw1hyyqTMNIv1+xAxft29bYXsJWaRr2o++F5VAC9RNrWo8X4Mr2ZM2SsQ+O1NFblTOtuT tFRlUKfLuOABVa430G0qzYZTIhHBKD1i8pPkgRRdLT4gb7xvcHUfsnCtTstleUx7uGi9cQ YnB16FF777MtAsRXu2gqcvr79CyzDeORtbEdnF1zxxeJxyveifNor8TZ/a43tg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713346446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WXHMgCoxkvQpet00Q19cxZJkOm1T4p+LzBOkMzDbXOE=; b=c/A7I8SOMI3vyvSmsclkbn2uLOeRruiCLrU3ZeV022vdkIHCQyvoKTmSrjPdG6ZekeLkv5 fWXj5Hh68F+eq/CQ== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior , stable@vger.kernel.org Subject: [PATCH 2/2] wifi: rtl8xxxu: enable MFP support Date: Wed, 17 Apr 2024 11:33:52 +0200 Message-Id: <20240417093352.1840632-3-martin.kaistra@linutronix.de> In-Reply-To: <20240417093352.1840632-1-martin.kaistra@linutronix.de> References: <20240417093352.1840632-1-martin.kaistra@linutronix.de> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In order to connect to networks which require 802.11w, add the MFP_CAPABLE flag and let mac80211 do the actual crypto in software. When a robust management frame is received, rx_dec->swdec is not set, even though the HW did not decrypt it. Extend the check and don't set RX_FLAG_DECRYPTED for these frames in order to use SW decryption. Use the security flag in the RX descriptor for this purpose, like it is done in the rtw88 driver. Cc: stable@vger.kernel.org Signed-off-by: Martin Kaistra --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 9 +++++++++ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h index fd92d23c43d91..4f2615dbfd0f0 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h @@ -122,6 +122,15 @@ enum rtl8xxxu_rx_type { RX_TYPE_ERROR = -1 }; +enum rtw_rx_desc_enc { + RX_DESC_ENC_NONE = 0, + RX_DESC_ENC_WEP40 = 1, + RX_DESC_ENC_TKIP_WO_MIC = 2, + RX_DESC_ENC_TKIP_MIC = 3, + RX_DESC_ENC_AES = 4, + RX_DESC_ENC_WEP104 = 5, +}; + struct rtl8xxxu_rxdesc16 { #ifdef __LITTLE_ENDIAN u32 pktlen:14; diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 4a49f8f9d80f2..b15a30a54259e 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -6473,7 +6473,8 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb) rx_status->mactime = rx_desc->tsfl; rx_status->flag |= RX_FLAG_MACTIME_START; - if (!rx_desc->swdec) + if (!rx_desc->swdec && + rx_desc->security != RX_DESC_ENC_NONE) rx_status->flag |= RX_FLAG_DECRYPTED; if (rx_desc->crc32) rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; @@ -6578,7 +6579,8 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8xxxu_priv *priv, struct sk_buff *skb) rx_status->mactime = rx_desc->tsfl; rx_status->flag |= RX_FLAG_MACTIME_START; - if (!rx_desc->swdec) + if (!rx_desc->swdec && + rx_desc->security != RX_DESC_ENC_NONE) rx_status->flag |= RX_FLAG_DECRYPTED; if (rx_desc->crc32) rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; @@ -7998,6 +8000,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface, ieee80211_hw_set(hw, HAS_RATE_CONTROL); ieee80211_hw_set(hw, SUPPORT_FAST_XMIT); ieee80211_hw_set(hw, AMPDU_AGGREGATION); + ieee80211_hw_set(hw, MFP_CAPABLE); wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); -- 2.39.2