Skip Navigation Links | |
Exit Print View | |
man pages section 9: DDI and DKI Kernel Functions Oracle Solaris 11.1 Information Library |
csx_AccessConfigurationRegister(9F)
csx_Parse_CISTPL_BYTEORDER(9F)
csx_Parse_CISTPL_CFTABLE_ENTRY(9F)
csx_Parse_CISTPL_DEVICEGEO(9F)
csx_Parse_CISTPL_DEVICEGEO_A(9F)
csx_Parse_CISTPL_DEVICE_OA(9F)
csx_Parse_CISTPL_DEVICE_OC(9F)
csx_Parse_CISTPL_LINKTARGET(9F)
csx_Parse_CISTPL_LONGLINK_A(9F)
csx_Parse_CISTPL_LONGLINK_C(9F)
csx_Parse_CISTPL_LONGLINK_MFC(9F)
ddi_get_soft_iblock_cookie(9F)
ddi_intr_get_supported_types(9F)
ddi_prop_lookup_byte_array(9F)
ddi_prop_lookup_int64_array(9F)
ddi_prop_lookup_string_array(9F)
ddi_prop_update_byte_array(9F)
ddi_prop_update_int64_array(9F)
ddi_prop_update_string_array(9F)
ldi_prop_lookup_byte_array(9F)
ldi_prop_lookup_int64_array(9F)
ldi_prop_lookup_string_array(9F)
mac_prop_info_set_default_link_flowctrl(9F)
mac_prop_info_set_default_str(9F)
mac_prop_info_set_default_uint8(9F)
mac_prop_info_set_range_uint32(9F)
net_event_notify_unregister(9F)
net_instance_notify_register(9F)
net_instance_notify_unregister(9F)
net_instance_protocol_unregister(9F)
net_protocol_notify_register(9F)
nvlist_lookup_boolean_array(9F)
nvlist_lookup_boolean_value(9F)
nvlist_lookup_nvlist_array(9F)
nvlist_lookup_string_array(9F)
nvlist_lookup_uint16_array(9F)
nvlist_lookup_uint32_array(9F)
nvlist_lookup_uint64_array(9F)
nvpair_value_boolean_array(9F)
pci_plist_lookup_int16_array(9F)
pci_plist_lookup_int32_array(9F)
pci_plist_lookup_int64_array(9F)
pci_plist_lookup_int8_array(9F)
pci_plist_lookup_string_array(9F)
pci_plist_lookup_uint16_array(9F)
pci_plist_lookup_uint32_array(9F)
pci_plist_lookup_uint64_array(9F)
pci_plist_lookup_uint8_array(9F)
scsi_get_device_type_scsi_options(9F)
scsi_get_device_type_string(9F)
scsi_sense_cmdspecific_uint64(9F)
usb_get_current_frame_number(9F)
usb_get_max_pkts_per_isoc_request(9F)
usb_pipe_get_max_bulk_transfer_size(9F)
usb_pipe_stop_intr_polling(9F)
usb_pipe_stop_isoc_polling(9F)
- Raise or lower power of components
#include <sys/ddi.h> #include <sys/sunddi.h> int pm_raise_power(dev_info_t *dip, int component, int level);
int pm_lower_power(dev_info_t *dip, int component, int level);
Solaris DDI specific (Solaris DDI)
Pointer to the device's dev_info structure
The number of the component for which a power level change is desired
The power level to which the indicated component will be raised
Pointer to the device's dev_info structure
Number of the component for which a power level change is desired
Power level to which the indicated component will be lowered
The pm_raise_power(9F) function requests the Power Management framework to raise the power level of component of dip to at least level.
The state of the device should be examined before each physical access. The pm_raise_power(9F) function should be called to set a component to the required power level if the operation to be performed requires the component to be at a power level higher than its current power level.
When pm_raise_power(9F) returns with success, the component is guaranteed to be at least at the requested power level. All devices that depend on this will be at their full power level. Since the actual device power level may be higher than requested by the driver, the driver should not make any assumption about the absolute power level on successful return from pm_raise_power(9F).
The pm_raise_power(9F) function may cause re-entry of the driver power(9E) to raise the power level. Deadlock may result if the driver locks are held across the call to pm_raise_power(9F).
The pm_lower_power(9F) function requests the Power Management framework to lower the power level of component of dip to at most level.
Normally, transitions to lower power levels are initiated by the Power Management framework based on component idleness. However, when detaching, the driver should also initiate reduced power levels by setting the power level of all device components to their lowest levels. The pm_lower_power(9F) function is intended for this use only, and will return DDI_FAILURE if the driver is not detaching at the time of the call.
If automatic Power Management is disabled (see dtpower(1M)), pm_lower_power(9F) returns DDI_SUCCESS without changing the power level of the component. Otherwise, when pm_lower_power(9F) returns with success, the component is guaranteed to be at most at the requested power level. Since the actual device power level may be lower than requested by the driver, the driver should not make any assumption about the absolute power level on successful return from pm_lower_power(9F).
The pm_lower_power(9F) function may cause re-entry of the driver power(9E) to lower the power level. Deadlock may result if the driver locks are held across the call to pm_lower_power(9F).
Note - If these functions are called as a result of entry into the driver's attach(9E), detach(9E) or power(9E) entry point, these functions must be called from the same thread which entered attach(9E), detach(9E) or power(9E).
The pm_raise_power(9F) function returns:
Component is now at the requested power level or higher.
Component or level is out of range, or the framework was unable to raise the power level of the component to the requested level.
The pm_lower_power(9F) function returns:
Component is now at the requested power level or lower, or automatic Power Management is disabled.
Component or level is out of range, or the framework was unable to lower the power level of the component to the requested level, or the device is not detaching.
A hypothetical disk driver might include this code to handle pm_raise_power(9F):
static int xxdisk_strategy(struct buf *bp) { ... /* * At this point we have determined that we need to raise the * power level of the device. Since we have to drop the * mutex, we need to take care of case where framework is * lowering power at the same time we are raising power. * We resolve this by marking the device busy and failing * lower power in power() entry point when device is busy. */ ASSERT(mutex_owned(xsp->lock)); if (xsp->pm_busycnt < 1) { /* * Component is not already marked busy */ if (pm_busy_component(xsp->dip, XXDISK_COMPONENT) != DDI_SUCCESS) { bioerror(bp,EIO); biodone(bp); return (0); } xsp->pm_busycnt++; } mutex_exit(xsp->lock); if (pm_raise_power(xsp->dip, XXDISK_COMPONENT, XXPOWER_SPUN_UP) != DDI_SUCCESS) { bioerror(bp,EIO); biodone(bp); return (0); } mutex_enter(xsp->lock); .... } xxdisk_power(dev_info *dip, int comp, int level) { ... /* * We fail the power() entry point if the device is busy and * request is to lower the power level. */ ASSERT(mutex_owned( xsp->lock)); if (xsp->pm_busycnt >= 1) { if (level < xsp->cur_level) { mutex_exit( xsp->lock); return (DDI_FAILURE); } } ... }
These functions can be called from user or kernel context.
See attributes(5) for a description of the following attribute:
|
pm(7D), attach(9E), detach(9E), power(9E), pm_busy_component(9F), pm_idle_component(9F), pm(9P), pm-components(9P)