From owner-freebsd-wireless@freebsd.org Wed Jul 22 04:00:49 2020 Return-Path: Delivered-To: freebsd-wireless@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29E62370349 for ; Wed, 22 Jul 2020 04:00:49 +0000 (UTC) (envelope-from notjanedeere@gmail.com) Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBMFX1Vk5z4cjJ for ; Wed, 22 Jul 2020 04:00:48 +0000 (UTC) (envelope-from notjanedeere@gmail.com) Received: by mail-il1-x132.google.com with SMTP id h16so105066ilj.11 for ; Tue, 21 Jul 2020 21:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=9CaI7DO/0V3jSSeWfWpCOx6w39/ickgJJesfbuc5dbo=; b=HsqwOoFjDahJ2gupa1mh9dXPXAiHN08LUFIeawywWhs6aZ3aUVT3KV26wsgCRs2buQ 8HVtTnqbWiRKBUd3XF46XsWQWVRhY9oCddr+WFMT23ZQn8g4CWnLtBf5WBSDLad6swRx tBIQRpUs6NvI0aXbdFyjAPcLzqHRPUI9cYP5CXE+DjL+Kz7JDd1bSQkulBCDtHCVY2Ft 09uIjxoDLxGd5SA4ybTei5WB6w0uSAsd9DVNRyqlf8sl2PgKbeV29RINcTLhK7Mgekrq 4BMUFypNzxRjQEVIel5q3F6LVcZNMaMx74QJ3VzLK48mdcIf9SSd3FCE805qY0AMy717 GbHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=9CaI7DO/0V3jSSeWfWpCOx6w39/ickgJJesfbuc5dbo=; b=H0SddUMxgHqor5IGCHtqFSLT4Rg+SME5MF+hbqjek2SJWPNIMaywJzXxCx3uZyOnVc XmoCL0uoodDbxgovGNgyk0/qlnfS5su2NEnYQL99BjWr3z8xUN0xViW6EBhR/4z9s92v f21unsar0lWPR/uO4cJCYvzXP5QlPC6Ay9fiTjL2KoW0HxlSqe8EyjQeykUQhJXxF8xb bjvw00m1kONPAO7cS+068cxxA3NUNl6yMKajRTCMRPW+0Wj4QNQCETZ9yD0sZ2mTO5vN VgdoNm56N+C+rvGGbC2nwwR/fKM3bu/+cvgEfms/00VDexxIih1TRnsnSRcuC6Gan6C6 oxPQ== X-Gm-Message-State: AOAM5338LysfLq/6qt4qoLsOt2isxjExWJlKqoCX3x5wH/a22zbGTUow hHUFggCzTHPYzPYicyw9uH4qqLT8 X-Google-Smtp-Source: ABdhPJwpfhNiQJo1TOwlaZ6divcWxLRBsnq/cKMGKKs2cNpeMzqCgPfxIhniTAzgU5ddJaLV8USdWA== X-Received: by 2002:a92:d2c6:: with SMTP id w6mr29790112ilg.24.1595390446863; Tue, 21 Jul 2020 21:00:46 -0700 (PDT) Received: from [10.5.0.2] ([153.92.40.7]) by smtp.gmail.com with ESMTPSA id w10sm11534332ilo.10.2020.07.21.21.00.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Jul 2020 21:00:46 -0700 (PDT) Subject: Re: regdomain.xml - Linux wireless-regdb To: Adrian Chadd Cc: freebsd-wireless References: From: Aaron Message-ID: Date: Wed, 22 Jul 2020 00:00:45 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Rspamd-Queue-Id: 4BBMFX1Vk5z4cjJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=HsqwOoFj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of notjanedeere@gmail.com designates 2607:f8b0:4864:20::132 as permitted sender) smtp.mailfrom=notjanedeere@gmail.com X-Spamd-Result: default: False [-3.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.59)[-0.589]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.02)[-1.025]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.984]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-wireless@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::132:from]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2020 04:00:49 -0000 On 7/21/2020 11:39 PM, Adrian Chadd wrote: > On Tue, 21 Jul 2020 at 20:36, Aaron > wrote: > > Still working on my mailing list etiquette ... > > On 7/21/2020 11:11 PM, Adrian Chadd wrote: > > > On Tue, 21 Jul 2020 at 20:03, Aaron > > >> > wrote: > > > >     On 7/21/2020 10:53 PM, Adrian Chadd wrote: > >     > As a data source yes, but I'd /love/ ours to be more > structured. > >     > Parsing the wireless-regdb format is ... lol. > >     > > >     > > >     > -a > >     Fair enough.  This data also has a 1:1 mapping between > country and > >     regulatory domain.  You mentioned Atheros earlier, is this > 1:many > >     country:rd mapping necessary or just an artifact of how they > coded > >     things? > > > > > > I mean, both are true. For atheros hardware we do that already > in the > > driver; and for other NICs that need local weird channel/sku > bits they > > can implement themselves. :-) > > > > > > > > -adrian > > > >     _______________________________________________ > > freebsd-wireless@freebsd.org > > > > >     mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-wireless > >     To unsubscribe, send any mail to > >     "freebsd-wireless-unsubscribe@freebsd.org > > >      >" > > > So Atheros and the Japanese are on their own.  In that case, the data > that's needed is ... what's already in the wireless-regdb file?  > You've got: > > >   * Country >   * Regulatory domain name (albeit only FCC, ETSI and JP), /which > isn't >     actually used for anything!/  The details for each country are >     stored directly, there's no referring to the regulatory > domains at all. > > > They're used for DFS modules which need to know which DFS regulatory > domain one needs. :-) > >   * Frequencies and channel widths. >   * TX power (in db OR mW, if that needs to be normalised someone's >     going to have to supply me with a reference or a formula) > > > As you'll discover, the challenge is that there can be multiple ways > to skin the regulatory power limits felines. For we should stick to > what net80211 already does;  which is just tx power in 1/2 dBm increments. Not an issue, found the formula, apparently conversion between mW and db is dead simple.  Reference here: https://www.rapidtables.com/convert/power/mW_to_dBm.html Hypothetical case:  We have a 300mW transmit power limit, which converts to ~24.77db.  Since this is a regulatory restriction, do we round that down to 24.5 or up to 25?  What if it was 24.95, 24.5 or 25?  Since it's a maximum power restriction I'm guessing we always round down. >   * Flags.  Once the data's parsed we can get a complete list of > these. > > Right. > > Is there anything else needed?  And given that each country is a > self-contained dataset, what do we need the regulatory domain name > for > beyond a label? > > DFS is the main consumer for now. The wireless-regdb only has three domains listed.  The regdomain.xml seems to have more detail, although I'm not sure how much of that is Atheros leftovers.  Is there a list of country:domain with more detail? Here's the list I got out of regdomain.xml:      rd {'id': 'debug'}      rd {'id': 'fcc'}      rd {'id': 'fcc3'}      rd {'id': 'fcc4'}      rd {'id': 'japan'}      rd {'id': 'etsi'}      rd {'id': 'etsi2'}      rd {'id': 'etsi3'}      rd {'id': 'apac'}      rd {'id': 'apac2'}      rd {'id': 'apac3'}      rd {'id': 'korea'}      rd {'id': 'row'}      rd {'id': 'none'}      rd {'id': 'sr9'}      rd {'id': 'xr9'}      rd {'id': 'gz901'}      rd {'id': 'xc900m'}