From nobody Sat Jan 20 07:53:58 2024 X-Original-To: freebsd-usb@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 4TH7zH2z8Qz58Th6 for ; Sat, 20 Jan 2024 07:54:03 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TH7zH0PM5z4DyS for ; Sat, 20 Jan 2024 07:54:02 +0000 (UTC) (envelope-from guru@unixarea.de) Authentication-Results: mx1.freebsd.org; none Received: from [188.174.54.150] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rR6Ay-007h9F-6w; Sat, 20 Jan 2024 08:54:00 +0100 Received: from localhost.my.domain (c720-1400094 [127.0.0.1]) by localhost.unixarea.de (8.17.1/8.14.9) with ESMTP id 40K7rxTr001839; Sat, 20 Jan 2024 08:53:59 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.17.1/8.14.9/Submit) id 40K7rw1d001838; Sat, 20 Jan 2024 08:53:58 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Sat, 20 Jan 2024 08:53:58 +0100 From: Matthias Apitz To: Gary Jennejohn Cc: freebsd-usb@freebsd.org Subject: Re: USB key is 2.0 or 3.0 Message-ID: Reply-To: Matthias Apitz Mail-Followup-To: Gary Jennejohn , freebsd-usb@freebsd.org References: <20240118142634.69f7d675@ernst.home> <20240119152419.03ddec41@ernst.home> List-Id: FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-usb List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240119152419.03ddec41@ernst.home> X-Operating-System: FreeBSD 14.0-CURRENT r1400094 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 188.174.54.150 X-Rspamd-Queue-Id: 4TH7zH0PM5z4DyS X-Spamd-Bar: ---- 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:42730, ipnet:178.254.0.0/19, country:DE] El día viernes, enero 19, 2024 a las 02:24:19p. m. +0000, Gary Jennejohn escribió: > You could try running usbdump(8). Be aware that you need device bpf and > perhaps options DEV_BPF in your kernel config file if you aren't running a > GENERIC kernel. > > usbdump has to be run as root. > > I tried it with a USB3 and a USB2 thumb drive, plugging both into a USB3 > port. > > I used this command line: usbdump -d ugenX.Y -s 256 -w /tmp/USB{2,3} to > save the output and then usbdump -r /tmp/USB{2,3} to get the user > readable text. > > You'll probably want to use different names for the -w file names. > > I simply plugged in and unplugged each thumb drive and then stopped > usbdump. > > The USB3 thumb drive always showed SPD=SUPER and the USB2 thumb drive > always showed SPD=HIGH in the user readable text. > > So, if your disk shows SPD=SUPER and the thumb drives show SPD=HIGH > then the thumb drives are NOT USB3. I did the above tests with the 'hama' USB key; it shows: $ tail -5 hama.dmp.txt 08:15:12.873247 usbus0.4 DONE-BULK-EP=00000002,SPD=HIGH,NFR=1,SLEN=0,IVAL=0,ERR=0 08:15:12.873254 usbus0.4 SUBM-BULK-EP=00000081,SPD=HIGH,NFR=1,SLEN=0,IVAL=0 08:15:12.874636 usbus0.4 DONE-BULK-EP=00000081,SPD=HIGH,NFR=1,SLEN=36,IVAL=0,ERR=0 08:15:12.874642 usbus0.4 SUBM-BULK-EP=00000081,SPD=HIGH,NFR=1,SLEN=0,IVAL=0 08:15:12.874884 usbus0.4 DONE-BULK-EP=00000081,SPD=HIGH,NFR=1,SLEN=16,IVAL=0,ERR=0 Then I used an extrernal Western Digital USB disk, which presents itself in /var/log/messages as: Jan 20 08:36:07 c720-1400094 kernel: usb_msc_auto_quirk: UQ_MSC_NO_GETMAXLUN set for USB mass storage device Western Digital Elements 2621 (0x1058:0x2621) Jan 20 08:36:07 c720-1400094 kernel: usb_msc_auto_quirk: UQ_MSC_NO_TEST_UNIT_READY set for USB mass storage device Western Digital Elements 2621 (0x1058:0x2621) Jan 20 08:36:09 c720-1400094 kernel: usb_msc_auto_quirk: UQ_MSC_NO_SYNC_CACHE set for USB mass storage device Western Digital Elements 2621 (0x1058:0x2621) Jan 20 08:36:09 c720-1400094 kernel: usb_msc_auto_quirk: UQ_MSC_NO_PREVENT_ALLOW set for USB mass storage device Western Digital Elements 2621 (0x1058:0x2621) Jan 20 08:36:09 c720-1400094 kernel: usb_msc_auto_quirk: UQ_MSC_NO_TEST_UNIT_READY set for USB mass storage device Western Digital Elements 2621 (0x1058:0x2621) Jan 20 08:36:09 c720-1400094 kernel: usb_msc_auto_quirk: UQ_MSC_NO_START_STOP set for USB mass storage device Western Digital Elements 2621 (0x1058:0x2621) Jan 20 08:36:09 c720-1400094 kernel: ugen0.4: at usbus0 Jan 20 08:36:09 c720-1400094 kernel: umass0 on uhub0 Jan 20 08:36:09 c720-1400094 kernel: umass0: on usbus0 Jan 20 08:36:09 c720-1400094 kernel: umass0: SCSI over Bulk-Only; quirks = 0xc105 Jan 20 08:36:09 c720-1400094 kernel: umass0:1:0: Attached to scbus1 Jan 20 08:36:10 c720-1400094 kernel: da0 at umass-sim0 bus 0 scbus1 target 0 lun 0 Jan 20 08:36:10 c720-1400094 kernel: da0: Fixed Direct Access SPC-4 SCSI device Jan 20 08:36:10 c720-1400094 kernel: da0: Serial Number 57584B314132394152334B33 Jan 20 08:36:10 c720-1400094 kernel: da0: 400.000MB/s transfers Jan 20 08:36:10 c720-1400094 kernel: da0: 1907697MB (3906963456 512 byte sectors) Jan 20 08:36:10 c720-1400094 kernel: da0: quirks=0x2 Jan 20 08:36:17 c720-1400094 kernel: ugen0.4: at usbus0 (disconnected) and the usbdump shows: $ tail -5 WD.dmp.txt 08:36:10.663903 usbus0.4 DONE-BULK-EP=00000002,SPD=SUPER,NFR=1,SLEN=0,IVAL=0,ERR=0 08:36:10.663906 usbus0.4 SUBM-BULK-EP=00000081,SPD=SUPER,NFR=1,SLEN=0,IVAL=0 08:36:10.664158 usbus0.4 DONE-BULK-EP=00000081,SPD=SUPER,NFR=1,SLEN=512,IVAL=0,ERR=0 08:36:10.664161 usbus0.4 SUBM-BULK-EP=00000081,SPD=SUPER,NFR=1,SLEN=0,IVAL=0 08:36:10.664411 usbus0.4 DONE-BULK-EP=00000081,SPD=SUPER,NFR=1,SLEN=16,IVAL=0,ERR=0 Thanks in advance for further comments matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub I am not at war with Russia. Я не воюю с Россией. Ich bin nicht im Krieg mit Russland.