xref: /illumos-gate/usr/src/man/man9s/mac_intr.9s (revision 8ab441ef78c0aa3a5e87b38d2f5a0b5316b6da11)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright (c) 2017, Joyent, Inc.
13.\" Copyright 2022 Oxide Compuer Company
14.\" Copyright 2023 Peter Tribble
15.\"
16.Dd July 17, 2023
17.Dt MAC_INTR 9S
18.Os
19.Sh NAME
20.Nm mac_intr ,
21.Nm mac_intr_t
22.Nd MAC interrupt information
23.Sh SYNOPSIS
24.In sys/mac_provider.h
25.Sh INTERFACE STABILITY
26.Sy Uncommitted -
27This interface is still evolving.
28API and ABI stability is not guaranteed.
29.Sh DESCRIPTION
30The
31.Vt mac_intr_t
32structure is used by the MAC framework as part of the
33.Dv MAC_CAPAB_RINGS
34capability.
35For more background on the MAC framework, please see
36.Xr mac 9E
37and for more information on the
38.Dv MAC_CAPAB_RINGS
39capability,
40.Xr mac_capab_rings 9E .
41.Pp
42The
43.Vt mac_intr_t
44structure is used to describe an interrupt and additional capabilities
45around it.
46The structure is usually used as part of another
47.Xr mac 9E
48related structure such as the
49.Fa mri_intr
50member of the
51.Xr mac_ring_info 9S
52structure.
53The MAC framework uses the functions described here to enable and
54disable interrupt generation for a specific ring, which is used as part
55of switching between polling and interrupt-driven receiving.
56.Pp
57While the structure does embed a
58.Vt ddi_intr_handle_t
59that corresponds to the ring's underlying MSI-X, MSI, INTx, or other
60interrupt type, the
61.Vt mac_intr_t
62still represents and is scoped to a single ring itself.
63.Sh TYPES
64Tye following types define the function pointers in use in the
65.Vt mac_intr_t
66structure.
67.Bd -literal -offset indent
68typedef int (*mac_intr_enable_t)(mac_intr_handle_t);
69typedef int (*mac_intr_disable_t)(mac_intr_handle_t);
70.Ed
71.Sh STRUCTURE MEMBERS
72.Bd -literal -offset indent
73mac_intr_handle_t       mi_handle;
74mac_intr_enable_t       mi_enable;
75mac_intr_disable_t      mi_disable;
76ddi_intr_handle_t       mi_ddi_handle;
77.Ed
78.Pp
79The
80.Fa mi_handle
81member should be set to a driver-specific value that will be passed back
82to the driver in the various callback functions that are setin the
83structure and described below.
84.Pp
85The
86.Fa mi_enable
87member is a required entry point for receive rings and optional for
88transmit rings.
89It should be set to a function which enables interrupts for the ring.
90For more information, see
91.Xr mi_enable 9E .
92.Pp
93The
94.Fa mi_disable
95member is a required entry point for receive rings and an optional entry
96point for transmit rings.
97It should be set to a function which disables interrupts for the ring.
98For more information, see
99.Xr mi_disable 9E .
100.Pp
101The
102.Fa mi_ddi_handle
103member should be set to the interrupt handle that corresponds to the
104ring.
105the interrupt handle will have come from
106.Xr ddi_intr_alloc 9F .
107This member should only be set if the interrupt is a MSI or MSI-X
108interrupt.
109.Sh SEE ALSO
110.Xr mac 9E ,
111.Xr mac_capab_rings 9E ,
112.Xr mi_disable 9E ,
113.Xr mi_enable 9E ,
114.Xr ddi_intr_alloc 9F ,
115.Xr mac_ring_info 9S
116