Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp427753rdb; Tue, 5 Dec 2023 09:06:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFl2Ts5wC0b7/JuZhCzWW3bEak02/azT0aqhDGdW4Gita0YQgfmGb4JC41K60sQxfEQFfzL X-Received: by 2002:a17:906:2814:b0:a19:a19a:eadc with SMTP id r20-20020a170906281400b00a19a19aeadcmr660698ejc.149.1701796006365; Tue, 05 Dec 2023 09:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701796006; cv=none; d=google.com; s=arc-20160816; b=JEyBx+C21KmFOUmMrmU/l27qc4tQlT2L4GXB5Pt4UppNQywp/R3kIDsJUKLuVWdSSM DF67psoJrfuw7L8+StulVnM/Q0gBSSPLK6awNk1YbgtEM3uC3kzQXCwUcXu6dwky6Y6m CYtK/tdRV/pdhTJvveD3lOWy5fMEqzKSqC/JL4zxbf/BRpN5HE+QodwozJiAaXTEvQ1X HE2h8CjkpHyCpobfC7+PyLzQRXoYrGfl0ek1GQcY+B1wWl3xztUZqeUbFTXQy/IrKo/n mv84gtwa5cdSzegWgxdhi6W5M4rV5+pI+dJUERRr42NryebxIZIBKYth+gbHFTiv+VMK IYbg== ARC-Message-Signature: i=1; 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:message-id:date:subject:cc:to :from:dkim-signature; bh=ugvsFKAItoLjKrCDlNdSuts7Cy16Xu5/2UPE/n5rav4=; fh=wuKGCzOwMdWeTFhvzuE2t1Edd1dQha2iiatoK3aFyjw=; b=blHY5SccwiB03ujshSmOqrNo6KPbKUZPIOazwLhBuID2b90SLm8DbvntmyiMEr1flH lhZXWBABRDFToKnlJFKoh9rZWLDsOTeLnHT4LUS5Y3UwTN0j1801NPu/Mz9xFBdchR9F 7SOKCXG0tFQITUfQ4E3sY0JgsF4FuVD8VCHbiryqZvkYHA1E8eG3lgc6siitQt+oyP1o vvg6kLb1w5BMSfZ2+gUViU5XoVob/o5p8VdMReIHHQ5A2jrpcqogZRhYi/u1EZQNH76p gUjK3buUXNOAh6CVd9RuWx1dij8qBpJODIHAwjlyMmRcaI8rYO2t0oG3+4CLs6HVkSUy IBRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@freebox-fr.20230601.gappssmtp.com header.s=20230601 header.b=hGdueItI; spf=pass (google.com: domain of linux-wireless+bounces-434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-434-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id a12-20020a17090680cc00b009b3037d0242si5648770ejx.865.2023.12.05.09.06.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 09:06:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@freebox-fr.20230601.gappssmtp.com header.s=20230601 header.b=hGdueItI; spf=pass (google.com: domain of linux-wireless+bounces-434-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-434-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3149A1C20CF6 for ; Tue, 5 Dec 2023 17:06:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 846036928B; Tue, 5 Dec 2023 17:06:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=freebox-fr.20230601.gappssmtp.com header.i=@freebox-fr.20230601.gappssmtp.com header.b="hGdueItI" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D07083 for ; Tue, 5 Dec 2023 09:06:37 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3333131e08dso4520800f8f.2 for ; Tue, 05 Dec 2023 09:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebox-fr.20230601.gappssmtp.com; s=20230601; t=1701795996; x=1702400796; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ugvsFKAItoLjKrCDlNdSuts7Cy16Xu5/2UPE/n5rav4=; b=hGdueItIYsb0IklhxfY7lgRwFdsSfVpM50G6FbA9fvWS/Jj9MzhMYzpzN14Y9g9oS9 ZeQRsYt70kvKVpEwINhUgVR6eAXg/c7kTZDHfeQucgv2Y+UT0SFJXYPV2j1QvvQZkCiX X4Miui3+c3+PTyYqblbQILCBoks+wCjVD2v4Wuo+K5uAvm2Q7yMspXodAuvUkMznp8C9 ZUdksj/6SPs9/GTdXgj2ukSLdAsAAMBXLfxodGxq1sJQEx1ce/ZeLMwq3DU0jLjgq7DP UMLobjTrBZ8xwLh9vbrwup3n0nxOkjLq6VKlXzbP4f6++kxSnQDB0rjqTzNd8WkjsdUj HQxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701795996; x=1702400796; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ugvsFKAItoLjKrCDlNdSuts7Cy16Xu5/2UPE/n5rav4=; b=uMmeFCV+15zEj6v6gJYq8vmS5eD7LjFadytwKcbs9ZKbtGVF4CGS+FrT0yVxz4gPTB XOFhpz4h1L+9HZKKtQQcyrNFN08FPaLGRKD4HkgRptU+4F3NsK5kgeVnJrtLQl1/d+WH 1s2OmqRzCqoe6TicrTX1AqhshBeHuJhoWpZikug9mZxTKFh1gMZ+r7dDjzIWI2A10aXZ uuwtHgoMfSsB5i9K1CT0tIGU+rRJaCFDbjlAD6MQqOb8gduTmP8BI2/zb4sXf9W730WS tPsQ9El+VbQXP25M5EWUypcgAvQ/2ozmw6KplIvyFGYHyK/iocqW8VWTPUXVm8Yd3pAW AT4A== X-Gm-Message-State: AOJu0YyI/9yCboXKrqJGS61UtahMzFsGcNEBRJt/shKskJvCJtZV3ON5 WNUuUKysvB2727k2J8R0RPxNFw== X-Received: by 2002:a05:600c:1f90:b0:40b:337d:cad6 with SMTP id je16-20020a05600c1f9000b0040b337dcad6mr675246wmb.29.1701795995896; Tue, 05 Dec 2023 09:06:35 -0800 (PST) Received: from hyang-ThinkStation-P620.iliad.local (freebox.vlq16.iliad.fr. [213.36.7.13]) by smtp.gmail.com with ESMTPSA id g10-20020a05600c4eca00b0040596352951sm22922250wmq.5.2023.12.05.09.06.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 09:06:35 -0800 (PST) From: Hancheng Yang To: toke@toke.dk Cc: hyang@freebox.fr, linux-wireless@vger.kernel.org, kvalo@kernel.org Subject: [PATCH 1/1] ath9k: reset survey of current channel after a scan started Date: Tue, 5 Dec 2023 18:06:23 +0100 Message-Id: <20231205170623.3029689-1-hyang@freebox.fr> X-Mailer: git-send-email 2.34.1 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 the `ath_set_channel()` function, we only reset surveys that are not from the current channel. This leads to the accumulation of survey data for the current channel indefinitely. This may not be the most optimal approach, as we want the ACS to rely on the most recent survey. So reset the survey data for the current channel at the start of each scan. Signed-off-by: Hancheng Yang --- drivers/net/wireless/ath/ath9k/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 859210b586c2..bb94b0dd86bb 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -2383,7 +2383,22 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw, { struct ath_softc *sc = hw->priv; struct ath_common *common = ath9k_hw_common(sc->sc_ah); + struct cfg80211_chan_def *chandef = &sc->cur_chan->chandef; + struct ieee80211_channel *chan = chandef->chan; + int pos = chan->hw_value; set_bit(ATH_OP_SCANNING, &common->op_flags); + + /* Reset current survey */ + if (!sc->cur_chan->offchannel) { + if (sc->cur_survey != &sc->survey[pos]) { + if (sc->cur_survey) + sc->cur_survey->filled &= ~SURVEY_INFO_IN_USE; + sc->cur_survey = &sc->survey[pos]; + } + + memset(sc->cur_survey, 0, sizeof(struct survey_info)); + sc->cur_survey->filled |= SURVEY_INFO_IN_USE; + } } static void ath9k_sw_scan_complete(struct ieee80211_hw *hw, -- 2.34.1