From owner-freebsd-drivers@freebsd.org Wed Mar 25 01:53:45 2020 Return-Path: Delivered-To: freebsd-drivers@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 CC3BB271F0B for ; Wed, 25 Mar 2020 01:53:45 +0000 (UTC) (envelope-from stephen.wall@redcom.com) Received: from smtp1.redcom.com (smtp1.redcom.com [192.86.3.143]) by mx1.freebsd.org (Postfix) with ESMTP id 48nB3m267Tz4D4S for ; Wed, 25 Mar 2020 01:53:40 +0000 (UTC) (envelope-from stephen.wall@redcom.com) Received: from localhost (localhost [127.0.0.1]) by smtp1.redcom.com (Postfix) with ESMTP id 36D41A11F for ; Tue, 24 Mar 2020 21:53:31 -0400 (EDT) X-Virus-Scanned: amavisd-new at redcom.com Received: from smtp1.redcom.com ([127.0.0.1]) by localhost (smtp1.redcom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vrpuEyZxiWGp for ; Tue, 24 Mar 2020 21:53:22 -0400 (EDT) Received: from pie.redcom.com (pie [192.168.33.15]) by smtp1.redcom.com (Postfix) with ESMTP id 3A8F5A11E for ; Tue, 24 Mar 2020 21:53:22 -0400 (EDT) Received: from exch-03.redcom.com (exch-03.redcom.com [192.168.32.32]) by pie.redcom.com (8.11.7p1+Sun/8.10.2) with ESMTP id 02P1rMl29585 for ; Tue, 24 Mar 2020 21:53:22 -0400 (EDT) Received: from exch-03.redcom.com (fd00::8549:68c0:3d5f:ee62) by exch-03.redcom.com (fd00::8549:68c0:3d5f:ee62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.330.5; Tue, 24 Mar 2020 21:53:22 -0400 Received: from exch-03.redcom.com ([fe80::a442:ce34:c9c8:268f]) by exch-03.redcom.com ([fe80::a442:ce34:c9c8:268f%3]) with mapi id 15.02.0330.010; Tue, 24 Mar 2020 21:53:22 -0400 From: "Wall, Stephen" To: "freebsd-drivers@freebsd.org" Subject: Sending data packets to USB bulk endpoint Thread-Topic: Sending data packets to USB bulk endpoint Thread-Index: AdYCR/iL46k17/e8QeqVMbLCCQEh4Q== Date: Wed, 25 Mar 2020 01:53:21 +0000 Message-ID: <14d06ca2f98e42eca84e9b0d0df8b39e@redcom.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [192.168.84.20] MIME-Version: 1.0 X-Rspamd-Queue-Id: 48nB3m267Tz4D4S X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of stephen.wall@redcom.com designates 192.86.3.143 as permitted sender) smtp.mailfrom=stephen.wall@redcom.com X-Spamd-Result: default: False [-3.13 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.988,0]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:192.86.3.143/32]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/related,multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-drivers@freebsd.org]; DMARC_NA(0.00)[redcom.com]; RCPT_COUNT_ONE(0.00)[1]; URIBL_BLOCKED(0.00)[redcom.com.multi.uribl.com]; IP_SCORE(-0.94)[ip: (-2.45), ipnet: 192.86.3.0/24(-1.22), asn: 46679(-0.98), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_IN_DNSWL_NONE(0.00)[143.3.86.192.list.dnswl.org : 127.0.10.0]; TO_DN_EQ_ADDR_ALL(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~]; ASN(0.00)[asn:46679, ipnet:192.86.3.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_SEVEN(0.00)[7] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2020 01:53:46 -0000 I posted this on the FreeBSD Drivers forum, got no response, so I'm trying = here. I am working on a driver to support a Silicon Labs I2S to USB bridge. Besid= es the audio portion, the chip supports a bulk endpoint which uses a docume= nted packet format to read & control 16 GPIO pins, and to pass messages to = & from an I2C bus. I have not previously worked with USB, or FreeBSD driver= s. I'm been handed a partially complete codebase - the audio stream works -= and I'm trying to get the GPIO controls working. My intent is to use ioctl= () calls to read and set the pins. Creating an entry in /dev and the associated character device structure for= the GPIO control is pretty straightforward. Where I'm getting stuck is try= ing to figure out how to get the messages I am creating in the driver down = to the bulk endpoint - the USB driver code is a bit overwhelming to a newco= mer, and I can't seem to find a function that fits "send this block of data= to this endpoint". The only way I've seen for interacting with bulk endpoi= nts is to write a driver based on usb_fifo_methods rather than cdevsw (per = "FreeBSD Device Drivers", chapter 15), which does not seem to fit what I'm = trying to do. I would appreciate any pointers experienced driver developers could give me= to get where I'm trying to go with this - either the name of the function = I'm looking for, or some other was to get that functionality. Thanks. - Steve -- Stephen Wall Senior Staff Software Engineer 585.924.7550 [https://www.redcom.com/images/email/REDCOM-Logo.png] REDCOM Laboratories, Inc. One Redcom Center Victor, NY 14564-0995 www.redcom.com DUNS 09-166-5919 | CAGE 1U548 Woman Owned Small Business