From owner-freebsd-wireless@freebsd.org Tue Jul 21 21:32:40 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 3D3B83688DB for ; Tue, 21 Jul 2020 21:32:40 +0000 (UTC) (envelope-from notjanedeere@gmail.com) Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) (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 4BBBdg05Rxz4GSr for ; Tue, 21 Jul 2020 21:32:38 +0000 (UTC) (envelope-from notjanedeere@gmail.com) Received: by mail-qk1-x730.google.com with SMTP id l6so92058qkc.6 for ; Tue, 21 Jul 2020 14:32:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=HUfo3XLND3YsziBBBI6LB1J2hbEL5yMx+bxi6o5g8gs=; b=lE9bDQ+AiMOMdhp2pcI75f1oCI3MAa5xOMdjjyXVBzNv0RRI1CKL9c0o7UrBqRhfIG dPWvfo/mgbRnNoEKH6kjpI6Sm/wm5ZUh1At8LqLClLNjYl/qTJbnWpuniKHexphEprOr 9dcG0APXkiJexAPuEhSVjN3sPxm0n1vB/ewPZFzDqhwiMN+jrg6wbQ60II+PItdr2asf cXyUs2mlASTxpo89I/+oArE5kRxy8IBqx7Dfkv+7x3Bnrm51Pu2h6E5/8V1Iau9iJlhV HSZshxECi2GiX/xHSNz9OlO7hBAtfHv/l6RMpd+Eb9Gl5Ob3MlwONmtT0/HVk6Gk8OHp gXVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=HUfo3XLND3YsziBBBI6LB1J2hbEL5yMx+bxi6o5g8gs=; b=SYqD2wsb6IdfYbk5ot23CQCK2Eu4w4pvNswuairuuazidllaTBiTgnc8k/OF95QQsz XWFoEXRastvDwR/rHqjOwJ5W3Fwf/5yiQotWq48MK4KnqC5z08Q/+4/5UrNeaz1n/n8T elrkZNGg6pjdvlv7C5m9MD9K7vZPBKilrMS+ncsLaExuV9SlgfvRAVigujJTVGCoOHpU 7s6rLojTF9GNKsx1vlZa2MpwBXKcnFnvKjwrsScd0Mf+EhwvwON3ZHM5GDEcZaxrQpPp MkJH/yHvCfqZ06GmbCC6lj+vGMtZBE6QLnIQdSFz+tBbHr4diX/OfSzcgSvVbLHAcCfV YZzQ== X-Gm-Message-State: AOAM532DPzp6OwG9KRqVHOSVeTDZV1a4nlJ2/AgJx+mFPdn2Ta908lKk 1fIlp6MmvPVQq30ZzKk0OQ+GWbFS X-Google-Smtp-Source: ABdhPJycRjp7Pn0Cx+LHgLx/h3kzrBc99ruxZ2nPRVF136GVl3syCLNHn2Pz2paDpv4DV3nqWH3lHg== X-Received: by 2002:a05:620a:9d0:: with SMTP id y16mr17653767qky.353.1595367157695; Tue, 21 Jul 2020 14:32:37 -0700 (PDT) Received: from [10.5.0.2] ([162.219.176.188]) by smtp.gmail.com with ESMTPSA id c133sm3837993qkb.111.2020.07.21.14.32.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Jul 2020 14:32:37 -0700 (PDT) To: freebsd-wireless@freebsd.org From: Aaron Subject: Re: regdomain.xml Message-ID: <87ea181d-b859-ea07-731e-e910e43db16b@gmail.com> Date: Tue, 21 Jul 2020 17:32:36 -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 Content-Language: en-US X-Rspamd-Queue-Id: 4BBBdg05Rxz4GSr X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=lE9bDQ+A; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of notjanedeere@gmail.com designates 2607:f8b0:4864:20::730 as permitted sender) smtp.mailfrom=notjanedeere@gmail.com X-Spamd-Result: default: False [-2.18 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.24)[-0.236]; 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)[]; FAKE_REPLY(1.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.98)[-0.980]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.966]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-wireless@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::730: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: Tue, 21 Jul 2020 21:32:40 -0000 Sent this to Adrian instead of the list: --- I preface this with the realisation that I'm using 12.1-RELEASE and should switch to one of the dev releases.  13-CURRENT? > I read the "regdomain" manpage ... no help there. > > Yeah, it's ...old. :-0 Stick that on the TODO?  Once everything else is done, obviously. > Luckily we can just use what's in the linux regulatory domain tables > because they've already done the work of scouring the regulatory sites > for their information :-) I'll search for this myself, but if someone has a link? > >   * the regulatory database is indexed by SKU, rather than by country. >     So adding a new _country_ is actually rather annoyingly difficult. >       o There's a section that links to , so > either >         someone's already done the work here or I need this item > explained. > > The file is organised per-SKU; 'rd' is regulatory domain, not country. The portion of the file is organised by , which contains a .  However, there is a section that is organised by and contains an .  If I wanted to add a new country working under the FCC rules, I'd just add one here and presto.  So why is adding a country difficult?   999 Madeupistan And now Madeupistan is mapped to the "japan" . >   * Change the regulatory database code to be indexed by something > that >     isn't hard-coded, and have the "regulatory domain entry index" map >     _to_ an SKU where needed. >       o "regulatory database code" meaning ? >       o Since SKU in this context is not a Stock Keeping Unit ... >         definition please? > > > it /is/ stock keeping unit. Ok, so! > > This database is an XML representation of the Atheros regulatory > database. You can find that in sys/dev/ath/ath_hal/ah_regdomain/ or > something similar under ath_hal. > It's organised per-SKU because the Atheros parts are kinda organised > that way. Eg, there are multiple japan codes because the japan rules > state that older hardware doesn't need to work with newer rules, but > newer hardware does. So each respin of the japan regdomain rules > created a new SKU. This is actually more confusing rather than less.  If the SKU is a piece of hardware, it shouldn't be in this file at all.  If it SHOULD be here, it should be in its own section.  Currently there's a list of s, a list of s, and a list of s.  If particular hardware (a ) needs to be mapped onto a particular , should there be a list of s? Also, isn't it user-defined which domain you join?  I know my wifi hardware asks me which country/domain/environment I'm in, it doesn't seem to set that without my intervention.  Where in the software does a particular piece of hardware get assigned to JAPAN-2010 instead of JAPAN-2020? Also ... the regulatory domains have versions?  They don't seem to be present in regdomain.xml.  Should they be added? >   * This lets me do useful things like _update the regulatory > database_.. >       o When you refer to the "regulatory database", do you just mean >         "/etc/regdomain.xml"?  And what updates are you trying to do >         that are currently difficult? > > Well, it's a pain to update things :-) Eg, if I wanted to update the > US I'd have to go update all the FCC domains that the US can use. FCC > is FCC without DFS channels; FCC3 is FCC with DFS channels. It's just > a lot of work. As implemented the file allows one to mapping per ISO country code ().  According to the file, the only the US uses is FCC.  How are you currently mapping the US onto multiple s?  Is it happening somewhere outside "/etc/regdomain.xml"? > >   * add VHT flags and 80/80+80/160MHz wide channel widths. >       o More data entry.  Link to the data you want added? > > I've added it for FCC. You can see what work it was just to add them > there. :-) Which FreeBSD version is this work in?  13-CURRENT? > So, I'd really like to figure out how to simplify the regdomain.xml > file. But - we should come up with a firm plan first. Luckily this IS > basically all userland work. :-) I'm trying to understand all the relationships so the refactoring solves rather than causes problems.  I'll be sticking to code samples in the mailing list until everyone's comfortable the new format is better than the old one. I'm not a FreeBSD user, mostly I just have it running on routers and wifi hardware (hence my interest).  Are XML config files widely used? Anyway, thanks for the response! CmdrWgls