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