From owner-freebsd-usb@freebsd.org Thu Jun 27 13:16:18 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 5896C15C29FA for ; Thu, 27 Jun 2019 13:16:18 +0000 (UTC) (envelope-from stephane.dalu@gmail.com) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0B8B85802 for ; Thu, 27 Jun 2019 13:16:16 +0000 (UTC) (envelope-from stephane.dalu@gmail.com) Received: by mail-wm1-x332.google.com with SMTP id c6so5671868wml.0 for ; Thu, 27 Jun 2019 06:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=qM5wFxH3k0pb5Sl0cW+KFtJ7YXjmrtHGZWGccuzkebc=; b=WiZg7ygoXAO4EnQRPlJFG9MDd73rN8+yRK7VFNM1bE21ZqcLJIAUcmdCasMSuIgFDr 5S3x7NVSBDuNtxCRbO/47yuyCV/BqRjIn6r4l1uU6P7xAo+peQGZsHmO58KRRNBEaraO t8NVJuFcaBZIEYAcNEVovx1zBDimPEdnLEwmXoiqZ001HWkkpGehyK0kn2D6N/s22GPq hKVD/z9zAUlL6pANPxib9Ol1d6X1Kz2iPb9UqUGsRAmCc96SCWZUpUDrNRJ8kNjKXByL LMQwm3SdM1rTRGiHM8VzH3gr2/cbRVYXeDdy633BIhJP2FL2ei5q4AC/vD2vd2A90ylC P2Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=qM5wFxH3k0pb5Sl0cW+KFtJ7YXjmrtHGZWGccuzkebc=; b=gqswoLU9V6f52FlJG707r5zSpyZWzPJv8uHKL8WtvSzCS+y45/jk+nIFAtKrHVcv1Z tdaEeqTCuHptNFLJZRYZx4JRgLRZA9TN73pwc9guBH7jGE8YfUZFLeA5CO3/5zwTaecM +9JA8nMuGcKGtL8zMqG7uVvprU/ueixf7v4JQ7WT9dH72vjIPzt3nsA32wLnFuWw/3Lv xqpefRvhOgY+Y+Q5rf7b9zajlb51MNyqimH9HGxPNAdljbXfCDIptN4SEfK6UDHk20tK eMPjWSfZ02uVmp1juAIW+czo8XLKWHVhjnvBSxngikVkdN2RLemXC3fBjok91iEcRJY8 tXnw== X-Gm-Message-State: APjAAAWmzdcPwp0x1ami1wjQTIJ+bpk7C80pKvFXUfJklTY7V/7bVqdM t8aq98azUa/Yhsfi0/Vxn/JXsXKq X-Google-Smtp-Source: APXvYqzO7eI4tEaiiLHAh9Az64ROZ9w1aXIR+nROH310D76JOxrNpDjdBchrMVZ5QWBiz7E4q0DjwQ== X-Received: by 2002:a1c:345:: with SMTP id 66mr3338052wmd.8.1561641375421; Thu, 27 Jun 2019 06:16:15 -0700 (PDT) Received: from hyperion.home.sdalu.com ([2001:660:5003:410:ec1c:acb8:4cf5:a879]) by smtp.gmail.com with ESMTPSA id t12sm2489048wrw.53.2019.06.27.06.16.14 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2019 06:16:14 -0700 (PDT) From: "Stephane D'Alu" X-Google-Original-From: Stephane D'Alu To: freebsd-usb@freebsd.org Subject: Implemeting xbox one controller on uhid Message-ID: Date: Thu, 27 Jun 2019 15:16:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: F0B8B85802 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=WiZg7ygo; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of stephanedalu@gmail.com designates 2a00:1450:4864:20::332 as permitted sender) smtp.mailfrom=stephanedalu@gmail.com X-Spamd-Result: default: False [-6.80 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-usb@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2.3.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-2.80)[ip: (-9.00), ipnet: 2a00:1450::/32(-2.60), asn: 15169(-2.34), country: US(-0.06)] 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:16:18 -0000 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 -- Stephane D'Alu