Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp12112487ybi; Fri, 26 Jul 2019 05:01:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5R5G4fy82ropS4WuGPvCnJJjRfGk4O92FyvV7VwayToSi9Yf+5YcKzhUEeytMqGSXcNIW X-Received: by 2002:a17:902:20e9:: with SMTP id v38mr97161846plg.62.1564142500634; Fri, 26 Jul 2019 05:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564142500; cv=none; d=google.com; s=arc-20160816; b=N2VSVm9feSUdlh1RiUnXAJWrKdmyXEH2ZgFGd+QLwBAeky+ZE36gJ+sSycH0+GFNKQ frTXsAneh382UFIGr7rdRl1H8NX+0y2Iw7M3YQeEdkcG9GlJTLk/eO1iR2IkH0LHOEd2 nOxkZRooApHOXGVevsSYJ28wg1Hcofs7WX7Dq0mhuTmRLcpf3f8DeCjXohWZxjBl5q0F rQVKTSaqD7QBW3FU2z1tQOK376gebQTn0Gur2hJu7DiqZMLDMNx7wZkMr6iD0DTImIL+ Q3L48UaE71uy6pmFkpTzrwMxRaegz/6D/RR/NqO8qDxnJyM32RjsMDnoIM3FsNtr7BQo 65eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=x9GZTaqurJ2ul5WlwTK7aUdhR4ZUX3itSH1V+zVoOHw=; b=yX40L5eEIj7n2TD1VFYMhDLu6xtbx+bRZjjVumpuUFSAfkinN3WI+H913IZuZu7/Fn 2aDtJWGcM0sYNQ1kQtcacKU0Rip5XsWQoJ3OLAIo28D2UV6kEbojo3y/9C/gQX01u/0t rxtmeL5ThE8eFaJbGuvRCQaXAGzfcQcW6r2g5H+d5c8wc6Bl1p9xkuaZfsaoU6YJhlFF CkJnqOfAaWa1ReJRFfVKtgNAN5mt+JhL3T47z98CEYmpfuvhT2sthQsDMe6Y6zCs/R+s 40PAjOL2MJ4FUEjtxtNllEsFipjHLe1Ya+uJoud/P3XjoCqieSDk6pa0kWohYm7v7SgS N25A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l143si19106868pfd.162.2019.07.26.05.01.16; Fri, 26 Jul 2019 05:01:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726643AbfGZLtB (ORCPT + 99 others); Fri, 26 Jul 2019 07:49:01 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:47848 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbfGZLtB (ORCPT ); Fri, 26 Jul 2019 07:49:01 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hqyiZ-0002CG-S9; Fri, 26 Jul 2019 13:48:59 +0200 Message-ID: <046b22fb9c4784351c36e29d0a3b8a1e0097d264.camel@sipsolutions.net> Subject: Re: [PATCH V3 2/2] mac80211: allow setting spatial reuse parameters from bss_conf From: Johannes Berg To: John Crispin Cc: linux-wireless@vger.kernel.org, Shashidhar Lakkavalli Date: Fri, 26 Jul 2019 13:48:57 +0200 In-Reply-To: <20190618061915.7102-3-john@phrozen.org> References: <20190618061915.7102-1-john@phrozen.org> <20190618061915.7102-3-john@phrozen.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, 2019-06-18 at 08:19 +0200, John Crispin wrote: > Store the OBSS PD parameters inside bss_conf when bringing up an AP and/or > when a station connects to an AP. This allows the driver to configure the > HW accordingly. > > Signed-off-by: Shashidhar Lakkavalli > Signed-off-by: John Crispin > --- > include/net/cfg80211.h | 15 +++++++++++++ > include/net/mac80211.h | 4 ++++ > include/uapi/linux/nl80211.h | 27 ++++++++++++++++++++++ > net/mac80211/cfg.c | 5 ++++- > net/mac80211/he.c | 24 ++++++++++++++++++++ > net/mac80211/ieee80211_i.h | 3 +++ > net/mac80211/mlme.c | 1 + > net/wireless/nl80211.c | 43 ++++++++++++++++++++++++++++++++++++ > 8 files changed, 121 insertions(+), 1 deletion(-) Not sure if I missed this before, but in any case please split between cfg80211 and mac80211 for all but the most trivial patches. > +/** > + * enum nl80211_he_spr - spatial reuse attributes bad copy/paste? :) > + * @__NL80211_HE_OBSS_PD_ATTR_INVALID: Invalid > + * > + * @NL80211_ATTR_HE_OBSS_PD_MIN_OFFSET: the OBSS PD minimum tx power offset. > + * @NL80211_ATTR_HE_OBSS_PD_MAX_OFFSET: the OBSS PD maximum tx power offset. > + * > + * @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal > + * @NL80211_HE_OBSS_PD_ATTR_MAX: highest spiatl reuse attribute. typo & wrong anyway, OBSS PD not SPR > + */ Those prefixes are a bit confusing - IMHO they should all be NL80211_HE_OBSS_PD_ATTR_*, NL80211_ATTR_* is mostly (except for a few historical bugs) the top-level attributes. > +enum nl80211_he_spr_attributes { here also > + memcpy(&sdata->vif.bss_conf.he_obss_pd, ¶ms->he_obss_pd, > + sizeof(struct ieee80211_he_obss_pd)); just use struct assignment blabla.he_obss_pd = params->he_obss_pd; > + [NL80211_ATTR_HE_OBSS_PD] = { .type = NLA_NESTED }, please use NLA_POLICY_NESTED() (requires putting the below policy above this point) > +static const struct nla_policy > + he_spr_policy[NL80211_HE_OBSS_PD_ATTR_MAX + 1] = { I guess I'd lose all the tabs here but don't really care that much. > + [NL80211_ATTR_HE_OBSS_PD_MIN_OFFSET] = { .type = NLA_U32 }, > + [NL80211_ATTR_HE_OBSS_PD_MAX_OFFSET] = { .type = NLA_U32 }, That can't be right, they go into u8 eventually, no? Use NLA_U8 or maybe even NLA_POLICY_RANGE(). Also in the struct ieee80211_he_obss_pd you have u32 for no real reason? In the element in the frame you only used a single u8. > + if (!tb[NL80211_ATTR_HE_OBSS_PD_MIN_OFFSET] || > + !tb[NL80211_ATTR_HE_OBSS_PD_MAX_OFFSET]) > + return -EINVAL; > + if (he_obss_pd->min_offset >= he_obss_pd->max_offset) > + return -EINVAL; Maybe add some extack error messages for this. johannes