Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp266633rdb; Thu, 8 Feb 2024 05:36:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfBwcs1FWJuoyo7kSAJymWd3EAztP6QMDWD4MYy+Br4zIADF0KER44GyHu0cCy2MS6EM9r X-Received: by 2002:a05:6808:bcd:b0:3bf:ef96:8650 with SMTP id o13-20020a0568080bcd00b003bfef968650mr4342134oik.43.1707399362771; Thu, 08 Feb 2024 05:36:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707399362; cv=pass; d=google.com; s=arc-20160816; b=ALsj3WFQWBBTXWk90fHkpbHHsmImnwNTuoXkBijqaO1vPRtTDkSRYJhHF0daaN+RqG LnWtH5VP9b/nc4ixg1dgpLGrXvBEQFx/ZHZRli9mPkI/ArKinY5MdnJWhrcLHgKCZlIM SToZEV6Y+ioLuQf1cmYGp1wwLSpIcMfagMK+yeNYowZXMU7gQeIYOSzo11UXNJh67yxG ZGj6vWqN+JfEo+MX6Uao80f5yPzSmfZ91fwQen8PeoMBMIxLRbLdJTth40GWFR/7V1ML JhCX3bR8EOyJbQKRtEx3hJofeYdvP2fDalmslJuoLg90Qb+KtEpa2eCUMuMLaymouc/p jmgQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=r17q1U4BSEBGcEVJq5z9iZi13EGZhxsJ18ERvTeuATs=; fh=dyTQCeRNiFpa1R1cEDlclzCmO14EBVsCI/bDRL06FAQ=; b=qlvfyVM4MYAzijtCdLnbAQ+HuW+/kCerNVr2VFewjC8zYZZGJ3LGC4OBoDo1O73BlW zGs4PfZF4SEZ2Fb6JArAx/Kh6AZOj0aAReZP8PsbDXe7LFD3slZsUqqgF7EcBZC+RQxA aY1ay2f0eft3RLQaEEev4VUW5hItTXb1nwddkXZ4NAUHYpBJLC30uTMtkEzXF8coXpqw +1lviKJ1+KiUtEXXzoht/9Ik99fKTE+0ehyE5hToGYDYTpmiaUua4HQlD+fQRuIDpbcG nEKQyo1NyL6naq5HNsNZ5i2ylIoURWq6pwXegcn0FGZO8L/nkpxJvbi68AxFEZ6fzZZy JyCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=itHMInCZ; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-3333-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=2; AJvYcCUqD8VNFbhEPerBNR8/lQhvrJy+yq/miyq8OkzUkw9ehAq8A4uO5WHKWPy1wFgYkkXq3fHybNq38ZyUPuuvxiX/PV5lBujp0o6MAlhYrg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e7-20020a05622a110700b0042c44dec59bsi3821qty.482.2024.02.08.05.36.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 05:36:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3333-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=@sipsolutions.net header.s=mail header.b=itHMInCZ; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-3333-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3333-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net 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 4F3A91C214F6 for ; Thu, 8 Feb 2024 13:35:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F09DD762F0; Thu, 8 Feb 2024 13:35:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="itHMInCZ" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 C8EA2763EC for ; Thu, 8 Feb 2024 13:35:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707399354; cv=none; b=h/t7z+MGrXFYVv0oA7kuTQYTYdhe6dVLVt4tLCGbMFV9e1SE6A3ptlyAxdlw1z9uT6Rkod6AEa54MuGJ6OrcKtv5kjj/SDkyzHUwIskIjbVXCvW3bcsmrRmj4Jd3z097x7D9/CX3cvammI8xexHOzFWZS6x6kGI8iB5gWs2o17E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707399354; c=relaxed/simple; bh=hP305+Afo2wbGGXrExtos8KS4x99SmFFbo3z1s+hvFg=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=ofS6x9hKb1KuCtNdf/jd0SiqNqTEliawF3Mh3afog5S3g0Rbg0HRJbqQVc6aIzStGMmuPvkuhYPvX1T4MQndA5OAKys/RRx3Fnj4Q3MY5bzIIyrKg0O3gG0wumLTl3m5jQeduG6/JnH/NfwwLirmg8BxLLk/khwagMX7q8y28iY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=itHMInCZ; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=r17q1U4BSEBGcEVJq5z9iZi13EGZhxsJ18ERvTeuATs=; t=1707399350; x=1708608950; b=itHMInCZMb5lMxoLEziI9i6SKnf4WGP9ODqWOqLRYY7uN8e 78ygeK66oOKh6ocW7NXLo0pCZO8dyNlnDc2/4f3wiMAfBZciAwFbkPHNAY2lVnJt/L1BEIU01jfL/ +sOIj5EjYtbYo1fkhQGYom9c+blx6Jx7nmw5eWOLwV4QEEv6wencmGBRYbQTnJOOWFLZ0RrEveS1c erelUzPswHX+XCuUzowmoqDt2hWKOjAaWYZVpZLWzUhYHjTHiOc2vtv38VlnIXr+V67iT6oRRVaGX RbrCpWMBcATc6J03T70fokOeSLA7dL8xgRHXGl9sX6LzujOeO38uMQ3fP+gSyLwQ==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rY4Z7-0000000HUJa-2rLW; Thu, 08 Feb 2024 14:35:45 +0100 Message-ID: Subject: Re: [v4,2/2] wifi: mac80211: refactor STA CSA parsing flows From: Johannes Berg To: Michael-CY Lee , linux-wireless Cc: Felix Fietkau , Lorenzo Bianconi , Evelyn Tsai , Money Wang , linux-mediatek Date: Thu, 08 Feb 2024 14:35:44 +0100 In-Reply-To: <20231222010914.6521-3-michael-cy.lee@mediatek.com> References: <20231222010914.6521-1-michael-cy.lee@mediatek.com> <20231222010914.6521-3-michael-cy.lee@mediatek.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.3 (3.50.3-1.fc39) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-malware-bazaar: not-scanned Hi, So ... I foolishly applied my other changes first, so I had to rebase this - please do check. Couple of questions/notes, if anything needs changing please send another patch. > + he._oper.he_oper_params =3D cpu_to_le32(u32_encode_bits(1, > + IEEE80211_HE_OPERATION_6GHZ_OP_INFO)); (I changed this to le32_encode_bits, FWIW) > + /* if data is there validate the bandwidth & use it */ > + if (new_chandef.chan) { > + if (conn_flags & IEEE80211_CONN_DISABLE_320MHZ && > + new_chandef.width =3D=3D NL80211_CHAN_WIDTH_320) > + ieee80211_chandef_downgrade(&new_chandef); > =20 > if (conn_flags & IEEE80211_CONN_DISABLE_80P80MHZ && > - new_vht_chandef.width =3D=3D NL80211_CHAN_WIDTH_80P80) > - ieee80211_chandef_downgrade(&new_vht_chandef); > + new_chandef.width =3D=3D NL80211_CHAN_WIDTH_80P80) > + ieee80211_chandef_downgrade(&new_chandef); > + > if (conn_flags & IEEE80211_CONN_DISABLE_160MHZ && > - new_vht_chandef.width =3D=3D NL80211_CHAN_WIDTH_160) > - ieee80211_chandef_downgrade(&new_vht_chandef); > - } > + new_chandef.width =3D=3D NL80211_CHAN_WIDTH_160) > + ieee80211_chandef_downgrade(&new_chandef); > =20 Shouldn't that have (had!) an 80 MHz handling case? Or maybe a loop a la the one in ieee80211_config_bw(): /* * Downgrade the new channel if we associated with restricted * bandwidth capabilities. For example, if we associated as a * 20 MHz STA to a 40 MHz AP (due to regulatory, capabilities * or config reasons) then switching to a 40 MHz channel now * won't do us any good -- we couldn't use it with the AP. */ while (link->u.mgd.conn.bw_limit < ieee80211_min_bw_limit_from_chandef(&chanreq.oper)) ieee80211_chandef_downgrade(&chanreq.oper, NULL); Feels like this should be the same here. Also note how this uses ieee80211_chandef_downgrade() - we really need to track the "chanreq.oper" vs. "chanreq.ap" in this code as well for puncturing - can I ask you to take a brief look at that? I'll anyway probably have to look at that soon though. johannes