From nobody Sat Nov 13 07:05:21 2021 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 7FB70184199A for ; Sat, 13 Nov 2021 07:05:25 +0000 (UTC) (envelope-from freebsd-usb@dino.sk) Received: from mailhost.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrmgS3gkDz4mCj for ; Sat, 13 Nov 2021 07:05:24 +0000 (UTC) (envelope-from freebsd-usb@dino.sk) Received: from zeta.dino.sk (fw3.dino.sk [84.245.95.254]) (AUTH: LOGIN milan, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mailhost.netlabit.sk with ESMTPSA; Sat, 13 Nov 2021 08:05:22 +0100 id 00DCA815.618F63B2.0000E4AA Date: Sat, 13 Nov 2021 08:05:21 +0100 From: Milan Obuch To: freebsd-usb@freebsd.org Subject: Re: USBDMSC emulated device does not work on FreeBSD Message-ID: <20211113080521.5e4798d7@zeta.dino.sk> In-Reply-To: <37a6b45a-be34-4216-d038-62f1c440037c@selasky.org> References: <20211112095915.226af6be@zeta.dino.sk> <6a6850f5-8233-aae7-8e65-42594402fcb5@selasky.org> <20211112120714.73f195a9@zeta.dino.sk> <972a650d-d490-1965-13a4-2fb984531f1d@selasky.org> <20211112121806.2db2a908@zeta.dino.sk> <85cdc03e-e8f1-871c-6e1d-66181e45dcb1@selasky.org> <20211112123438.6305fc56@zeta.dino.sk> <20211112140045.018ebf0c@zeta.dino.sk> <571bda62-b86c-a5b0-fcc6-f70102b85db7@selasky.org> <20211112142200.7947d6b2@zeta.dino.sk> <3f2a86d6-6906-d5a3-45ad-3b1c7ce1a345@selasky.org> <37a6b45a-be34-4216-d038-62f1c440037c@selasky.org> X-Mailer: Claws Mail 3.18.0git295 (GTK+ 2.24.33; i386-portbld-freebsd11.4) 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=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HrmgS3gkDz4mCj X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-usb@dino.sk designates 84.245.65.72 as permitted sender) smtp.mailfrom=freebsd-usb@dino.sk X-Spamd-Result: default: False [-1.30 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dino.sk]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:5578, ipnet:84.245.64.0/18, country:SK]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Fri, 12 Nov 2021 15:22:13 +0100 I wrote: > On Fri, 12 Nov 2021 14:26:32 +0100 > Hans Petter Selasky wrote: > > > On 11/12/21 14:25, Hans Petter Selasky wrote: > > > hw.usb.quirk.0="0x1514 0x0001 0 0xffff UQ_MSC_NO_SYNC_CACHE" > > > hw.usb.quirk.0="0x1514 0x0001 0 0xffff UQ_NO_STRINGS" > > > > Should be "1" for second quirk. > > > > hw.usb.quirk.0="0x1514 0x0001 0 0xffff UQ_MSC_NO_SYNC_CACHE" > > hw.usb.quirk.1="0x1514 0x0001 0 0xffff UQ_NO_STRINGS" > > > > --HPS > > > > Thanks for hint, it works now. For some reason, only one quirk works > on system under test (it is 12.2-STABLE, r368192). I checked it with > 'usbconfig dump_device_quirks', just the second one was shown. For > completeness, necessary lines in loader.conf files are > > usb_quirk_load=YES > hw.usb.quirk.0="0x1514 0x0001 0 0xffff UQ_NO_STRINGS" > hw.usb.quirk.1="0x1514 0x0001 0 0xffff UQ_MSC_NO_SYNC_CACHE" > > (I think UQ_NO_STRINGS could be omitted, did not test without, but > 'usbconfig dump_device_quirks | grep 1514' outputs just > > VID=0x1514 PID=0x0001 REVLO=0x0000 REVHI=0xffff > QUIRK=UQ_MSC_NO_SYNC_CACHE > > nothing more.) > > I am reading from /dev/da0 now... next check would be write, I'll test > later. If you'd like me to test anything else, just drop a note. > > Again, thanks for help. > > Regards, > Milan > [ Follow-up to my mail ] After looking a bit into man page, I found it is actually easy to do it without reboot (which is important for my main workstation, otherwise I'd have to reopen quite a number of various windows...). Also, it looks like some bug in loader makes it not possible to add more than one quirk on boot time, which I can 'fix' from shell: kldload usb_quirk usbconfig add_dev_quirk_vplh 0x1514 0x0001 0 0xffff UQ_NO_STRINGS usbconfig add_dev_quirk_vplh 0x1514 0x0001 0 0xffff UQ_MSC_NO_SYNC_CACHE Now I can get expected info from 'usbconfig -d ugen1.3 dump_all_desc' command: ugen1.3: at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA) bLength = 0x0012 bDescriptorType = 0x0001 bcdUSB = 0x0200 bDeviceClass = 0x0000 bDeviceSubClass = 0x0000 bDeviceProtocol = 0x0000 bMaxPacketSize0 = 0x0040 idVendor = 0x1514 idProduct = 0x0001 bcdDevice = 0x3000 iManufacturer = 0x0001 iProduct = 0x0002 iSerialNumber = 0x0003 <123456789ABCDEF151411111> bNumConfigurations = 0x0001 Configuration index 0 bLength = 0x0009 bDescriptorType = 0x0002 wTotalLength = 0x0020 bNumInterfaces = 0x0001 bConfigurationValue = 0x0001 iConfiguration = 0x0004 bmAttributes = 0x00c0 bMaxPower = 0x0032 Interface 0 bLength = 0x0009 bDescriptorType = 0x0004 bInterfaceNumber = 0x0000 bAlternateSetting = 0x0000 bNumEndpoints = 0x0002 bInterfaceClass = 0x0008 bInterfaceSubClass = 0x0006 bInterfaceProtocol = 0x0050 iInterface = 0x0005 Endpoint 0 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0081 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x00ff bRefresh = 0x0000 bSynchAddress = 0x0000 Endpoint 1 bLength = 0x0007 bDescriptorType = 0x0005 bEndpointAddress = 0x0001 bmAttributes = 0x0002 wMaxPacketSize = 0x0200 bInterval = 0x00ff bRefresh = 0x0000 bSynchAddress = 0x0000 and 'usbconfig show_ifdrv' relevant lines are ugen1.3: at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA) ugen1.3.0: umass0: Relevant lines in console log/dmesg: ugen1.3: at usbus1 umass0 on uhub3 umass0: Removable Direct Access SPC-2 SCSI device da0: 40.000MB/s transfers da0: 7457MB (15273600 512 byte sectors) da0: quirks=0x2 Now, 'gpart show da0' displays expected partitioning data, I can 'mount_msdosfs /dev/da0p2 /media' and access files there as needed. Thanks for really valuable help, highly appreciated. Regards, Milan