From nobody Mon Oct 21 00:17:25 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XWwqY5nYTz5ZxqD for ; Mon, 21 Oct 2024 00:17:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XWwqY1gf8z53SR for ; Mon, 21 Oct 2024 00:17:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTPS id 2bBEtPjvUMArN2g6xtzd70; Mon, 21 Oct 2024 00:17:27 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id 2g6vtM5JLKHV82g6wt5nJa; Mon, 21 Oct 2024 00:17:27 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=XeEqz555 c=1 sm=1 tr=0 ts=67159d97 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=DAUX931o1VcA:10 a=YxBL1-UpAAAA:8 a=NEAV23lmAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=N3OrklvN2ZZdH3oL9h8A:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 4110A47F; Sun, 20 Oct 2024 17:17:25 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 132A1393; Sun, 20 Oct 2024 17:17:25 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Tomoaki AOKI cc: Cy Schubert , Artem Hevorhian , freebsd-hackers@freebsd.org Subject: Re: Help wanted on porting a wifi library from Linux to FreeBSD In-reply-to: <20241021072213.d372a39793a9564030a31085@dec.sakura.ne.jp> References: <20241020194105.87D67216@slippy.cwsent.com> <20241021072213.d372a39793a9564030a31085@dec.sakura.ne.jp> Comments: In-reply-to Tomoaki AOKI message dated "Mon, 21 Oct 2024 07:22:13 +0900." List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 20 Oct 2024 17:17:25 -0700 Message-Id: <20241021001725.132A1393@slippy.cwsent.com> X-CMAE-Envelope: MS4xfAMP2+HOE+vD3GSZ20CphztqXY7Oz40woSQRlh1UDhs1YRSE5Y8M30Xv6CdRXliaZVWlF8Lf9ER8CNz+V6SSAzYVHjzxSQgzjzAKEHrNWdan27hrYie5 TjEXi5GOaPKaDQK4LKCmctUeu4An5bGQ1GPt49UnTpvvyAr3Hp51pei4BV5wzfN/Q1tUq/izPy7Pv/ZAdVkP+G1dD4SV8lIyIsoMiF0iJ/ault4jQdRd+aUD BptNIXmFuR0hZXLyp5wiiH3lqBx+L3Chx25NUJm1rcsF8G59arLL+gzajpfarh9x X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4XWwqY1gf8z53SR X-Spamd-Bar: ---- In message <20241021072213.d372a39793a9564030a31085@dec.sakura.ne.jp>, Tomoaki AOKI writes: > On Sun, 20 Oct 2024 12:41:05 -0700 > Cy Schubert wrote: > > > In message c > > om> > > , Artem Hevorhian writes: > > > > > > https://github.com/bmegli/wifi-scan > > > > > > Here it is. It uses nl80211.h header. I think we should do the same on > > > FreeBSD. Mentorship is required for me to work on it. Please help me with > > > this. > > > > Porting GPL code to FreeBSD is not a good idea. A rewrite under a BSD > > license would work though. > > Or requesting and acquiring for ALL authors of ALL needed files to be > BSD-compatiblly licensed (including dual or more licenced in conjunction > with GPL)? Dual licensing is ok. but one of the licenses must be BSD as opposed to BSD-compatibility. BSD is compatible with GPL but many users of FreeBSD are afraid that GPL in FreeBSD will make it GPL and therefore useless for their purposes. BSD-compatibility is not enough. It should also be BSD licensed. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Mon Oct 21 09:21:47 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XX9Jm45H3z5YlpV for ; Mon, 21 Oct 2024 09:40:08 +0000 (UTC) (envelope-from Stephane.ROCHOY@stormshield.eu) Received: from mail.stormshield.eu (mail.stormshield.eu [91.212.116.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.stormshield.eu", Issuer "Sectigo RSA Organization Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XX9Jl3Ck6z4qdw for ; Mon, 21 Oct 2024 09:40:07 +0000 (UTC) (envelope-from Stephane.ROCHOY@stormshield.eu) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=stormshield.eu header.s=signer2 header.b=dm+vtmA+; spf=pass (mx1.freebsd.org: domain of Stephane.ROCHOY@stormshield.eu designates 91.212.116.25 as permitted sender) smtp.mailfrom=Stephane.ROCHOY@stormshield.eu; dmarc=pass (policy=quarantine) header.from=stormshield.eu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stormshield.eu; s=signer2; t=1729503606; h=From:Subject:Date:Message-ID:To:MIME-Version :Content-Type:Content-Transfer-Encoding; bh=Bb6vlHNGD8WjSisGRNlXvuZO2IxxQ YluaVq5F+BWD8k=; b=dm+vtmA+kmN5iZ/nLt8i2HptIhKHDaw3n23xSFa+S7fsO69e4SOT1F dHd9+cb5e8NDFoIOeSl/qmB8qiLi+/ku0IhYfLnk+HbTUos3f+Zy7uMHOxvEaUo/NNp9sSwux nVIzloS7DapqXd7sWkb0MySPDxLeRB/XZLl+BGMy2BGxGWmzsyMAmm/qWntQ1tWnh9JA6mQhs 16FcQLNxa+bhggwy5C7vNNX/f46G57AEO2Vnvkg0MVyZphGmamOTgjNhdrnLOGeNJ4ZJ4BvNS znEWSfyexc0jqDaYSQQEy6cOlMqNqqwWVUYBuo0NeEkMthKbF7fPJN9hZk30Na+uvYR6g==; User-agent: mu4e 1.10.7; emacs 29.4 From: Stephane Rochoy To: Subject: swapon vs GEOM labels Date: Mon, 21 Oct 2024 11:21:47 +0200 Message-ID: <86ttd5rdze.fsf@cthulhu.stephaner.labo.int> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: ICTDCCEXCH002.one.local (10.180.4.2) To ICTDCCEXCH002.one.local (10.180.4.2) X-DKIM-Signer: DkimX (v3.60.360) X-Spamd-Result: default: False [-3.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.984]; DMARC_POLICY_ALLOW(-0.50)[stormshield.eu,quarantine]; R_SPF_ALLOW(-0.20)[+a:mail.stormshield.eu]; R_DKIM_ALLOW(-0.20)[stormshield.eu:s=signer2]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:49068, ipnet:91.212.116.0/24, country:FR]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[stormshield.eu:+] X-Rspamd-Queue-Id: 4XX9Jl3Ck6z4qdw X-Spamd-Bar: --- Hi Hackers, I'm playing with glabel(8) and swapon(8) but found a behavior that is somewhat puzzling. I boot main (b88df1e893c4) with an USB memstick plugged. The memstick is da0 and hold a freebsd-swap partition, da0p1. This partition was given the `swap` label using `glabel label` (i.e., an automatic label, stored somewhere into da0p1, AFAIK). # glabel status Name Status Components label/swap N/A da0p1 Then I give the whole device the `usbmemstick` label using `glabel create` (i.e., a manual label, not stored anywhere). # glabel create usbmemstick da0 # glabel status Name Status Components label/swap N/A da0p1 label/usbmemstick N/A da0 What puzzle me is what happen when I enable swap: # sysctl vm.nswapdev vm.nswapdev: 0 # swapctl -l Device: 1024-blocks Used: # dumpon -l /dev/null # swapon /dev/label/usbmemstickp1 # glabel status Name Status Components label/usbmemstick N/A da0 # swapoff /dev/label/usbmemstickp1 # glabel status Name Status Components label/usbmemstick N/A da0 label/swap N/A label/usbmemstickp1 While swap is enabled, the `swap` label is no longer available. It comes back when swap is disabled. Note that I also tried to enable swap using the automatic label (i.e., `swap`). In such a case this is the `usbmemstick` label that vanish. And the label is even not restored on `swapoff`. Is it the expected behavior? Am I doing something wrong? Regards, -- St=C3=A9phane Rochoy O: Stormshield From nobody Mon Oct 21 09:52:58 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XX9br0fbqz5Ymyt for ; Mon, 21 Oct 2024 09:53:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XX9bq3sTHz4sgP for ; Mon, 21 Oct 2024 09:53:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-7d4fa972cbeso3324873a12.2 for ; Mon, 21 Oct 2024 02:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1729504390; x=1730109190; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ovMVeBMdf3NjOVNR45jdBtFC4NUKwI4ZIeiiZTAMeYg=; b=XWaKPEdCZ9hEVN8bCZU1J73lvkSYAlhlZPzEm7rfdR0mZ/XhEu4eRhOXtpcbwRVckR Dsl5iazKHFWAMlcyg3A0uQnWegYk8me6utkOIJLZBPh3wXEZoyEC44FsfNW/46O/LMAW YR+ogBjqLHmSJ6W8joj/aV5eGbbeHvSNoi1E0FL/ZonAVOt/4NNCm0x4TdV7yHJ0ubYt +ttKXGJIexAfF/0mlcY+xC4RjYQV4iQTyrAYtpkxf22dqIkFxQWhQttXlViEKEmGBqb9 1X/oyoCUqIz20KMo2GDpewwtRWkT1eAoufL8mTpVscMVA5GVnxCJlyIBU9VocQVp43hv /qyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729504390; x=1730109190; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ovMVeBMdf3NjOVNR45jdBtFC4NUKwI4ZIeiiZTAMeYg=; b=MRw6g4olMHk5+e9eYVWy0YpJboo9mEKmsR51vzNvEgppKgnzGYNsdqam8JNJFa6rYE rYy0QP78j7wE1XXtkieRfppahdehnArU5qLFRrbYXIcW5iKmaPuHhCa3ziDpZsCxRFgQ bUBRX5xj2pc0ye7LA6AoeAjiw+mJMMjekIYtfrHeOIH+rTrjiENA7JfTiAkQvGh29zm+ H9piNqrj13bTqUFaDs+UxKDh2wpqjMU+tdkG7tAfd1oy9ncvJAOSl1U0TmH1PZM2Gsel ZJLM3ozU7ArVgrCWacy1ZaCqo2CfMtlmMVZIA7HXuW3WGlFf101bDDRm4QhtN9Vp1U0Q fSlQ== X-Gm-Message-State: AOJu0YxcF9/sxu+s798FV4E2F7ZV56GcFQkdb8zY3+UTCH7nSRr1h/aC YzKKI4nflc7tR65VEoDHJ7632WGiW2e2Z4+P8S50StULViq6oMJYkx9IOEfKGPVuzxyZxbRnjrk LUu9a9bqGaUeZkrYev20hRoV3Z/OV+mKQcYMmfQ== X-Google-Smtp-Source: AGHT+IFi4W/csG1q3AR8+r98o20s8vO7UpH0kbJ8k+zSBj+9H0lct8XoKb+BCqBv+axhDXHm386B3rp5GTOTcySyIDs= X-Received: by 2002:a05:6a21:710a:b0:1d8:d880:2069 with SMTP id adf61e73a8af0-1d92c4ad296mr14046437637.3.1729504390136; Mon, 21 Oct 2024 02:53:10 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <86ttd5rdze.fsf@cthulhu.stephaner.labo.int> In-Reply-To: <86ttd5rdze.fsf@cthulhu.stephaner.labo.int> From: Warner Losh Date: Mon, 21 Oct 2024 03:52:58 -0600 Message-ID: Subject: Re: swapon vs GEOM labels To: Stephane Rochoy Cc: freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="000000000000cfe45d0624f99e61" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XX9bq3sTHz4sgP X-Spamd-Bar: ---- --000000000000cfe45d0624f99e61 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Oct 21, 2024 at 3:40=E2=80=AFAM Stephane Rochoy < stephane.rochoy@stormshield.eu> wrote: > Hi Hackers, > > I'm playing with glabel(8) and swapon(8) but found a behavior that > is somewhat puzzling. > > I boot main (b88df1e893c4) with an USB memstick plugged. The > memstick is da0 and hold a freebsd-swap partition, da0p1. This > partition was given the `swap` label using `glabel label` (i.e., > an automatic label, stored somewhere into da0p1, AFAIK). > > # glabel status > Name Status Components > label/swap N/A da0p1 > > Then I give the whole device the `usbmemstick` label using `glabel > create` (i.e., a manual label, not stored anywhere). > > # glabel create usbmemstick da0 > # glabel status > Name Status Components > label/swap N/A da0p1 > label/usbmemstick N/A da0 > > What puzzle me is what happen when I enable swap: > > # sysctl vm.nswapdev > vm.nswapdev: 0 > # swapctl -l > Device: 1024-blocks Used: > # dumpon -l > /dev/null > # swapon /dev/label/usbmemstickp1 > # glabel status > Name Status Components > label/usbmemstick N/A da0 > # swapoff /dev/label/usbmemstickp1 > # glabel status > Name Status Components > label/usbmemstick N/A da0 > label/swap N/A label/usbmemstickp1 > > While swap is enabled, the `swap` label is no longer available. It > comes back when swap is disabled. > > Note that I also tried to enable swap using the automatic label > (i.e., `swap`). In such a case this is the `usbmemstick` label > that vanish. And the label is even not restored on `swapoff`. > > Is it the expected behavior? Am I doing something wrong? > This both makes sense to me, and seems wrong to me. When things are nested like this, it kinda makes sense that label/usbmemstickp1 shows up. geom doesn't enumerate everything and this seems to be a bit of an artifact. I'd expect both label/usbmemstickp1 and label/swap to be there. geom does odd things with devices that are open to keep others from opening them, and this may just be an artifact of this kinda weird behavior. Warner --000000000000cfe45d0624f99e61 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Oct 21, 2024 at 3:40=E2=80=AF= AM Stephane Rochoy <st= ephane.rochoy@stormshield.eu> wrote:
Hi Hackers,

I'm playing with glabel(8) and swapon(8) but found a behavior that
is somewhat puzzling.

I boot main (b88df1e893c4) with an USB memstick plugged. The
memstick is da0 and hold a freebsd-swap partition, da0p1. This
partition was given the `swap` label using `glabel label` (i.e.,
an automatic label, stored somewhere into da0p1, AFAIK).

=C2=A0 # glabel status
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Name=C2=A0 Status=C2=A0 Components
=C2=A0 label/swap=C2=A0 =C2=A0 =C2=A0N/A=C2=A0 da0p1

Then I give the whole device the `usbmemstick` label using `glabel
create` (i.e., a manual label, not stored anywhere).

=C2=A0 # glabel create usbmemstick da0
=C2=A0 # glabel status
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Name=C2=A0 Status=C2=A0 Co= mponents
=C2=A0 =C2=A0 =C2=A0 =C2=A0 label/swap=C2=A0 =C2=A0 =C2=A0N/A=C2=A0 da0p1 =C2=A0 label/usbmemstick=C2=A0 =C2=A0 N/A=C2=A0 da0

What puzzle me is what happen when I enable swap:

=C2=A0 # sysctl vm.nswapdev
=C2=A0 vm.nswapdev: 0
=C2=A0 # swapctl -l
=C2=A0 Device:=C2=A0 =C2=A0 =C2=A0 1024-blocks=C2=A0 =C2=A0 =C2=A0Used:
=C2=A0 # dumpon -l
=C2=A0 /dev/null
=C2=A0 # swapon /dev/label/usbmemstickp1
=C2=A0 # glabel status
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Name=C2=A0 Status=C2=A0 Co= mponents
=C2=A0 label/usbmemstick=C2=A0 =C2=A0 N/A=C2=A0 da0
=C2=A0 # swapoff /dev/label/usbmemstickp1
=C2=A0 # glabel status
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Name=C2=A0 Status=C2=A0 Co= mponents
=C2=A0 label/usbmemstick=C2=A0 =C2=A0 N/A=C2=A0 da0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 label/swap=C2=A0 =C2=A0 =C2=A0N/A=C2=A0 label/u= sbmemstickp1

While swap is enabled, the `swap` label is no longer available. It
comes back when swap is disabled.

Note that I also tried to enable swap using the automatic label
(i.e., `swap`). In such a case this is the `usbmemstick` label
that vanish. And the label is even not restored on `swapoff`.

Is it the expected behavior? Am I doing something wrong?

This both makes sense to me, and seems wrong to me.=C2=A0= When
things are nested like this, it kinda makes sense that labe= l/usbmemstickp1
shows up. geom doesn't enumerate everything a= nd this seems to be a bit
of an artifact. I'd expect both lab= el/usbmemstickp1 and label/swap to be there.
geom does odd things= with devices that are open to keep others from opening
them, and= this may just be an artifact of this kinda weird behavior.

<= /div>
Warner
--000000000000cfe45d0624f99e61-- From nobody Mon Oct 21 09:54:09 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XX9d70hkqz5Ymyx for ; Mon, 21 Oct 2024 09:54:19 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XX9d55Wbrz4tkK for ; Mon, 21 Oct 2024 09:54:17 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of phk@critter.freebsd.dk designates 130.225.244.222 as permitted sender) smtp.mailfrom=phk@critter.freebsd.dk; dmarc=none Received: from critter.freebsd.dk (unknown [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id 3B08C89293 for ; Mon, 21 Oct 2024 09:54:10 +0000 (UTC) Received: (from phk@localhost) by critter.freebsd.dk (8.18.1/8.16.1/Submit) id 49L9s9sD076618; Mon, 21 Oct 2024 09:54:09 GMT (envelope-from phk) Message-Id: <202410210954.49L9s9sD076618@critter.freebsd.dk> To: hackers@freebsd.org Subject: pyserial.tools.list_port improvement for FreeBSD From: Poul-Henning Kamp List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <76616.1729504449.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Mon, 21 Oct 2024 09:54:09 +0000 X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FREEFALL_USER(0.00)[phk]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[hackers@freebsd.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[freebsd.dk]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[hackers@freebsd.org]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: 4XX9d55Wbrz4tkK X-Spamd-Bar: -- I have had reason to muck about with pyserial. One result is much better pyserial.tools.list_port implementation for Free= BSD. I would appreciate it, if somebody else could give it a spin, before I ups= tream: https://github.com/bsdphk/pyserial Thanks in advance, Poul-Henning -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence= . From nobody Mon Oct 21 11:29:04 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XXCkf6XFfz5YskV for ; Mon, 21 Oct 2024 11:29:14 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXCkf19mQz45Zm for ; Mon, 21 Oct 2024 11:29:13 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Authentication-Results: mx1.freebsd.org; none Received: from kalamity.joker.local (123-1-21-232.area1b.commufa.jp [123.1.21.232]) (authenticated bits=0) by www121.sakura.ne.jp (8.17.1/8.17.1/[SAKURA-WEB]/20201212) with ESMTPA id 49LBT45K036048; Mon, 21 Oct 2024 20:29:05 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dec.sakura.ne.jp; s=s2405; t=1729510145; bh=Km6WCXSr83RQjE6nOw9603MAlFmDifGl1IKpwOvqcPo=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=uocLk6yJ8lfxEh2uQhlV7BQmwVDHk3K+G3FMX//eHXJMTfKpJiI1vtIt4Xl2o5s9V 4ztS0VrQ2Z6Bi69GdPktP2qfOcsE31cYvcTj6FgTnjKmArdjRmna8mjhWOtb2NxDZB Mft62J+dicecCoGQ5nW4v95ccasZ+oJ903FYTcyw= Date: Mon, 21 Oct 2024 20:29:04 +0900 From: Tomoaki AOKI To: Cy Schubert Cc: Artem Hevorhian , freebsd-hackers@freebsd.org Subject: Re: Help wanted on porting a wifi library from Linux to FreeBSD Message-Id: <20241021202904.91d6af0106facdf70f8f8f36@dec.sakura.ne.jp> In-Reply-To: <20241021001725.132A1393@slippy.cwsent.com> References: <20241020194105.87D67216@slippy.cwsent.com> <20241021072213.d372a39793a9564030a31085@dec.sakura.ne.jp> <20241021001725.132A1393@slippy.cwsent.com> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.1) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP] X-Rspamd-Queue-Id: 4XXCkf19mQz45Zm X-Spamd-Bar: ---- On Sun, 20 Oct 2024 17:17:25 -0700 Cy Schubert wrote: > In message <20241021072213.d372a39793a9564030a31085@dec.sakura.ne.jp>, > Tomoaki > AOKI writes: > > On Sun, 20 Oct 2024 12:41:05 -0700 > > Cy Schubert wrote: > > > > > In message > c > > > om> > > > , Artem Hevorhian writes: > > > > > > > > https://github.com/bmegli/wifi-scan > > > > > > > > Here it is. It uses nl80211.h header. I think we should do the same on > > > > FreeBSD. Mentorship is required for me to work on it. Please help me with > > > > this. > > > > > > Porting GPL code to FreeBSD is not a good idea. A rewrite under a BSD > > > license would work though. > > > > Or requesting and acquiring for ALL authors of ALL needed files to be > > BSD-compatiblly licensed (including dual or more licenced in conjunction > > with GPL)? > > Dual licensing is ok. but one of the licenses must be BSD as opposed to > BSD-compatibility. > BSD is compatible with GPL but many users of FreeBSD are afraid that GPL in > FreeBSD will make it GPL and therefore useless for their purposes. > > BSD-compatibility is not enough. It should also be BSD licensed. It depends on from which side of view. Let's limit "can we borrow any code without violating its license?" here. >From the point of view from GPL'ed software, BSD license is 100% compatible. OTOH, from the point of view from BSD licensed software, GPL is incompatible (because BSD license does not force licensees to make their modified/added codes to be GPL'ed). And FreeBSD has, for example, CDDL'ed codes like OpenZFS in tree, without any action to delete them, unlile GPL'ed ones. This is, (my understanding is) because CDDL is considered as BSD-compatible license. There are more, for example, MIT license and so on. So any of BSD-compatible license is/are included in multiple licenses of the codes, FreeBSD can introduce it in tree. This is my guess. > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 -- Tomoaki AOKI From nobody Mon Oct 21 19:00:01 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XXPqv3RhPz5Zf9y for ; Mon, 21 Oct 2024 19:04:27 +0000 (UTC) (envelope-from dirkx@webweaving.org) Received: from weser.webweaving.org (weser.webweaving.org [148.251.234.232]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "weser.webweaving.org", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXPqt3b00z4RZ1 for ; Mon, 21 Oct 2024 19:04:26 +0000 (UTC) (envelope-from dirkx@webweaving.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (83-85-39-103.cable.dynamic.v4.ziggo.nl [83.85.39.103]) (authenticated bits=0) by weser.webweaving.org (8.18.1/8.18.1) with ESMTPSA id 49LJ2s20068388 (version=TLSv1.2 cipher=ECDHE-ECDSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 21 Oct 2024 21:02:59 +0200 (CEST) (envelope-from dirkx@webweaving.org) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=webweaving.org; s=shared; t=1729537379; bh=y4rtjh0AZbOtXAi2T1JzKms9NKS1sjchBnNzsmqTEM8=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=nO78HDVB2G6NFfWrCPds3g7RXHBsZlCFMOorrX+U79SAPIzuArAZNXXsIquswNT8o yXCigjtlPpGvnjHRWXAybTqEei71cXr1b72uTXA8JLEPg/BP/h9coucqhu1JBhMz+n EHyxBONxyLqeNFHCjAgXXjE6BaoW1tZMdHd5jLL4= X-Authentication-Warning: weser.webweaving.org: Host 83-85-39-103.cable.dynamic.v4.ziggo.nl [83.85.39.103] claimed to be smtpclient.apple Content-Type: text/plain; charset=us-ascii List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: pyserial.tools.list_port improvement for FreeBSD From: Dirk-Willem van Gulik In-Reply-To: <202410210954.49L9s9sD076618@critter.freebsd.dk> Date: Mon, 21 Oct 2024 21:00:01 +0200 Cc: hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> References: <202410210954.49L9s9sD076618@critter.freebsd.dk> To: Poul-Henning Kamp X-Mailer: Apple Mail (2.3776.700.51.11.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (weser.webweaving.org [148.251.234.232]); Mon, 21 Oct 2024 21:02:59 +0200 (CEST) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:148.251.0.0/16, country:DE] X-Rspamd-Queue-Id: 4XXPqt3b00z4RZ1 X-Spamd-Bar: ---- On 21 Oct 2024, at 11:54, Poul-Henning Kamp wrote: > I have had reason to muck about with pyserial. One result is much = better pyserial.tools.list_port implementation for FreeBSD. >=20 > I would appreciate it, if somebody else could give it a spin, before I = upstream: >=20 > https://github.com/bsdphk/pyserial Works for me (provided /usr/sbin is in the path); and nicely picks up a = ugen0.2 that the ESP32 tooling would always need an explicit path for = prior despite it having a tty name. Dw= From nobody Mon Oct 21 20:21:16 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XXRXq6t7Qz5ZjkF for ; Mon, 21 Oct 2024 20:21:31 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXRXq00QHz4bL4 for ; Mon, 21 Oct 2024 20:21:30 +0000 (UTC) (envelope-from tomek@cedro.info) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cedro.info header.s=google header.b=OX34laCZ; spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when checking 2607:f8b0:4864:20::b36) smtp.mailfrom=tomek@cedro.info; dmarc=none Received: by mail-yb1-xb36.google.com with SMTP id 3f1490d57ef6-e297c8f8c86so4866525276.2 for ; Mon, 21 Oct 2024 13:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; t=1729542089; x=1730146889; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=j71IBIcqvML13vc6caPfbldOIU72CR5QuWPV18W/Wqc=; b=OX34laCZRqpG7JkRQe924T4lzbmzlTrJT6ll1eoN7Opvx8Dj402jFaPO97kcOyQrZ7 NyA1PuH73Nx4DdcdcwhfFOIMfXLC6j7aQL4VGeR0DVHje2qT/+tq9nCkLMY5cVgzpJJw c4o6zUiuJ7y6vQ5Aj4SqJtkibmWuUu5cfkBhf5GVMRGNXkMXZyoYNcixfRt6Icyc2N/L d7nZj/xjXIGt8s8OXkdbY5rjVnJNfSqKkF9tG5/9KOuJUNyiirv98wGGpQxx8S6IrXom VZ/pBHFAE1eNjGnsvRqmjNsMO8ddr6J9q7LfC7XAyp1MBEsyB+GmD9S8i9KRG8Qm+hUG UySA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729542089; x=1730146889; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j71IBIcqvML13vc6caPfbldOIU72CR5QuWPV18W/Wqc=; b=ua3ynHHyhM+T1LD4jkivqv7byIIcdUK0Ldi5to/LJyjsgAiZQuQLBNJdjVeqvmLk1X k1qAppmaKQ7Vm0TjCa1WFcWk3flbR8t9vSxbWUeGJRuCkXUK1k1b1UQAuhONW8GIJfGd +RLhwCr+gwomqAiwR/z1GTo2w4bFqOnviI99gXl3kdgQimzKyQ/nfLH3b54OKeeJLSU/ Fi5rzVJbLtQdmJ0a5r9GTWGSOH+VzLnsM2TkCaWZumvLR9QlCE6wH2CJ3qWE49pQUhC4 +TzAQIbl8VSA7iYFfBA9h0oGQLm2ZSDsUluGj29NwMk9zRBN8qfkoovpfvqZ/2slsUD1 sz/A== X-Gm-Message-State: AOJu0YyNEF/XYCeyBY5Rx3em6+mwSkWRXf1VLEdNtv64xDJr1CxwZnBz RoE6wD9jcngrEZCOGGdr6yxVDUyd3UYPOeNrcc4rW50kMqkJUugAr3Q4DbrfvS8pL3fnTlyfVJQ = X-Google-Smtp-Source: AGHT+IFvLHjWBmRPdyAr7DMgh5rzECm2E2L7HW7z8UXKcvUlOj6pK/Gprm2I9QQkWmt2ygzJJt2z5A== X-Received: by 2002:a05:690c:dc8:b0:6e2:f61e:8c9 with SMTP id 00721157ae682-6e5bfd4ca84mr127425237b3.30.1729542089223; Mon, 21 Oct 2024 13:21:29 -0700 (PDT) Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com. [209.85.219.180]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6e5f5ccb641sm8080047b3.83.2024.10.21.13.21.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Oct 2024 13:21:28 -0700 (PDT) Received: by mail-yb1-f180.google.com with SMTP id 3f1490d57ef6-e29756dc019so4579317276.3 for ; Mon, 21 Oct 2024 13:21:28 -0700 (PDT) X-Received: by 2002:a05:690c:fc2:b0:6e3:39c1:1692 with SMTP id 00721157ae682-6e5bfbebc36mr110691737b3.6.1729542088125; Mon, 21 Oct 2024 13:21:28 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <202410210954.49L9s9sD076618@critter.freebsd.dk> <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> In-Reply-To: <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> From: Tomek CEDRO Date: Mon, 21 Oct 2024 22:21:16 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pyserial.tools.list_port improvement for FreeBSD To: Poul-Henning Kamp Cc: hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.23 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.93)[-0.934]; R_DKIM_ALLOW(-0.20)[cedro.info:s=google]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_SPF_NA(0.00)[no SPF record]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[cedro.info]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[hackers@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b36:from,209.85.219.180:received]; TO_MATCH_ENVRCPT_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[hackers@freebsd.org]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[cedro.info:+] X-Rspamd-Queue-Id: 4XXRXq00QHz4bL4 X-Spamd-Bar: --- On Mon, Oct 21, 2024 at 9:04=E2=80=AFPM Dirk-Willem van Gulik wrote: > On 21 Oct 2024, at 11:54, Poul-Henning Kamp wrote: > > I have had reason to muck about with pyserial. One result is much bette= r pyserial.tools.list_port implementation for FreeBSD. > > I would appreciate it, if somebody else could give it a spin, before I = upstream: > > https://github.com/bsdphk/pyserial > > Works for me (provided /usr/sbin is in the path); and nicely picks up a u= gen0.2 that the ESP32 tooling would always need an explicit path for prior = despite it having a tty name. Very cool PHK! But I have some more ideas below :-) :-P % uname -a FreeBSD octagon 13.3-RELEASE-p7 FreeBSD 13.3-RELEASE-p7 GENERIC amd64 On current 3.5 system py311 package: >>> list_ports.main() /dev/cuaU0 /dev/cuaU1 /dev/cuaU2 /dev/cuaU3 /dev/cuaU4 /dev/cuau0 6 ports found On Your repo from 3.9 venv: (venv3.9embedded) python3 list_ports_freebsd.py /dev/cuaU0 - ugen0.7: usb /dev/cuaU1 - ugen0.8: usb /dev/cuaU2 - ugen0.9: usb /dev/cuaU3 - ugen0.10: usb /dev/cuaU4 - ugen0.11: usb /dev/cuau0 - cuau0: uart Now lets take a look at two example descriptors: % usbconfig -d ugen0.7 dump_device_desc ugen0.7: at usbus0, cfg=3D0 md=3DHOST spd=3DFULL (12Mbps) pwr=3DON (100mA) bLength =3D 0x0012 bDescriptorType =3D 0x0001 bcdUSB =3D 0x0110 bDeviceClass =3D 0x0000 bDeviceSubClass =3D 0x0000 bDeviceProtocol =3D 0x0000 bMaxPacketSize0 =3D 0x0040 idVendor =3D 0x10c4 idProduct =3D 0xea60 bcdDevice =3D 0x0100 iManufacturer =3D 0x0001 iProduct =3D 0x0002 iSerialNumber =3D 0x0003 <0001> bNumConfigurations =3D 0x0001 % usbconfig -d ugen0.8 dump_device_desc ugen0.8: at usbus0, cfg=3D0 md=3DHOST spd=3DFULL (12Mbps) pwr=3DON (500mA) bLength =3D 0x0012 bDescriptorType =3D 0x0001 bcdUSB =3D 0x0200 bDeviceClass =3D 0x00ef bDeviceSubClass =3D 0x0002 bDeviceProtocol =3D 0x0001 bMaxPacketSize0 =3D 0x0040 idVendor =3D 0x303a idProduct =3D 0x1001 bcdDevice =3D 0x0101 iManufacturer =3D 0x0001 iProduct =3D 0x0002 iSerialNumber =3D 0x0003 <60:XX:F9:CC:XX:XX> bNumConfigurations =3D 0x0001 % usbconfig -d ugen0.9 dump_device_desc ugen0.9: at usbus0, cfg=3D0 md=3DHOST spd=3DFULL (12Mbps) pwr=3DON (300mA) bLength =3D 0x0012 bDescriptorType =3D 0x0001 bcdUSB =3D 0x0200 bDeviceClass =3D 0x00ef bDeviceSubClass =3D 0x0002 bDeviceProtocol =3D 0x0001 bMaxPacketSize0 =3D 0x0040 idVendor =3D 0x0483 idProduct =3D 0x374b bcdDevice =3D 0x0100 iManufacturer =3D 0x0001 iProduct =3D 0x0002 iSerialNumber =3D 0x0003 <0667XXXX49558575671XXXXX> bNumConfigurations =3D 0x0001 It would be amazingly useful to also have SerialNumber, VID/PID, Manufacturer + Product printed out in a single line delimeted for easy parse (maybe a table?), something like: /dev/cuaU0: ugen0.9, usb, tty?, 0667XXXX49558575671XXXXX, 0483:374b, STMicroelectronics STM32 STLink. We are building distributed build and testing farm for NuttX RTOS where different boards are attached over multiport USB HUB(s). Build will be repeated with different tools and commits in order to verify a firmware image build, then firmware will be flashed to a physical board in order to perform on-board runtime tests. Logs will be gathered and sent back to a server for analysis (PASS / FAIL + logs). This comes as complementary action to build only verification on GitHub and recent cuts in CI availability (we exceed CI quota by a lot with just standard PR verification). Plus we will have real world hardware runtime verification :-) Also we plan to use https://github.com/mvp/uhubctl for single USB HUB port control. I did not play with that guy yet, is supposed to work on FreeBSD, will have to add support for my i-Tec U3CHARGEHUB16. ugen device is nice to know, but it will change depending on what will be attached to what port, maybe even change in time as HUB ports are cycled, SN is better for target board/interface identification in scripting :-) Thank you :-) Tomek --=20 CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From nobody Tue Oct 22 06:40:36 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XXk8j5Dskz59CP8 for ; Tue, 22 Oct 2024 07:20:05 +0000 (UTC) (envelope-from Stephane.ROCHOY@stormshield.eu) Received: from mail.stormshield.eu (mail.stormshield.eu [91.212.116.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.stormshield.eu", Issuer "Sectigo RSA Organization Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXk8j2tnfz4K2s for ; Tue, 22 Oct 2024 07:20:05 +0000 (UTC) (envelope-from Stephane.ROCHOY@stormshield.eu) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stormshield.eu; s=signer2; t=1729581603; h=From:Subject:Date:Message-ID:To:Cc :MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To :References; bh=+PQznfpLphmU3+2upG2zp+NGqM5YyIEKkqadWJfFPnA=; b=Pt4jqOVrN iswgucIA1t/XT8IKO//31NSR9M8fLN4cNgVmgpn5C5IaLHzKcF2Y+QDty/RtVFGJNFml5KZVH M/OOkP6GiyTUtNFCCQBU7ts8kOCymWi90AfJdFUhXlz5BBhR0puO4FEn9cPiVMZyjRsGSjTI4 vTWhR0Y8eDFfQMnS5SEi8f35N3I+oRUkzAV9rNINL98kh7ukLKmOHxcvZpOSRo0cMr9If5NBi wuxOFXYyZPOYSMPAoWw6SxYJvr/vS/mnjDsX3NiCYtJ7x4fdtYEg4C5EoikGKQrGS7Nz9oGJe 025MWycWrIQtryzJPMKmdxO7dIo4fxLdL8DFrV6wg==; References: <86ttd5rdze.fsf@cthulhu.stephaner.labo.int> User-agent: mu4e 1.10.7; emacs 29.4 From: Stephane Rochoy To: Warner Losh CC: Subject: Re: swapon vs GEOM labels Date: Tue, 22 Oct 2024 08:40:36 +0200 In-Reply-To: Message-ID: <86plnsr4d9.fsf@cthulhu.stephaner.labo.int> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: ICTDCCEXCH002.one.local (10.180.4.2) To ICTDCCEXCH002.one.local (10.180.4.2) X-DKIM-Signer: DkimX (v3.60.360) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:49068, ipnet:91.212.116.0/24, country:FR] X-Rspamd-Queue-Id: 4XXk8j2tnfz4K2s X-Spamd-Bar: ---- Warner Losh writes: > On Mon, Oct 21, 2024 at 3:40=E2=80=AFAM Stephane Rochoy=20 > wrote: > > Hi Hackers, > > I'm playing with glabel(8) and swapon(8) but found a behavior=20 > that > is somewhat puzzling. > > I boot main (b88df1e893c4) with an USB memstick plugged. The > memstick is da0 and hold a freebsd-swap partition, da0p1. This > partition was given the `swap` label using `glabel label`=20 > (i.e., > an automatic label, stored somewhere into da0p1, AFAIK). > > # glabel status > Name Status Components > label/swap N/A da0p1 > > Then I give the whole device the `usbmemstick` label using=20 > `glabel > create` (i.e., a manual label, not stored anywhere). > > # glabel create usbmemstick da0 > # glabel status > Name Status Components > label/swap N/A da0p1 > label/usbmemstick N/A da0 > > What puzzle me is what happen when I enable swap: > > # sysctl vm.nswapdev > vm.nswapdev: 0 > # swapctl -l > Device: 1024-blocks Used: > # dumpon -l > /dev/null > # swapon /dev/label/usbmemstickp1 > # glabel status > Name Status Components > label/usbmemstick N/A da0 > # swapoff /dev/label/usbmemstickp1 > # glabel status > Name Status Components > label/usbmemstick N/A da0 > label/swap N/A label/usbmemstickp1 > > While swap is enabled, the `swap` label is no longer available.=20 > It > comes back when swap is disabled. > > Note that I also tried to enable swap using the automatic label > (i.e., `swap`). In such a case this is the `usbmemstick` label > that vanish. And the label is even not restored on `swapoff`. > > Is it the expected behavior? Am I doing something wrong? > > This both makes sense to me, and seems wrong to me. When things > are nested like this, it kinda makes sense that > label/usbmemstickp1 shows up. geom doesn't enumerate everything > and this seems to be a bit of an artifact. I'd expect both > label/usbmemstickp1 and label/swap to be there. geom does odd > things with devices that are open to keep others from opening > them, and this may just be an artifact of this kinda weird > behavior. Well, I have to admit I'm a bit disappointed by the fact labels don't completely mimic devices. What I'm trying to achieve is to provide some sort of hardware abstraction. I wrote a command that is responsible for probing hardware and expose the fact that, e.g., an USB memstick is available, a read/write SD card is inserted, etc=E2=80=A6 My first attempt was to use symlinks in /dev/. The problem with this approach is that GEOM don't seems to dereference them. For example, if I have /dev/sdcard =E2=86=92 /dev/da0, I cannot do things like= =20 `geom disk list sdcard`. IOW, the GEOM API is defeated by symlinks. That's why I'm playing with labels. If symlinks and labels are not well suited for that, do you know of some alternative I could look at? Regards, -- St=C3=A9phane Rochoy O: Stormshield From nobody Tue Oct 22 11:18:27 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XXsB60sBGz5PQ67 for ; Tue, 22 Oct 2024 12:36:46 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XXsB55j5Vz3xQD for ; Tue, 22 Oct 2024 12:36:45 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Authentication-Results: mx1.freebsd.org; none Received: from critter.freebsd.dk (unknown [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id 453318929E; Tue, 22 Oct 2024 12:36:38 +0000 (UTC) Received: (from phk@localhost) by critter.freebsd.dk (8.18.1/8.16.1/Submit) id 49MBIRSj009090; Tue, 22 Oct 2024 11:18:27 GMT (envelope-from phk) Message-Id: <202410221118.49MBIRSj009090@critter.freebsd.dk> To: Tomek CEDRO cc: hackers@freebsd.org Subject: Re: pyserial.tools.list_port improvement for FreeBSD In-reply-to: From: "Poul-Henning Kamp" References: <202410210954.49L9s9sD076618@critter.freebsd.dk> <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9088.1729595906.1@critter.freebsd.dk> Date: Tue, 22 Oct 2024 11:18:27 +0000 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU] X-Rspamd-Queue-Id: 4XXsB55j5Vz3xQD X-Spamd-Bar: ---- -------- Tomek CEDRO writes: > Very cool PHK! But I have some more ideas below :-) :-P I think "pyserial-ports -v" already gives you the USB info ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From nobody Tue Oct 22 18:02:04 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XY0Pl65F5z5VhSV for ; Tue, 22 Oct 2024 18:02:19 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XY0Pk2YlLz4fLQ for ; Tue, 22 Oct 2024 18:02:18 +0000 (UTC) (envelope-from tomek@cedro.info) Authentication-Results: mx1.freebsd.org; none Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-e28fa2807eeso5562483276.1 for ; Tue, 22 Oct 2024 11:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; t=1729620137; x=1730224937; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GGuVPsU925bacKvGR4CxZ1USC2pK6VmAYX6ZHH6zS8E=; b=C/Sk01D6sRMAb0Hto7hA9KENI+Mi4cDx1tXBIszV60oNu67wa18FC8ESwGG6s8TsP+ mR/ZllvYOjL32mRM376XYur78cK76MJQZH5lrI9PJ5LB22ouQXOpzVKDAlrOPYtJvjL6 Ysrcp06jOfTTEmgwzO1ayOH0LFWWaOyBMDEuEZKFDCqah87DWgSYI05ltp14ooAv8byA vfiqKADiiq5bSYb9/LMMJ/ojyXK24SD0xw2P5lT0+ePZnx5M31sF3aEq17ytvkI6oaas 3di+FjH751Zmw7XAkLuDfmEnRAaTBrhpbzvc6xbcaVDFWoRHHkIYXHz1wP4H+hFyJUac awgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729620137; x=1730224937; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GGuVPsU925bacKvGR4CxZ1USC2pK6VmAYX6ZHH6zS8E=; b=kc2xhC8G3t9hKSzbLG4JvlK1iI82GuPDZhR2qR5vx05zXJWoya/1Px2U3b8mX70ClX IKKeJR1GWCrXham0OaRVxnRdOLhbqIpRjE6foZUt+XkM12fbwC/jKdoSQ272Wn+i4/mn tM05k9yxJ+gTWmH06mkmA3tVt6apDS0NmpdJ7b30PGuH4R4q81TWc5y17S4DtNl2nlPw RIBxtBwhEsvc2oMUtemWBWMIR7KIugWbJcNPjvQikFzm5hf16H1pQ4OHYEaux9DdCTSm HOe2JlRshU7ES9l5SmGUMhCPn4Za2Ycy5eBqJ3Ugyvq2VCtoJHbV/B57chD5bty3Gjgp hO9g== X-Gm-Message-State: AOJu0YxmX+dq4+9UvTBP7N7Fy7/vMA2U+uyxxsrQKseIuA4AMgsYYhQS dXZxzAO13IcZE91tx6HSoVq/JcO3jVhugpVo5lvLDALg1epxvTABpLD3vgc06HRGGhDksNHPCTY = X-Google-Smtp-Source: AGHT+IHaV360XK9ZUfwdSItgkIuQfgauXSevhjM8s5nWQCLm06QNxikvFtnqV/j3PHtBZQ4I6W7h7Q== X-Received: by 2002:a05:6902:200b:b0:e22:4f74:9590 with SMTP id 3f1490d57ef6-e2e27199c5amr3036994276.27.1729620137559; Tue, 22 Oct 2024 11:02:17 -0700 (PDT) Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com. [209.85.128.179]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e2e312b9971sm244634276.34.2024.10.22.11.02.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Oct 2024 11:02:16 -0700 (PDT) Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-6e5cec98cceso35155227b3.2 for ; Tue, 22 Oct 2024 11:02:16 -0700 (PDT) X-Received: by 2002:a05:690c:11:b0:6dd:d0fa:159f with SMTP id 00721157ae682-6e7d82af510mr38187407b3.34.1729620136499; Tue, 22 Oct 2024 11:02:16 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <202410210954.49L9s9sD076618@critter.freebsd.dk> <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> <202410221118.49MBIRSj009090@critter.freebsd.dk> In-Reply-To: <202410221118.49MBIRSj009090@critter.freebsd.dk> From: Tomek CEDRO Date: Tue, 22 Oct 2024 20:02:04 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pyserial.tools.list_port improvement for FreeBSD To: Poul-Henning Kamp Cc: hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XY0Pk2YlLz4fLQ X-Spamd-Bar: ---- On Tue, Oct 22, 2024 at 2:36=E2=80=AFPM Poul-Henning Kamp wrote: > -------- > Tomek CEDRO writes: > > Very cool PHK! But I have some more ideas below :-) :-P > > I think "pyserial-ports -v" already gives you the USB info ? System package: % pyserial-ports -v /dev/cuaU0 desc: n/a hwid: n/a /dev/cuaU1 desc: n/a hwid: n/a /dev/cuaU2 desc: n/a hwid: n/a /dev/cuau0 desc: n/a hwid: n/a 4 ports found Your repo: (venv3.9embedded) python3 list_ports.py -v /dev/cuaU0 desc: ugen0.7 hwid: USB VID:PID=3D0483:374B SER=3D"0667FF504955857567182143" LOCATION= =3Dugen0.7 /dev/cuaU1 desc: ugen0.8 hwid: USB VID:PID=3D303A:1001 SER=3D"60:55:F9:CC:E2:B8" LOCATION=3Dugen= 0.8 /dev/cuaU2 desc: ugen0.9 hwid: USB VID:PID=3D10C4:EA60 SER=3D"1a2626680675eb11955981afb7be2ba5" LOCATION=3Dugen0.9 /dev/cuau0 desc: cuau0 hwid: cuau0 4 ports found % ~/.local/venv3.9embedded/bin/pyserial-ports -v /dev/cuaU0 desc: ugen0.7 hwid: USB VID:PID=3D0483:374B SER=3D"0667FF504955857567182143" LOCATION= =3Dugen0.7 /dev/cuaU1 desc: ugen0.8 hwid: USB VID:PID=3D303A:1001 SER=3D"60:55:F9:CC:E2:B8" LOCATION=3Dugen= 0.8 /dev/cuaU2 desc: ugen0.9 hwid: USB VID:PID=3D10C4:EA60 SER=3D"1a2626680675eb11955981afb7be2ba5" LOCATION=3Dugen0.9 /dev/cuau0 desc: cuau0 hwid: cuau0 4 ports found It is here!! :-) On the "desc:" in place of ugen I would put "Silicon Labs CP2102N USB to UART Bridge Controller" as the ugen is in the HWID/LOCATION or there is a reason to put ugen there? :-) ugen0.9: at usbus0, cfg=3D0 md=3DHOST spd=3DFULL (12Mbps) pwr=3DON (100mA) bLength =3D 0x0012 bDescriptorType =3D 0x0001 bcdUSB =3D 0x0200 bDeviceClass =3D 0x0000 bDeviceSubClass =3D 0x0000 bDeviceProtocol =3D 0x0000 bMaxPacketSize0 =3D 0x0040 idVendor =3D 0x10c4 idProduct =3D 0xea60 bcdDevice =3D 0x0100 iManufacturer =3D 0x0001 iProduct =3D 0x0002 iSerialNumber =3D 0x0003 <1a2626680675eb11955981afb7be2ba5> bNumConfigurations =3D 0x0001 Thank you!! :-) Tomek --=20 CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From nobody Tue Oct 22 18:47:32 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XY1Q123n7z5VjlP for ; Tue, 22 Oct 2024 18:47:37 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XY1Q01nxMz4lpr for ; Tue, 22 Oct 2024 18:47:36 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Authentication-Results: mx1.freebsd.org; none Received: from critter.freebsd.dk (unknown [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id 3DCB08928B; Tue, 22 Oct 2024 18:47:34 +0000 (UTC) Received: (from phk@localhost) by critter.freebsd.dk (8.18.1/8.16.1/Submit) id 49MIlXEs014246; Tue, 22 Oct 2024 18:47:33 GMT (envelope-from phk) Message-Id: <202410221847.49MIlXEs014246@critter.freebsd.dk> To: Tomek CEDRO cc: hackers@freebsd.org Subject: Re: pyserial.tools.list_port improvement for FreeBSD In-reply-to: From: "Poul-Henning Kamp" References: <202410210954.49L9s9sD076618@critter.freebsd.dk> <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> <202410221118.49MBIRSj009090@critter.freebsd.dk> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14244.1729622852.1@critter.freebsd.dk> Date: Tue, 22 Oct 2024 18:47:32 +0000 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU] X-Rspamd-Queue-Id: 4XY1Q01nxMz4lpr X-Spamd-Bar: ---- -------- Tomek CEDRO writes: > On the "desc:" in place of ugen I would put "Silicon Labs CP2102N USB > to UART Bridge Controller" as the ugen is in the HWID/LOCATION or > there is a reason to put ugen there? :-) The strings from the USB descriptors are unfortunately not available from devinfo(8) and usbconfig(8) needs root-privs to reveal them. I vaguely recall that the strings are not in devinfo (aka: "newbus") due to valid security concerns about unsafe "strings" like these, but I cannot find any evidence of/from that ancient discussion just now. I do find it inconsistent, that usbconfig(8) cannot function in read-only mode for plain users, given that the information it would reveal is already available for all from dmesg, but this might not be policy but merely an sideeffect of the implementation. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From nobody Tue Oct 22 19:03:15 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XY1mL33mDz5VkZl for ; Tue, 22 Oct 2024 19:03:30 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XY1mK5KNtz4pLR for ; Tue, 22 Oct 2024 19:03:29 +0000 (UTC) (envelope-from tomek@cedro.info) Authentication-Results: mx1.freebsd.org; none Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-e2bd7d8aaf8so3253834276.3 for ; Tue, 22 Oct 2024 12:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; t=1729623809; x=1730228609; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WxhI+IlQGCRAwVf9WlF330CoI9R6/48T0SsVOguXtJU=; b=d2d7AXupSC7+Yb7KNpgquOpBsBFcVV0FqtppQdmhTsDqjo812Jv79qLrSDMrsWDvqe HFNGHu8fw5aK0cKHrj/odnTE7ybIAoO+QjWD1h4+0K3ampJwu9Ah1RzenhqS2IL790Gn dLBsWRlKkTcB88BqsxeSqNS72Alg8yCdoR8krIQywUsYfrkW7c+oTR149dLdGzQ0Nwoc pD2TGQYRZ/uaNTNgaszFl7cM9d17qF4u5QdkqCDaBe/Iq096f0HHkAyrL99PprwQhdY9 e+YgoFT/Bc5OBsAUKpzjNSlcFTYyjpkYYfFzezN32EbywOS8X2OYG9ghXwskQH7C5krS +15Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729623809; x=1730228609; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WxhI+IlQGCRAwVf9WlF330CoI9R6/48T0SsVOguXtJU=; b=pZZgpSf78f3YucRhN3zSal6FECbTjBJkYX9huzmjf5B2MfyO/Z/XjkTN/Nh0BNgcTk XwZGj/+YGXI50N3veaSiQeI3QRCVVvETn+F/mFkS79I4G2mfWwUhs69rmwSJn6NqN73c ieHEvBLVa2eH+gxLW9EmP81XeFYSBaf14Mf5s8lPewOwGEz76eYI2mRFE2RcCiEHRjxz LPX2PTQ5h3r11Q6iJuTI0Uynza4bxqc35FgkiowZqrYxLPlDsFXTbZZBEdcA3pyKEN+Z sNKE+4PM+A67UFUIfT7trXkXkSJXnW7ae15MyI39SmNDKMYegGDGELrUyVyQwfTWWD79 kUlA== X-Gm-Message-State: AOJu0Yxeh+QYN/4OnvKA6NBc+qMOxJSp26uZcpw4iJ6OuP5un6CQ8mIw 85sMQlWba95bF/75zwhQIaoRIwyvyWZCrbdNdcmHBY7Ir7L2oZm1DOWFFsBwiV8XtVQLC8pZJnM = X-Google-Smtp-Source: AGHT+IGQO/e0kF4RZ6VJnYwmI+Pw/GUVkDs0OrD8fkTc2QVN8+8YV7MogVpDrptVf6yf3ir7B4FN4Q== X-Received: by 2002:a05:6902:2502:b0:e2b:dcb6:ffa1 with SMTP id 3f1490d57ef6-e2e2721c08fmr3220704276.40.1729623808832; Tue, 22 Oct 2024 12:03:28 -0700 (PDT) Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com. [209.85.128.170]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e2bdc96ab29sm1166955276.10.2024.10.22.12.03.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Oct 2024 12:03:28 -0700 (PDT) Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-6e5cec98cceso35671197b3.2 for ; Tue, 22 Oct 2024 12:03:28 -0700 (PDT) X-Received: by 2002:a05:690c:4b05:b0:6dd:d0fa:159f with SMTP id 00721157ae682-6e7f0f89654mr204977b3.34.1729623807759; Tue, 22 Oct 2024 12:03:27 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <202410210954.49L9s9sD076618@critter.freebsd.dk> <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> <202410221118.49MBIRSj009090@critter.freebsd.dk> <202410221847.49MIlXEs014246@critter.freebsd.dk> In-Reply-To: <202410221847.49MIlXEs014246@critter.freebsd.dk> From: Tomek CEDRO Date: Tue, 22 Oct 2024 21:03:15 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pyserial.tools.list_port improvement for FreeBSD To: Poul-Henning Kamp Cc: hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XY1mK5KNtz4pLR X-Spamd-Bar: ---- On Tue, Oct 22, 2024 at 8:47=E2=80=AFPM Poul-Henning Kamp wrote: > > -------- > Tomek CEDRO writes: > > > On the "desc:" in place of ugen I would put "Silicon Labs CP2102N USB > > to UART Bridge Controller" as the ugen is in the HWID/LOCATION or > > there is a reason to put ugen there? :-) > > The strings from the USB descriptors are unfortunately not available > from devinfo(8) and usbconfig(8) needs root-privs to reveal them. > > I vaguely recall that the strings are not in devinfo (aka: "newbus") > due to valid security concerns about unsafe "strings" like these, > but I cannot find any evidence of/from that ancient discussion just > now. > > I do find it inconsistent, that usbconfig(8) cannot function in > read-only mode for plain users, given that the information it would > reveal is already available for all from dmesg, but this might not > be policy but merely an sideeffect of the implementation. Hmm, I am running usbconfig on non-root user in the operator group with some devfs.rules tweak that enables operator group members to have full access to usb devices with no suid and I can see these strings :-) I did put a pkg-message when creating OpenOCD port and it seems to work fine for a long time :-) % whoami cederom % cat /etc/devfs.rules [system=3D10] add path 'usb/*' mode 0660 group operator % grep ruleset /etc/rc.conf devfs_system_ruleset=3D"localrules" % whereis usbconfig usbconfig: /usr/sbin/usbconfig /usr/share/man/man8/usbconfig.8.gz /usr/src/usr.sbin/usbconfig % ls -al /usr/sbin/usbconfig -r-xr-xr-x 1 root wheel 29504 4 lip 20:31 /usr/sbin/usbconfig % usbconfig (..) ugen0.7: at usbus0, cfg=3D0 md=3DHOST spd=3DFULL (12Mbps) pwr=3DON (300mA) % ls -al /dev/usb/0.7* crw-rw---- 1 root operator 0x24a 22 pa=C5=BA 20:50 /dev/usb/0.7.0 crw-rw---- 1 root operator 0x24e 22 pa=C5=BA 20:50 /dev/usb/0.7.1 crw-rw---- 1 root operator 0x250 22 pa=C5=BA 20:50 /dev/usb/0.7.2 crw-rw---- 1 root operator 0x252 22 pa=C5=BA 20:50 /dev/usb/0.7.3 crw-rw---- 1 root operator 0x253 22 pa=C5=BA 20:50 /dev/usb/0.7.4 crw-rw---- 1 root operator 0x280 22 pa=C5=BA 20:50 /dev/usb/0.7.5 Can you please verify? Maybe when this string is not available you can put ugen0.7 instead? :-) Thank you :-) Tomek --=20 CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From nobody Tue Oct 22 19:07:11 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XY1rd1Mzdz5VmnM for ; Tue, 22 Oct 2024 19:07:13 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XY1rd0SJ2z4qT0 for ; Tue, 22 Oct 2024 19:07:12 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Authentication-Results: mx1.freebsd.org; none Received: from critter.freebsd.dk (unknown [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id 78B3D8928B; Tue, 22 Oct 2024 19:07:11 +0000 (UTC) Received: (from phk@localhost) by critter.freebsd.dk (8.18.1/8.16.1/Submit) id 49MJ7BZl014476; Tue, 22 Oct 2024 19:07:11 GMT (envelope-from phk) Message-Id: <202410221907.49MJ7BZl014476@critter.freebsd.dk> To: Tomek CEDRO cc: hackers@freebsd.org Subject: Re: pyserial.tools.list_port improvement for FreeBSD In-reply-to: From: "Poul-Henning Kamp" References: <202410210954.49L9s9sD076618@critter.freebsd.dk> <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> <202410221118.49MBIRSj009090@critter.freebsd.dk> <202410221847.49MIlXEs014246@critter.freebsd.dk> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14474.1729624031.1@critter.freebsd.dk> Date: Tue, 22 Oct 2024 19:07:11 +0000 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU] X-Rspamd-Queue-Id: 4XY1rd0SJ2z4qT0 X-Spamd-Bar: ---- -------- Tomek CEDRO writes: > Hmm, I am running usbconfig on non-root user in the operator group > with some devfs.rules tweak that enables [...] This is all very interesting, but really relevant to my pyserial patch :-) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From nobody Tue Oct 22 19:13:32 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XY20C4P1Gz5Vncn for ; Tue, 22 Oct 2024 19:13:47 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XY20C0dvYz4rnP for ; Tue, 22 Oct 2024 19:13:47 +0000 (UTC) (envelope-from tomek@cedro.info) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-6e5ef7527deso32971587b3.0 for ; Tue, 22 Oct 2024 12:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; t=1729624426; x=1730229226; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=M1FLJEzqp5AWQicry9i+Sui5MP4qKGUBo5fld5lU9+c=; b=grDlycyNLYx1YyC0Pm25yHSbfdVj59vXs0HO8FOas4048HeXbcKzOMjiklLiykHppe RCIWJj1LrvRLUFLofdegK9jAFxcIlpAJQLfugUTgif5pBKxYxt2sse+4Y4gFGk/Ez+gT NK5zalZ4+7X4EcrbJkDL04I4BCZj8K/Den1NP/leLsBOpBviixQCEvYJNDB+mSLqFBXy 7GOJoj9W9mbUkjo9zuPJ+YqnC4VRzwJqLiWOm3/jsD54PkjlTZI/Xz+yqci+ZQ0haHSC 5g8kJ9CWStaWKhyQwbby3kA3IOOTbjwinJdxysYRg4W+0PFtU/m9Wp8uuUPhu3H9LRAy KIZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729624426; x=1730229226; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M1FLJEzqp5AWQicry9i+Sui5MP4qKGUBo5fld5lU9+c=; b=K0A0dTI7i8kxLhuhLUIWIkI2TOEz52UK0Pz7QpvNy5A5tal+VUUC/TQzqsS4T5XJr9 sPSDC8B8PTSYNNNi+OSzTEaUpq+dteeJrGjwpW2iOVqnv6qVg1ipyl/vs9z9bcanVawG 9+Ed8r0R7t7cw0BXslkWAcnhuxNREyP0zpnOzaDi/a1/7Tu5UQLA076J7DEiGZ3+Rrz8 P5Mh1mXfluLfLYTySj8YZYC1UiVpPSl4cuOevFLwjbWsPQeqhxuwLMIbdx9MuTkjiGHH bPTNtgZ40ek394g8wjHo1FdKH6FKvCkcaKnPoC7Ie+sXkWV/zhcCow7u7jXT8BR/uVdZ AUzw== X-Forwarded-Encrypted: i=1; AJvYcCU2NmPOLcdlOksuStrCldiKsUTUTYqVsqZEteRBDB4wB9l8362L5BtbfhKzeJdQy8lfraZhfxNS@freebsd.org X-Gm-Message-State: AOJu0YzDHOqCsrPJA93lHoolLvlxX6vepX7psC+SnVZh90OntXUo8cmy Iieud5rYGmjQWDHA8H8iU9BLJa85wgcxLZyb3utA03ICHnXVPqMy6NsR+jz8u1ClEfS0tuTtg64 = X-Google-Smtp-Source: AGHT+IFtHTLOy/2CkfVYyohRipsVvUWV0YmbYKeB+K4EPOTuK5bDI64lwVJZm/74nuhC1lAiaB/a8w== X-Received: by 2002:a05:690c:660a:b0:6e5:de2d:39b1 with SMTP id 00721157ae682-6e7f0dbbf37mr674387b3.5.1729624426228; Tue, 22 Oct 2024 12:13:46 -0700 (PDT) Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com. [209.85.219.180]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6e5f5ccb77fsm11904867b3.92.2024.10.22.12.13.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Oct 2024 12:13:45 -0700 (PDT) Received: by mail-yb1-f180.google.com with SMTP id 3f1490d57ef6-e2e340218daso753387276.0 for ; Tue, 22 Oct 2024 12:13:45 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWG1gVwN7BmwCqRyjrLGAi1sBn1g08rM32oqaWQ9zSxQc/HLGPFx+Ac65ZZeVq08PsziWddhWnD@freebsd.org X-Received: by 2002:a05:690c:3145:b0:6e2:985:f4df with SMTP id 00721157ae682-6e7f0ffc91cmr377517b3.44.1729624425022; Tue, 22 Oct 2024 12:13:45 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <202410210954.49L9s9sD076618@critter.freebsd.dk> <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> <202410221118.49MBIRSj009090@critter.freebsd.dk> <202410221847.49MIlXEs014246@critter.freebsd.dk> <202410221907.49MJ7BZl014476@critter.freebsd.dk> In-Reply-To: <202410221907.49MJ7BZl014476@critter.freebsd.dk> From: Tomek CEDRO Date: Tue, 22 Oct 2024 21:13:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pyserial.tools.list_port improvement for FreeBSD To: Poul-Henning Kamp Cc: Tomek CEDRO , hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XY20C0dvYz4rnP X-Spamd-Bar: ---- On Tue, Oct 22, 2024 at 9:07=E2=80=AFPM Poul-Henning Kamp wrote: > > -------- > Tomek CEDRO writes: > > > Hmm, I am running usbconfig on non-root user in the operator group > > with some devfs.rules tweak that enables [...] > > This is all very interesting, but really relevant to my pyserial patch :-= ) Just a hint that "desc:" giving a descriptive string could make things easier / faster to read with no reference to usbconfig/dmesg when there are like 20+ devices on the list but its your patch and decision :-P :-) ps/2: My user has access to usbconfig with strings but has no dmesg access = :-) --=20 CeDeROM, SQ7MHZ, http://www.tomek.cedro.info From nobody Wed Oct 23 05:28:35 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XYHdx5G6Rz5Zr1m for ; Wed, 23 Oct 2024 05:28:53 +0000 (UTC) (envelope-from artemhevorhian@gmail.com) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XYHdw5jXLz4sQD for ; Wed, 23 Oct 2024 05:28:52 +0000 (UTC) (envelope-from artemhevorhian@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=TlKGFVwP; spf=pass (mx1.freebsd.org: domain of artemhevorhian@gmail.com designates 2a00:1450:4864:20::429 as permitted sender) smtp.mailfrom=artemhevorhian@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-37d8901cb98so316987f8f.0 for ; Tue, 22 Oct 2024 22:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729661331; x=1730266131; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6Fu73jhroPdbvkMAh/8Ky/4AR8g/gs5AY2raYvYOsTk=; b=TlKGFVwPqQ02ulU6bD0hYNPE2oA7d4VB2/Ffv6/2ukx+Kvj6eiV540+1MjUQn5+yOp mNqiSDKLhG5C8SDG7UyED0vx7ByBvuT24uw3hX0ZJoCF5+yLvmtbBja9CIRsoGp0kmvA Hu7ZTXBw14pooyf1qYr1hjOq+ewVYWoiiEbvoa6sRApVTmQP5RAtfIa7V3xrRCN6SCv4 o6xuhWves7urSRiFyz7m9kK7zkSdqd5RMEg0KNqMYztUg+8lgCkaNhZiuf+/iIBEnYqw B9wUdNimZeeaq4/CGJSRYN1FB0ncDnO6yiqQ49gBJsKoP9Yz3wwFtDXrV0ChRKO2IDDT ihxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729661331; x=1730266131; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6Fu73jhroPdbvkMAh/8Ky/4AR8g/gs5AY2raYvYOsTk=; b=vAHGKyGyI7YPbB9onK3SgknRCe2Zs1BspEElmsqH/AtNtXNiquYP1HJk5jyv9SQqqg w3EgddJMndNtwyf+aru9LZlL7LLz9kUAa/GcgexuPD9/qhIFImITBc5JJkzNT5rZS6YI /smriuc9Q3j93zKX2MitnDXeQahcrp5Y8PVU4uMgdhazTNBf/BxUPHGPB7u02gwQV0+N GfZQuuJUxe+ENbjG8HKl7Al+rweaZUVIWFKeUuGYfu1h1r+7BaSJ6pf64fv5MagXgWkN b4r1Bd9MYnav2tERk2aeavlfZ4kMz0giDqvKlMjSMm2e3La335S/+GJFepJVJH8KalYk gA9A== X-Forwarded-Encrypted: i=1; AJvYcCX1zwHTn/tdk6V5Q/HQKO3prWhxPU1dgpqJg2vqf5Fc5i1mBoui8dmf6ZbmZByD4vEAsmTsG2iL7GNbDVPIfnM=@freebsd.org X-Gm-Message-State: AOJu0YzPt06ERwvpSZ9FMcN9u4FFpmks9q/hlRSC2TuWVpEulP1Gf1Bx L+NmM1MYI/0KvVwypiZ/0fA835QCEfnlVwMa1NpEsB6ln8fKdeYS7Z6w3gXII/OmQuUhN5hFRQV pk3E0vMKLvfSosruekmflMMEBzRGtYlCJ X-Google-Smtp-Source: AGHT+IF3sZSLIfc4h5lMYKVsRcPXmaxPyDFyEiwsgM+cdAfRvEA67vrUkNHh5pHPv8i/OUZSHGYjLtxW5M/HbvrRcss= X-Received: by 2002:a05:6000:e50:b0:37d:4330:c87a with SMTP id ffacd0b85a97d-37efc5d546dmr677057f8f.4.1729661330284; Tue, 22 Oct 2024 22:28:50 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <20241020194105.87D67216@slippy.cwsent.com> <20241021072213.d372a39793a9564030a31085@dec.sakura.ne.jp> <20241021001725.132A1393@slippy.cwsent.com> <20241021202904.91d6af0106facdf70f8f8f36@dec.sakura.ne.jp> In-Reply-To: <20241021202904.91d6af0106facdf70f8f8f36@dec.sakura.ne.jp> From: Artem Hevorhian Date: Wed, 23 Oct 2024 08:28:35 +0300 Message-ID: Subject: Re: Help wanted on porting a wifi library from Linux to FreeBSD To: Tomoaki AOKI Cc: Cy Schubert , freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="0000000000002c66db06251e297e" X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.997]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::429:from]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4XYHdw5jXLz4sQD X-Spamd-Bar: --- --0000000000002c66db06251e297e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Let me rephrase. I would like to modernize the wifi stack so that ioctls are not used anymore in ifconfig scan operation, for example. I would like to use netlink instead. =D0=BF=D0=BD, 21 =D0=B6=D0=BE=D0=B2=D1=82. 2024, 14:29 =D0=BA=D0=BE=D1=80= =D0=B8=D1=81=D1=82=D1=83=D0=B2=D0=B0=D1=87 Tomoaki AOKI =D0=BF=D0=B8=D1=88=D0=B5: > On Sun, 20 Oct 2024 17:17:25 -0700 > Cy Schubert wrote: > > > In message <20241021072213.d372a39793a9564030a31085@dec.sakura.ne.jp>, > > Tomoaki > > AOKI writes: > > > On Sun, 20 Oct 2024 12:41:05 -0700 > > > Cy Schubert wrote: > > > > > > > In message > > > c > > > > om> > > > > , Artem Hevorhian writes: > > > > > > > > > > https://github.com/bmegli/wifi-scan > > > > > > > > > > Here it is. It uses nl80211.h header. I think we should do the > same on > > > > > FreeBSD. Mentorship is required for me to work on it. Please help > me with > > > > > this. > > > > > > > > Porting GPL code to FreeBSD is not a good idea. A rewrite under a > BSD > > > > license would work though. > > > > > > Or requesting and acquiring for ALL authors of ALL needed files to be > > > BSD-compatiblly licensed (including dual or more licenced in > conjunction > > > with GPL)? > > > > Dual licensing is ok. but one of the licenses must be BSD as opposed to > > BSD-compatibility. > > BSD is compatible with GPL but many users of FreeBSD are afraid that GP= L > in > > FreeBSD will make it GPL and therefore useless for their purposes. > > > > BSD-compatibility is not enough. It should also be BSD licensed. > > It depends on from which side of view. > Let's limit "can we borrow any code without violating its license?" > here. > > From the point of view from GPL'ed software, BSD license is > 100% compatible. > > OTOH, from the point of view from BSD licensed software, GPL is > incompatible (because BSD license does not force licensees to make > their modified/added codes to be GPL'ed). > > And FreeBSD has, for example, CDDL'ed codes like OpenZFS in tree, > without any action to delete them, unlile GPL'ed ones. > > This is, (my understanding is) because CDDL is considered as > BSD-compatible license. There are more, for example, MIT license and so > on. > > So any of BSD-compatible license is/are included in multiple licenses > of the codes, FreeBSD can introduce it in tree. > > This is my guess. > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > e^(i*pi)+1=3D0 > > > -- > Tomoaki AOKI > --0000000000002c66db06251e297e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Let me rephrase.=C2=A0

I would like to modernize the wifi stack so that ioctls are not = used anymore in ifconfig scan operation, for example. I would like to use n= etlink instead.

=D0=BF=D0=BD, 21 =D0=B6=D0=BE=D0=B2=D1=82. 2024, 14:29= =D0=BA=D0=BE=D1=80=D0=B8=D1=81=D1=82=D1=83=D0=B2=D0=B0=D1=87 Tomoaki AOKI = <junchoon@dec.sakura.ne.jp<= /a>> =D0=BF=D0=B8=D1=88=D0=B5:
O= n Sun, 20 Oct 2024 17:17:25 -0700
Cy Schubert <
Cy.Schubert@cschubert.com> wrote:

> In message <20241021072213.d3= 72a39793a9564030a31085@dec.sakura.ne.jp>,
> Tomoaki
> AOKI writes:
> > On Sun, 20 Oct 2024 12:41:05 -0700
> > Cy Schubert <Cy.Schubert@cschubert.com> wrote: > >
> > > In message <CA+AExUT4fM+p85Shzp1xFFOrabS_FDwWYSbUJjmka6+R= OOJnLw@mail.gmail.
> > c
> > > om>
> > > , Artem Hevorhian writes:
> > > >
> > > > https://github.com/bmegli/wifi-sca= n
> > > >
> > > > Here it is. It uses nl80211.h header. I think we should= do the same on
> > > > FreeBSD. Mentorship is required for me to work on it. P= lease help me with
> > > > this.
> > >
> > > Porting GPL code to FreeBSD is not a good idea. A rewrite un= der a BSD
> > > license would work though.
> >
> > Or requesting and acquiring for ALL authors of ALL needed files t= o be
> > BSD-compatiblly licensed (including dual or more licenced in conj= unction
> > with GPL)?
>
> Dual licensing is ok. but one of the licenses must be BSD as opposed t= o
> BSD-compatibility.
> BSD is compatible with GPL but many users of FreeBSD are afraid that G= PL in
> FreeBSD will make it GPL and therefore useless for their purposes.
>
> BSD-compatibility is not enough. It should also be BSD licensed.

It depends on from which side of view.
Let's limit "can we borrow any code without violating its license?= "
here.

>From the point of view from GPL'ed software, BSD license is
100% compatible.

OTOH, from the point of view from BSD licensed software, GPL is
incompatible (because BSD license does not force licensees to make
their modified/added codes to be GPL'ed).

And FreeBSD has, for example, CDDL'ed codes like OpenZFS in tree,
without any action to delete them, unlile GPL'ed ones.

This is, (my understanding is) because CDDL is considered as
BSD-compatible license. There are more, for example, MIT license and so
on.

So any of BSD-compatible license is/are included in multiple licenses
of the codes, FreeBSD can introduce it in tree.

This is my guess.

> --
> Cheers,
> Cy Schubert <Cy.Schubert@cschubert.com>
> FreeBSD UNIX:=C2=A0 <cy@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://FreeBSD.org
> NTP:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<cy@nwtime.org>=C2= =A0 =C2=A0 Web:=C2=A0 https://nwtime.org
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0e^(i*pi)+1=3D0


--
Tomoaki AOKI=C2=A0 =C2=A0 <junchoon@dec.sakura.ne.jp>
--0000000000002c66db06251e297e-- From nobody Wed Oct 23 22:13:19 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XYjxB6jYTz5Zk2V for ; Wed, 23 Oct 2024 22:13:34 +0000 (UTC) (envelope-from yaroslaw.mashko@gmail.com) Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XYjxB3j19z4dWt for ; Wed, 23 Oct 2024 22:13:34 +0000 (UTC) (envelope-from yaroslaw.mashko@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-71e93d551a3so222692b3a.1 for ; Wed, 23 Oct 2024 15:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729721613; x=1730326413; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Idl6uhibHRWLxtCXNyueJPIlHF9zAIykOrHKM6hWUus=; b=M3oqoqcQJDLxTNfNaHGkVANGZwpiu2REM+zvRGfEBfcZdsk4ss0ej/DWnJ9Ay6Ei6P kiwbFI27+ZneY2OQOL9wi8UzNloN4HhSCNZIWl8tOzoS0tDd+KShoIu5Tcez9TwQKgoX 5mUkyknhmmxJAAKNgHxngP/SuOtI047QQ8A5F2J8kPzah2vbEFuBoi/FUcscoTj9B6Oo PpYOTX0QliWl7jXbeM1EYL7FA44/ACcO+g4BgAU2ru/dPwzf8YhdPK9eQ+yZJ60vhMI3 A4T/bbJLul1jH/oXEiBhrKftCK79VSVGnaow9EHDdMu8/gmmibHxbhsyZpPrEARPVI/Y fZAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729721613; x=1730326413; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Idl6uhibHRWLxtCXNyueJPIlHF9zAIykOrHKM6hWUus=; b=J7IMeVa+qRJDZACF9iFjqSugoWOY+cOKeex86PALlQLHJldMMFtdbvfsfbpkuCEqVO Yr9CF4xeYY8N3/GHm9rLOpzSzscl0YewKsa3sN2cxI4pFGQozFRuIW+mTce1BGDRLtMe T1FVZ7O5dpWNGXVagfbhkKF56VbsveU3/9F8AI2XoCbkrACuohef57c8L8VYHyOFGavA it+lZTHjGEHdYZUwXPdXfB6OGYCqK/qXCPNUl1gyxmZCP5bsxdHa/5F/7rhi5jwnDWyC jJ6aRK9mZnwIZG+MOvinjmIdnz5chTO00AiAHNzFCL4xQb2NPLXFUHbsStmhsNxif+hr e66g== X-Forwarded-Encrypted: i=1; AJvYcCVExAH6IhnGepLxwIETGjvPt71FJO+B+SX7H37isYOMRb5gdjYnF3KRS1CBLJIUzRroWaEwN8KzEbkveP9mXEg=@freebsd.org X-Gm-Message-State: AOJu0YwibfkY08Mz/1vpofbhYqmWuU6EDHD7cmONOMDxhkC7+lpxM2Xz ft+lHZv3b5ZZ2hTCya1ywL8Sqd2LVozv5WLxmOTARWo0+jXcX/Y9XVenlMHqrSLqoFuLhxCY1OL scEK2/eyXNxNkN1iqBAyG8DHYfYVFsw== X-Google-Smtp-Source: AGHT+IFNVovcVMyjzFXANbsMM3QynlRhydGUuge2NELU9eUzv+WihMinfYEqm4pTz1zejxJQgHjcdST3PX4Qs7/UVX4= X-Received: by 2002:a05:6a00:890:b0:71e:19a:c48b with SMTP id d2e1a72fcca58-72030c9e440mr5654400b3a.22.1729721612588; Wed, 23 Oct 2024 15:13:32 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <20241020194105.87D67216@slippy.cwsent.com> <20241021072213.d372a39793a9564030a31085@dec.sakura.ne.jp> <20241021001725.132A1393@slippy.cwsent.com> <20241021202904.91d6af0106facdf70f8f8f36@dec.sakura.ne.jp> In-Reply-To: From: =?UTF-8?B?0K/RgNC+0YHQu9Cw0LIg0JzQsNGI0LrQvg==?= Date: Thu, 24 Oct 2024 01:13:19 +0300 Message-ID: Subject: Re: Help wanted on porting a wifi library from Linux to FreeBSD To: Artem Hevorhian Cc: Tomoaki AOKI , Cy Schubert , freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="000000000000475fae06252c325b" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XYjxB3j19z4dWt X-Spamd-Bar: ---- --000000000000475fae06252c325b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable hello, Artem, if u no get it, the discusion hare is more about ethical and legal point of view. this is the very first thing that shall be settled. other than that... if you Artem is russian, i would not help you. in today's ukraine there is much interest in all this wi-fi topic. drones is a one area where it will be used. and drones carry explosives. so use your =D0=B8=D0=BC=D0=BF=D0=BE=D1=80=D1=82=D0=BE=D0=B7=D0=B0=D0=BC=D0= =B5=D1=89=D0=B5=D0=BD=D0=B8=D0=B5 rather. russia proudly declaring that it = will have their very own analogues of a software. so do your own. =D1=81=D1=80, 23 =D0=BE=D0=BA=D1=82. 2024 =D0=B3., 08:29 Artem Hevorhian : > Let me rephrase. > > I would like to modernize the wifi stack so that ioctls are not used > anymore in ifconfig scan operation, for example. I would like to use > netlink instead. > > =D0=BF=D0=BD, 21 =D0=B6=D0=BE=D0=B2=D1=82. 2024, 14:29 =D0=BA=D0=BE=D1=80= =D0=B8=D1=81=D1=82=D1=83=D0=B2=D0=B0=D1=87 Tomoaki AOKI < > junchoon@dec.sakura.ne.jp> =D0=BF=D0=B8=D1=88=D0=B5: > >> On Sun, 20 Oct 2024 17:17:25 -0700 >> Cy Schubert wrote: >> >> > In message <20241021072213.d372a39793a9564030a31085@dec.sakura.ne.jp>, >> > Tomoaki >> > AOKI writes: >> > > On Sun, 20 Oct 2024 12:41:05 -0700 >> > > Cy Schubert wrote: >> > > >> > > > In message >> > > > c >> > > > om> >> > > > , Artem Hevorhian writes: >> > > > > >> > > > > https://github.com/bmegli/wifi-scan >> > > > > >> > > > > Here it is. It uses nl80211.h header. I think we should do the >> same on >> > > > > FreeBSD. Mentorship is required for me to work on it. Please hel= p >> me with >> > > > > this. >> > > > >> > > > Porting GPL code to FreeBSD is not a good idea. A rewrite under a >> BSD >> > > > license would work though. >> > > >> > > Or requesting and acquiring for ALL authors of ALL needed files to b= e >> > > BSD-compatiblly licensed (including dual or more licenced in >> conjunction >> > > with GPL)? >> > >> > Dual licensing is ok. but one of the licenses must be BSD as opposed t= o >> > BSD-compatibility. >> > BSD is compatible with GPL but many users of FreeBSD are afraid that >> GPL in >> > FreeBSD will make it GPL and therefore useless for their purposes. >> > >> > BSD-compatibility is not enough. It should also be BSD licensed. >> >> It depends on from which side of view. >> Let's limit "can we borrow any code without violating its license?" >> here. >> >> From the point of view from GPL'ed software, BSD license is >> 100% compatible. >> >> OTOH, from the point of view from BSD licensed software, GPL is >> incompatible (because BSD license does not force licensees to make >> their modified/added codes to be GPL'ed). >> >> And FreeBSD has, for example, CDDL'ed codes like OpenZFS in tree, >> without any action to delete them, unlile GPL'ed ones. >> >> This is, (my understanding is) because CDDL is considered as >> BSD-compatible license. There are more, for example, MIT license and so >> on. >> >> So any of BSD-compatible license is/are included in multiple licenses >> of the codes, FreeBSD can introduce it in tree. >> >> This is my guess. >> >> > -- >> > Cheers, >> > Cy Schubert >> > FreeBSD UNIX: Web: https://FreeBSD.org >> > NTP: Web: https://nwtime.org >> > >> > e^(i*pi)+1=3D0 >> >> >> -- >> Tomoaki AOKI >> > --000000000000475fae06252c325b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

hello, Artem,

if u no get it, the discusion hare is more about ethical and= legal point of view. this is the very first thing that shall be settled.

other than that... if you Artem is russian, i would not help= you. in today's ukraine there is much interest in all this wi-fi topic= . drones is a one area where it will be used. and drones carry explosives.<= /p>

so use your =D0=B8=D0=BC=D0=BF=D0=BE=D1=80=D1=82=D0=BE=D0=B7= =D0=B0=D0=BC=D0=B5=D1=89=D0=B5=D0=BD=D0=B8=D0=B5 rather. russia proudly dec= laring that it will have their very own analogues of a software. so do your= own.


=D1=81= =D1=80, 23 =D0=BE=D0=BA=D1=82. 2024 =D0=B3., 08:29 Artem Hevorhian <artemhevorhian@gmail.com>:
Let me rephrase.= =C2=A0

I would like to moderni= ze the wifi stack so that ioctls are not used anymore in ifconfig scan oper= ation, for example. I would like to use netlink instead.

=D0=BF=D0=BD,= 21 =D0=B6=D0=BE=D0=B2=D1=82. 2024, 14:29 =D0=BA=D0=BE=D1=80=D0=B8=D1=81=D1= =82=D1=83=D0=B2=D0=B0=D1=87 Tomoaki AOKI <junchoon@dec.sakura.ne.= jp> =D0=BF=D0=B8=D1=88=D0=B5:
Cy.Schubert@cschubert.com> wrote:<= br>
> In message <202410= 21072213.d372a39793a9564030a31085@dec.sakura.ne.jp>,
> Tomoaki
> AOKI writes:
> > On Sun, 20 Oct 2024 12:41:05 -0700
> > Cy Schubert <Cy.Schubert@cschubert.com&= gt; wrote:
> >
> > > In message <CA+AExUT4fM+p85Shzp1xFFOrabS_FDwWYSbUJjmka6+R= OOJnLw@mail.gmail.
> > c
> > > om>
> > > , Artem Hevorhian writes:
> > > >
> > > > https://github.com/bmeg= li/wifi-scan
> > > >
> > > > Here it is. It uses nl80211.h header. I think we should= do the same on
> > > > FreeBSD. Mentorship is required for me to work on it. P= lease help me with
> > > > this.
> > >
> > > Porting GPL code to FreeBSD is not a good idea. A rewrite un= der a BSD
> > > license would work though.
> >
> > Or requesting and acquiring for ALL authors of ALL needed files t= o be
> > BSD-compatiblly licensed (including dual or more licenced in conj= unction
> > with GPL)?
>
> Dual licensing is ok. but one of the licenses must be BSD as opposed t= o
> BSD-compatibility.
> BSD is compatible with GPL but many users of FreeBSD are afraid that G= PL in
> FreeBSD will make it GPL and therefore useless for their purposes.
>
> BSD-compatibility is not enough. It should also be BSD licensed.

It depends on from which side of view.
Let's limit "can we borrow any code without violating its license?= "
here.

>From the point of view from GPL'ed software, BSD license is
100% compatible.

OTOH, from the point of view from BSD licensed software, GPL is
incompatible (because BSD license does not force licensees to make
their modified/added codes to be GPL'ed).

And FreeBSD has, for example, CDDL'ed codes like OpenZFS in tree,
without any action to delete them, unlile GPL'ed ones.

This is, (my understanding is) because CDDL is considered as
BSD-compatible license. There are more, for example, MIT license and so
on.

So any of BSD-compatible license is/are included in multiple licenses
of the codes, FreeBSD can introduce it in tree.

This is my guess.

> --
> Cheers,
> Cy Schubert <Cy.Schubert@cschubert.com> > FreeBSD UNIX:=C2=A0 <cy@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 https://FreeBSD.org
> NTP:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<cy@nwtime.org>=C2=A0 =C2=A0 Web:=C2=A0 https://nwtime.org
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0e^(i*pi)+1=3D0


--
Tomoaki AOKI=C2=A0 =C2=A0 <junchoon@dec.sakura.ne.jp>
--000000000000475fae06252c325b-- From nobody Sat Oct 26 23:51:26 2024 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xbbz51MwLz5bKPX for ; Sat, 26 Oct 2024 23:51:45 +0000 (UTC) (envelope-from tomek@cedro.info) Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) (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 "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xbbz42gJyz4fZ4 for ; Sat, 26 Oct 2024 23:51:44 +0000 (UTC) (envelope-from tomek@cedro.info) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=cedro.info header.s=google header.b=THpSA6RS; spf=none (mx1.freebsd.org: domain of tomek@cedro.info has no SPF policy when checking 2607:f8b0:4864:20::b2c) smtp.mailfrom=tomek@cedro.info; dmarc=none Received: by mail-yb1-xb2c.google.com with SMTP id 3f1490d57ef6-e28fa2807eeso3158355276.1 for ; Sat, 26 Oct 2024 16:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cedro.info; s=google; t=1729986703; x=1730591503; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5JBVEUB7ezrRkrqc/ou7YoDjxKt7e8SoLjqq/8ygIlU=; b=THpSA6RSvmUr88hAkwztkL1iBoPa6v+j8g5b7wXgsZ1SAinZzefqby8OWLjrzKL1Lg EGHVaAjOXuvmiufdVqSEvDJqbd5VzcSX9711mVUIf0RTKcSvt63GDjFc1COgm3lD/lV0 pph8dgTjcWY83hbEHBX8ksmWMSCkwSley6qw2Sxi3EQKn8N4AVBwS8AhXP8VjVrLUOpZ HKA7ihv4RkgT7kysV6F/zgaixfyFIhyZ5gdA7h6YSYdZzxL+b5//EakzhuNDj5cdp61D WgazwLhNH0uEoK4xtaIJ0h5AJImCgAv8jv/bz5/Q2fXmguYJbmKUjVH6fo340+iEweN/ 2DQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729986703; x=1730591503; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5JBVEUB7ezrRkrqc/ou7YoDjxKt7e8SoLjqq/8ygIlU=; b=lPz3GOTjUngWYVFwG9H2lAGdPm821dLq0EABfqBCOHLThRbX85HQIvzLJkcdWmJD8s qLPbAdakspAMbTXpvYSyVKr2lnncsTblC7es127qy5G4f7NO9Be1grfDI0V99ybW96kk beacFAagsBG3sf1SfIp5FcUz56bE2D9/lmCsd+rBtJOY4SfQ8PR7WJWqcCrZyLHgIIbE FI2a/884K5wqy4gHqUTNugjidy8aAM4rry401zLBoH+V2UKqbWozmKIf57Vi1TppVGKW +IjBqCUX0yyQTM9q1JKpAKlUnbGbyFbzPnd7zTGPsBdFfAVuOCEZdEAygqtc7wv17PE2 J6QA== X-Gm-Message-State: AOJu0Yw5BwDhgYClpVQa1wan1e0p1RDHRnAkwLtW5p0XmiJceYsJVfT9 x/3eFs/pzVMiuWcDCxXuwVHt6XRtfnqE+fXOSBgvvSiU4MTHE1EVqTwaIZQ/nRdQG6XSqy3q268 = X-Google-Smtp-Source: AGHT+IGbZYSAYCdCvF9hGtO2FmaW75LV9wkwMK24sfzRxCwUyGDkg4w4OKqBP1ZIJ6xFU7B9FSNFMQ== X-Received: by 2002:a05:6902:2410:b0:e2b:b74c:4783 with SMTP id 3f1490d57ef6-e3087a5c571mr2702678276.18.1729986702918; Sat, 26 Oct 2024 16:51:42 -0700 (PDT) Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com. [209.85.128.174]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e3079d82cd8sm785917276.23.2024.10.26.16.51.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Oct 2024 16:51:41 -0700 (PDT) Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-6e9ed5e57a7so3123787b3.1 for ; Sat, 26 Oct 2024 16:51:40 -0700 (PDT) X-Received: by 2002:a05:690c:61c8:b0:6dd:bcce:7cd7 with SMTP id 00721157ae682-6e9d8aff19emr37940077b3.42.1729986700271; Sat, 26 Oct 2024 16:51:40 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 References: <202410210954.49L9s9sD076618@critter.freebsd.dk> <203ADA8C-A4ED-4849-B89D-6D18664D67D0@webweaving.org> <202410221118.49MBIRSj009090@critter.freebsd.dk> <202410221847.49MIlXEs014246@critter.freebsd.dk> <202410221907.49MJ7BZl014476@critter.freebsd.dk> In-Reply-To: From: Tomek CEDRO Date: Sun, 27 Oct 2024 01:51:26 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: pyserial.tools.list_port improvement for FreeBSD To: Poul-Henning Kamp Cc: hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-3.30 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[cedro.info:s=google]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_SPF_NA(0.00)[no SPF record]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[cedro.info]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[hackers@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b2c:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[hackers@freebsd.org]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[cedro.info:+] X-Rspamd-Queue-Id: 4Xbbz42gJyz4fZ4 X-Spamd-Bar: --- By the way, most of develkits use USB-TO-UART chip that have unusable serial number because with many boards having the same VID:PID and serial number it is not possible to distinguish them o_O It would be nice to add chip customization to pyserial :-) I found two kinda broken old utilities to update CP2102 USB-TO-UART chips that may serve as reference point :-) C: https://github.com/DiUS/cp210x-cfg Python: https://github.com/cederom/cp210x-program The first one uses LibUSB 1.0. After minor tweaks on FreeBSD I made it to compile, work, and burn the new serial.. maybe I will create a Port for this nice utility :-) >From what I read this is one time only operation but that is okay I will add random stuff :-) % ./cp210x-cfg ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller Model: CP2102 Vendor ID: 10c4 Product ID: ea60 Name: CP2102 USB to UART Bridge Controller Serial: 0001 % dd if=/dev/random count=1M | md5 1048576+0 records in 1048576+0 records out 76f24aad88225fedf7260bb4f54c525d 536870912 bytes transferred in 3.788303 secs (141718053 bytes/sec) % ./cp210x-cfg -h Syntax: cp210x-cfg [-h ] | [-m vid:pid] [-d bus:dev] [ -l | [-V vid] [-P pid] [-F flush] [-M mode] [-N name] [-S serial]] -h This help -m vid:pid Find and use first device with vid:pid -d bus:dev Find and use device at bus:dev -l List all CP210x devices connected -V vid Program the given Vendor ID -P pid Program the given Product ID -F flush Program the given buffer flush bitmap (CP2105 only) -M mode Program the given SCI/ECI mode (CP2105 only) -N name Program the given product name string -S serial Program the given serial string Unless the -d option is used, the first found CP210x device is used. If no programming options are used, the current values are printed. % ./cp210x-cfg -S 76f24aad88225fedf7260bb4f54c525d ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller Model: CP2102 Vendor ID: 10c4 Product ID: ea60 Name: CP2102 USB to UART Bridge Controller Serial: 76f24aad88225fedf7260bb4f54c525d % ./cp210x-cfg ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller Model: CP2102 Vendor ID: 10c4 Product ID: ea60 Name: CP2102 USB to UART Bridge Controller Serial: 76f24aad88225fedf7260bb4f54c525d I would not be myself not to try write serial again knowing it it supposedly one time only operation :-) % ./cp210x-cfg -S CeDeROM76f24aad88225fedf7260bb4f54c525d ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller Model: CP2102 Vendor ID: 10c4 Product ID: ea60 Name: CP2102 USB to UART Bridge Controller Serial: CeDeROM76f24aad88225fedf7260bb4f54c525d % ./cp210x-cfg ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller Model: CP2102 Vendor ID: 10c4 Product ID: ea60 Name: CP2102 USB to UART Bridge Controller Serial: CeDeROM76f24aad88225fedf7260bb4f54c525d % ./cp210x-cfg -S ESP32DEVKITC-CDR-76f24aad88225fedf7260bb4f54c525d ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller Model: CP2102 Vendor ID: 10c4 Product ID: ea60 Name: CP2102 USB to UART Bridge Controller Serial: ESP32DEVKITC-CDR-76f24aad88225fedf7260bb4f54c525d % ./cp210x-cfg ID 10c4:ea60 @ bus 000, dev 007: CP2102 USB to UART Bridge Controller Model: CP2102 Vendor ID: 10c4 Product ID: ea60 Name: CP2102 USB to UART Bridge Controller Serial: ESP32DEVKITC-CDR-76f24aad88225fedf7260bb4f54c525d Very cool, looks like this chip has Flash not the OTP and we can assign whatever serial string we want :-) Have a good weekend folks :-) -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info