2 .\" Copyright (c) 2004, Sun Microsystems, Inc., All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH USB_LOOKUP_EP_DATA 9F "Sep 16, 2016"
8 usb_lookup_ep_data \- Lookup endpoint information
12 #include <sys/usb/usba.h>
16 \fBusb_ep_data_t *\fR\fBusb_lookup_ep_data\fR(\fBdev_info_t *\fR\fIdip\fR,
17 \fBusb_client_dev_data_t *\fR\fIdev_datap\fR, \fBuint_t\fR \fIinterface\fR,
18 \fBuint_t\fR \fIalternate\fR, \fBuint_t\fR \fIskip\fR, \fBuint_t\fR \fItype\fR, \fBuint_t\fR \fIdirection\fR);
23 Solaris DDI specific (Solaris DDI)
30 Pointer to the device's \fBdev_info\fR structure.
39 Pointer to a \fBusb_client_dev_data_t\fR structure containing tree.
48 Number of interface in which endpoint resides.
57 Number of interface alternate setting in which endpoint resides.
66 Number of endpoints which match the requested type and direction to skip before
67 finding one to retrieve.
76 Type of endpoint. This is one of: USB_EP_ATTR_CONTROL, USB_EP_ATTR_ISOCH,
77 USB_EP_ATTR_BULK, or USB_EP_ATTR_INTR. Please see \fBusb_pipe_xopen\fR(9F) for
87 Direction of endpoint, either USB_EP_DIR_OUT or USB_EP_DIR_IN. This argument is
88 ignored for bi-directional control endpoints.
93 The \fBusb_lookup_ep_data()\fR function returns endpoint information from the
94 tree embedded in client data returned from \fBusb_get_dev_data\fR. It operates
95 on the current configuration (pointed to by the dev_curr_cfg field of the
96 \fBusb_client_dev_data_t\fR argument). It skips the first <skip> number of
97 endpoints it finds which match the specifications of the other arguments, and
98 then retrieves information on the next matching endpoint it finds. Note that it
99 does not make a copy of the data, but points to the tree itself.
102 On success: the tree node corresponding to the desired endpoint.
105 On failure: returns NULL. Fails if \fIdip\fR or \fIdev_datap\fR are NULL, if
106 the desired endpoint does not exist in the tree, or no tree is present in
110 May be called from user, kernel or interrupt context.
113 Retrieve the polling interval for the second interrupt endpoint at interface 0,
118 uint8_t interval = 0;
119 usb_ep_data_t *ep_node = usb_lookup_ep_data(
120 dip, dev_datap, 0, 3, 1, USB_EP_ATTR_INTR, USB_EP_DIR_IN);
121 if (ep_node != NULL) {
122 interval = ep_node->ep_descr.bInterval;
129 Retrieve the maximum packet size for the first control pipe at interface 0, alt
134 uint16_t maxPacketSize = 0;
135 usb_ep_data_t *ep_node = usb_lookup_ep_data(
136 dip, dev_datap, 0, 4, 0, USB_EP_ATTR_CONTROL, 0);
137 if (ep_node != NULL) {
138 maxPacketSize = ep_node->ep_descr.wMaxPacketSize;
145 See \fBattributes\fR(5) for descriptions of the following attributes:
153 ATTRIBUTE TYPE ATTRIBUTE VALUE
155 Architecture PCI-based systems
157 Interface stability Committed
162 \fBattributes\fR(5), \fBusb_get_dev_data\fR(9F), \fBusb_pipe_open\fR(9F),
163 \fBusb_cfg_descr\fR(9S), \fBusb_if_descr\fR(9S), \fBusb_ep_descr\fR(9S)