From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46949ECAAA1 for ; Tue, 6 Sep 2022 09:43:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239293AbiIFJnX (ORCPT ); Tue, 6 Sep 2022 05:43:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239450AbiIFJmv (ORCPT ); Tue, 6 Sep 2022 05:42:51 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4AA475FD4 for ; Tue, 6 Sep 2022 02:42:36 -0700 (PDT) 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=j6qYNPb0qFADyDa8+JWEUg6eJTWZ9Vkbb+BZqLNJ6Sw=; t=1662457356; x=1663666956; b=DXiWK3lZbbXiNvqkZ8zbuPOQTwe2UfSy7WhBsAq3k1lVVZO lacVZJJedCCHbAGU4jH/j6vby8AKDREq/D15UFw+nnQ6AvI7TAzsOVNI6C7UYAWdk5ZJacdMd55hc AVeWI7574sGcfXDrXyH2kb9m3Ewqhh/jEy56zLBL9nQ72cFmexeLmX0I5uVbp0+F4cudkMJzPq0fF bcyhYLgPH2XMXMm+0/+1I1g0qOouhPFK7EogyBv+Hpm+/lJqLzNWPQJZGAza/DnyXcoGCJlyrGb4O nPKRiap9k3Lg1410dhMZ3/r4R+hH8V7z3GWYh2HKsJwMifz2NLmn6YIc78hO1X5A==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1oVV6H-009Mgt-0d; Tue, 06 Sep 2022 11:42:33 +0200 Message-ID: Subject: Re: [PATCH v3 04/12] nl80211: support setting S1G short beacon period From: Johannes Berg To: Kieran Frewen Cc: linux-wireless@vger.kernel.org, quic_jjohnson@quicinc.com Date: Tue, 06 Sep 2022 11:42:32 +0200 In-Reply-To: <20220906044812.7609-5-kieran.frewen@morsemicro.com> References: <20220906044812.7609-1-kieran.frewen@morsemicro.com> <20220906044812.7609-5-kieran.frewen@morsemicro.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, 2022-09-06 at 16:48 +1200, Kieran Frewen wrote: >=20 > @@ -805,6 +805,7 @@ static const struct nla_policy nl80211_policy[NUM_NL8= 0211_ATTR] =3D { > [NL80211_ATTR_MLD_ADDR] =3D NLA_POLICY_EXACT_LEN(ETH_ALEN), > [NL80211_ATTR_MLO_SUPPORT] =3D { .type =3D NLA_FLAG }, > [NL80211_ATTR_MAX_NUM_AKM_SUITES] =3D { .type =3D NLA_REJECT }, > + [NL80211_ATTR_SHORT_BEACON_PERIOD] =3D { .type =3D NLA_U16 }, You probably want _some_ kind of range validation here, like "don't set it to zero" at least? > + if (info->attrs[NL80211_ATTR_SHORT_BEACON_PERIOD]) > + params->short_beacon_period =3D > + nla_get_u32(info->attrs[NL80211_ATTR_SHORT_BEACON_PERIOD]); >=20 And maybe it should be < the long beacon period? Actually the mac80211 code makes it sound like what you really should have is a "long beacon period" or something, so that every N beacons you send a long one? Or are these really completely independent? It feels like probably the intention would be to have a (short) beacon period, and then every N beacons you send a long one? johannes