1ddi_intr_get_nintrs(9F) Kernel Functions for Drivers ddi_intr_get_nintrs(9F)
2
3
4
6 ddi_intr_get_nintrs, ddi_intr_get_navail - return number of interrupts
7 supported or available for a given interrupt type
8
10 #include <sys/types.h>
11 #include <sys/conf.h>
12 #include <sys/ddi.h>
13 #include <sys/sunddi.h>
14
15 int ddi_intr_get_nintrs(dev_info_t *dip, int type, int *nintrsp);
16
17
18 int ddi_intr_get_navail(dev_info_t *dip, int type, int *navailp);
19
20
22 Solaris DDI specific (Solaris DDI).
23
25 ddi_intr_get_nintrs()
26
27 dip Pointer to dev_info structure
28
29
30 type Interrupt type
31
32
33 nintrsp Pointer to number of interrupts of the given type that are
34 supported by the system
35
36
37
38 ddi_intr_get_navail()
39
40 dip Pointer to dev_info structure
41
42
43 type Interrupt type
44
45
46 navailp Pointer to number of interrupts of the given type that are
47 currently available from the system
48
49
51 The ddi_intr_get_nintrs() function returns the number of interrupts of
52 the given type supported by a particular hardware device. On a success‐
53 ful return, the number of supported interrupts is returned as an inte‐
54 ger pointed to by the nintrsp argument.
55
56
57 If the hardware device is not found to support any interrupts of the
58 given type, the DDI_INTR_NOTFOUND failure is returned rather than a
59 zero in nintrsp.
60
61
62 The ddi_intr_get_navail() function returns the number of interrupts of
63 a given type that is available to a particular hardware device. On a
64 successful return, the number of available interrupts is returned as an
65 integer pointed to by navailp.
66
67
68 The hardware device may support more than one interrupt and can request
69 that all interrupts be allocated. The host software can then use pol‐
70 icy-based decisions to determine how many interrupts are made available
71 to the device. Based on the determination, a value is returned that
72 should be used to allocate interrupts with the ddi_int_alloc() func‐
73 tion.
74
75
76 The ddi_intr_get_supported_types(9F) function returns a list of valid
77 supported types for the given hardware device. It must be called prior
78 to calling either the ddi_intr_get_nintrs() or ddi_intr_get_navail().
79
81 The ddi_intr_get_nintrs() and ddi_intr_get_navail() functions return:
82
83 DDI_SUCCESS On success.
84
85
86 DDI_EINVAL On encountering invalid input parameters.
87
88
89 DDI_INTR_NOTFOUND On not finding any interrupts for the given inter‐
90 rupt type.
91
92
93 DDI_FAILURE On any implementation specific failure.
94
95
97 The ddi_intr_get_nintrs() and ddi_intr_get_navail() functions can be
98 called from either user or kernel non-interrupt context.
99
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
113 attributes(5), ddi_intr_alloc(9F), ddi_intr_enable(9F),
114 ddi_intr_get_supported_types(9F)
115
116
117 Writing Device Drivers
118
120 The ddi_intr_get_nintrs() and ddi_intr_get_navail() functions can be
121 called at any time, even if the driver has added an interrupt handler
122 for a given interrupt specification.
123
124
125 On x86 platforms, the number of interrupts returned by the
126 ddi_intr_get_navail() function might need to be further reduced by the
127 number of interrupts available for each interrupt priority on the sys‐
128 tem. In that case, drivers should use different priorities for some of
129 the interrupts.
130
131
132 Consumers of these interfaces should verify that the return value is
133 not equal to DDI_SUCCESS. Incomplete checking for failure codes could
134 result in inconsistent behavior among platforms.
135
136
137
138SunOS 5.11 13 November 2006 ddi_intr_get_nintrs(9F)