From nobody Thu Apr 21 20:51:57 2022 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 972EC11DD760 for ; Thu, 21 Apr 2022 20:52:06 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (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 4KkqTx36d5z3mv9 for ; Thu, 21 Apr 2022 20:52:05 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C4D205C0127; Thu, 21 Apr 2022 16:51:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 21 Apr 2022 16:51:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=farhan.codes; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1650574318; x= 1650660718; bh=WsDIxc7pK2C5uwLXCH7JOfV81ODF7cWnmbIQhVppKOY=; b=h Tx++bYrGsItObPyhXHJJyJVUp6Ts6yjl6yzMeidqVYTvpmBV8gcrecDUBM7mNOW2 VR40rtIISQSLko8Ml28ZLX9Y9/SGtnbR/fTN/VPqMvF//I5+7dRMbBCj11zBtdfm zFY2XIauTqcNqOQFgrI2CrBf8bxmQ+Zf1XuIiloKHMIrhgpcsJs51P0v4924dFgY zEM1yZwKCLOrsB0rbpWTy6cwHrT8RM+2XcDuJAiIjiNMRrpAtJeSlBbkEXOjN+PA pCmihwIWhLWnoCw3Dl04AFha56K718ufg7CXA4Lcv0a5XRT9ZXKq+ZQH+lDm+PMJ IiU4+xSG+tV9GZ1aWdByg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1650574318; x=1650660718; bh=WsDIxc7pK2C5uwLXCH7JOfV81ODF 7cWnmbIQhVppKOY=; b=NJdBORWo+gjPlChd4YfTVBAyvXIr3Vesj9RJDjgfK5qt fJOOhblJH6GB8ROxXasQqVCcye5EVZu8yayPaiYEZbtyQiYbrrQ1SeUDShKzdXpX ILgIOC6cUrNHOUgKEXW799EkPY3fOIf2wWHPo6IG+WcWcKQPpJF2zshaOTSsvdv2 CcpYs/0nK6fZUHEAk7ZoHKxHXD07JHYo4d6ASlF5z+ArAoV7Z3i8d5HMP/qKJnHG Sre4YK+Z9Vj+gEG0w1WDyvxGr5aMUi+5Bqjs0IuBRlAmmtIKIAT4JyB1wnneYs22 /BTQ6SQIzSdhlkzgQRt6fzt7wylZrlTzHu7nqiRQ6Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrtddvgdduheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkuffhvfffjghftggfggfgsehtje ertddtreejnecuhfhrohhmpefhrghrhhgrnhcumfhhrghnuceofhgrrhhhrghnsehfrghr hhgrnhdrtghouggvsheqnecuggftrfgrthhtvghrnhepieeugfefhfdvkeejhfffteeltd eivdduveetvdfhuefhhffhtdfgkeefffejtdegnecuffhomhgrihhnpehgihhthhhusgdr tghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hfrghrhhgrnhesfhgrrhhhrghnrdgtohguvghs X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 21 Apr 2022 16:51:58 -0400 (EDT) Message-ID: <7abdf40246e7f60d129b8e02451445d1f3a75883.camel@farhan.codes> Subject: Re: Trouble loading firmware to USB device From: Farhan Khan To: Hans Petter Selasky , freebsd-usb@freebsd.org Date: Thu, 21 Apr 2022 16:51:57 -0400 In-Reply-To: References: <9315bf6d-b9a9-89a2-9a32-aca9fd9cc015@farhan.codes> <007551144c601a21e2ec8133a8359323de29725f.camel@farhan.codes> <6fd2d680bf9edd969476f4544314235538c7fe41.camel@farhan.codes> <4f9a9bd7-28e4-99c7-6394-27368fafdbb1@selasky.org> <92f7b8ab463d057eea5490ff330e0ec955868efc.camel@farhan.codes> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.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-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4KkqTx36d5z3mv9 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=farhan.codes header.s=fm2 header.b="h Tx++bY"; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=NJdBORWo; dmarc=none; spf=pass (mx1.freebsd.org: domain of farhan@farhan.codes designates 66.111.4.28 as permitted sender) smtp.mailfrom=farhan@farhan.codes X-Spamd-Result: default: False [-4.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[farhan.codes:s=fm2,messagingengine.com:s=fm1]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.28]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[farhan.codes]; RWL_MAILSPIKE_GOOD(0.00)[66.111.4.28:from]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[farhan.codes:+,messagingengine.com:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[freebsd-usb]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:19151, ipnet:66.111.4.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.28:from] X-ThisMailContainsUnwantedMimeParts: N 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 status 0xea0a3 -------- Should this change make a difference to the interrupt issue? - Farhan