From owner-svn-src-head@freebsd.org Sun Jul 1 22:48:01 2018 Return-Path: Delivered-To: svn-src-head@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 66DB5FE401D; Sun, 1 Jul 2018 22:48:01 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CF67A820BA; Sun, 1 Jul 2018 22:48:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC7C124F29; Sun, 1 Jul 2018 22:48:00 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w61Mm0eB068741; Sun, 1 Jul 2018 22:48:00 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w61Mm0a4068740; Sun, 1 Jul 2018 22:48:00 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201807012248.w61Mm0a4068740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 1 Jul 2018 22:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335854 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 335854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2018 22:48:01 -0000 Author: gonzo Date: Sun Jul 1 22:48:00 2018 New Revision: 335854 URL: https://svnweb.freebsd.org/changeset/base/335854 Log: [man] Get uhid(4) man page in sync with current API API documented in previous version of uhid(4) man page has been obsolete since May 2009 when old USB stack was replaced with USB2 implentation. Current API has the same set of ioctl calls but uses usb_gen_descriptor structure to pass data to/from kernel. MFC after: 1 week Modified: head/share/man/man4/uhid.4 Modified: head/share/man/man4/uhid.4 ============================================================================== --- head/share/man/man4/uhid.4 Sun Jul 1 20:52:50 2018 (r335853) +++ head/share/man/man4/uhid.4 Sun Jul 1 22:48:00 2018 (r335854) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd July 1, 2018 .Dt UHID 4 .Os .Sh NAME @@ -61,17 +61,28 @@ calls: .Bl -tag -width indent .It Dv USB_GET_REPORT_ID Pq Vt int Get the report identifier used by this HID report. -.It Dv USB_GET_REPORT_DESC Pq Vt "struct usb_ctl_report_desc" +.It Dv USB_GET_REPORT_DESC Pq Vt "struct usb_gen_descriptor" Get the HID report descriptor. +Copies a maximum of +.Va ugd_maxlen +bytes of the report descriptor data into the memory +specified by +.Va ugd_data . +Upon return +.Va ugd_actlen +is set to the number of bytes copied. Using this descriptor the exact layout and meaning of data to/from the device can be found. The report descriptor is delivered without any processing. .Bd -literal -struct usb_ctl_report_desc { - int ucrd_size; - u_char ucrd_data[1024]; /* filled data size will vary */ +struct usb_gen_descriptor { + void *ugd_data; + uint16_t ugd_maxlen; + uint16_t ugd_actlen; + uint8_t ugd_report_type; + ... }; .Ed .It Dv USB_SET_IMMED Pq Vt int @@ -85,11 +96,18 @@ will only return the data that the device reports on i interrupt pipe. This call may fail if the device does not support this feature. -.It Dv USB_GET_REPORT Pq Vt "struct usb_ctl_report" +.It Dv USB_GET_REPORT Pq Vt "struct usb_gen_descriptor" Get a report from the device without waiting for data on the interrupt pipe. +Copies a maximum of +.Va ugd_maxlen +bytes of the report data into the memory specified by +.Va ugd_data . +Upon return +.Va ugd_actlen +is set to the number of bytes copied. The -.Va report +.Va ugd_report_type field indicates which report is requested. It should be .Dv UHID_INPUT_REPORT , @@ -97,22 +115,21 @@ It should be or .Dv UHID_FEATURE_REPORT . This call may fail if the device does not support this feature. -.Bd -literal -struct usb_ctl_report { - int ucr_report; - u_char ucr_data[1024]; /* used data size will vary */ -}; -.Ed -.It Dv USB_SET_REPORT Pq Vt "struct usb_ctl_report" +.It Dv USB_SET_REPORT Pq Vt "struct usb_gen_descriptor" Set a report in the device. The -.Va report +.Va ugd_report_type field indicates which report is to be set. It should be .Dv UHID_INPUT_REPORT , .Dv UHID_OUTPUT_REPORT , or .Dv UHID_FEATURE_REPORT . +The value of the report is specified by the +.Va ugd_data +and the +.Va ugd_maxlen +fields. This call may fail if the device does not support this feature. .El .Pp