Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3875404pxu; Tue, 20 Oct 2020 02:51:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCiRbEcSbGhPsVQyaik6TIDALylVLtYNXsDlCcYPTdr0eY44VuSRjjoXiwc30J2xAV9Yy3 X-Received: by 2002:a17:906:8545:: with SMTP id h5mr2257980ejy.384.1603187464938; Tue, 20 Oct 2020 02:51:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603187464; cv=none; d=google.com; s=arc-20160816; b=V+f12GYIlE+6+vQL2VE92jR9JT5fLGICd3uieklbUffd15MjX0L0Z6CQJEolNiJYyW AWSRKv+mBCN2p9oEnrwckWQ+iSpPOukL8lf2iyJEjBvUlpkhNoKY3ZbYBA8i1lbOBubm o117i3xeP2pZNmR/+MRElQAZvYZZP8K/Zoaeife6xHYDmCJVFf0RP6KHT3m7gghwkB3U KddF7VbSHp/gNIyreG9I8n+MYeJwrTgCAH3Hwbdn5DfQqezqy6VI5WzAGVReuH1nggda r1Ht8LgiGbodl1JNB0xQ1kG8kZtDPb7t65AFr+TJYsqSolxrMZ6NTdDe1lykhjZz7pJR OQgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bKNUhCp6Y3F9Grr1XEkYQ03EStU0/rfn+PwEs2KyPKA=; b=iJ1eC4f1uuTgLRtkX0KqhOAkVZNFZT9yfIg9S3xCklfVrkMJ+t7sq3rRAVRHov8Xqj EJvnJSL2UXlyilguwqQDxU//RYwaKBZv6OUNFjbybJ4GGDnVkGsse71pnetBfngmkK8L 2EzrCCB7zxWEmGVM5qH3qO+4RM1yETW4SdZe6dKXi+n0oZCtTDcQTQEIldXLMjCo+XjZ zTiwaAZM0Hdhlg3M+Nm5j2LiGS0adKcvmlLw2J7JgethCr5bY4wZI64gcV/6V0Va4G2Y wlo+sdgJOm5ca+2rSgFtNW67KDQBNYFxIRN47aN+gDW6G2AnbRK41hGDVkt8oeLzeNKS 3PnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=c+EQ7Y0L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si835742edg.229.2020.10.20.02.50.27; Tue, 20 Oct 2020 02:51:04 -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; dkim=pass (test mode) header.i=@wp.pl header.s=1024a header.b=c+EQ7Y0L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wp.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404940AbgJTHT2 (ORCPT + 99 others); Tue, 20 Oct 2020 03:19:28 -0400 Received: from mx3.wp.pl ([212.77.101.9]:54390 "EHLO mx3.wp.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730928AbgJTHT1 (ORCPT ); Tue, 20 Oct 2020 03:19:27 -0400 Received: (wp-smtpd smtp.wp.pl 23164 invoked from network); 20 Oct 2020 09:12:44 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1603177964; bh=bKNUhCp6Y3F9Grr1XEkYQ03EStU0/rfn+PwEs2KyPKA=; h=From:To:Cc:Subject; b=c+EQ7Y0LEOD6Pr/K1g9JrE43o4R2TECEMP0WOLIOL9WwxeQyHrTeUT8tKaMdlokqB O198Pebob99V7btr1P/FtqqI3RYIqXjGFb7i8ChjwBd2F/9HCHsYTPcVyKMvvKwEzn JNnbonHnv/mqMabP2lgVmuPjAuNZotNN/bTrn/Bs= Received: from ip4-46-39-164-203.cust.nbox.cz (HELO localhost) (stf_xl@wp.pl@[46.39.164.203]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 20 Oct 2020 09:12:44 +0200 Date: Tue, 20 Oct 2020 09:12:43 +0200 From: Stanislaw Gruszka To: =?utf-8?B?0JzQsNGA0LrQvtCyINCc0LjRhdCw0LjQuyDQkNC70LXQutGB0LDQvdC00YA=?= =?utf-8?B?0L7QstC40Yc=?= Cc: "linux-wireless@vger.kernel.org" , Helmut Schaa , Kalle Valo , "\"David S. Miller\"" , Jakub Kicinski , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "illumin@yandex.ru" Subject: Re: [PATCH] rt2x00: save survey for every channel visited Message-ID: <20201020071243.GA302394@wp.pl> References: <1603134408870.78805@itmh.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1603134408870.78805@itmh.ru> X-WP-MailID: 7f530163ad75dcce13db46f787cfd916 X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000002 [YeH0] Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, Oct 19, 2020 at 07:06:47PM +0000, Марков Михаил Александрович wrote: > rt2800 only gives you survey for current channel. > .watchdog = rt2800_watchdog, > + .update_survey = rt2800_update_survey, Since this feature is rt2800 specific, I would do not add new generic callback. It could be fully done in rt2800* code, i.e ... > diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c > index 8c6d3099b19d..8eff57132154 100644 > --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c > +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c > @@ -1026,6 +1026,12 @@ static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, > if (!rates) > goto exit_free_channels; > > + rt2x00dev->chan_survey = > + kcalloc(spec->num_channels, sizeof(struct rt2x00_chan_survey), > + GFP_KERNEL); > + if (!rt2x00dev->chan_survey) > + goto exit_free_rates; ... this could be placed in rt2800_probe_hw_mode() just after channel info array allocation ... > @@ -316,6 +316,15 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed) > if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) > return 0; > > + /* > + * To provide correct survey data for survey-based ACS algorithm > + * we have to save survey data for current channel before switching. > + */ > + if (rt2x00dev->ops->lib->update_survey && > + (changed & IEEE80211_CONF_CHANGE_CHANNEL)) { ... and this in rt2800_config() Thanks Stanislaw