1usb_pipe_set_private(9F) Kernel Functions for Drivers usb_pipe_set_private(9F)
2
3
4

NAME

6       usb_pipe_set_private,  usb_pipe_get_private  -  USB  user-defined  pipe
7       data-field facility
8

SYNOPSIS

10       #include <sys/usb/usba.h>
11
12       int usb_pipe_set_private(usb_pipe_handle_t pipe_handle, usb_opaque_t data);
13
14
15       usb_opaque_t usb_pipe_get_private (usb_pipe_handle_t pipe_handle);
16
17

INTERFACE LEVEL

19       Solaris DDI specific (Solaris DDI)
20

PARAMETERS

22       For usb_pipe_set_private():
23
24       pipe_handle    Pipe handle into which user-defined data is placed.
25
26
27       data           Data to store in the pipe handle.
28
29
30
31       For usb_pipe_get_private():
32
33       pipe_handle    Pipe handle from which user-defined data is retrieved.
34
35

DESCRIPTION

37       The usb_set_driver_private() function initializes the user-private data
38       field  of  the  pipe referred to by pipe_handle, using data. The  user-
39       private data field is  used to store any data the client desires and is
40       not  used  in any way by the USBA or OS framework. Client drivers often
41       store their soft-state here for convenient retrieval by their  callback
42       handlers.
43
44
45       The  usb_get_driver_private()  function retrieves the user-private data
46       stored via usb_set_driver_private(),  from  the  pipe  referred  to  by
47       pipe_handle.
48

RETURN VALUES

50       For usb_pipe_set_private():
51
52       USB_SUCCESS         Private  data  has been successfully stored in pipe
53                           handle.
54
55
56       USB_INVALID_PIPE    pipe_handle argument is NULL or invalid.
57
58                           Pipe is closing or closed.
59
60
61       USB_INVALID_PERM    The pipe_handle argument refers to the default con‐
62                           trol pipe.
63
64
65
66       For usb_pipe_get_private():
67
68
69       On success: usb_opaque_t pointer to data being retrieved.
70
71
72       On  failure:  NULL.  Fails  if pipe handle is NULL or invalid. Fails if
73       pipe handle is to a pipe which is closing or closed.
74

CONTEXT

76       May be called from user, kernel or interrupt context.
77

EXAMPLES

79             usb_pipe_handle_t pipe;
80
81             /* Some driver defined datatype. */
82             xxx_data_t *data = kmem_zalloc(...);
83
84             usb_pipe_set_private(pipe, data);
85
86             ----
87
88             xxx_data_t *xxx_data_ptr = (xxx_data_t *)usb_pipe_get_private(pipe);
89
90
91

ATTRIBUTES

93       See attributes(5) for descriptions of the following attributes:
94
95
96
97
98       ┌─────────────────────────────┬─────────────────────────────┐
99       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
100       ├─────────────────────────────┼─────────────────────────────┤
101       │Architecture                 │PCI-based systems            │
102       ├─────────────────────────────┼─────────────────────────────┤
103       │Interface stability          │Committed                    │
104       ├─────────────────────────────┼─────────────────────────────┤
105       │Availability                 │SUNWusb                      │
106       └─────────────────────────────┴─────────────────────────────┘
107

SEE ALSO

109       attributes(5), usb_pipe_open(9F), usb_alloc_request(9F)
110
111
112
113SunOS 5.11                        5 Jan 2004          usb_pipe_set_private(9F)
Impressum