Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp91367lql; Fri, 12 Apr 2024 04:59:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXOGerCyUGnH5XWjx09jUAoPfjJrzQ7t09RKIXW+C+xbTbkuiVMyZO8g2hLe+gSjLWZSjPUKLbekiaFmY6p9hJKTFKIgmyU0BHF4aCqNQ== X-Google-Smtp-Source: AGHT+IEQCv7NsxBpiFFypG9dGVlGI7MSDLxY0ssHWPRIsk2AiX6DwKW2XIDlg49laCiKaBo/TmEP X-Received: by 2002:a17:90a:d918:b0:2a5:2f48:1eba with SMTP id c24-20020a17090ad91800b002a52f481ebamr2081760pjv.13.1712923187091; Fri, 12 Apr 2024 04:59:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712923187; cv=pass; d=google.com; s=arc-20160816; b=Lal2EOPA4bTXK5x0E9ilwiIWmiCbA7HRia9XQt6BtyZsHa4BzOscoN2SnpRQDgAH/Y MORVnj0W2TiTk+Ur+Bey2T3DtzQbyA8+6VEgWSylDqYBTnolC+xgb3e/yL3+JXMTuOXy eecenOPOlf4AjrPsHDTivXPvnroB+v9Px8gYR63ZK5EczYOTNKW7gOeYYCuWvcRyJVxL AuVyPogp9I420V0RZsFPlGGsRFu12ce6rz/+F7AyRY7d5BXZd5Q1+DpJh8iDnj0FzUfH +LFlDPg0l2c1k6Yvqzx4gCw6zP0qlRsmk4O52yKi19kTbOWL+RdJjuM9cHnbg0tNTOLp z1Tg== 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:from; bh=PzwD2AFuh8W+cBoDBGbXyWC78ukjDZrAYK6/xBOFVTU=; fh=HUg66QM+WrcYjhrjAZO9Io78soUV0XNx50nXI3Hf4XU=; b=T4j1UTaN/cZsXbuI+4UMGuPt8umPwHqOxp67UbeUMdquxTTEZVafpDqAzyCR/w4DtP pigjyZMBoN3p+4RxtlOEDxE/kRaHs0gQMd/OSqHxpNze9Os1mBLdaVg3XSksXaMQv/5D UB+1+vGwYsT7PYMJw2+R57PaUMQPMzZHFO6H5hViaxvqC2NF3WQrzgHs16ouZVe7wh7b P0r6XT+bhgLVwOzoGlT34EHhTx38kSPjKiTHJ0UMdLWfKOWrnE2rDPkOt84BO+a4w5qD ErSkU6uRMCCQcK5gaHvM7urmraCHx0AhF3J5R9lyKIGjKOwZ4FWmDORs/5gddaIdswbg CVew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-6246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6246-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l1-20020a17090a49c100b002a63fd3c73csi3153775pjm.15.2024.04.12.04.59.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 04:59:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-wireless+bounces-6246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6246-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id F110BB226A2 for ; Fri, 12 Apr 2024 11:59:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B27C355E45; Fri, 12 Apr 2024 11:59:21 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48AAB56443 for ; Fri, 12 Apr 2024 11:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712923161; cv=none; b=oudmtMJK9WwJJkP3fN5EibCKtEWvwGIi2TtBA9tuIWxy+VUEk3ISG5p2Oy+mDrEQwCK8rrQFn681+MpILQ9OaEp8TXu3brfh8M9kl0zmWHWdHPSQNptmVT3QFYmyXR+yOYsrUOk68ULF7wrfydz/eDxMZYT/+F+WXSYryTJxN1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712923161; c=relaxed/simple; bh=IhGLo7jupCS3fnEyeeNifOj2LWvdRlhjw4RgDhV86UE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ljPC0qXjlOR6z38tWgDGZiJCkQeFnwFeH7g6lfRYDSB5NQuuGIu7+zJfD/VG9PsEJbd/oC+T63GmZDZLCdk2j4fPGKz9pgZLr8BYlDzxP9P9q+IEzzw45Y6/jgUcx8xBNRr/KrA5efurIQBRetmG+jiX4erxfyiD97U70ILZlO0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 43CBxFCw92093242, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 43CBxFCw92093242 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 12 Apr 2024 19:59:15 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 19:59:16 +0800 Received: from [127.0.1.1] (172.16.17.25) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 19:59:15 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH 2/8] wifi: rtw89: fw: scan offload prohibit all 6 GHz channel if no 6 GHz sband Date: Fri, 12 Apr 2024 19:57:23 +0800 Message-ID: <20240412115729.8316-3-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240412115729.8316-1-pkshih@realtek.com> References: <20240412115729.8316-1-pkshih@realtek.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback From: Zong-Zhe Yang We have some policy via BIOS to block uses of 6 GHz. In this case, 6 GHz sband will be NULL even if it is WiFi 7 chip. So, add NULL handling here to avoid crash. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/fw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 74d0d515ada0..d9ab781fa0e6 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -4689,6 +4689,10 @@ static void rtw89_scan_get_6g_disabled_chan(struct rtw89_dev *rtwdev, u8 i, idx; sband = rtwdev->hw->wiphy->bands[NL80211_BAND_6GHZ]; + if (!sband) { + option->prohib_chan = U64_MAX; + return; + } for (i = 0; i < sband->n_channels; i++) { chan = &sband->channels[i]; -- 2.25.1