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

NAME

6       ddi_intr_set_nreq - set the number of interrupts requested for a device
7       driver instance
8

SYNOPSIS

10       #include <sys/ddi_intr.h>
11
12
13
14       int ddi_intr_set_nreq(dev_info_t *dip, int nreq);
15
16

INTERFACE LEVEL

18       Solaris DDI specific (Solaris DDI).
19

PARAMETERS

21       dip     Pointer to the dev_info structure.
22
23
24       nreq    Number of interrupts requested.
25
26

DESCRIPTION

28       The ddi_intr_set_nreq()  function  changes  the  number  of  interrupts
29       requested by a device driver instance.
30
31
32       The nreq parameter is the total number of interrupt resources that this
33       instance of the device driver would like to have  available.  The  nreq
34       parameter  includes  any  interrupt  resources already allocated by the
35       driver. For example, if the driver instance already has two MSI-X  vec‐
36       tors  and  it wants two more, it should call this function with an nreq
37       parameter set to four.
38
39
40       The nreq parameter can be any value between one and the maximum  number
41       of  interrupts  supported by the device hardware, as reported by a call
42       to the ddi_intr_get_nintrs(9F) function. The driver receives a callback
43       notifying  it  in  cases  when it must release any previously allocated
44       interrupts, or when it is allowed to  allocate  more  interrupts  as  a
45       result of its new nreq parameter.
46
47
48       The  ddi_intr_set_nreq()function  is  not  supported unless a driver is
49       already consuming interrupts, and if it has a registered callback  han‐
50       dler  that  can  process actions related to changes in interrupt avail‐
51       ability. See ddi_cb_register(9F) for an explanation on  how  to  enable
52       this functionality.
53

RETURN VALUES

55       The ddi_intr_set_nreq() function returns:
56
57       DDI_SUCCESS    on success
58
59
60       DDI_EINVAL     The  operation  is invalid because the nreq parameter is
61                      not a legal value
62
63
64       DDI_ENOTSUP    The operation is not supported. The driver must  have  a
65                      registered  callback, and the system must have interrupt
66                      pools implemented.
67
68
69       DDI_FAILURE    Implementation specific failure
70
71

CONTEXT

73       These functions can be called from kernel, non-interrupt context.
74

ATTRIBUTES

76       See attributes(5) for descriptions of the following attributes:
77
78
79
80
81       ┌─────────────────────────────┬─────────────────────────────┐
82       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
83       ├─────────────────────────────┼─────────────────────────────┤
84       │Interface Stability          │Private                      │
85       ├─────────────────────────────┼─────────────────────────────┤
86       │MT-Level                     │MT-Safe                      │
87       └─────────────────────────────┴─────────────────────────────┘
88

SEE ALSO

90       attributes(5),  attach(9E),  ddi_cb_register(9F),   ddi_intr_alloc(9F),
91       ddi_intr_get_nintrs(9F)
92

NOTES

94       The  Interrupt  Resource Management feature is limited to device driver
95       instances   that   are   using   MSI-X   interrupts   (interrupt   type
96       DDI_INTR_TYPE_MSIX).  Attempts  to use this function for any other type
97       of interrupts fails with DDI_ENOTSUP.
98
99
100       The total number of interrupts requested by  the  driver  is  initially
101       defined  by  the count parameter provided by the driver's first call to
102       the  ddi_intr_alloc(9F)  function,  specifically  during   the   driver
103       instance's attach(9E) routine. The ddi_intr_set_nreq() function is only
104       used if the driver instance experiences changes in  its  I/O  load.  In
105       response  to  increased  I/O load, the driver may want to request addi‐
106       tional interrupt resources. In response to  diminished  I/O  load.  the
107       driver  may  volunteer  to return extra interrupt resources back to the
108       system.
109
110
111
112SunOS 5.11                        5 Jan 2009             ddi_intr_set_nreq(9F)
Impressum