From nobody Thu Apr 21 17:51:47 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 E2AF911CA435 for ; Thu, 21 Apr 2022 17:51:52 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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 4KklTz1tcTz4lbm for ; Thu, 21 Apr 2022 17:51:50 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 532D532032B2; Thu, 21 Apr 2022 13:51:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 21 Apr 2022 13:51:49 -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=1650563508; x= 1650649908; bh=IKBhdjFwIKCCGqYq6M3Ws6vd3S4T1ZVsM99BD+A/9VE=; b=V Oa0W6myu/ZBsuimAm85jcw7w2730nD14sLCpZiVs4SBI1ROUMD2s/eCx3ZirSReO XpFQDtQkfQ+uH0zv9+IkfG+qe8GNZG59NQtTKzGNQxk9wEKoN8NHOXmJMXL0DgNU 0RFcjowwS/q35pgBdR53mUN0Fg9AwYQ3cZFi+Grv1DFJUQ8JF56C2B2f4guS9lni a/EI2F73skEoRRHHd4tevrGzBkxlrDXPzvNfoufiTRcv5T3A8pdZwcb+nUz508Hf +j/SZgGam7sMmC7sc8tsz7sklQufjnKZ8OyyIJ0ifU5pF2FlK1n1jMU6nT0M4cXT 9SlYZ5p6pyHiKnT5SlRsw== 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=1650563508; x=1650649908; bh=IKBhdjFwIKCCGqYq6M3Ws6vd3S4T 1ZVsM99BD+A/9VE=; b=hOjNTh0tKLKe6U7+Rqdb2LlWPvydGgK4yVCzFKXLxyZ0 Zx1W0UEpZ6kpxbnd8nVx8JKTAR1asqpiUPZ6Z/J3fWfh68mQaq90X0EsAeX/vS7E QrtO7Nq/Oz00nBkjdtxenXEFjGEaaRxkrXVhZWtZQoQrFj0E1TkBJks45nRWZmjg Fg7AftWwZFTi3CGxjP0oByxYV2VnPlYZKcyOQdyKwT/TsflMaIHMgB7OEA/FmXVc hE0NhFWMh+v3AiBnhF2NKSg49zgGKKz5wKmt+gAycNDUbvA4LLG4c3xEVf+fAmhA GdZVTCC5Zje4A44aUblc6jvXG9BqgJMvTb4K1Qq8jw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrtddvgdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkuffhvfffjghftggfggfgsehtke ertddtreejnecuhfhrohhmpefhrghrhhgrnhcumfhhrghnuceofhgrrhhhrghnsehfrghr hhgrnhdrtghouggvsheqnecuggftrfgrthhtvghrnhepheeukeffffffhfejtefgveefge dvgfffledttdefjeevveeghffgleejgeffgfeknecuffhomhgrihhnpehgihhthhhusgdr tghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hfrghrhhgrnhesfhgrrhhhrghnrdgtohguvghs X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 21 Apr 2022 13:51:48 -0400 (EDT) Message-ID: <92f7b8ab463d057eea5490ff330e0ec955868efc.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 13:51:47 -0400 In-Reply-To: <4f9a9bd7-28e4-99c7-6394-27368fafdbb1@selasky.org> References: <9315bf6d-b9a9-89a2-9a32-aca9fd9cc015@farhan.codes> <007551144c601a21e2ec8133a8359323de29725f.camel@farhan.codes> <6fd2d680bf9edd969476f4544314235538c7fe41.camel@farhan.codes> <4f9a9bd7-28e4-99c7-6394-27368fafdbb1@selasky.org> 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: 8bit X-Rspamd-Queue-Id: 4KklTz1tcTz4lbm X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=farhan.codes header.s=fm2 header.b="V Oa0W6m"; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=hOjNTh0t; dmarc=none; spf=pass (mx1.freebsd.org: domain of farhan@farhan.codes designates 64.147.123.19 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:64.147.123.19]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[farhan.codes]; 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:29838, ipnet:64.147.123.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.19:from] X-ThisMailContainsUnwantedMimeParts: N On Thu, 2022-04-21 at 07:57 +0200, Hans Petter Selasky wrote: > Hi, > > 8) usbdump will answer this question. > > I see some more bugs: > >         [ATHN_RX_INTR] = { >                 .type = UE_INTERRUPT, >                 .endpoint = 0x83, // AR_PIPE_RX_INTR, >                 .direction = UE_DIR_ANY, >                               ^^^^ try to use UE_DIR_RX here, else > you might > bind for TX! > > And use UE_DIR_TX for TX. Ditto for the other transfers. Any change? > > Second note, is that you should set some buffer size for the > non-interrupt endpoints, else the buffer size will only be > wMaxPacketSize bytes big! > > --HPS Hi Hans! I did both, but there is no change in the behavior, 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 Still not working :/ - Farhan ----- static const struct usb_config athn_config_common[ATHN_N_TRANSFERS] = { [ATHN_TX_DATA] = { .type = UE_BULK, .endpoint = 0x01, // AR_PIPE_TX_DATA, .direction = UE_DIR_TX, .flags = { .short_xfer_ok = 1, // .force_short_xfer = 1, .pipe_bof = 1 }, .callback = athn_data_tx_callback, .bufsize = 0x200, }, [ATHN_RX_DATA] = { .type = UE_BULK, .endpoint = 0x82, //AR_PIPE_RX_DATA, .direction = UE_DIR_RX, .flags = { .short_xfer_ok = 1, // .force_short_xfer = 1, .pipe_bof = 1 }, .callback = athn_data_rx_callback, .bufsize = 0x200, }, [ATHN_RX_INTR] = { .type = UE_INTERRUPT, .endpoint = 0x83, // AR_PIPE_RX_INTR, .direction = UE_DIR_RX, .flags = { .short_xfer_ok = 1, // .force_short_xfer = 1, .pipe_bof = 1 }, .callback = athn_usb_intr, .bufsize = 0x40, // .callback = athn_intr_rx_callback, }, [ATHN_TX_INTR] = { .type = UE_INTERRUPT, .endpoint = 0x04, //AR_PIPE_TX_INTR, .direction = UE_DIR_TX, .flags = { .short_xfer_ok = 1, // .force_short_xfer = 1, .pipe_bof = 1 }, .callback= athn_intr_tx_callback, .bufsize = 0x40, } }; -----