19b0e7716SRobert Mustacchi.\"
29b0e7716SRobert Mustacchi.\" This file and its contents are supplied under the terms of the
39b0e7716SRobert Mustacchi.\" Common Development and Distribution License ("CDDL"), version 1.0.
49b0e7716SRobert Mustacchi.\" You may only use this file in accordance with the terms of version
59b0e7716SRobert Mustacchi.\" 1.0 of the CDDL.
69b0e7716SRobert Mustacchi.\"
79b0e7716SRobert Mustacchi.\" A full copy of the text of the CDDL should have accompanied this
89b0e7716SRobert Mustacchi.\" source.  A copy of the CDDL is also available via the Internet at
99b0e7716SRobert Mustacchi.\" http://www.illumos.org/license/CDDL.
109b0e7716SRobert Mustacchi.\"
119b0e7716SRobert Mustacchi.\"
129b0e7716SRobert Mustacchi.\" Copyright 2016 Joyent, Inc.
139b0e7716SRobert Mustacchi.\"
149b0e7716SRobert Mustacchi.Dd Sep 16, 2016
159b0e7716SRobert Mustacchi.Dt USBA_HCDI_BIND_ROOT_HUB 9F
169b0e7716SRobert Mustacchi.Os
179b0e7716SRobert Mustacchi.Sh NAME
189b0e7716SRobert Mustacchi.Nm usba_hubdi_bind_root_hub ,
199b0e7716SRobert Mustacchi.Nm usba_hubdi_unbind_root_hub
209b0e7716SRobert Mustacchi.Nd bind and unbind the root USB hub
219b0e7716SRobert Mustacchi.Sh SYNOPSIS
229b0e7716SRobert Mustacchi.In sys/usb/usba/hubdi.h
239b0e7716SRobert Mustacchi.Ft int
249b0e7716SRobert Mustacchi.Fo usba_hubdi_bind_root_hub
259b0e7716SRobert Mustacchi.Fa "dev_info_t *dip"
269b0e7716SRobert Mustacchi.Fa "uchar_t *hub_descr"
279b0e7716SRobert Mustacchi.Fa "size_t descr_len"
289b0e7716SRobert Mustacchi.Fa "usb_dev_descr_t *dev_descr"
299b0e7716SRobert Mustacchi.Fc
309b0e7716SRobert Mustacchi.Ft int
319b0e7716SRobert Mustacchi.Fo usba_hubdi_unbind_root_hub
329b0e7716SRobert Mustacchi.Fa "dev_info_t *dip"
339b0e7716SRobert Mustacchi.Fc
349b0e7716SRobert Mustacchi.Sh INTERFACE LEVEL
359b0e7716SRobert Mustacchi.Sy Volatile -
369b0e7716SRobert Mustacchiillumos USB HCD private function
379b0e7716SRobert Mustacchi.Pp
3872d3dbb9SYuri PankovThis is a private function that is not part of the stable DDI.
3972d3dbb9SYuri PankovIt may be removed or changed at any time.
409b0e7716SRobert Mustacchi.Sh PARAMETERS
419b0e7716SRobert Mustacchi.Bl -tag -width Fa
429b0e7716SRobert Mustacchi.It Fa dip
439b0e7716SRobert MustacchiPointer to the device's
449b0e7716SRobert Mustacchi.Sy dev_info
459b0e7716SRobert Mustacchistructure.
469b0e7716SRobert Mustacchi.It Fa hub_descr
479b0e7716SRobert MustacchiPointer to a byte array that contains the standard descriptors for a USB
489b0e7716SRobert MustacchiHub device.
499b0e7716SRobert Mustacchi.It Fa descr_len
509b0e7716SRobert MustacchiThe length in bytes of the
519b0e7716SRobert Mustacchi.Fa hub_descr
529b0e7716SRobert Mustacchibyte array.
539b0e7716SRobert Mustacchi.It Fa dev_descr
549b0e7716SRobert MustacchiA filled in standard USB device descriptor.
559b0e7716SRobert Mustacchi.El
569b0e7716SRobert Mustacchi.Sh DESCRIPTION
579b0e7716SRobert MustacchiThe
589b0e7716SRobert Mustacchi.Fn usba_hubdi_bind_root_hub
599b0e7716SRobert Mustacchiand
609b0e7716SRobert Mustacchi.Fn usba_hubdi_unbind_root_hub
619b0e7716SRobert Mustacchifunctions are used to bind and unbind the root USB hub that is a part of
6272d3dbb9SYuri Pankovevery HCD driver.
6372d3dbb9SYuri PankovSee
649b0e7716SRobert Mustacchi.Xr usba_hcdi 9E
659b0e7716SRobert Mustacchifor more information on this relationship.
669b0e7716SRobert Mustacchi.Pp
679b0e7716SRobert MustacchiThe
689b0e7716SRobert Mustacchi.Fn usba_hubdi_root_bind_driver
699b0e7716SRobert Mustacchiis used after calling the
709b0e7716SRobert Mustacchi.Xr usba_hcdi_register 9F
719b0e7716SRobert Mustacchifunction during a device's
729b0e7716SRobert Mustacchi.Xr attach 9E
739b0e7716SRobert Mustacchientry point.
749b0e7716SRobert Mustacchi.Pp
759b0e7716SRobert MustacchiBecause the root hub is generally a virtual hub, the HCD driver is
769b0e7716SRobert Mustacchiresponsible for making it appear to the system as a normal USB hub.
779b0e7716SRobert Mustacchi.Pp
789b0e7716SRobert MustacchiThe contents of the
799b0e7716SRobert Mustacchi.Fa hub_descr
8072d3dbb9SYuri Pankovshould be the standard USB Hub class-specific descriptor.
8172d3dbb9SYuri PankovThis hub descriptor should match a hub of a similar class of speed.
8272d3dbb9SYuri PankovFor example, with the xhci controller, a USB 3.x Hub class-specific descriptor
8372d3dbb9SYuri Pankovis used, where as for the ehci controller, a USB 2.x Hub class-specific
8472d3dbb9SYuri Pankovdescriptor is used.
8572d3dbb9SYuri PankovFor more information, see the USB 3.1 specification, section 10.15.2
869b0e7716SRobert Mustacchi.Em Class-specific Descriptors .
879b0e7716SRobert Mustacchi.Pp
889b0e7716SRobert MustacchiSimilarly, the contents of the
899b0e7716SRobert Mustacchi.Fa dev_descr
909b0e7716SRobert Mustacchineed to be a filled in USB device descriptor that indicates that the
9172d3dbb9SYuri Pankovroot hub corresponds to the appropriate USB generation.
9272d3dbb9SYuri PankovFor more information on the contents, see
939b0e7716SRobert Mustacchi.Xr usb_dev_descr 9S
949b0e7716SRobert Mustacchiand the USB 3.1 specification, section 10.15.1
959b0e7716SRobert Mustacchi.Em Standard Descriptors for Hub Class .
969b0e7716SRobert Mustacchi.Pp
979b0e7716SRobert MustacchiThe
989b0e7716SRobert Mustacchi.Fn usba_hubdi_unbind_root_hub
999b0e7716SRobert Mustacchifunction is used to detach the root hub associated with the HCD driver.
1009b0e7716SRobert MustacchiThis should be called during a device's
1019b0e7716SRobert Mustacchi.Xr detach 9E
1029b0e7716SRobert Mustacchiroutine before calling
10372d3dbb9SYuri Pankov.Xr usba_hcdi_unregister 9F .
1049b0e7716SRobert Mustacchi.Pp
1059b0e7716SRobert MustacchiIf a call to the
1069b0e7716SRobert Mustacchi.Fn usba_hubdi_unbind_root_hub
1079b0e7716SRobert Mustacchifunction fails during a device's
1089b0e7716SRobert Mustacchi.Xr detach 9E
1099b0e7716SRobert Mustacchifunction, then it should fail the call to
1109b0e7716SRobert Mustacchi.Xr detach 9E .
1119b0e7716SRobert Mustacchi.Sh CONTEXT
1129b0e7716SRobert MustacchiThe
1139b0e7716SRobert Mustacchi.Fn usba_hubdi_bind_root_hub
1149b0e7716SRobert Mustacchifunction should only be called during a device's
1159b0e7716SRobert Mustacchi.Xr attach 9E
1169b0e7716SRobert Mustacchientry point.
1179b0e7716SRobert Mustacchi.Pp
1189b0e7716SRobert MustacchiThe
1199b0e7716SRobert Mustacchi.Fn usba_hubdi_unbind_root_hub
1209b0e7716SRobert Mustacchifunction should only be called during a device's
1219b0e7716SRobert Mustacchi.Xr detach 9E entry point.
1229b0e7716SRobert Mustacchi.Sh RETURN VALUES
1239b0e7716SRobert MustacchiUpon successful completion, the
1249b0e7716SRobert Mustacchi.Fn usba_hubdi_bind_root_hub
1259b0e7716SRobert Mustacchiand
1269b0e7716SRobert Mustacchi.Fn usba_hubdi_unbind_root_hub
1279b0e7716SRobert Mustacchifunctions return
1289b0e7716SRobert Mustacchi.Sy USB_SUCCESS .
1299b0e7716SRobert MustacchiOtherwise, they return
1309b0e7716SRobert Mustacchi.Sy USB_FAILURE
1319b0e7716SRobert Mustacchito indicate that they could not proceed.
1329b0e7716SRobert Mustacchi.Sh SEE ALSO
1339b0e7716SRobert Mustacchi.Xr attach 9E ,
1349b0e7716SRobert Mustacchi.Xr detach 9E ,
1359b0e7716SRobert Mustacchi.Xr usba_hcdi 9E ,
1369b0e7716SRobert Mustacchi.Xr usba_hcdi_register 9F ,
1379b0e7716SRobert Mustacchi.Xr usba_hcdi_unregister 9F ,
138*9f17ecf0SPeter Tribble.Xr usb_dev_descr 9S
139