xref: /illumos-gate/usr/src/man/man9f/usb_ep_xdescr_fill.9f (revision d1aea6f139360e9e7f1504facb24f8521047b15c)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2016 Joyent, Inc.
13.\"
14.Dd Aug 7, 2016
15.Dt USB_EP_XDESCR_FILL 9F
16.Os
17.Sh NAME
18.Nm usb_ep_xdescr_fill
19.Nd fill extended endpoint description from endpoint data
20.Sh SYNOPSIS
21.In sys/usb/usba.h
22.Ft int
23.Fo usb_ep_xdescr_fill
24.Fa "uint_t version"
25.Fa "dev_info_t *dip"
26.Fa "usb_ep_data_t *ep_data"
27.Fa "usb_ep_xdescr_t *ep_xdescr"
28.Fc
29.Sh INTERFACE STABILITY
30illumos DDI specific
31.Sh PARAMETESR
32.Bl -tag -width Fa
33.It Fa version
34Indicates the current version of the
35.Ft usb_ep_xdescr_t
36structure the driver is using. Callers should always specify
37.Sy USB_EP_XDESCR_CURRENT_VERSION .
38.It Fa dip
39Pointer to the device's
40.Sy dev_info
41structure.
42.It Fa ep_data
43Pointer to endpoint data retrieved by calling
44.Xr usb_lookup_ep_data 9F .
45.It Fa ep_xdescr
46Pointer to the extended endpoint descriptor that will be filled out.
47.El
48.Sh DESCRIPTION
49The
50.Fn usb_ep_xdescr_fill
51function is used to fill in the members of the extended endpoint
52descriptor
53.Fa ep_xdescr
54based on the endpoint descriptor data in
55.Fa ep_data .
56Once filled in,
57.Fa ep_xdescr
58can be used to open a pipe by calling
59.Xr usb_pipe_xopen 9F .
60.Pp
61Prior to USB 3.0, only one descriptor, the
62.Xr usb_ep_descr 9S ,
63was needed to describe an endpoint. However, with USB 3.0, additional
64companion descriptors have been added and are required to successfully
65open an endpoint. After calling this, all descriptors needed
66to successfully open a pipe will be placed into
67.Fa ep_xdescr
68and the endpoint data,
69.Fa ep_data ,
70is no longer required.
71.Sh CONTEXT
72The
73.Fn usb_ep_xdescr_fill
74is generally only called from a drivers
75.Xr attach 9E
76entry point; however, it may be called from either
77.Sy user
78or
79.Sy kernel
80context.
81.Sh RETURN VALUES
82Upon successful completion, the
83.Fn usb_ep_xdescr_fill
84function returns
85.Sy USB_SUCCESS .
86Otherwise an error number is returned.
87.Sh ERRORS
88.Bl -tag -width Er
89.It Er USB_INVALID_ARGS
90The value of
91.Fa version
92is unknown, or one of
93.Fa dip ,
94.Fa ep_data ,
95and
96.Fa ep_xdescr
97was an invalid pointer.
98.It Er USB_FAILURE
99An unknown error occurred.
100.El
101.Sh SEE ALSO
102.Xr usb_lookup_ep_data 9F ,
103.Xr usb_pipe_xopen 9F ,
104.Xr usb_ep_descr 9S ,
105.Xr usb_ep_ss_comp_descr 9S ,
106.Xr usb_ep_xdescr 9S
107