xref: /illumos-gate/usr/src/man/man9f/usba_hcdi_register.9f (revision 8c3347c4989237d6ebeeb03a67b21a523fc105d6)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2016 Joyent, Inc.
13.\"
14.Dd Nov 26, 2017
15.Dt USBA_HCDI_REGISTER 9F
16.Os
17.Sh NAME
18.Nm usba_hcdi_register ,
19.Nm usba_hcdi_unregister
20.Nd register and unregister HCD driver
21.Sh SYNOPSIS
22.In sys/usb/usba/hcdi.h
23.Ft int
24.Fo usba_hcdi_register
25.Fa "usba_hcdi_register_args_t *args"
26.Fa "uint_t flags"
27.Fc
28.Ft void
29.Fo usba_hcdi_unregister
30.Fa "dev_info_t *dip"
31.Fc
32.Sh INTERFACE LEVEL
33.Sy Volatile -
34illumos USB HCD private function
35.Pp
36This is a private function that is not part of the stable DDI.
37It may be removed or changed at any time.
38.Sh PARAMETERS
39.Bl -tag -width Fa
40.It Fa args
41A pointer to a filled out registration structure.
42See
43.Xr usba_hcdi_register_args_t 9S
44for the members to fill in.
45.It Fa flags
46Should be set to
47.Sy 0 .
48.It Fa dip
49Pointer to the device's
50.Sy dev_info
51structure.
52.El
53.Sh DESCRIPTION
54The
55.Fn usba_hcdi_register
56and
57.Fn usba_hcdi_unregister
58functions are used to register and unregister a USB HCDI driver from the
59USBA framework.
60.Pp
61The
62.Fn usba_hcdi_register
63function is called during a device driver's
64.Xr attach 9E
65entry point after it has finished initializing the device.
66After this function successfully returns, device drivers should assume that the
67.Xr usba_hcdi_ops 9S
68functions may be called at any time.
69.Pp
70The
71.Fn usba_hcdi_unregister
72function should be called during a driver's
73.Xr detach 9E
74entry point after it has unbound its root hub, but before the remainder
75of the device's state is torn down.
76After calling the
77.Fn usba_hcdi_unregister
78function, the driver will receive no more function calls to its
79.Xr usba_hcdi_ops 9S
80entry points.
81.Pp
82For more information on the initialization and finalization path of a
83USB HCD driver, see
84.Xr usba_hcdi 9E .
85.Sh CONTEXT
86The
87.Fn usba_hcdi_register
88function should only be called from a driver's
89.Xr attach 9E
90entry point.
91.Pp
92The
93.Fn usba_hcdi_unregister
94function should only be called frm a driver's
95.Xr detach 9E
96entry point.
97.Sh RETURN VALUES
98Upon successful completion, the
99.Fn usba_hcdi_register
100function returns
101.Sy USB_SUCCESS .
102Otherwise
103.Sy USB_FAILURE
104is returned to indicate that the device was not registered.
105.Pp
106The
107.Fn usba_hcdi_unregister
108function does not define any return values and always succeeds.
109.Sh SEE ALSO
110.Xr attach 9E ,
111.Xr detach 9E ,
112.Xr usba_hcdi 9E ,
113.Xr usba_hcdi_ops 9S ,
114.Xr usba_hcdi_register_args_t 9S
115