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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
.\"
.\" 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 Computer Company
.\"
.Dd July 2, 2022
.Dt MAC_GROUP_INFO 9S
.Os
.Sh NAME
.Nm mac_group_info ,
.Nm mac_group_info_t
.Nd MAC group information structure
.Sh SYNOPSIS
.In sys/mac_provider.h
.Sh INTERFACE LEVEL
.Sy Uncommitted -
This interface is still evolving.
API and ABI stability is not guaranteed.
.Sh DESCRIPTION
The
.Vt mac_group_info_t
structure is used by the MAC framework as part of the
.Dv MAC_CAPAB_RINGS
capability.
For background on the MAC framework, please see
.Xr mac 9E
and for an introduction to the
.Dv MAC_CAPAB_RINGS
capability,
.Xr mac_capab_rings 9E .
.Pp
When a device driver declares that it supports the
.Dv MAC_CAPAB_RINGS
capability and fills out the capability structure as described in
.Xr mac_capab_rings 9E ,
it indicates that it supports a number of transmit and receive groups.
For each group that it indicates, its
.Xr mr_gget 9E
entry point will be called, during which it will have to fill out the
.Vt mac_group_info_t
structure described here.
.Sh TYPES
The following types define the function pointers in use in the
.Vt mac_group_info_t
structure.
.Bd -literal -offset indent
typedef int (*mac_group_start_t)(mac_group_driver_t);
typedef void (*mac_group_stop_t)(mac_group_driver_t);
typedef int (*mac_add_mac_addr_t)(mac_group_driver_t, const uint8_t *mac,
uint_t flags)
typedef int (*mac_rem_mac_addr_t)(mac_group_driver_t, const uint8_t *mac,
uint_t flags)
typedef int (*mac_add_vlan_t)(mac_group_driver_t, uint16_t vlan, uint_t flags)
typedef int (*mac_rem_vlan_t)(mac_group_driver_t, uint16_t vlan, uint_t flags)
.Ed
.Sh STRUCTURE MEMBERS
.Bd -literal -offset indent
mac_group_driver_t mgi_driver;
mac_group_start_t mgi_start;
mac_group_start_t mgi_stop;
uint_t mgi_count;
mac_add_mac_addr_t mgi_addmac;
mac_rem_mac_addr_t mgi_remmac;
mac_add_vlan_t mgi_addvlan;
mac_rem_vlan_t mgi_remvlan;
.Ed
.Pp
The
.Fa mgi_driver
member should be set by the driver to a driver-specific value that
represents the data structure that corresponds to this group.
The driver will receive this value in all of the callback functions that
are defined in this structure and listed below.
.Pp
The
.Fa mgi_start
member is an optional entry point.
If the driver needs to take a specific action before it the group is
used, then it should set this to a function.
For more information, see
.Xr mgi_start 9E .
.Pp
The
.Fa mgi_stop
member is an optional entry point.
If the driver needs to take a specific action when the group is being
stopped, then it should set this to a function.
For more information, see
.Xr mgi_stop 9E .
.Pp
The
.Fa mgi_count
member should be set to a count of the number of rings that are present
in this group.
When the group type is
.Dv MAC_GROUP_TYPE_STATIC ,
then the value in
.Fa mgi_count
represents the fixed number of rings available to the group.
.Pp
The
.Fa mgi_addmac
member is an optional entry point and should be set to a function that
can add a MAC address filter to the group in hardware.
For more information, see
.Xr mgi_addmac 9E .
This member only has meaning for a receive group, transmit groups should
set this to
.Dv NULL .
.Pp
The
.Fa mgi_remmac
member is an optional entry point and should be set to a function that
can remove a MAC address filter from a group in hardware.
If the
.Fa mgi_addmac
member is a valid pointer, then this entry point must be as well.
For more information, see
.Xr mgi_remmac 9E .
This member only has meaning for a receive group, transmit groups should
set this to
.Dv NULL .
.Pp
The
.Fa mgi_addvlan
member is an optional entry point and should be set to a function that
can add a VLAN filter to the group in hardware.
For more information, see
.Xr mgi_addvlan 9E .
This member only has meaning for a receive group, transmit groups should
set this to
.Dv NULL .
.Pp
The
.Fa mgi_remvlan
member is an optional entry point and should be set to a function that
can remove a VLAN filter from a group in hardware.
If the
.Fa mgi_addvlan
member is a valid pointer, then this entry point must be as well.
For more information, see
.Xr mgi_remvlan 9E .
This member only has meaning for a receive group, transmit groups should
set this to
.Dv NULL .
.Ss Required Members
All of the non-function pointers described in this manual are required
members for both transmit and receive groups.
The
.Fa mgi_start
and
.Fa mgi_stop
members are optional for both transmit and receive groups.
.Pp
For transmit groups, all of the filter entry points must be set to
.Dv NULL .
.Pp
Receive groups must have some way to set a MAC address filter.
This means that one of the MAC address related functions must be set.
Currently, the driver must implement either
.Fa mgi_addmac
and
.Fa mgi_remmac .
.Sh SEE ALSO
.Xr mac 9E ,
.Xr mac_capab_rings 9E ,
.Xr mgi_addmac 9E ,
.Xr mgi_addvlan 9E ,
.Xr mgi_remmac 9E ,
.Xr mgi_remvlan 9E ,
.Xr mgi_start 9E ,
.Xr mgi_stop 9E ,
.Xr mr_gget 9E
|