From owner-freebsd-wireless@freebsd.org Tue Jul 21 21:42:07 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 C611E368E81 for ; Tue, 21 Jul 2020 21:42:07 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 4BBBrb0P5Hz4H06 for ; Tue, 21 Jul 2020 21:42:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-qk1-f171.google.com with SMTP id l6so113794qkc.6 for ; Tue, 21 Jul 2020 14:42:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=bYP/4qDSyJgLrQ6+WO67CWAV52NHYOEfREoCqnaKb18=; b=IwLxeX1Az1geTs8oFUqb0x4buaLnu9WLS3qK9KU+rmDKhI1s+TOjrWlSWp7whggyga Z0v3SYnm/TpX+BtkaDDUY/AQg1X6NP4da9rHbxTBYLzSPReG2LHS1SrOiQk6rvCXL2EH 6zbrjeZ/QNph60lB1dwYyM+2VLZ8gqCWf9FTbtdx3p1EQLHe2CqgLOLeY7tEWuX7vDM5 9hdOVGY9sroExR+Jo42DVZu3oQWD0JipyWJwzP4zMror9Wdve+qhbnLfrPK4bI5soDo3 6ptbFXkZx0u921NWxHMa+louwdZOgzPrQEalBWqAM6Cfq1pFOQ2bb/Isv4Ekai7FJzSt XorA== X-Gm-Message-State: AOAM5303DmJ38liOXVeOsjBe9okVXjecw7sf0Dt4VooA61rQ/ra8Yd/s AylzdDtrb2pDOy6ootlxF+FFHa+eK5GXxy2inx4= X-Google-Smtp-Source: ABdhPJwdkUeRpr/3l3Xwi1ypkKREgej7QXOVfBWeJ1jOf6dfKRxoAnxy1vfUBPts6WZJgpkL04h2CC0cbyhIGF6GUO8= X-Received: by 2002:a05:620a:b04:: with SMTP id t4mr29155604qkg.183.1595367726201; Tue, 21 Jul 2020 14:42:06 -0700 (PDT) MIME-Version: 1.0 References: <7a0f5e2c-a9e2-a476-6d99-f4591211bbe5@gmail.com> In-Reply-To: <7a0f5e2c-a9e2-a476-6d99-f4591211bbe5@gmail.com> From: Adrian Chadd Date: Tue, 21 Jul 2020 14:41:54 -0700 Message-ID: Subject: Re: regdomain.xml To: Aaron , freebsd-wireless X-Rspamd-Queue-Id: 4BBBrb0P5Hz4H06 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 209.85.222.171 as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-2.19 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.922]; FROM_NEQ_ENVFROM(0.00)[adrian@freebsd.org,adrianchadd@gmail.com]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-wireless@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.01)[-1.010]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.25)[-0.254]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[209.85.222.171:from]; FREEMAIL_TO(0.00)[gmail.com,freebsd.org]; FORGED_SENDER(0.30)[adrian@freebsd.org,adrianchadd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.222.171:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" 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:42:07 -0000 (cc'ing the list again, hehe :-) On Tue, 21 Jul 2020 at 14:35, Aaron wrote: > > On 7/21/2020 5:33 PM, Adrian Chadd wrote: > > > Ok. Please do dig into it. > > Do try to treat the regdomain code as a black box - input is "what > regulatory domain do we want" and the output is "a list of channels and > properties of those channels that we currently program into net80211." > Hopefully we don't have to change the net80211 channel API! > > This is the sort of information I'm looking for! So far all I'm looking > at is an XML file. Where would I find the "regdomain code"? > (We really should write a page in the wiki about regdomain stuff.) So, here's my suggestion: * get freebsd with a supported wifi card * look at what happens when you type "ifconfig wlan0 create wlandev XXX"; and then "ifconfig wlan0 regdomain FCC3" * .. see what it does with the channel programming in src/sbin/ifconfig/ and src/lib/lib80211/ * Also 'ifconfig wlan0 list sta" and "ifconfig -v wlan0 list sta" in src/sbin/ifconfig/ifieee80211.c look at setdefregdomain(), setregdomain_cb(), print_channels() and list_channels() * print_channels() queries net80211 for the list of channels * list_channels() calls it :-) * setregdomain_cb() sucks in the lib80211 regdomain code, does a bunch of hijinx, and then calls into net80211 using the IEEE80211_IOC_REGDOMAIN ioctl to set the sku/country and the channel list. -adrian