Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Apr 2022 16:51:57 -0400
From:      Farhan Khan <farhan@farhan.codes>
To:        Hans Petter Selasky <hps@selasky.org>, freebsd-usb@freebsd.org
Subject:   Re: Trouble loading firmware to USB device
Message-ID:  <7abdf40246e7f60d129b8e02451445d1f3a75883.camel@farhan.codes>
In-Reply-To: <d6157001-deaa-fed9-a8b0-cb46cc969206@selasky.org>
References:  <f47b9415c262267d5c2505463b54f58ceaf76315.camel@farhan.codes> <d27787a2-eb6b-25dc-2d0d-56af4184032b@selasky.org> <9315bf6d-b9a9-89a2-9a32-aca9fd9cc015@farhan.codes> <dfc1cd8a-75a9-6637-e721-83d134910185@selasky.org> <007551144c601a21e2ec8133a8359323de29725f.camel@farhan.codes> <d2253b56-3174-ae31-078c-ba43bb3c7fc2@selasky.org> <6fd2d680bf9edd969476f4544314235538c7fe41.camel@farhan.codes> <4f9a9bd7-28e4-99c7-6394-27368fafdbb1@selasky.org> <92f7b8ab463d057eea5490ff330e0ec955868efc.camel@farhan.codes> <d6157001-deaa-fed9-a8b0-cb46cc969206@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2022-04-21 at 20:19 +0200, Hans Petter Selasky wrote:
> On 4/21/22 19:51, Farhan Khan wrote:
> > The usb_config is listed below. I got the bufsize's by running
> > `lsusb`
> > on Linux, but it should be the same basic output from FreeBSD
> > tools. A
> > link to my latest commit is here:
> > https://github.com/khanzf/freebsd/blob/30fe0bd7677f07fd290e4150ccec620b7b09d532/sys/dev/athn/usb/if_athn_usb.c#L249
> 
> bufsize from lsusb is just wMaxPacketSize and is not correct. You
> need 
> to check the driver how big transfers it is doing per endpoint.
> 
> Can you capture all traffic using "usbdump -i usbusX -f Y -s 256 -
> vvv" 
> after you load the driver?
> 
> --HPS

I fooled around a bit with `-f Y`, because I was not certain if the
offset was 0 or 1, but I think (could be wrong) the value for the
interrupt and what the data is loaded over is interrupt 3.

It appears to me that the size of the interrupt is 1024 based on this:

-------
$ sudo usbdump -i usbus3  -s 256 -vvv -f 3
16:46:25.723242 usbus3.3 SUBM-CTRL-
EP=00000000,SPD=HIGH,NFR=2,SLEN=1024,IVAL=0
 frame[0] WRITE 0 bytes
 frame[1] WRITE 1024 bytes
 flags 0x10 <PROXY_BUFFER|0>
 status 0xea0a3
<OPEN|TRANSFERRING|STARTED|CONTROL_XFR|BDMA_ENABLE|BDMA_SETUP|CURR_DMA_
SET|CAN_CANCEL_IMMED|DOING_CALLBACK|0>
--------

Should this change make a difference to the interrupt issue?

- Farhan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7abdf40246e7f60d129b8e02451445d1f3a75883.camel>