Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1063930pxu; Thu, 8 Oct 2020 02:16:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ0aOsx7hrAUqvcdLomBb0ma5M5TDRa6XZ8ok80oIwLi43XXE9MocQtEpcnQqS8KjsfFkf X-Received: by 2002:a50:cd51:: with SMTP id d17mr7679222edj.93.1602148560753; Thu, 08 Oct 2020 02:16:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602148560; cv=none; d=google.com; s=arc-20160816; b=HJJg6oFzNLz/6w6hOhGYMvSdmK7p3DIxIs1gmDLVTcvBaAfkIswRcbjUnHQSmV6Y1E YzA7g0PYrjHWXTGq+qH1dF6n503tccNZNrfe900jfMSFgSS495rzipPEE8afPA6IPti/ 421SjrXX27V597+7/F4Di94zp+hu6k0AkRGijErXVmCEriIjusfrZmmuix7+qvjbNQpD y1HwY7zLchCZ3cyTgtl3lvxnbqC1IVj9hGfDKneB0HaXcLEeuKl3DBJYFjOZEjv35ISL IgA0zNX4gPBEKKH6WDjQvzOBb9zksuYXWEhJvK3VBvWyGuq5vAteaTHn5xiRttQiG2fj Ietg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=tgT1XXFUwDqIok2DbKJCyTAxz/2GlTnvBTzak6/B3EQ=; b=GkBfJN0iN8hQQJEZvpN0bBBFA79UjPx8JpEwNzucU+WJBJ/h56xaJ1uvkGQCc4piX5 danY+V8LId0bIQU/uJ7X5WXMz341/iu51L/XjfD3VOLJrYnxha2thmsTOUOP5gCKhEcw btKcKvCeRfOJqupzaaI029yhtd2BV3iAN9DWd2oKp4fgRpPntsue+vBfiz27ohcsSv+u McbKy3DB34sFTRwhIlSH10AKpzBZqwdaxoTBBgd2DnWt7eXpS7wBEG1TQVXrlbaVv2Ak 59dx3DN1qw/KAYWZuU2/egIYNRGcuvbtj3Ig3J/IRHEOGnFvpckKYURqWQ1E6t61idLv 5VkA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si3494365ejr.370.2020.10.08.02.15.34; Thu, 08 Oct 2020 02:16:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725916AbgJHJGx (ORCPT + 99 others); Thu, 8 Oct 2020 05:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgJHJGx (ORCPT ); Thu, 8 Oct 2020 05:06:53 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E20EC061755 for ; Thu, 8 Oct 2020 02:06:53 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1kQRsw-001VGL-Tr; Thu, 08 Oct 2020 11:06:51 +0200 Message-ID: Subject: Re: [PATCH v2] cfg80211: add support to configure HE MCS for beacon rate From: Johannes Berg To: Rajkumar Manoharan Cc: linux-wireless@vger.kernel.org Date: Thu, 08 Oct 2020 11:06:49 +0200 In-Reply-To: <1601762257-14934-1-git-send-email-rmanohar@codeaurora.org> References: <1601762257-14934-1-git-send-email-rmanohar@codeaurora.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sat, 2020-10-03 at 14:57 -0700, Rajkumar Manoharan wrote: > This allows an option to configure a single HE MCS beacon tx rate. > > Signed-off-by: Rajkumar Manoharan > --- > v2: clear mcs ratemask when beacon tx rate is not set. I can't believe I didn't realize this before, but ... > @@ -4672,14 +4673,20 @@ static int nl80211_parse_tx_bitrate_mask(struct genl_info *info, > nla_len(tb[NL80211_TXRATE_HT]), > mask->control[band].ht_mcs)) > return -EINVAL; > - } > + } else if (is_beacon_tx_rate) > + memset(&mask->control[band].ht_mcs, 0, > + sizeof(mask->control[band].ht_mcs)); I think this is a bit strange? I mean, why not just skip the /* Default to all rates enabled */ for (i = 0; i < NUM_NL80211_BANDS; i++) { [...] } code? Right now you're first setting it, and then clearing it again when is_beacon_tx_rate is set ... I'd prefer a "default_all_enabled" parameter, and then call the above loop conditionally on it (perhaps moving it to a separate function to not have all the deep indentation to worry about). johannes