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> int usb_pipe_set_private(usb_pipe_handle_t pipe_handle, usb_opaque_t data);
usb_opaque_t usb_pipe_get_private (usb_pipe_handle_t pipe_handle);
Solaris DDI specific (Solaris DDI)
For usb_pipe_set_private(): pipe_handle
Pipe handle into which user-defined data is placed.
Data to store in the pipe handle.
For usb_pipe_get_private(): pipe_handle
Pipe handle from which user-defined data is retrieved.
The usb_set_driver_private() function initializes the user-private data field of the pipe referred to by pipe_handle, using data. The user-private data field is used to store any data the client desires and is not used in any way by the USBA or OS framework. Client drivers often store their soft-state here for convenient retrieval by their callback handlers.
The usb_get_driver_private() function retrieves the user-private data stored via usb_set_driver_private(), from the pipe referred to by pipe_handle.
For usb_pipe_set_private(): USB_SUCCESS
Private data has been successfully stored in pipe handle.
pipe_handle argument is NULL or invalid. Pipe is closing or closed.
The pipe_handle argument refers to the default control pipe.
For usb_pipe_get_private():
On success: usb_opaque_t pointer to data being retrieved.
On failure: NULL. Fails if pipe handle is NULL or invalid. Fails if pipe handle is to a pipe which is closing or closed.
May be called from user, kernel or interrupt context.
usb_pipe_handle_t pipe; /* Some driver defined datatype. */ xxx_data_t *data = kmem_zalloc(...); usb_pipe_set_private(pipe, data); ---- xxx_data_t *xxx_data_ptr = (xxx_data_t *)usb_pipe_get_private(pipe);
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Architecture PCI-based systems |
Interface stability Committed |
attributes(5), usb_pipe_open(9F), usb_alloc_request(9F)