From owner-freebsd-usb@freebsd.org Fri May 7 21:41:15 2021 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 7251763DACA for ; Fri, 7 May 2021 21:41:15 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FcP5l2bkxz3PqP; Fri, 7 May 2021 21:41:15 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.not-for.work (onlyone.not-for.work [IPv6:2a01:4f8:201:6350::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: lev/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 348C487C6; Fri, 7 May 2021 21:41:15 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from [IPv6:2001:470:923f:1:c551:9512:4a6f:7c39] (unknown [IPv6:2001:470:923f:1:c551:9512:4a6f:7c39]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.not-for.work (Postfix) with ESMTPSA id ACAF73E09; Sat, 8 May 2021 00:41:11 +0300 (MSK) Reply-To: lev@FreeBSD.org Subject: Re: Flickering connection to UPS (again, but now I'm sure it is Ok under Windows) To: Hans Petter Selasky , freebsd-usb@freebsd.org References: <98420b49-dc9a-0a5f-bcfe-e0a0e11a5994@selasky.org> <0c52bcf1-3b1a-a746-9ac3-26bdb4c46354@FreeBSD.org> <6e52d05d-8668-8c38-6745-a4edec50741d@selasky.org> <9a7b3be1-d606-cca6-d6c0-7ebefdfd4753@FreeBSD.org> <0814e5e8-45dd-14c8-3206-40eab0dc286e@selasky.org> From: Lev Serebryakov Organization: FreeBSD Message-ID: <035b4eb7-58bd-8555-3416-39e0ec0a665e@FreeBSD.org> Date: Sat, 8 May 2021 00:41:10 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <0814e5e8-45dd-14c8-3206-40eab0dc286e@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 May 2021 21:41:15 -0000 On 07.05.2021 17:14, Hans Petter Selasky wrote: >> ster kernel: xhci_roothub_exec: port status=0x000202a0 >> May  7 14:39:08 hamster kernel: xhci_roothub_exec: type=0x23 request=0x01 wLen=0x0000 wValue=0x0010 wIndex=0x0002 >> May  7 14:39:08 hamster kernel: xhci_roothub_exec: UR_CLEAR_PORT_FEATURE >> May  7 14:39:08 hamster kernel: xhci_device_state_change: May  7 14:39:08 hamster kernel: ugen0.6: at usbus0 (disconnected) > > The value reported by XHCI PORTSC, 0x000202a0, indicates: > > BIT5-8 : 5) Link is in the RxDetect State > BIT9 : Port Power (PP) – RWS. Default = ‘1’ > BIT17 : Connect Status Change (CSC) > > It is clear that the XHCI controller has received a disconnect event from the UPS. > Can you check the other OS'es where this supposedly does not happen, if the UPS device attaches to the XHCI or EHCI controller? Windows 10 Device Manager shows it under "Intel(R) USB 3.1 eXtensible Host Controller". This laptop (with Windows 10) has only USB-C ports... I've captured sessions on Windows with "Device Monitoring Studio" and WireShark (it was two sessions, not one) and uploaded them at http://lev.serebryakov.spb.ru/_sklad/ups/ ups-windows-dms.dump - dump from "Device Monitoring Studio" ups-windows-dms.log - log from "Device Monitoring Studio" ups-windows-wireshark.pcapng - dump from WireShark ups-windows-wireshark.txt - dissection export from WireShark. My FreeBSD laptop (Lenovo T540p) has both USB 2.0 an USB 3.0 ports, and UPS flickers in both. > Did you start any driver for the UPS? On FreeBSD — I'm not (`nut` supports this UPS, but it detects device slower than UPS stay connected). Windows 10, Windows installs something generic and not very useful (it shows battery level as 0%), but "provided" software (very crude one) works and shows plausible information. Windows 10 shows it as "HID UPS Battery" in device manager. -- // Lev Serebryakov