From owner-freebsd-usb@freebsd.org Sun Sep 29 21:00:31 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BA7D12A4B3 for ; Sun, 29 Sep 2019 21:00:31 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 46hHxB6yNKz3y9X for ; Sun, 29 Sep 2019 21:00:30 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id E9D2012A4A0; Sun, 29 Sep 2019 21:00:30 +0000 (UTC) Delivered-To: usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E93E812A49F for ; Sun, 29 Sep 2019 21:00:30 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hHxB5HKbz3y9G for ; Sun, 29 Sep 2019 21:00:30 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 932F91FDF2 for ; Sun, 29 Sep 2019 21:00:30 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x8TL0U6n025871 for ; Sun, 29 Sep 2019 21:00:30 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x8TL0Uor025869 for usb@FreeBSD.org; Sun, 29 Sep 2019 21:00:30 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <201909292100.x8TL0Uor025869@kenobi.freebsd.org> X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@FreeBSD.org using -f From: bugzilla-noreply@FreeBSD.org To: usb@FreeBSD.org Subject: Problem reports for usb@FreeBSD.org that need special attention Date: Sun, 29 Sep 2019 21:00:30 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2019 21:00:31 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 213877 | xhci reset causes panic on SuperMicro A1SRi-2758F Open | 233884 | Corsair CORSAIR K70 RGB MK.2 / K63 / K63 Wireless Open | 234578 | Support for Sierra Wireless EM7455 modem Open | 237666 | repeated messages of "uhub_reattach_port: giving 4 problems total for which you should take action. From owner-freebsd-usb@freebsd.org Tue Oct 1 13:43:15 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D4B29136C2F for ; Tue, 1 Oct 2019 13:43:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 46jL7l5Lwrz3NWZ for ; Tue, 1 Oct 2019 13:43:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id B78E0136C2E; Tue, 1 Oct 2019 13:43:15 +0000 (UTC) Delivered-To: usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B754D136C2D for ; Tue, 1 Oct 2019 13:43:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jL7l4SsNz3NWY for ; Tue, 1 Oct 2019 13:43:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E54F1C38E for ; Tue, 1 Oct 2019 13:43:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x91DhFX4087117 for ; Tue, 1 Oct 2019 13:43:15 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x91DhFqN087116 for usb@FreeBSD.org; Tue, 1 Oct 2019 13:43:15 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 120321] [hang] System hangs when transferring data to WD MyBook USB HDD Date: Tue, 01 Oct 2019 13:43:15 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 6.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: larafercue@gmail.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 13:43:15 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D120321 larafercue@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |larafercue@gmail.com --- Comment #3 from larafercue@gmail.com --- The same error is happening in FreeBSD 12.0-RELEASE for a SATA device. The main issue here is that g_vfs_done reports the error but nothing else is done about it. A good solution could be to end transactions to the device when an error is reported (after some attempts). --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Tue Oct 1 14:14:22 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 292C91376ED for ; Tue, 1 Oct 2019 14:14:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 46jLqf0NN2z3Q7w for ; Tue, 1 Oct 2019 14:14:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 0CE5E1376EC; Tue, 1 Oct 2019 14:14:22 +0000 (UTC) Delivered-To: usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CA601376EB for ; Tue, 1 Oct 2019 14:14:22 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jLqd6b8Bz3Q7v for ; Tue, 1 Oct 2019 14:14:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C22681C8ED for ; Tue, 1 Oct 2019 14:14:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x91EEL29060627 for ; Tue, 1 Oct 2019 14:14:21 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x91EELGS060626 for usb@FreeBSD.org; Tue, 1 Oct 2019 14:14:21 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 120321] [hang] System hangs when transferring data to WD MyBook USB HDD Date: Tue, 01 Oct 2019 14:14:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 6.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: larafercue@gmail.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 14:14:22 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D120321 --- Comment #4 from larafercue@gmail.com --- I activated the kern.geom.debugflags and I found the following messages on dmesg after ejecting the disk. g_orphan_provider(0xfffff80122cac900(ada1), 6) g_orphan_register(ada1) g_part_orphan(ada1)g_vfs_done(): ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)]g_orphan_provider(0xfffff80117547300(ada1p1), 6)error =3D 5 g_orphan_provider(0xfffff800251fee00(ada1p2), 6) g_orphan_provider(0xfffff80122a59c00(ada1p3), 6) g_orphan_provider(0xfffff801173eac00(ada1p4), 6) g_orphan_provider(0xfffff80122c9ec00(ada1p5), 6) g_orphan_provider(0xfffff801174fb300(ada1p6), 6) g_wither_geom(0xfffff80122cac800(ada1)) g_dev_orphan(0xfffff8002876f780(ada1)) g_orphan_register(ada1p1)g_dev_callback(0xfffff8002876f780(ada1)) g_post_event_x(0xffffffff80ae1510, 0xfffff8002876f780, 2, 0) g_slice_orphan(0xfffff8000369ed80/ada1p1) g_wither_geom(0xfffff801174fc900(ada1p1)) g_orphan_provider(0xfffff801174fca00(gpt/bloader), 6) g_dev_orphan(0xfffff801177f8c80(ada1p1)) g_orphan_register(ada1p2)g_dev_callback(0xfffff801177f8c80(ada1p1)) g_slice_orphan(0xfffff80025d68e80/ada1p2)g_post_event_x(0xffffffff80ae1510, 0xfffff801177f8c80, 2, 0) g_wither_geom(0xfffff80117506400(ada1p2)) g_orphan_provider(0xfffff8011715d600(ufs/DOMBoot), 6) g_slice_orphan(0xfffff80117824e00/ada1p2) g_wither_geom(0xfffff80122cadd00(ada1p2))g_vfs_done(): g_orphan_provider(0xfffff80122cade00(ufsid/5c137f0f2b744507), 6)ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)] g_slice_orphan(0xfffff80122730680/ada1p2) g_wither_geom(0xfffff80122cadb00(ada1p2)) g_orphan_provider(0xfffff80122cada00(gpt/DOMBoot), 6) g_dev_orphan(0xfffff801177f8c00(ada1p2))error =3D 5 g_orphan_register(ada1p3) g_vfs_done():g_slice_orphan(0xfffff80033dd0300/ada1p3)ada1p5.eli[READ(offse= t=3D2232576792112496640, length=3D32768)] g_wither_geom(0xfffff80117b5c800(ada1p3))error =3D 5 g_orphan_provider(0xfffff80122cb7e00(gpt/NVRAM), 6)g_vfs_done(): g_slice_orphan(0xfffff8002507d180/ada1p3) g_wither_geom(0xfffff80033f96400(ada1p3)) g_orphan_provider(0xfffff80033f96600(label/NVRAM), 6) g_dev_orphan(0xfffff80122cdb880(ada1p3)) g_orphan_register(ada1p4) g_slice_orphan(0xfffff80025d6a800/ada1p4) g_wither_geom(0xfffff80122cb7600(ada1p4)) g_orphan_provider(0xfffff80122cb7500(ufs/DOMUPDATE), 6) g_slice_orphan(0xfffff80033dcf580/ada1p4) g_wither_geom(0xfffff80122cb7900(ada1p4)) g_orphan_provider(0xfffff80122cb7800(ufsid/5c137f135e2a00d9), 6)ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)] g_slice_orphan(0xfffff80122cdc180/ada1p4) g_wither_geom(0xfffff80122cb7c00(ada1p4)) g_orphan_provider(0xfffff80122cb7b00(gpt/DOMUPDATE), 6) g_dev_orphan(0xfffff80122734600(ada1p4)) g_orphan_register(ada1p5)error =3D 5 g_vfs_done(): g_dev_callback(0xfffff801177f8c00(ada1p2)) g_orphan_provider(0xfffff80122942b00(ada1p5.eli), 6)g_post_event_x(0xffffffff80ae1510, 0xfffff801177f8c00, 2, 0) g_dev_orphan(0xfffff8002507d200(ada1p5)) g_dev_callback(0xfffff80122cdb880(ada1p3)) g_orphan_register(ada1p6) g_orphan_provider(0xfffff80122a7b900(ada1p6.eli), 6) g_dev_orphan(0xfffff8002507d380(ada1p6))ada1p5.eli[READ(offset=3D2232576792= 112496640, length=3D32768)] g_post_event_x(0xffffffff80ae1510, 0xfffff80122cdb880, 2, 0) g_orphan_register(gpt/bloader) g_dev_orphan(0xfffff80122735000(gpt/bloader)) g_dev_callback(0xfffff80122734600(ada1p4)) g_orphan_register(ufs/DOMBoot) g_post_event_x(0xffffffff80ae1510, 0xfffff80122734600, 2, 0) g_dev_callback(0xfffff8002507d200(ada1p5)) g_post_event_x(0xffffffff80ae1510, 0xfffff8002507d200, 2, 0) g_dev_orphan(0xfffff8002507d000(ufs/DOMBoot))g_dev_callback(0xfffff8002507d= 380(ada1p6)) g_orphan_register(ufsid/5c137f0f2b744507)error =3D 5 g_vfs_done():g_dev_orphan(0xfffff80122985c00(ufsid/5c137f0f2b744507))ada1p5= .eli[READ(offset=3D2232576792112496640, length=3D32768)] error =3D 6 g_orphan_register(gpt/DOMBoot) g_dev_orphan(0xfffff80122730300(gpt/DOMBoot)) g_orphan_register(gpt/NVRAM)g_vfs_done(): ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)]g_dev_orphan(0xfffff80122ab8500(gpt/NVRAM))error =3D 6 g_post_event_x(0xffffffff80ae1510, 0xfffff8002507d380, 2, 0)g_vfs_done(): g_orphan_register(label/NVRAM) g_dev_orphan(0xfffff80025140400(label/NVRAM))ada1p5.eli[READ(offset=3D22325= 76792112496640, length=3D32768)] g_dev_callback(0xfffff80122735000(gpt/bloader)) g_post_event_x(0xffffffff80ae1510, 0xfffff80122735000, 2, 0) g_dev_callback(0xfffff8002507d000(ufs/DOMBoot)) g_post_event_x(0xffffffff80ae1510, 0xfffff8002507d000, 2, 0) g_dev_callback(0xfffff80122985c00(ufsid/5c137f0f2b744507)) g_post_event_x(0xffffffff80ae1510, 0xfffff80122985c00, 2, 0) g_dev_callback(0xfffff80122730300(gpt/DOMBoot)) g_post_event_x(0xffffffff80ae1510, 0xfffff80122730300, 2, 0) g_orphan_register(ufs/DOMUPDATE) g_dev_callback(0xfffff80122ab8500(gpt/NVRAM)) g_post_event_x(0xffffffff80ae1510, 0xfffff80122ab8500, 2, 0)g_dev_orphan(0xfffff80025811b80(ufs/DOMUPDATE)) g_dev_callback(0xfffff80025140400(label/NVRAM)) g_orphan_register(ufsid/5c137f135e2a00d9) g_dev_orphan(0xfffff80122986f00(ufsid/5c137f135e2a00d9)) g_post_event_x(0xffffffff80ae1510, 0xfffff80025140400, 2, 0) g_dev_callback(0xfffff80025811b80(ufs/DOMUPDATE)) g_orphan_register(gpt/DOMUPDATE) g_post_event_x(0xffffffff80ae1510, 0xfffff80025811b80, 2, 0) g_dev_callback(0xfffff80122986f00(ufsid/5c137f135e2a00d9)) g_post_event_x(0xffffffff80ae1510, 0xfffff80122986f00, 2, 0)error =3D 6 g_vfs_done():ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)]= error =3D 6 g_vfs_done():ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)]= error =3D 6 g_vfs_done():ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)]= error =3D 6 g_dev_orphan(0xfffff80122986c80(gpt/DOMUPDATE)) g_orphan_register(ada1p5.eli)g_dev_callback(0xfffff80122986c80(gpt/DOMUPDAT= E)) g_vfs_done(): g_post_event_x(0xffffffff80ae1510, 0xfffff80122986c80, 2, 0)ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)] error =3D 6 g_vfs_done():ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)]= error =3D 6 g_vfs_done():ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)]= error =3D 6 g_vfs_done():ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)]g_vfs_orphan(0xfffff80122abb880(ffs.ada1p5.eli))error =3D 6 g_dev_orphan(0xfffff80117348680(ada1p5.eli))g_vfs_done(): g_orphan_register(ada1p6.eli)g_dev_callback(0xfffff80117348680(ada1p5.eli)) g_vfs_orphan(0xfffff80122ab8600(ffs.ada1p6.eli)) g_post_event_x(0xffffffff82de7860, 0xfffff80122c9f500, 2, 0)ada1p5.eli[READ(offset=3D2232576792112496640, length=3D32768)] g_detach(0xfffff80122ab8600) g_dev_orphan(0xfffff80122986000(ada1p6.eli)) g_dev_destroy(0xfffff8002876f780(ada1))error =3D 6 g_post_event_x(0xffffffff80aeb230, 0xfffff80122abb880, 2, 0) g_detach(0xfffff8002876f780) g_post_event_x(0xffffffff80ae1510, 0xfffff80117348680, 2, 0) g_dev_callback(0xfffff80122986000(ada1p6.eli)) g_post_event_x(0xffffffff80ae1510, 0xfffff80122986000, 2, 0) g_destroy_consumer(0xfffff8002876f780) g_destroy_geom(0xfffff80122cac600(ada1)) g_dev_destroy(0xfffff801177f8c80(ada1p1)) g_detach(0xfffff801177f8c80) g_destroy_consumer(0xfffff801177f8c80) g_destroy_geom(0xfffff80117ae1c00(ada1p1)) g_dev_destroy(0xfffff801177f8c00(ada1p2)) g_detach(0xfffff801177f8c00) g_destroy_consumer(0xfffff801177f8c00) g_destroy_geom(0xfffff8012290a500(ada1p2)) g_dev_destroy(0xfffff80122cdb880(ada1p3)) g_detach(0xfffff80122cdb880) g_destroy_consumer(0xfffff80122cdb880) g_destroy_geom(0xfffff801229c8500(ada1p3)) g_dev_destroy(0xfffff80122734600(ada1p4)) g_detach(0xfffff80122734600) g_destroy_consumer(0xfffff80122734600) g_destroy_geom(0xfffff80033f67600(ada1p4)) g_dev_destroy(0xfffff8002507d200(ada1p5)) g_detach(0xfffff8002507d200) g_destroy_consumer(0xfffff8002507d200) g_destroy_geom(0xfffff80117547000(ada1p5)) g_dev_destroy(0xfffff8002507d380(ada1p6)) g_detach(0xfffff8002507d380) g_destroy_consumer(0xfffff8002507d380) g_destroy_geom(0xfffff80122a6c700(ada1p6)) g_dev_destroy(0xfffff80122735000(gpt/bloader)) g_detach(0xfffff80122735000) g_destroy_consumer(0xfffff80122735000) g_destroy_geom(0xfffff801174fb400(gpt/bloader)) g_dev_destroy(0xfffff8002507d000(ufs/DOMBoot)) g_detach(0xfffff8002507d000) g_destroy_consumer(0xfffff8002507d000) g_destroy_geom(0xfffff80122d3a000(ufs/DOMBoot)) g_dev_destroy(0xfffff80122985c00(ufsid/5c137f0f2b744507)) g_detach(0xfffff80122985c00) g_destroy_consumer(0xfffff80122985c00) g_destroy_geom(0xfffff80122cadc00(ufsid/5c137f0f2b744507)) g_dev_destroy(0xfffff80122730300(gpt/DOMBoot)) g_detach(0xfffff80122730300) g_destroy_consumer(0xfffff80122730300) g_destroy_geom(0xfffff801174fcb00(gpt/DOMBoot)) g_dev_destroy(0xfffff80122ab8500(gpt/NVRAM)) g_detach(0xfffff80122ab8500) g_destroy_consumer(0xfffff80122ab8500) g_destroy_geom(0xfffff80025136800(gpt/NVRAM)) g_dev_destroy(0xfffff80025140400(label/NVRAM)) g_detach(0xfffff80025140400) g_destroy_consumer(0xfffff80025140400) g_destroy_geom(0xfffff80033f96500(label/NVRAM)) g_dev_destroy(0xfffff80025811b80(ufs/DOMUPDATE)) g_detach(0xfffff80025811b80) g_destroy_consumer(0xfffff80025811b80) g_destroy_geom(0xfffff80122cb7700(ufs/DOMUPDATE)) g_dev_destroy(0xfffff80122986f00(ufsid/5c137f135e2a00d9)) g_detach(0xfffff80122986f00) g_destroy_consumer(0xfffff80122986f00) g_destroy_geom(0xfffff80122a59000(ufsid/5c137f135e2a00d9)) g_dev_destroy(0xfffff80122986c80(gpt/DOMUPDATE)) g_detach(0xfffff80122986c80) g_destroy_consumer(0xfffff80122986c80) g_destroy_geom(0xfffff80122cb7d00(gpt/DOMUPDATE)) After ejecting the disk, geom does not react. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Tue Oct 1 15:52:18 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06E81139637 for ; Tue, 1 Oct 2019 15:52:18 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 46jP0d6Rjtz41NM for ; Tue, 1 Oct 2019 15:52:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id DB738139636; Tue, 1 Oct 2019 15:52:17 +0000 (UTC) Delivered-To: usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DB335139635 for ; Tue, 1 Oct 2019 15:52:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jP0d5Xvyz41NL for ; Tue, 1 Oct 2019 15:52:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A303E1D9CF for ; Tue, 1 Oct 2019 15:52:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x91FqHnR028244 for ; Tue, 1 Oct 2019 15:52:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x91FqHHI028243 for usb@FreeBSD.org; Tue, 1 Oct 2019 15:52:17 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 120321] [hang] System hangs when transferring data to WD MyBook USB HDD Date: Tue, 01 Oct 2019 15:52:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 6.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: larafercue@gmail.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 15:52:18 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D120321 --- Comment #5 from larafercue@gmail.com --- It happened to be an "unclean" partition. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-usb@freebsd.org Thu Oct 3 02:56:20 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 866F5FCB38 for ; Thu, 3 Oct 2019 02:56:20 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ipmail07.adl2.internode.on.net (ipmail07.adl2.internode.on.net [150.101.137.131]) by mx1.freebsd.org (Postfix) with ESMTP id 46kHhL52Vkz4M2x for ; Thu, 3 Oct 2019 02:56:17 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ppp14-2-72-4.adl-apt-pir-bras31.tpg.internode.on.net (HELO midget.dons.net.au) ([14.2.72.4]) by ipmail07.adl2.internode.on.net with ESMTP; 03 Oct 2019 12:26:14 +0930 Received: from midget.dons.net.au (localhost [127.0.0.1]) by midget.dons.net.au (8.15.2/8.15.2) with ESMTPS id x932twOM085186 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 3 Oct 2019 12:26:04 +0930 (ACST) (envelope-from darius@dons.net.au) Received: (from mailnull@localhost) by midget.dons.net.au (8.15.2/8.15.2/Submit) id x932tFAR084916 for ; Thu, 3 Oct 2019 12:25:15 +0930 (ACST) (envelope-from darius@dons.net.au) X-Authentication-Warning: midget.dons.net.au: mailnull set sender to using -f X-MIMEDefang-Relay-be813b1f1da6d6b27d681222cb70cc4f5b642383: 203.31.81.177 Received: from [203.31.81.177] ([203.31.81.177]) by ppp14-2-72-4.adl-apt-pir-bras31.tpg.internode.on.net (envelope-sender ) (MIMEDefang) with ESMTP id x932tA4k083912; Thu, 03 Oct 2019 12:25:15 +0930 From: "O'Connor, Daniel" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Date: Thu, 3 Oct 2019 12:25:09 +0930 Subject: USB serial ports by serial number Message-Id: To: freebsd-usb@freebsd.org X-Mailer: Apple Mail (2.3445.104.11) X-Spam-Score: 1.5 (*) No, score=1.5 required=5.0 tests=HELO_MISC_IP, RDNS_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Scanned-By: MIMEDefang 2.83 on 10.0.2.1 X-Rspamd-Queue-Id: 46kHhL52Vkz4M2x X-Spamd-Bar: +++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of darius@dons.net.au has no SPF policy when checking 150.101.137.131) smtp.mailfrom=darius@dons.net.au X-Spamd-Result: default: False [5.35 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_NONE(0.00)[]; IP_SCORE(1.87)[ip: (5.51), ipnet: 150.101.0.0/16(2.51), asn: 4739(1.29), country: AU(0.01)]; NEURAL_SPAM_LONG(1.00)[0.997,0]; RCVD_IN_DNSWL_NONE(0.00)[131.137.101.150.list.dnswl.org : 127.0.5.0]; NEURAL_SPAM_MEDIUM(0.99)[0.989,0]; R_SPF_NA(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4739, ipnet:150.101.0.0/16, country:AU]; MID_RHS_MATCH_FROM(0.00)[]; DMARC_NA(0.00)[dons.net.au] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 02:56:20 -0000 Hi, I have several USB serial ports on a machine and I don't want to rely on = attach order to get various programs to talk to the correct serial port. I wrote the following devd script and shell script to create symlinks = from cu.${sernum}/tty.${sernum} to the real device nodes. I post it here in the hope other people find it useful. [maarsytest 2:49] ~> cat /usr/local/etc/devd/usbserialsn.conf attach 100 { device-name ".*"; match "ttyname" ".+"; match "ugen" ".+"; match "sernum" ".+"; action "/usr/local/libexec/usbserialsn attach $device-name = $sernum $ttyname"; }; detach 100 { device-name ".*"; action "/usr/local/libexec/usbserialsn detach $device-name"; }; [maarsytest 2:49] ~> cat /usr/local/libexec/usbserialsn #!/bin/sh if [ $# -lt 2 ]; then echo "Bad usage" exit 1 fi mode=3D$1 devname=3D$2 sernum=3D$3 ttyname=3D$4 case "$mode" in attach) if [ $# -ne 4 ]; then echo "Bad usage" exit 1 fi ln -sf cua${ttyname} /dev/cu.${sernum} ln -sf tty${ttyname} /dev/tty.${sernum} echo ${sernum} >/var/run/usbserialsn.${devname} ;; detach) if [ $# -ne 2 ]; then echo "Bad usage" exit 1 fi if [ ! -e /var/run/usbserialsn.${devname} ]; then exit 0 fi sernum=3D$(cat /var/run/usbserialsn.${devname}) rm -f /dev/cu.${sernum} /dev/tty.${sernum} = /var/run/usbserialsn.${devname} ;; *) echo "Unknown mode" exit 1 ;; esac It would be a lot simpler if devd reported the same things on detach as = it does on attach but I am not sure how difficult that would be to = achieve (presumably it would require caching them). -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum From owner-freebsd-usb@freebsd.org Thu Oct 3 06:43:10 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 644F112A395 for ; Thu, 3 Oct 2019 06:43:10 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-vk1-xa2b.google.com (mail-vk1-xa2b.google.com [IPv6:2607:f8b0:4864:20::a2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kNk52yt4z3CC7 for ; Thu, 3 Oct 2019 06:43:08 +0000 (UTC) (envelope-from ray@ddteam.net) Received: by mail-vk1-xa2b.google.com with SMTP id u4so378023vkl.6 for ; Wed, 02 Oct 2019 23:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddteam-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Re9zies7QdCIkmup7pJZ4G2l5LK8DPYQwns/nfZKRYs=; b=F//fcrRaLQQPSrjMEare4FayH9KZ73JTea6RI3p6cPejYSB5z+Eh31bzeXzjHMDJuM XPwyKRi0YTPFBXpGYn9j1wzei9Ph6Fkh7FoVRO7rIANwg5leVkdnhmLMl6hcaKV3VZuP J9vVUeIPTSNlJSTL2CI3P8AODeQPpgI0/BfuhylX7TTUfHmfn5SRnciX84+GT9eH7RUW lJNmDSSON6lmeZK8Ua/H1ttAmiRN/RT1a4CP+new0h3e5szgxlo8jmoJn8WbY5f0aIs+ GKEzIpaNUabKyeLVHGFJDc5K+S49c6gtTvpVNFetEwQKfJHi7L4a3mqKAXBRhla1nCUB U0mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Re9zies7QdCIkmup7pJZ4G2l5LK8DPYQwns/nfZKRYs=; b=XTYu2BjjkHZkhSwURNd7eZtTvRn5+DD72puFTUL9NljLIbW5ePQ4eBnP0AuygYodfT R8R/A+2FT2E9RtW6YsNWGisaFB4aHgjj9Nko8J0jRthqpzZJNCRXZ5oGfwjX28jSRoBm 2T+32tKAKa5u2u1BwSj5QtJn8sRwsnMBiqUmmkWSaqpAyTqT2j+Vt3UilTZT2o8evAez QfJbFjQ55QrE6fgKJ2KyYdEIPIIkNKwajbW1TPn7mtjHrLjAbIuUCfiBwrqReYOfSMiH 705R01Or7/YrlznrXe1XfCsMqKVELC+orlWok2JuK9GSZRep7zOXeAd3iUEbeFwrlxea oqGg== X-Gm-Message-State: APjAAAUx4K+STD3BQbzbEUV1AuTnx6EO4mvZ25SqLKBTGseXbqEru+eL JjybCal3dIrjnbxDkMqYgMm14t9pTYhp05i9XBlxQYI0Lg8= X-Google-Smtp-Source: APXvYqyHvX1newt70gH8C0jeL6oado6VFaxpVWr+nONOTh/dhHQEFr0pvMW1Q5HH20SIaqBecAAKSI6zqjkQmclEKw4= X-Received: by 2002:a1f:28c3:: with SMTP id o186mr4198816vko.30.1570084987520; Wed, 02 Oct 2019 23:43:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Oleksandr Rybalko Date: Thu, 3 Oct 2019 09:42:56 +0300 Message-ID: Subject: Re: USB serial ports by serial number To: "O'Connor, Daniel" Cc: freebsd-usb@freebsd.org X-Rspamd-Queue-Id: 46kNk52yt4z3CC7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ddteam-net.20150623.gappssmtp.com header.s=20150623 header.b=F//fcrRa; dmarc=none; spf=softfail (mx1.freebsd.org: 2607:f8b0:4864:20::a2b is neither permitted nor denied by domain of ray@ddteam.net) smtp.mailfrom=ray@ddteam.net X-Spamd-Result: default: False [-4.08 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[ddteam-net.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; DMARC_NA(0.00)[ddteam.net]; R_SPF_SOFTFAIL(0.00)[~all]; URI_COUNT_ODD(1.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ddteam-net.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[b.2.a.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.78)[ip: (-9.13), ipnet: 2607:f8b0::/32(-2.57), asn: 15169(-2.16), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 06:43:10 -0000 Hi, Looks like you are lucky guy :) Most of USB-serial devices have "very stable" serial number :) more than 50% have S/N "0123456789". So, sometime you change will do it's job. IMO, better to track hub/port. Thanks. =D1=87=D1=82, 3 =D0=B6=D0=BE=D0=B2=D1=82. 2019 =D0=BE 05:56 O'Connor, Danie= l =D0=BF=D0=B8=D1=88=D0=B5: > Hi, > I have several USB serial ports on a machine and I don't want to rely on > attach order to get various programs to talk to the correct serial port. > > I wrote the following devd script and shell script to create symlinks fro= m > cu.${sernum}/tty.${sernum} to the real device nodes. > > I post it here in the hope other people find it useful. > > [maarsytest 2:49] ~> cat /usr/local/etc/devd/usbserialsn.conf > attach 100 { > device-name ".*"; > match "ttyname" ".+"; > match "ugen" ".+"; > match "sernum" ".+"; > action "/usr/local/libexec/usbserialsn attach $device-name $sernu= m > $ttyname"; > }; > > detach 100 { > device-name ".*"; > action "/usr/local/libexec/usbserialsn detach $device-name"; > }; > [maarsytest 2:49] ~> cat /usr/local/libexec/usbserialsn > #!/bin/sh > > if [ $# -lt 2 ]; then > echo "Bad usage" > exit 1 > fi > > mode=3D$1 > devname=3D$2 > sernum=3D$3 > ttyname=3D$4 > > case "$mode" in > attach) > if [ $# -ne 4 ]; then > echo "Bad usage" > exit 1 > fi > ln -sf cua${ttyname} /dev/cu.${sernum} > ln -sf tty${ttyname} /dev/tty.${sernum} > echo ${sernum} >/var/run/usbserialsn.${devname} > ;; > > detach) > if [ $# -ne 2 ]; then > echo "Bad usage" > exit 1 > fi > if [ ! -e /var/run/usbserialsn.${devname} ]; then > exit 0 > fi > sernum=3D$(cat /var/run/usbserialsn.${devname}) > rm -f /dev/cu.${sernum} /dev/tty.${sernum} > /var/run/usbserialsn.${devname} > ;; > > *) > echo "Unknown mode" > exit 1 > ;; > esac > > It would be a lot simpler if devd reported the same things on detach as i= t > does on attach but I am not sure how difficult that would be to achieve > (presumably it would require caching them). > > -- > Daniel O'Connor > "The nice thing about standards is that there > are so many of them to choose from." > -- Andrew Tanenbaum > > > _______________________________________________ > freebsd-usb@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" > --=20 WBW ------- Rybalko Aleksandr From owner-freebsd-usb@freebsd.org Thu Oct 3 07:26:21 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3283C12AF84 for ; Thu, 3 Oct 2019 07:26:21 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by mx1.freebsd.org (Postfix) with ESMTP id 46kPgv2588z3Dt8 for ; Thu, 3 Oct 2019 07:26:18 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ppp14-2-72-4.adl-apt-pir-bras31.tpg.internode.on.net (HELO midget.dons.net.au) ([14.2.72.4]) by ipmail06.adl2.internode.on.net with ESMTP; 03 Oct 2019 16:56:15 +0930 Received: from midget.dons.net.au (localhost [127.0.0.1]) by midget.dons.net.au (8.15.2/8.15.2) with ESMTPS id x937PwmP080553 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 3 Oct 2019 16:56:08 +0930 (ACST) (envelope-from darius@dons.net.au) Received: (from mailnull@localhost) by midget.dons.net.au (8.15.2/8.15.2/Submit) id x936uiHB059088 for ; Thu, 3 Oct 2019 16:26:44 +0930 (ACST) (envelope-from darius@dons.net.au) X-Authentication-Warning: midget.dons.net.au: mailnull set sender to using -f X-MIMEDefang-Relay-be813b1f1da6d6b27d681222cb70cc4f5b642383: 203.31.81.187 Received: from havok.gsoft.com.au (Havok.gsoft.com.au [203.31.81.187]) by ppp14-2-72-4.adl-apt-pir-bras31.tpg.internode.on.net (envelope-sender ) (MIMEDefang) with ESMTP id x936uc6w059086; Thu, 03 Oct 2019 16:26:44 +0930 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: USB serial ports by serial number From: "O'Connor, Daniel" In-Reply-To: Date: Thu, 3 Oct 2019 16:26:37 +0930 Cc: freebsd-usb@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <40CAFE90-B8F6-4A9B-A6D0-671D2DCEED52@dons.net.au> References: To: Oleksandr Rybalko X-Mailer: Apple Mail (2.3445.104.11) X-Spam-Score: 0.4 () No, score=0.4 required=5.0 tests=KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Scanned-By: MIMEDefang 2.83 on 10.0.2.1 X-Rspamd-Queue-Id: 46kPgv2588z3Dt8 X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of darius@dons.net.au has no SPF policy when checking 150.101.137.129) smtp.mailfrom=darius@dons.net.au X-Spamd-Result: default: False [4.78 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; HAS_XAW(0.00)[]; AUTH_NA(1.00)[]; DMARC_NA(0.00)[dons.net.au]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(0.97)[0.975,0]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[129.137.101.150.list.dnswl.org : 127.0.5.0]; NEURAL_SPAM_LONG(0.99)[0.990,0]; R_SPF_NA(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4739, ipnet:150.101.0.0/16, country:AU]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(1.32)[ip: (2.79), ipnet: 150.101.0.0/16(2.51), asn: 4739(1.29), country: AU(0.01)] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 07:26:21 -0000 > On 3 Oct 2019, at 16:12, Oleksandr Rybalko wrote: > Looks like you are lucky guy :) > Most of USB-serial devices have "very stable" serial number :) > more than 50% have S/N "0123456789". These are either FTDI (or possibly clones..) or a Micropython board so I = guess avoiding CH341s is paying off :) > So, sometime you change will do it's job. Yes, it should be possible but of course not if the manufacturer has = really cheaped out :( > IMO, better to track hub/port. No reason you couldn't do that (either instead or as well) with some = very basic script modifications. Perhaps I should have made /dev/usbserialbysn and put symlinks in that. > Thanks. >=20 >=20 > =D1=87=D1=82, 3 =D0=B6=D0=BE=D0=B2=D1=82. 2019 =D0=BE 05:56 O'Connor, = Daniel =D0=BF=D0=B8=D1=88=D0=B5: > Hi, > I have several USB serial ports on a machine and I don't want to rely = on attach order to get various programs to talk to the correct serial = port. >=20 > I wrote the following devd script and shell script to create symlinks = from cu.${sernum}/tty.${sernum} to the real device nodes. >=20 > I post it here in the hope other people find it useful. >=20 > [maarsytest 2:49] ~> cat /usr/local/etc/devd/usbserialsn.conf > attach 100 { > device-name ".*"; > match "ttyname" ".+"; > match "ugen" ".+"; > match "sernum" ".+"; > action "/usr/local/libexec/usbserialsn attach $device-name = $sernum $ttyname"; > }; >=20 > detach 100 { > device-name ".*"; > action "/usr/local/libexec/usbserialsn detach $device-name"; > }; > [maarsytest 2:49] ~> cat /usr/local/libexec/usbserialsn > #!/bin/sh >=20 > if [ $# -lt 2 ]; then > echo "Bad usage" > exit 1 > fi >=20 > mode=3D$1 > devname=3D$2 > sernum=3D$3 > ttyname=3D$4 >=20 > case "$mode" in > attach) > if [ $# -ne 4 ]; then > echo "Bad usage" > exit 1 > fi > ln -sf cua${ttyname} /dev/cu.${sernum} > ln -sf tty${ttyname} /dev/tty.${sernum} > echo ${sernum} >/var/run/usbserialsn.${devname} > ;; >=20 > detach) > if [ $# -ne 2 ]; then > echo "Bad usage" > exit 1 > fi > if [ ! -e /var/run/usbserialsn.${devname} ]; then > exit 0 > fi > sernum=3D$(cat /var/run/usbserialsn.${devname}) > rm -f /dev/cu.${sernum} /dev/tty.${sernum} = /var/run/usbserialsn.${devname} > ;; >=20 > *) > echo "Unknown mode" > exit 1 > ;; > esac >=20 > It would be a lot simpler if devd reported the same things on detach = as it does on attach but I am not sure how difficult that would be to = achieve (presumably it would require caching them). >=20 > -- > Daniel O'Connor > "The nice thing about standards is that there > are so many of them to choose from." > -- Andrew Tanenbaum >=20 >=20 > _______________________________________________ > freebsd-usb@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-usb > To unsubscribe, send any mail to "freebsd-usb-unsubscribe@freebsd.org" >=20 >=20 > --=20 > WBW > ------- > Rybalko Aleksandr >=20 -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum From owner-freebsd-usb@freebsd.org Thu Oct 3 07:32:50 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 644E112B1D8 for ; Thu, 3 Oct 2019 07:32:50 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46kPqP5dZSz3FJy for ; Thu, 3 Oct 2019 07:32:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C70892602FE; Thu, 3 Oct 2019 09:32:47 +0200 (CEST) Subject: Re: USB serial ports by serial number To: "O'Connor, Daniel" , Oleksandr Rybalko Cc: freebsd-usb@freebsd.org References: <40CAFE90-B8F6-4A9B-A6D0-671D2DCEED52@dons.net.au> From: Hans Petter Selasky Message-ID: <1f0a3207-89fd-0ddb-6049-91f114381386@selasky.org> Date: Thu, 3 Oct 2019 09:31:57 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <40CAFE90-B8F6-4A9B-A6D0-671D2DCEED52@dons.net.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46kPqP5dZSz3FJy X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.48 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-3.18)[ip: (-9.35), ipnet: 88.99.0.0/16(-4.75), asn: 24940(-1.80), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 07:32:50 -0000 On 2019-10-03 08:56, O'Connor, Daniel wrote: > Most of USB-serial devices have "very stable" serial number:) > more than 50% have S/N "0123456789". It is also allowed to have no serial number. Maybe some kind of "lstty" would do. -l - list all devices -s - match by serial -v - match by vendor -p - match by product -i - match by interface ID -t - type [USB/PCI] which simply output the tty number you need. Could be an API we could add to libusb. --HPS From owner-freebsd-usb@freebsd.org Thu Oct 3 07:56:11 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5702212C551 for ; Thu, 3 Oct 2019 07:56:11 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [150.101.137.136]) by mx1.freebsd.org (Postfix) with ESMTP id 46kQLK6L6wz3GwQ for ; Thu, 3 Oct 2019 07:56:09 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ppp14-2-72-4.adl-apt-pir-bras31.tpg.internode.on.net (HELO midget.dons.net.au) ([14.2.72.4]) by ipmail01.adl6.internode.on.net with ESMTP; 03 Oct 2019 17:26:04 +0930 Received: from midget.dons.net.au (localhost [127.0.0.1]) by midget.dons.net.au (8.15.2/8.15.2) with ESMTPS id x937twsP002277 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 3 Oct 2019 17:25:58 +0930 (ACST) (envelope-from darius@dons.net.au) Received: (from mailnull@localhost) by midget.dons.net.au (8.15.2/8.15.2/Submit) id x937bTfO087900 for ; Thu, 3 Oct 2019 17:07:29 +0930 (ACST) (envelope-from darius@dons.net.au) X-Authentication-Warning: midget.dons.net.au: mailnull set sender to using -f X-MIMEDefang-Relay-be813b1f1da6d6b27d681222cb70cc4f5b642383: 203.31.81.187 Received: from havok.gsoft.com.au (Havok.gsoft.com.au [203.31.81.187]) by ppp14-2-72-4.adl-apt-pir-bras31.tpg.internode.on.net (envelope-sender ) (MIMEDefang) with ESMTP id x937bNsX087894; Thu, 03 Oct 2019 17:07:29 +0930 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: USB serial ports by serial number From: "O'Connor, Daniel" In-Reply-To: <1f0a3207-89fd-0ddb-6049-91f114381386@selasky.org> Date: Thu, 3 Oct 2019 17:07:23 +0930 Cc: Oleksandr Rybalko , freebsd-usb@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <366762AE-757E-4EB4-9A51-8B513FE7BC42@dons.net.au> References: <40CAFE90-B8F6-4A9B-A6D0-671D2DCEED52@dons.net.au> <1f0a3207-89fd-0ddb-6049-91f114381386@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3445.104.11) X-Spam-Score: 0.4 () No, score=0.4 required=5.0 tests=KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Scanned-By: MIMEDefang 2.83 on 10.0.2.1 X-Rspamd-Queue-Id: 46kQLK6L6wz3GwQ X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of darius@dons.net.au has no SPF policy when checking 150.101.137.136) smtp.mailfrom=darius@dons.net.au X-Spamd-Result: default: False [4.88 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; HAS_XAW(0.00)[]; AUTH_NA(1.00)[]; DMARC_NA(0.00)[dons.net.au]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(0.97)[0.973,0]; NEURAL_SPAM_LONG(0.96)[0.963,0]; R_SPF_NA(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4739, ipnet:150.101.0.0/16, country:AU]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(1.54)[ip: (3.90), ipnet: 150.101.0.0/16(2.51), asn: 4739(1.29), country: AU(0.01)]; RCVD_IN_DNSWL_LOW(-0.10)[136.137.101.150.list.dnswl.org : 127.0.5.1] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 07:56:11 -0000 > On 3 Oct 2019, at 17:01, Hans Petter Selasky wrote: > On 2019-10-03 08:56, O'Connor, Daniel wrote: >> Most of USB-serial devices have "very stable" serial number:) >> more than 50% have S/N "0123456789". >=20 > It is also allowed to have no serial number. Yes, that's why I match sernum to '.+' to skip those. > Maybe some kind of "lstty" would do. >=20 > -l - list all devices > -s - match by serial > -v - match by vendor > -p - match by product > -i - match by interface ID > -t - type [USB/PCI] >=20 > which simply output the tty number you need. Could be an API we could = add to libusb. The problem is you can't modify some program to call a new API a lot of = the time but it is usually trivial to change which serial port it's = configured to use. -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum From owner-freebsd-usb@freebsd.org Thu Oct 3 08:12:02 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 15ABE12D6F7 for ; Thu, 3 Oct 2019 08:12:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46kQhd0p91z3Hp5 for ; Thu, 3 Oct 2019 08:12:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D0D542602CD; Thu, 3 Oct 2019 10:11:58 +0200 (CEST) Subject: Re: USB serial ports by serial number To: "O'Connor, Daniel" Cc: Oleksandr Rybalko , freebsd-usb@freebsd.org References: <40CAFE90-B8F6-4A9B-A6D0-671D2DCEED52@dons.net.au> <1f0a3207-89fd-0ddb-6049-91f114381386@selasky.org> <366762AE-757E-4EB4-9A51-8B513FE7BC42@dons.net.au> From: Hans Petter Selasky Message-ID: <138601da-b6f9-f791-c6ef-ce54a4ae60e6@selasky.org> Date: Thu, 3 Oct 2019 10:11:00 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <366762AE-757E-4EB4-9A51-8B513FE7BC42@dons.net.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46kQhd0p91z3Hp5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-4.89 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-2.59)[ip: (-9.11), ipnet: 2a01:4f8::/29(-2.04), asn: 24940(-1.80), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 08:12:02 -0000 On 2019-10-03 09:37, O'Connor, Daniel wrote: > > >> On 3 Oct 2019, at 17:01, Hans Petter Selasky wrote: >> On 2019-10-03 08:56, O'Connor, Daniel wrote: >>> Most of USB-serial devices have "very stable" serial number:) >>> more than 50% have S/N "0123456789". >> >> It is also allowed to have no serial number. > > Yes, that's why I match sernum to '.+' to skip those. > >> Maybe some kind of "lstty" would do. >> >> -l - list all devices >> -s - match by serial >> -v - match by vendor >> -p - match by product >> -i - match by interface ID >> -t - type [USB/PCI] >> >> which simply output the tty number you need. Could be an API we could add to libusb. > > The problem is you can't modify some program to call a new API a lot of the time but it is usually trivial to change which serial port it's configured to use. > You don't need to change any program: cu /dev/cuaU`lstty -s SERIAL` --HPS From owner-freebsd-usb@freebsd.org Thu Oct 3 08:26:10 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E2F712DC37 for ; Thu, 3 Oct 2019 08:26:10 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [150.101.137.129]) by mx1.freebsd.org (Postfix) with ESMTP id 46kR0w02nhz3JjV for ; Thu, 3 Oct 2019 08:26:07 +0000 (UTC) (envelope-from darius@dons.net.au) Received: from ppp14-2-72-4.adl-apt-pir-bras31.tpg.internode.on.net (HELO midget.dons.net.au) ([14.2.72.4]) by ipmail06.adl2.internode.on.net with ESMTP; 03 Oct 2019 17:56:05 +0930 Received: from midget.dons.net.au (localhost [127.0.0.1]) by midget.dons.net.au (8.15.2/8.15.2) with ESMTPS id x938Pw0b023942 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 3 Oct 2019 17:55:59 +0930 (ACST) (envelope-from darius@dons.net.au) Received: (from mailnull@localhost) by midget.dons.net.au (8.15.2/8.15.2/Submit) id x938E5OZ013401 for ; Thu, 3 Oct 2019 17:44:05 +0930 (ACST) (envelope-from darius@dons.net.au) X-Authentication-Warning: midget.dons.net.au: mailnull set sender to using -f X-MIMEDefang-Relay-be813b1f1da6d6b27d681222cb70cc4f5b642383: 203.31.81.187 Received: from havok.gsoft.com.au (Havok.gsoft.com.au [203.31.81.187]) by ppp14-2-72-4.adl-apt-pir-bras31.tpg.internode.on.net (envelope-sender ) (MIMEDefang) with ESMTP id x938E0g1013395; Thu, 03 Oct 2019 17:44:05 +0930 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: USB serial ports by serial number From: "O'Connor, Daniel" In-Reply-To: <138601da-b6f9-f791-c6ef-ce54a4ae60e6@selasky.org> Date: Thu, 3 Oct 2019 17:43:59 +0930 Cc: Oleksandr Rybalko , freebsd-usb@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <40CAFE90-B8F6-4A9B-A6D0-671D2DCEED52@dons.net.au> <1f0a3207-89fd-0ddb-6049-91f114381386@selasky.org> <366762AE-757E-4EB4-9A51-8B513FE7BC42@dons.net.au> <138601da-b6f9-f791-c6ef-ce54a4ae60e6@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3445.104.11) X-Spam-Score: 0.4 () No, score=0.4 required=5.0 tests=KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Scanned-By: MIMEDefang 2.83 on 10.0.2.1 X-Rspamd-Queue-Id: 46kR0w02nhz3JjV X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of darius@dons.net.au has no SPF policy when checking 150.101.137.129) smtp.mailfrom=darius@dons.net.au X-Spamd-Result: default: False [4.75 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; AUTH_NA(1.00)[]; DMARC_NA(0.00)[dons.net.au]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_MEDIUM(0.97)[0.967,0]; NEURAL_SPAM_LONG(0.96)[0.963,0]; RCVD_IN_DNSWL_NONE(0.00)[129.137.101.150.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:4739, ipnet:150.101.0.0/16, country:AU]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(1.32)[ip: (2.78), ipnet: 150.101.0.0/16(2.51), asn: 4739(1.29), country: AU(0.01)] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 08:26:10 -0000 > On 3 Oct 2019, at 17:41, Hans Petter Selasky wrote: >=20 > On 2019-10-03 09:37, O'Connor, Daniel wrote: >>> On 3 Oct 2019, at 17:01, Hans Petter Selasky = wrote: >>> On 2019-10-03 08:56, O'Connor, Daniel wrote: >>>> Most of USB-serial devices have "very stable" serial number:) >>>> more than 50% have S/N "0123456789". >>>=20 >>> It is also allowed to have no serial number. >> Yes, that's why I match sernum to '.+' to skip those. >>> Maybe some kind of "lstty" would do. >>>=20 >>> -l - list all devices >>> -s - match by serial >>> -v - match by vendor >>> -p - match by product >>> -i - match by interface ID >>> -t - type [USB/PCI] >>>=20 >>> which simply output the tty number you need. Could be an API we = could add to libusb. >> The problem is you can't modify some program to call a new API a lot = of the time but it is usually trivial to change which serial port it's = configured to use. >=20 > You don't need to change any program: >=20 > cu /dev/cuaU`lstty -s SERIAL` That doesn't work in a lot of cases, eg serial port is in some other = configuration file. Even in rc.conf it would be tricky since that file is read so often. -- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum From owner-freebsd-usb@freebsd.org Thu Oct 3 10:42:18 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FF1E130D95 for ; Thu, 3 Oct 2019 10:42:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46kV2146s8z3RG6 for ; Thu, 3 Oct 2019 10:42:17 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id BBB142602CD; Thu, 3 Oct 2019 12:42:13 +0200 (CEST) Subject: Re: USB serial ports by serial number To: "O'Connor, Daniel" Cc: Oleksandr Rybalko , freebsd-usb@freebsd.org References: <40CAFE90-B8F6-4A9B-A6D0-671D2DCEED52@dons.net.au> <1f0a3207-89fd-0ddb-6049-91f114381386@selasky.org> <366762AE-757E-4EB4-9A51-8B513FE7BC42@dons.net.au> <138601da-b6f9-f791-c6ef-ce54a4ae60e6@selasky.org> From: Hans Petter Selasky Message-ID: <7f1aac2b-8184-e404-014b-543505e4ffab@selasky.org> Date: Thu, 3 Oct 2019 12:40:47 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46kV2146s8z3RG6 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-4.89 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-2.59)[ip: (-9.11), ipnet: 2a01:4f8::/29(-2.04), asn: 24940(-1.80), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 10:42:18 -0000 On 2019-10-03 10:13, O'Connor, Daniel wrote: > > >> On 3 Oct 2019, at 17:41, Hans Petter Selasky wrote: >> >> On 2019-10-03 09:37, O'Connor, Daniel wrote: >>>> On 3 Oct 2019, at 17:01, Hans Petter Selasky wrote: >>>> On 2019-10-03 08:56, O'Connor, Daniel wrote: >>>>> Most of USB-serial devices have "very stable" serial number:) >>>>> more than 50% have S/N "0123456789". >>>> >>>> It is also allowed to have no serial number. >>> Yes, that's why I match sernum to '.+' to skip those. >>>> Maybe some kind of "lstty" would do. >>>> >>>> -l - list all devices >>>> -s - match by serial >>>> -v - match by vendor >>>> -p - match by product >>>> -i - match by interface ID >>>> -t - type [USB/PCI] >>>> >>>> which simply output the tty number you need. Could be an API we could add to libusb. >>> The problem is you can't modify some program to call a new API a lot of the time but it is usually trivial to change which serial port it's configured to use. >> >> You don't need to change any program: >> >> cu /dev/cuaU`lstty -s SERIAL` > > That doesn't work in a lot of cases, eg serial port is in some other configuration file. > > Even in rc.conf it would be tricky since that file is read so often. > How about that we build the cuaX unit number by the location, and have a sysctl for that? unit = 0; while (hubdepth--) { unit *= numports; unit += portno - 1; } unit *= maxifaces; unit += device_get_unit(x); Typically this should fit into a 32-bit integer, but we could also use a 64-bit integer. --HPS From owner-freebsd-usb@freebsd.org Thu Oct 3 12:03:55 2019 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1707A13379D for ; Thu, 3 Oct 2019 12:03:55 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46kWrB2k8xz423c for ; Thu, 3 Oct 2019 12:03:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EB8B42602CD; Thu, 3 Oct 2019 14:03:51 +0200 (CEST) Subject: Re: USB serial ports by serial number From: Hans Petter Selasky To: "O'Connor, Daniel" Cc: Oleksandr Rybalko , freebsd-usb@freebsd.org References: <40CAFE90-B8F6-4A9B-A6D0-671D2DCEED52@dons.net.au> <1f0a3207-89fd-0ddb-6049-91f114381386@selasky.org> <366762AE-757E-4EB4-9A51-8B513FE7BC42@dons.net.au> <138601da-b6f9-f791-c6ef-ce54a4ae60e6@selasky.org> <7f1aac2b-8184-e404-014b-543505e4ffab@selasky.org> Message-ID: <0ed4830c-d2b2-65d4-5fe0-941ffeea40dd@selasky.org> Date: Thu, 3 Oct 2019 14:02:11 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <7f1aac2b-8184-e404-014b-543505e4ffab@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46kWrB2k8xz423c X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-4.89 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net:c]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-2.59)[ip: (-9.12), ipnet: 2a01:4f8::/29(-2.04), asn: 24940(-1.80), country: DE(-0.01)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2019 12:03:55 -0000 Hi, Can you try this patch: https://reviews.freebsd.org/D21886 --HPS