MAC_GROUP_INFO(9S) | Data Structures for Drivers | MAC_GROUP_INFO(9S) |
mac_group_info
,
mac_group_info_t
— MAC group
information structure
#include
<sys/mac_provider.h>
Uncommitted - This interface is still evolving. API and ABI stability is not guaranteed.
The mac_group_info_t structure is used by
the MAC framework as part of the MAC_CAPAB_RINGS
capability. For background on the MAC framework, please see
mac(9E) and for an introduction to the
MAC_CAPAB_RINGS
capability,
mac_capab_rings(9E).
When a device driver declares that it supports the
MAC_CAPAB_RINGS
capability and fills out the
capability structure as described in
mac_capab_rings(9E), it
indicates that it supports a number of transmit and receive groups. For each
group that it indicates, its
mr_gget(9E) entry point will be
called, during which it will have to fill out the
mac_group_info_t structure described here.
The following types define the function pointers in use in the mac_group_info_t structure.
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)
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;
The 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.
The 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 mgi_start(9E).
The 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 mgi_stop(9E).
The 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 MAC_GROUP_TYPE_STATIC
, then the value in
mgi_count represents the fixed number of rings
available to the group.
The 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
mgi_addmac(9E). This member only
has meaning for a receive group, transmit groups should set this to
NULL
.
The 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 mgi_addmac member is
a valid pointer, then this entry point must be as well. For more
information, see mgi_remmac(9E).
This member only has meaning for a receive group, transmit groups should set
this to NULL
.
The 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
mgi_addvlan(9E). This member
only has meaning for a receive group, transmit groups should set this to
NULL
.
The 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 mgi_addvlan member is a
valid pointer, then this entry point must be as well. For more information,
see mgi_remvlan(9E). This member
only has meaning for a receive group, transmit groups should set this to
NULL
.
All of the non-function pointers described in this manual are required members for both transmit and receive groups. The mgi_start and mgi_stop members are optional for both transmit and receive groups.
For transmit groups, all of the filter entry points must be set to
NULL
.
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 mgi_addmac and mgi_remmac.
mac(9E), mac_capab_rings(9E), mgi_addmac(9E), mgi_addvlan(9E), mgi_remmac(9E), mgi_remvlan(9E), mgi_start(9E), mgi_stop(9E), mr_gget(9E)
July 2, 2022 | OmniOS |