Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2212246ybz; Thu, 30 Apr 2020 12:55:33 -0700 (PDT) X-Google-Smtp-Source: APiQypKM2vTGU0SAx1P9K4pk1/llQgm/RrtlAf0tRqVz98HDOBo50oB4SDWuqFekwiM1Qpq2mnEA X-Received: by 2002:a17:906:c839:: with SMTP id dd25mr91194ejb.164.1588276533346; Thu, 30 Apr 2020 12:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588276533; cv=none; d=google.com; s=arc-20160816; b=ds3FL1DXVh7CtejdbYvoYAzrYDwD3PJXx1mnZS/BAaFMlBMQwsX3f/wLNFUnNKKz46 /IWALx+Rtqutw+o+EctYcs6daez13td9C5OpblYKqONxxATz2niCs2+Tw9ticEEQSoNL qDugIYftcA8+X2E9v8qfwPkeOCt4OAPhvb/TdxAmsSJXkQ1uskROcXHypu8Jz8zhwqh2 DXcq85ZUocAFSJUi/ifl8ukYx1cBNffk4zi/8AmnAox0YXY8cd3ILe0qkZ/yVhenU2qi abhBLV6E80IB54WjU/XTknFW64dbHsIko+6oOoqERjOlSdUh0AF+TZ8VWISFJ/v+pbFd WUzA== 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=+CkS2KXbtc+M67A0AdYUYpzcTPZWn71z2YmS9T+PdG8=; b=l8iROG4aHqlnEuTy2YKrB0de5HS1RSkz+DJyYnsWw/K87nxyF+u8eVufM9CIFG61HD Mtq+wjRyXiFPpJrvpN/CIEexjOausIq6xcr6vvmrAWcKqaCg8nXqMtJOlpxP3fcXjy2j WHMrMhoXaakxdRVulbWMsSG9lhBc+tVWufZOzkR16oXVpkEMhpYobxqjKV8Fm6hjgk9f HuDVUm9h+aDn0+8tp6PPeLEg4y/8T6qaiYHLSxLDlzU0VGx1e0TkukfCPTwti8bUan5+ sr4q/R+voY2R+iGI/rL3yft0f0HtU+0ties0JCKXkYqhjpo1m/aUWjahoN5cJrw8gVKV kMSQ== 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 v25si372108ejx.386.2020.04.30.12.55.09; Thu, 30 Apr 2020 12:55:33 -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 S1726440AbgD3Tyn (ORCPT + 99 others); Thu, 30 Apr 2020 15:54:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726272AbgD3Tyn (ORCPT ); Thu, 30 Apr 2020 15:54:43 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1A67C035494 for ; Thu, 30 Apr 2020 12:54:42 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jUFGb-002qNU-3Z; Thu, 30 Apr 2020 21:54:41 +0200 Message-ID: Subject: Re: [PATCH 02/10] cfg80211: validate 6 GHz chandef From: Johannes Berg To: Rajkumar Manoharan Cc: linux-wireless@vger.kernel.org Date: Thu, 30 Apr 2020 21:54:39 +0200 In-Reply-To: References: <1587768108-25248-1-git-send-email-rmanohar@codeaurora.org> <1587768108-25248-3-git-send-email-rmanohar@codeaurora.org> <73a4e63e16bffb69cd9b62fd904b926dd5278fbf.camel@sipsolutions.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) 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 > > > +static enum nl80211_chan_width cfg80211_chan_to_bw_6ghz(u8 idx) > > > +{ > > > + /* channels: 1, 5, 9, 13... */ > > > + if ((idx & 0x3) == 0x1) > > > + return NL80211_CHAN_WIDTH_20; > > > + /* channels 3, 11, 19... */ > > > + if ((idx & 0x7) == 0x3) > > > + return NL80211_CHAN_WIDTH_40; > > > + /* channels 7, 23, 39.. */ > > > + if ((idx & 0xf) == 0x7) > > > + return NL80211_CHAN_WIDTH_80; > > > + /* channels 15, 47, 79...*/ > > > + if ((idx & 0x1f) == 0xf) > > > + return NL80211_CHAN_WIDTH_160; > > > + > > > + return NL80211_CHAN_WIDTH_20; > > > +} > > > > We haven't really done that for anything else - is that really > > necessary? > > > Hmm.. to check whether give center_freq1 chan_idx is allowed to operate > in given bandwidth. > Similar to center_idx_to_bw_6ghz of hostapd, this API is used to chandef > bw. Yeah, but good enough if hostapd does that check? I don't really see the kernel caring too much? > Don't we have to check chandef bw? If not, I will drop the change. I'm not really sure why we should, tbh. johannes