Copyright (c) 2004, Sun Microsystems, Inc., All Rights Reserved
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.
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.
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]
#include <sys/usb/usba.h> usb_ep_data_t *usb_lookup_ep_data(dev_info_t *dip, usb_client_dev_data_t *dev_datap, uint_t interface, uint_t alternate, uint_t skip, uint_t type, uint_t direction);
Pointer to the device's dev_info structure.
Pointer to a usb_client_dev_data_t structure containing tree.
Number of interface in which endpoint resides.
Number of interface alternate setting in which endpoint resides.
Number of endpoints which match the requested type and direction to skip before finding one to retrieve.
Type of endpoint. This is one of: USB_EP_ATTR_CONTROL, USB_EP_ATTR_ISOCH, USB_EP_ATTR_BULK, or USB_EP_ATTR_INTR. Please see usb_pipe_xopen(9F) for more information.
Direction of endpoint, either USB_EP_DIR_OUT or USB_EP_DIR_IN. This argument is ignored for bi-directional control endpoints.
On failure: returns NULL. Fails if dip or dev_datap are NULL, if the desired endpoint does not exist in the tree, or no tree is present in dev_datap.
uint8_t interval = 0; usb_ep_data_t *ep_node = usb_lookup_ep_data( dip, dev_datap, 0, 3, 1, USB_EP_ATTR_INTR, USB_EP_DIR_IN); if (ep_node != NULL) { interval = ep_node->ep_descr.bInterval; }
Retrieve the maximum packet size for the first control pipe at interface 0, alt 4:
uint16_t maxPacketSize = 0; usb_ep_data_t *ep_node = usb_lookup_ep_data( dip, dev_datap, 0, 4, 0, USB_EP_ATTR_CONTROL, 0); if (ep_node != NULL) { maxPacketSize = ep_node->ep_descr.wMaxPacketSize; }
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Architecture PCI-based systems |
Interface stability Committed |