Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3244260rdb; Wed, 13 Sep 2023 06:38:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuvyq2p77dWli4K5lbt/6Sj2zILTPIQp8UVywJHmcqB4pHvUCCQqn15K1ySrUrvakIU2kv X-Received: by 2002:a05:6a20:4321:b0:14c:c986:d105 with SMTP id h33-20020a056a20432100b0014cc986d105mr2785862pzk.45.1694612306345; Wed, 13 Sep 2023 06:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694612306; cv=none; d=google.com; s=arc-20160816; b=P6ZQLAgydnLHV4yQqeRxvLDGdBHabhRDKturzyVYsQpR38AIJKP7T077ofGwn/647A 1U3ZE0gQAKMVQXxg21utjh/pH5Ut6ss2sK/pp5hIZoU6NUtT5PsUNQ0SrOtVIlGsXCol HAXUglE/wXTIsSlvlL1Oqa+L2SqrHqdUPJQHcE/Sgg1FT/Yxx7pfbWfFJwZkhp3oipR+ DdivCNIHNSr/qOSmPZw6V7QLNlOQKAVg16+x9L6z+4IdtNG8+fXP2e985+iZyX5SgD4A Pk/skpmjwfGKXqNHp/vZMYqtIq8j1NGWfPALeBkfBCauh+kARZzFNfcrUW3+wGcyT/R0 U7Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=TJXbv58nZXH9xs0idbIKM4PwT3gIhgk7a+ziFWpPZk0=; fh=vXPBMBSGR11YbCvwlO+ke/aa5aR9GpZna8u8kCFmyLM=; b=cQ8mgxSL/a1pfwrTBlNM2ZvI6Noy/YHg2u5jFSuPnziJ4qv/7R6Z3s6weQUvopf8nV dLgES86qaxULyEGDQ/hblL4cmoniK0Fp+FWJlLUe0pJxFO39e+2AQEfJe/ww1eLEBuYy wdcpVwez5Jj29P8CTi4n5eNdfENFrp1d9e3rV+bT+ildcgfFnr5L7JoNJrvNoI5LcXrz Jr50jSH4AGUfzPtim9nKOht7wjJDZkDY/yE+Vr17G9mtsoWjD7gmH+89Enys057Luo+O AtB0zrIcnPoc/BN/EW11x5vmtTYx122C7I8UMB3R59X7lWgy991Dw5DCNRmN+JmvYESM Kxfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=DxWj+iSP; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id n7-20020a170903110700b001c1e1fe16cbsi10630404plh.255.2023.09.13.06.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 06:38:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=DxWj+iSP; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BAB3E812229D; Wed, 13 Sep 2023 04:56:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240518AbjIML4d (ORCPT + 56 others); Wed, 13 Sep 2023 07:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231334AbjIML4d (ORCPT ); Wed, 13 Sep 2023 07:56:33 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DB3A1996 for ; Wed, 13 Sep 2023 04:56:29 -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=TJXbv58nZXH9xs0idbIKM4PwT3gIhgk7a+ziFWpPZk0=; t=1694606189; x=1695815789; b=DxWj+iSP0ff/w7GLeIULoFG0bBgmx+6xJQHsvwfDVtZJEjz 1KTM4Ic6u2fMrLRDAPdy2DAI5VHWlcQ2DyL1ReCj4UFcpH178ffZM4UL2/FPynSacw5+Ifipjc0xZ vYmUeO9l2zd5Y/ld4d6A13TmKO9TXpzaHEkJypCo7dVOsseWfQRpwZNCe64y5Nkva+yeELLSBxk+j 4fpdIveQAnPHpzhAX/z1VfLvc9XyOCNdOKC/BRClVdFP5oZua/dk1+7GtnOV9gfOLlKtUmfNQYHe6 eQ8tqHTZUBlefMtjz1e1fYVbPxneXgpmt08ONh+f/WS7K/iw94ANSy5rbgpSKwjw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1qgOTq-00EsIh-3C; Wed, 13 Sep 2023 13:56:27 +0200 Message-ID: <7f049725302e06040194e0aa76a8c34d6ecc024c.camel@sipsolutions.net> Subject: Re: [PATCH v7 2/2] wifi: mac80211: S1G beacon/short beacon support From: Johannes Berg To: Bassem Dawood , linux-wireless@vger.kernel.org Cc: Kieran Frewen , Gilad Itzkovitch Date: Wed, 13 Sep 2023 13:56:25 +0200 In-Reply-To: <20230810093556.33800-2-bassem@morsemicro.com> References: <20230810093556.33800-1-bassem@morsemicro.com> <20230810093556.33800-2-bassem@morsemicro.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Sep 2023 04:56:30 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email On Thu, 2023-08-10 at 19:35 +1000, Bassem Dawood wrote: > From: Kieran Frewen >=20 > With the kernel able to send both short and long S1G beacons, include > the ability for setting the short beacon period. If configured, use > the S1G short beacon format. The S1G short beacon format includes a > limited set of information elements. It also adds the support for > distinguish short beacon head and tail. Also here, I think that could be more elaborate. And we like to also have commit logs in imperative voice. > +++ b/net/mac80211/ieee80211_i.h > @@ -259,10 +259,13 @@ struct ieee80211_color_change_settings { > =20 > struct beacon_data { > u8 *head, *tail; > + u8 *short_head, *short_tail; > int head_len, tail_len; > + int short_head_len, short_tail_len; > struct ieee80211_meshconf_ie *meshconf; > u16 cntdwn_counter_offsets[IEEE80211_MAX_CNTDWN_COUNTERS_NUM]; > u8 cntdwn_current_counter; > + u8 long_beacon_count; I don't understand why this is called long_beacon_count? > +++ b/net/mac80211/tx.c > @@ -5260,6 +5260,18 @@ ieee80211_beacon_get_ap(struct ieee80211_hw *hw, > struct sk_buff *skb =3D NULL; > u16 csa_off_base =3D 0; > int mbssid_len; > + bool is_short =3D false; > + > + if (vif->cfg.s1g) { > + if (beacon->long_beacon_count =3D=3D 0) { > + is_short =3D false; > + beacon->long_beacon_count =3D > + vif->bss_conf.short_beacon_period - 1; > + } else { > + is_short =3D true; > + beacon->long_beacon_count--; It's decremented for every _short_ beacon, and then you get a long one when it reaches 0 ... so it's surely not counting long beacons? Seems like is_short now needs to be taken into account for the beacon skb allocation, nowhere did you actually ensure that the short beacon is indeed shorter than the long beacon ... you don't want to let userspace crash us with that. johannes