Unleashed v1.4
[unleashed.git] / share / man / man9f / usb_create_pm_components.9f
blob9346fb4a5588b374753ceb60219fccc15c510637
1 '\" te
2 .\" Copyright (c) 2004, Sun Microsystems, Inc., All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH USB_CREATE_PM_COMPONENTS 9F "Jan 5, 2004"
7 .SH NAME
8 usb_create_pm_components \- Create power management components for USB devices
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/usb/usba.h>
16 \fBint\fR \fBusb_create_pm_components\fR(\fBdev_info_t *\fR\fIdip\fR, \fBuint_t *\fR\fIpwrstates\fR);
17 .fi
19 .SH INTERFACE LEVEL
20 .sp
21 .LP
22 Solaris DDI specific (Solaris DDI)
23 .SH PARAMETERS
24 .sp
25 .ne 2
26 .na
27 \fB\fIdip\fR\fR
28 .ad
29 .RS 13n
30 Pointer to the device's \fBdev_info\fR structure.
31 .RE
33 .sp
34 .ne 2
35 .na
36 \fB\fIpwrstates\fR\fR
37 .ad
38 .RS 13n
39 Address into which a mask which lists power states capable by device is
40 returned. This is a bitmask containing zero or more of the following values:
41 .RE
43 .sp
44 .ne 2
45 .na
46 \fBUSB_DEV_PWRMASK_D0\fR
47 .ad
48 .RS 22n
49 Corresponds to USB_DEV_OS_PWR_3 or full power.
50 .RE
52 .sp
53 .ne 2
54 .na
55 \fBUSB_DEV_PWRMASK_D1\fR
56 .ad
57 .RS 22n
58 Corresponds to USB_DEV_OS_PWR_2.
59 .RE
61 .sp
62 .ne 2
63 .na
64 \fBUSB_DEV_PWRMASK_D2\fR
65 .ad
66 .RS 22n
67 Corresponds to USB_DEV_OS_PWR_1.
68 .RE
70 .sp
71 .ne 2
72 .na
73 \fBUSB_DEV_PWRMASK_D3\fR
74 .ad
75 .RS 22n
76 Corresponds to USB_DEV_OS_PWR_0 or no power.
77 .RE
79 .SH DESCRIPTION
80 .sp
81 .LP
82 The \fBusb_create_pm_components()\fR function creates pm component properties
83 that assume the standard USB D0-D3 powerlevels (USB_DEV_PWR_D0 -
84 USB_DEV_PWR_D3). See the device's relevant USB descriptor to determine the
85 device's power management capabilities and account for bus-powered devices. The
86 \fBusb_create_pm_components()\fR function also updates the pm-components
87 property in the device's dev_info structure.
88 .sp
89 .LP
90 Note that these USB power levels are inverse of OS power levels. For example,
91 USB_DEV_OS_PWR_0 and USB_DEV_PWR_D3 are equivalent levels corresponding to
92 powered-down.
93 .SH RETURN VALUES
94 .sp
95 .ne 2
96 .na
97 \fBUSB_SUCCESS\fR
98 .ad
99 .RS 15n
100 Power management facilities in device are recognized by system.
104 .ne 2
106 \fBUSB_FAILURE\fR
108 .RS 15n
109 An error occurred.
112 .SH CONTEXT
115 May be called from user or kernel context.
116 .SH EXAMPLES
118 .in +2
120    uint_t *pwrstates;
122     /* Hook into device's power management.  Enable remote wakeup. */
123     if (usb_create_pm_components(dip, pwrstates) == USB_SUCCESS) {
124             usb_handle_remote_wakeup(dip,USB_REMOTE_WAKEUP_ENABLE);
125     }
128 .in -2
130 .SH ATTRIBUTES
133 See \fBattributes\fR(5) for descriptions of the following attributes:
138 box;
139 c | c
140 l | l .
141 ATTRIBUTE TYPE  ATTRIBUTE VALUE
143 Architecture    PCI-based systems
145 Interface stability     Committed
148 .SH SEE ALSO
151 \fBattributes\fR(5), \fBusb_clr_feature\fR(9F),
152 \fBusb_register_hotplug_cbs\fR(9F), \fBusb_get_cfg\fR(9F),
153 \fBusb_get_dev_data\fR(9F), \fBusb_handle_remote_wakeup\fR(9F),
154 \fBpm_idle_component\fR(9F), \fBpm_busy_component\fR(9F),
155 \fBpm_raise_power\fR(9F), \fBpm_lower_power\fR(9F), \fBusb_cfg_descr\fR(9S)