From owner-freebsd-usb@freebsd.org Tue Mar 3 03:42:51 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AA48264257 for ; Tue, 3 Mar 2020 03:42:51 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48WjWr61yvz4FbQ for ; Tue, 3 Mar 2020 03:42:48 +0000 (UTC) (envelope-from farhan@farhan.codes) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E295C20C86; Mon, 2 Mar 2020 22:42:47 -0500 (EST) Received: from imap35 ([10.202.2.85]) by compute1.internal (MEProxy); Mon, 02 Mar 2020 22:42:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=farhan.codes; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm2; bh=APIZEvhCDmpwUGbiXWk5Ot5A3qGMawL 2bd6bUzLBtMQ=; b=vPL6Hb53AdH21Om6LaQEgGQAZ3MPlFER8zbm96AMNmMXOd+ PKijfC8ru5JkS+c3K13yfv2Zng9wToCHjQSxbnLpTIqpZymvSuMKW75TVB7mrKUG hJLVpTO+/dg0cKXsw5JuphVvfVCtT7xdnu6meZ4BG5TVXxE2K66SdHeptWS55B+/ w3rEThazCXPD6hPDAT1PqGnSPLf+aDbi+fNyRA850Jf75iyaAma7vzmpRtOrgkmC Id7afOqZQd13ftLw0SOCUy/IQMbRGGrWgrELHN7Krnnp2mUab4aSQBW++m+lNAw1 r9z25ioOm5Hb3eSt7OT/zf0wLoYXlZazkCFOC9A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=APIZEv hCDmpwUGbiXWk5Ot5A3qGMawL2bd6bUzLBtMQ=; b=3n6qQR6vRz5QsaJ9AFhdIZ HZ5ALqKD/97rt84TMAulm5XbXsxcuvdP4ORYPevPRbAsVEGbogK4UF7WOvQUO2L/ VZMb1u9IQS1Vw8Jk0FaBsfi9falMR5Dg2bf3/S0x0uZSW+Y0XUMtj1UVnKzi3qy6 XVeuyk9LKPTZuBkTl8B8O6CaO3LEM/l8XDfYNw8AkxZXzyKSpelhqE27yelC61OG WoNoWnB4EQFilxiagT6i9P7bHcyFPGhvxVUFUjqu1m4/bkg9ExnVpJsMhOmsu2fs sNTG6wtt77N/NJp8ZJweAZqPuk7HHFIaOff1L00YP2grIFVYIT0acUtQfO8EBEZA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddthedgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsehttd ertderredtnecuhfhrohhmpedfhfgrrhhhrghnucfmhhgrnhdfuceofhgrrhhhrghnsehf rghrhhgrnhdrtghouggvsheqnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepfhgrrhhhrghnsehfrghrhhgrnhdrtghouggvsh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 32C5814C0149; Mon, 2 Mar 2020 22:42:47 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-967-g014f925-fmstable-20200226v1 Mime-Version: 1.0 Message-Id: In-Reply-To: <497ed8b0-9d9b-8c35-74f5-e9fd2e32fc08@selasky.org> References: <8d84a572-f70f-4080-bfe2-263b7f97993c@www.fastmail.com> <497ed8b0-9d9b-8c35-74f5-e9fd2e32fc08@selasky.org> Date: Mon, 02 Mar 2020 22:42:25 -0500 From: "Farhan Khan" To: "Hans Petter Selasky" , freebsd-usb@freebsd.org Subject: Re: Understanding how USB transmission works Content-Type: text/plain X-Rspamd-Queue-Id: 48WjWr61yvz4FbQ X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=farhan.codes header.s=fm2 header.b=vPL6Hb53; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=3n6qQR6v; dmarc=none; spf=pass (mx1.freebsd.org: domain of farhan@farhan.codes designates 66.111.4.27 as permitted sender) smtp.mailfrom=farhan@farhan.codes X-Spamd-Result: default: False [-5.08 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[farhan.codes:s=fm2,messagingengine.com:s=fm2]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.27]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[farhan.codes]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; 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]; IP_SCORE(-3.49)[ip: (-9.84), ipnet: 66.111.4.0/24(-4.89), asn: 11403(-2.69), country: US(-0.05)]; RCVD_IN_DNSWL_LOW(-0.10)[27.4.111.66.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; RCVD_TLS_LAST(0.00)[]; MID_RHS_WWW(0.50)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2020 03:42:51 -0000 On Mon, Mar 2, 2020, at 4:48 PM, Hans Petter Selasky wrote: > On 2020-03-02 22:19, Farhan Khan wrote: > > Hi all, > > > > I am trying to understand how FreeBSD's usb transfers work compared to OpenBSD by using the rum(4) driver. I am a little confused how the FreeBSD side works. > > In FreeBSD USB transfers are a statemachine. In the beginning you call > the start method, and that invokes the statemachine callback in the > SETUP state. There you setup all parameters, buffers, lengths etc. and > then you can submit the USB transfer, which invoke the host controller > drivers routines, which actually lay out the required DMA descriptors > for data transfer. When the USB transfer is completed the statemachine > callback is invoked again and you can choose what to do. > > --HPS > Thank you so much for your prompt response! I understand that you are the one who wrote the USB stack? If so, I am honored. Can you please clarify a few points you made? > In the beginning you call the start method Within rum(4), would that be rum_start()? If not, which function is that? > then you can submit the USB transfer Would that function be usbd_transfer_submit(9)? Thanks again! -- Farhan Khan PGP Fingerprint: 1312 89CE 663E 1EB2 179C 1C83 C41D 2281 F8DA C0DE