From owner-freebsd-usb@freebsd.org Thu Jun 27 13:21:21 2019 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4BC015C2D64 for ; Thu, 27 Jun 2019 13:21:21 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 6C13E85980 for ; Thu, 27 Jun 2019 13:21:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 60EEF260389; Thu, 27 Jun 2019 15:21:17 +0200 (CEST) Subject: Re: Implemeting xbox one controller on uhid To: Stephane D'Alu , freebsd-usb@freebsd.org References: From: Hans Petter Selasky Message-ID: <342406ee-c51e-0691-5560-4f49de90c83f@selasky.org> Date: Thu, 27 Jun 2019 15:20:41 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 6C13E85980 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 2a01:4f8:c17:6c4b::2 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-5.87 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; 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,0]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mail.turbocat.net]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; IP_SCORE(-2.58)[ip: (-9.04), ipnet: 2a01:4f8::/29(-2.06), asn: 24940(-1.80), country: DE(-0.01)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Thu, 27 Jun 2019 13:21:22 -0000 On 2019-06-27 15:16, Stephane D'Alu wrote: > Hi > > I'm still trying to implement the xbox one controller on the kernel > uhid [2] module, based on the linux xpad.c [1] > > I've found that I need, during the attach phase, to write an init packet > on the interrupt endpoint; on linux this is done using the USB request > buffer (URB) [l.1041]. > On freebsd I'm kind of stuck on the function that I should use to > transmit such a packet, I've tried the usbd_req_set_report, but it > doesn't look like the right function. > > any help welcome > > > [1] https://github.com/paroj/xpad/blob/master/xpad.c > [2] /usr/src/sys/dev/usb/input/uhid.c > Hi, For sending a interrupt endpoint message you need to allocate an own USB transfer. The usbd_req_set_report() only works on the control endpoint. --HPS