From nobody Tue Mar 29 18:10:07 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 8BAAE1A39644 for ; Tue, 29 Mar 2022 18:10:31 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (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 4KSd061XGVz4pxF for ; Tue, 29 Mar 2022 18:10:29 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 9D8143202234 for ; Tue, 29 Mar 2022 14:10:28 -0400 (EDT) Received: from imap45 ([10.202.2.95]) by compute5.internal (MEProxy); Tue, 29 Mar 2022 14:10:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=farhan.codes; h= cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm2; bh=N PRdXTfUsuWQAADtUhym0nmJS9IqV4cOZUyN+0TBIjs=; b=T/ZeSeq/qC8+HQPK/ P/oi+LO9iL+D8xAvNenbnl8TI3L6Z5U/D4Qj9mivunGCcdgy/oJxJIL4QdHkP3ts Hbb1cDnX7vMMcwdkdIv8tVkF5yJ9vzQwjzcV0xtInhCexP7rk4juQ6I4VfACDkYI V9qGgD+DiaDKQw10AdObLz/RSGv/jjIJpa1m92+oavu/hOsC3i0E6WwWlzu3elBy I19lw8pSjZ5igVq3v4Vm+cnujxJz7UC600Fmokffr6CTIrH8r4xLyWp7hbBYVIYx p8CjfBM+TAlKuquGLJjwAor7TTGlvfmkSiJZiTVxqjP1MoOoyunwUCSvUDViYKWJ rTEgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=NPRdXTfUsuWQAADtUhym0nmJS9IqV4cOZUyN+0TBI js=; b=XKJ522BDjo/+iR7B372A4Zy1UXiLYWURR0M5TEOoRvZUxRWRBd0KYYRPe 2BpLxc3MAzWby0imiah9vaw6+wwZWG2YDy+trjII28Q41IHhyj9I+Klte0aKZtaU f7TPmz+BU2Htyk205aHqqs7zKzUJSjd75slIxhpt/yRz9L3FbO2286aVXAAf0MpB wR69l60WYAA2UXJryTM08D5Bewdb7MzPGsuPWk/VJfsEs7phCq9FjK5ucLLJoLO9 vXBjTVTeQTTAG6Dt38GKfzws0qPZRLz23mktdDe1nW4uW8lXUU57dCTeTt9XinDH sdSz56keLoaX+oFnq5vc9L4ei7hWQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeitddgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd erredtnecuhfhrohhmpedfhfgrrhhhrghnucfmhhgrnhdfuceofhgrrhhhrghnsehfrghr hhgrnhdrtghouggvsheqnecuggftrfgrthhtvghrnhepieejtdegteevhfegvdefieeghe ethfduudffkeevffejueegudevfeffuddvheegnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomhepfhgrrhhhrghnsehfrghrhhgrnhdrtghouggvsh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 13FDE24A0074; Tue, 29 Mar 2022 14:10:27 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4911-g925b585eab-fm-20220323.003-g925b585e 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 Message-Id: <55adbaa5-27d3-451d-9320-a1966f167498@www.fastmail.com> Date: Tue, 29 Mar 2022 14:10:07 -0400 From: "Farhan Khan" To: freebsd-usb@freebsd.org Subject: Why receiving USB_ERR_CANCELLED error during initial Rx transfer Content-Type: text/plain X-Rspamd-Queue-Id: 4KSd061XGVz4pxF X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=farhan.codes header.s=fm2 header.b="T/ZeSeq/"; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=XKJ522BD; dmarc=none; spf=pass (mx1.freebsd.org: domain of farhan@farhan.codes designates 64.147.123.20 as permitted sender) smtp.mailfrom=farhan@farhan.codes X-Spamd-Result: default: False [-3.59 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[farhan.codes:s=fm2,messagingengine.com:s=fm3]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[farhan.codes]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.20]; DKIM_TRACE(0.00)[farhan.codes:+,messagingengine.com:+]; 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_WWW(0.50)[]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.20:from] X-ThisMailContainsUnwantedMimeParts: N Hi all, I am trying to send the initial "wakeup" USB Rx interrupt packet via usbd_transfer_start(), but after running the callback with USB_ST_SETUP, I receive another callback with USB_ERR_CANCELLED as the value of usb_error_t. What might be causing the cancellation? Detailed explanation: I am opening the pipes, then immediately running usbd_transfer_start() on the Rx Interrupt with this: usbd_transfer_start(usc->usc_xfer[ATHN_RX_INTR]); The callback function runs this: case USB_ST_SETUP: usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); usbd_transfer_submit(xfer); break; The next time the callback is invoked, the USB_GET_STATE macro reports USB_ST_ERROR with the value being USB_ERR_CANCELLED. The manual page suggests that this is the result of a transfer currently happening, but I am not clear on the issue. I have both set and disabled pipe_bof on the Rx Interrupt with the same result. I borrowed the above code from the otus(4) driver. Please assist. Thanks! -- Farhan Khan PGP Fingerprint: 1312 89CE 663E 1EB2 179C 1C83 C41D 2281 F8DA C0DE