From owner-freebsd-usb@freebsd.org Sun May 9 18:53:07 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 4217563F5DF for ; Sun, 9 May 2021 18:53:07 +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) 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 4FdYGp1jzwz3n0S; Sun, 9 May 2021 18:53:05 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2020.home.selasky.org (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 3BBFE2600DD; Sun, 9 May 2021 20:52:58 +0200 (CEST) Subject: Re: Flickering connection to UPS (again, but now I'm sure it is Ok under Windows) To: lev@FreeBSD.org, 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> <035b4eb7-58bd-8555-3416-39e0ec0a665e@FreeBSD.org> From: Hans Petter Selasky Message-ID: Date: Sun, 9 May 2021 20:51:40 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <035b4eb7-58bd-8555-3416-39e0ec0a665e@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FdYGp1jzwz3n0S 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 [-1.40 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[88.99.82.50:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[selasky.org]; NEURAL_SPAM_SHORT(0.90)[0.901]; SPAMHAUS_ZRD(0.00)[88.99.82.50:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; 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]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-usb]; RCVD_COUNT_TWO(0.00)[2] 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: Sun, 09 May 2021 18:53:07 -0000 On 5/7/21 11:41 PM, Lev Serebryakov wrote: > 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. > Hi, Could you do: usbdump -i usbusX -f Y -s 65536 -vvv Where X.Y are the numbers after ugen for this device. Are you certain that NUT only execute exactly the same commands like the windows tool for this UPS? Does apcupsd work for this device too? I've never used NUT myself. --HPS