1pci_report_pmcap(9F)     Kernel Functions for Drivers     pci_report_pmcap(9F)
2
3
4

NAME

6       pci_report_pmcap - Report Power Management capability of a PCI device
7

SYNOPSIS

9       #include <sys/ddi.h>
10       #include <sys/sunddi.h>
11
12
13
14       int pci_report_pmcap(dev_info_t *dip,  int cap, void *arg);
15
16

INTERFACE LEVEL

18       Solaris DDI specific (Solaris DDI)
19

PARAMETERS

21       dip    Pointer to the device's dev_info structure
22
23
24       cap    Power management capability
25
26
27       arg    Argument for the capability
28
29

DESCRIPTION

31       Some  PCI  devices provide power management capabilities in addition to
32       those  provided  by  the  PCI  Power  Management   Specification.   The
33       pci_report_pmcap() function reports those Power Management capabilities
34       of the PCI device to the framework. Framework supports dynamic changing
35       of  the capability by allowing pci_report_pmcap() to be called multiple
36       times. Following are the supported capabilities  as  indicated  by  the
37       cap:
38
39
40       PCI_PM_IDLESPEED  — The PCI_PM_IDLESPEED value indicates the lowest PCI
41       clock speed that a device can tolerate when idle,  and  is   applicable
42       only  to  33 MHz PCI bus. arg represents the lowest possible idle speed
43       in KHz (1 KHz is 1000 Hz). The integer  value  representing  the  speed
44       should be cast to (void *)before passing as arg to pci_report_pmcap().
45
46
47       The special values of arg are:
48
49       PCI_PM_IDLESPEED_ANY     The device can tolerate any idle clock speed.
50
51
52       PCI_PM_IDLESPEED_NONE    The device cannot tolerate slowing down of PCI
53                                clock even when idle.
54
55
56
57       If the driver doesn't make this call, PCI_PM_IDLESPEED_NONE is assumed.
58       In  this  case, one offending device can keep the entire bus from being
59       power managed.
60

RETURN VALUES

62       The pci_report_pmcap() function returns:
63
64       DDI_SUCCESS    Successful reporting of the capability
65
66
67       DDI_FAILURE    Failure to report capability because  of  invalid  argu‐
68                      ment(s)
69
70

CONTEXT

72       The  pci_report_pmcap()  function  can  be called from user, kernel and
73       interrupt context.
74

EXAMPLES

76       1. A device driver knows that the device it  controls  works  with  any
77       clock  between  DC  and  33  MHz as specified in Section 4.2.3.1: Clock
78       Specification  of the PCI Bus Specification Revision  2.1.  The  device
79       driver makes the following call from its attach(9E):
80
81         if (pci_report_pmcap(dip, PCI_PM_IDLESPEED, PCI_PM_IDLESPEED_ANY) !=
82                     DDI_SUCCESS)
83                         cmn_err(CE_WARN, "%s%d: pci_report_pmcap failed\n",
84                             ddi_driver_name(dip), ddi_get_instance(dip));
85
86
87
88       2.  A device driver controls a 10/100 Mb Ethernet device which runs the
89       device state machine on the chip from the PCI  clock.  For  the  device
90       state  machine  to receive packets at 100 Mb, the PCI clock cannot drop
91       below 4 MHz. The driver makes the following call whenever it negotiates
92       a 100 Mb Ethernet connection:
93
94         if (pci_report_pmcap(dip,  PCI_PM_IDLESPEED, (void *)4000) !=
95                        DDI_SUCCESS)
96                         cmn_err(CE_WARN, "%s%d: pci_report_pmcap failed\n",
97                             ddi_driver_name(dip), ddi_get_instance(dip));
98
99

ATTRIBUTES

101       See attributes(5) for descriptions of the following attributes:
102
103
104
105
106       ┌─────────────────────────────┬─────────────────────────────┐
107       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
108       ├─────────────────────────────┼─────────────────────────────┤
109       │Interface Stability          │Committed                    │
110       └─────────────────────────────┴─────────────────────────────┘
111

SEE ALSO

113       Writing Device Drivers
114
115
116       PCI Bus Power Management Interface Specification Version 1.1
117
118
119       PCI Bus Specification Revision 2.1
120
121
122
123SunOS 5.11                      13 August 1999            pci_report_pmcap(9F)
Impressum