From owner-freebsd-current@FreeBSD.ORG Tue Nov 15 21:04:19 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6980B106566B for ; Tue, 15 Nov 2011 21:04:19 +0000 (UTC) (envelope-from mva@FreeBSD.org) Received: from smtprelay05.ispgateway.de (smtprelay05.ispgateway.de [80.67.31.94]) by mx1.freebsd.org (Postfix) with ESMTP id F25C88FC15 for ; Tue, 15 Nov 2011 21:04:18 +0000 (UTC) Received: from [89.182.9.211] (helo=localhost) by smtprelay05.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1RQPx1-0005hf-Hu; Tue, 15 Nov 2011 21:49:52 +0100 Date: Tue, 15 Nov 2011 21:54:06 +0100 From: Marcus von Appen To: Alexander Motin , current Message-ID: <20111115205406.GB1922@medusa.sysfault.org> References: <4EC2C757.4060303@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tjCHc7DPkfUGtrlw" Content-Disposition: inline In-Reply-To: <4EC2C757.4060303@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Df-Sender: MzAzMjU2 Cc: Subject: Re: uhid(4) and report structures X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Marcus von Appen List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 21:04:19 -0000 --tjCHc7DPkfUGtrlw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On, Tue Nov 15, 2011, Alexander Motin wrote: > On 15.11.2011 21:29, Marcus von Appen wrote: > > I wonder, if I am correct with my assumption that the usb_ctl_report* > > structures mentioned in uhid(4) have to be defined and created by the > > code portion that uses the USB_GET_REPORT(), USB_SET_REPORT(), > > ... calls. > > > > In FreeBSD< 800063 we defined them in the header files of the USB > > subsystem. After the rewrite those struct definitions vanished. Will > > the USB_ macros mentioned in uhid(4) "just" return a byte sequence > > (that's what I understand from the UHID specification) so that code, > > which uses those calls, can implement its own struct container for the > > information retrieved? > > > > Thanks for shedding some light on this. In case i am correct with what I > > wrote above, it might make sense to mention it in uhid(4). >=20 > In new USB stack these calls use struct usb_gen_descriptor argument.=20 > Difficult to say why it was done, but it was. To hide that I've recently= =20 > added two wrapper functions to the libusbhid in HEAD: hid_get_report()=20 > and hid_set_report(). So the man page is currently not up to date and can - at least for now - be assumed to be wrong? To get the mappings correct, which fields would I have to use from usb_gen_descriptor? Earlier we had: struct usb_ctl_report { int ucr_report; u_char ucr_data[1024]; }; The mapping might be: usb_gen_descriptor.ugd_data =3D=3D usb_ctl_report.ucr_data usb_gen_descriptor.ugd_report_type =3D=3D usb_ctl_report.ucr_report Is that correct? Also, ugd_data is of variable size with ugd_actlen indicating the size of the ugd_data buffer? Best regards Marcus --tjCHc7DPkfUGtrlw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7C0W4ACgkQi68/ErJnpkdtLQCfcnouA0eQY5HlNl1oeKipItMQ wFYAoL4O3cgkTuGkjoiRUUB22e/9J7lb =ZbF3 -----END PGP SIGNATURE----- --tjCHc7DPkfUGtrlw--