summaryrefslogtreecommitdiff
path: root/usr/src/man/man9s/usba_device.9s
blob: 036e50feed6f66a93a3abf5e3571ed5857464743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
.\"
.\" This file and its contents are supplied under the terms of the
.\" Common Development and Distribution License ("CDDL"), version 1.0.
.\" You may only use this file in accordance with the terms of version
.\" 1.0 of the CDDL.
.\"
.\" A full copy of the text of the CDDL should have accompanied this
.\" source.  A copy of the CDDL is also available via the Internet at
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
.\" Copyright 2016 Joyent, Inc.
.\"
.Dd Dec 20, 2016
.Dt USBA_DEVICE 9S
.Os
.Sh NAME
.Nm usba_device ,
.Nm usba_device_t
.Nd USBA Device Data Structure
.Sh SYNOPSIS
.In sys/usb/usba/hcdi.h
.Sh INTERFACE LEVEL
.Sy Volatile -
illumos USB HCD private
.Pp
This is a private data structure that is not part of the stable DDI.
It may be removed or changed at any time.
.Sh DESCRIPTION
The
.Sy usba_device_t
structure is used by the illumos USB Architecture (USBA) to represent a
physical USB device.
While a given USB device may be a composite device, a USB device that implements
two or more classes, there will still only be a single device structure.
A USB device is always plugged into a port on some hub, excepting the root hub,
and has an address on the USB fabric.
.Pp
Many of the USB HCD driver operations pass a
.Sy usba_device_t
to the HCD driver.
The
.Sy usba_device_t
should be used by an HCD driver in a
.Em read-only
fashion.
A subset of the structure's fields that are useful for HCD drivers to read are
listed below.
.Pp
In addition, there are two optional HCD entry points that interact with
this structure and give the change for a driver to store per-device
state.
If the driver implements the
.Xr usba_hcdi_device_init 9E
and
.Xr usba_hcdi_device_fini 9E
functions, then the private data stored from
.Xr usba_hcdi_device_init 9E
can be retrieved with
.Xr usba_hcdi_get_device_private 9F .
.Sh STRUCTURE MEMBERS
The
.Sy usba_device_t
structure includes the following members:
.Bd -literal -offset indent
dev_info_t		*usb_dip
usba_hubdi_t		*usb_hubdi;
usb_addr_t		usb_addr;
usb_dev_descr_t		*usb_dev_descr;
char			*usb_mfg_str;
char			*usb_product_str;
char			*usb_serialno_str;
usb_port_status_t	usb_port_status;
usb_port_t		usb_port;
usba_device_t		*usb_hs_hub_usba_dev;
usba_device_t		*usb_parent_hub;
.Ed
.Pp
The
.Sy usb_dip
member is a pointer to the device's
.Sy dev_info_t
structure.
This generally is used if the HCD driver wants to get naming information for
diagnostic purposes.
When duplicating requests for isochronous and interrupt requests, HCD drivers
should use the
.Sy dev_info_t
from the
.Xr usba_pipe_handle_data_t 9S .
.Pp
The
.Sy usb_hubdi
member can be used to determine whether or not the
.Sy usba_device_t
in question is a hub or not.
HCD drivers should compare this member to
.Dv NULL .
If the member is not
.Dv NULL ,
then this USB device corresponds to a hub.
.Pp
the
.Sy usb_addr
member indicates the address of the USB device on the broader USB bus.
Note, that the actual address assigned to the device may be different,
especially if the HCD driver implements the optional
.Xr usba_hcdi_device_address 9E
entry point.
See the section
.Sy USB addressing
in
.Xr usba_hcdi 9E
for more information.
.Pp
The
.Sy usb_dev_descr
member points to the device descriptor for a given device.
This structure is documented in
.Xr usb_dev_descr 9S .
This member may be
.Dv NULL
as it may not have been populated during device
attachment.
This member may be
.Dv NULL .
HCD drivers should always check for
.Dv NULL
before dereferencing it.
.Pp
The
.Sy usb_mfg_str
member may contain a pointer to a character string with the name of the
manufacturer as retrieved from the device.
This member may be
.Dv NULL .
HCD drivers should always check for
.Dv NULL
before dereferencing it.
.Pp
The
.Sy usb_product_str
member may contain a pointer to a character string with the name of the
product as retrieved from the device.
This member may be
.Dv NULL .
HCD drivers should always check for
.Dv NULL
before dereferencing it.
.Pp
The
.Sy usb_serialno_str
member may contain a pointer to a character string with the serial
number of the device as retrieved from the device.
This member may be
.Dv NULL .
HCD drivers should always check for
.Dv NULL
before dereferencing it.
.Pp
The
.Sy usb_port_status
contains a
.Xr usb_port_status_t 9T
entry, which describes the current negotiated speed of the device.
See
.Xr usb_port_status_t 9T
for more information on the values and types.
.Pp
The
.Sy usb_port
member contains the port on a hub that the device is plugged into.
Ports are always numbered starting at 1.
.Pp
The
.Sy usb_hs_hub_usba_dev
member is set when there is a parent high-speed hub.
This is most notable for low- and full- speed devices which require split
transaction support.
This points to the
.Sy usb_device_t
structure that is the closest high-speed parent hub.
This member should
always be set to
.Dv NULL
for super-speed devices.
A device operating a super-speed can never be plugged into a high-speed hub.
.Pp
The
.Sy usb_parent_hub
member points to the
.Sy usba_device_t
structure that the device in question is plugged into.
If the device represents the root hub, then this field will be
.Dv NULL .
.Sh SEE ALSO
.Xr usba_hcdi 9E ,
.Xr usba_hcdi_device_address 9E ,
.Xr usba_hcdi_device_fini 9E ,
.Xr usba_hcdi_device_init 9E ,
.Xr usba_pipe_handle_data_t 9S ,
.Xr usb_port_status_t 9T