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 Sep 16, 2016
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. It may be
37removed 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. See
42.Xr usba_hcdi_register_args_t 9S
43for the members to fill in.
44.It Fa flags
45Should be set to
46.Sy 0 .
47.It Fa dip
48Pointer to the device's
49.Sy dev_info
50structure.
51.El
52.Sh DESCRIPTION
53The
54.Fn usba_hcdi_register
55and
56.Fn usba_hcdi_unregister
57functions are used to register and unregister a USB HCDI driver from the
58USBA framework.
59.Pp
60The
61.Fn usba_hcdi_register
62function is called during a device driver's
63.Xr attach 9E
64entry point after it has finished initializing the device. After this
65function successfuly returns, device drivers should assume that the
66.Xr usba_hcdi_ops 9S
67functions may be called at any time.
68.Pp
69The
70.Fn usba_hcdi_unregister
71function should be called during a driver's
72.Xr detach 9E
73entry point after it has unbound its root hub, but before the remainder
74of the device's state is torn down. After calling the
75.Fn usba_hcdi_unregister
76function, the driver will receive no more function calls to its
77.Xr usba_hcdi_ops 9S
78entry points.
79.Pp
80For more information on the initialization and finalization path of a
81USB HCD driver, see
82.Xr usba_hcdi 9E .
83.Sh CONTEXT
84The
85.Fn usba_hcdi_register
86function should only be called from a driver's
87.Xr attach 9E
88entry point.
89.Pp
90The
91.Fn usba_hcdi_unregister
92function should only be called frm a driver's
93.Xr detach 9E
94entry point.
95.Sh RETURN VALUES
96Upon successful completion, the
97.Fn usba_hcdi_register
98function returns
99.Sy USB_SUCCESS .
100Otherwise
101.Sy USB_FAILURE
102is returned to indicate that the device was not registered.
103.Pp
104The
105.Fn usba_hcdi_unregister
106function does not define any return values and always succeeds.
107.Sh SEE ALSO
108.Xr attach 9E ,
109.Xr detach 9E ,
110.Xr usba_hcdi 9E ,
111.Xr usba_hcdi_ops 9S ,
112.Xr usba_hcdi_register_args_t 9S
113