From nobody Wed Apr 27 07:41:27 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 BB8291AA9653 for ; Wed, 27 Apr 2022 07:41:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 4Kp9g43nBZz57L7 for ; Wed, 27 Apr 2022 07:41:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.36.2.165] (unknown [176.74.213.87]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 80C23260222; Wed, 27 Apr 2022 09:41:29 +0200 (CEST) Message-ID: <05b3c211-2b77-7e59-a9da-d28a21d5b389@selasky.org> Date: Wed, 27 Apr 2022 09:41:27 +0200 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: Trouble loading firmware to USB device Content-Language: en-US From: Hans Petter Selasky To: Farhan Khan , freebsd-usb@freebsd.org 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> <7abdf40246e7f60d129b8e02451445d1f3a75883.camel@farhan.codes> <7fc346b1-b70d-8e29-860d-5ed0988a7838@selasky.org> <9ca0e355-d780-f9c0-4d38-b99662f43edd@selasky.org> In-Reply-To: <9ca0e355-d780-f9c0-4d38-b99662f43edd@selasky.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Kp9g43nBZz57L7 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-3.29 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.994]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[freebsd-usb]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 4/25/22 10:21, Hans Petter Selasky wrote: > >>  status 0xeb023 >> >> >> 12:25:07.785438 usbus3.3 >> SUBM-INTR-EP=00000083,SPD=HIGH,NFR=1,SLEN=0,IVAL=1 >>  frame[0] READ 1024 bytes >>  flags 0xa > > You are asking for 1024 bytes. Try asking for only 64 bytes instead, > same as one wMaxPacket, before submitting the job. Hi Farhan, > So my question is, where am I reading 1024 bytes, such that I need to change > it to 64? Somewhere in the code you are asking for a read of 1024 bytes on the interrupt endpoint. That is what usbdump says. That means multiple packets will have to be received for it to complete. I'm not sure exactly where the problem is, but can you add a print here: > case USB_ST_SETUP: > printf("====USB_ST_SETUP athn_usb_intr\n"); > usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); printf("FRAME LENGTH = %d\n", usbd_xfer_max_len(xfer)); > usbd_transfer_submit(xfer); Also make sure there is only one instance of your .ko in /boot/kernel or /boot/modules, that you are not loading an old version of the built .ko. --HPS