MAC_RING_INFO(9S) Data Structures for Drivers MAC_RING_INFO(9S)

NAME


mac_ring_info, mac_ring_info_t - MAC ring information structure

SYNOPSIS


#include <sys/mac_provider.h>

INTERFACE STABILITY


Uncommitted - This interface is still evolving. API and ABI stability is
not guaranteed.

DESCRIPTION


The mac_ring_info_t structure is used by the MAC framework as part of the
MAC_CAPAB_RINGS capability. For more 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 structure as described in mac_capab_rings(9E),
it indicates that it supports a number of rings for transmitting and
receiving. For each ring that it supports, the driver's mr_rget(9E) entry
point will be called, during which it will have to fill out the
mac_ring_info_t structure defined here.

TYPES


The following types define the function pointers in use in the
mac_ring_info_t structure.

typedef int (*mac_ring_start_t)(mac_ring_driver_t, uint64_t);
typedef void (*mac_ring_stop_t)(mac_ring_driver_t);

typedef mblk_t *(*mac_ring_send_t)(mac_ring_driver_t, mblk_t *);
typedef mblk_t *(*mac_ring_poll_t)(mac_ring_driver_t, int);

typedef int (*mac_ring_stat_t)(mac_ring_driver_t, uint_t, uint64_t *);

STRUCTURE MEMBERS


mac_ring_driver_t mri_driver;
mac_ring_start_t mri_start;
mac_ring_stop_t mri_stop;
mac_intr_t mri_intr;
mac_ring_send_t mri_tx;
mac_ring_poll_t mri_poll;
mac_ring_stat_t mri_stat;

The mri_driver member should be set to a driver-specific value that
represents the data structure that corresponds to the ring. The driver
will receive this value in all of the callback functions that are defined
in this structure and discussed below.

The mri_start member is a required entry point that is used to start the
ring. While the device driver may not need to do any work with hardware to
start the use of the ring, it must record the ring's generation number.
For more information, see mri_start(9E).

The mri_stop member is an optional entry point that will be called when the
ring is being stopped. For more information, see mri_stop(9E).

The mri_intr member contains information about the interrupt associated
with the ring. For more information on filling it out, see mac_intr(9S).

The mri_tx member should only be set on transmit rings. It must not be set
on receive rings. The mri_tx member should be set to a function that will
transmit a given frame on the specified ring. For more information, see
mri_tx(9E).

The mri_poll member should only be set on receive rings. It must not be
set on transmit rings. The mri_poll member should be set to a function
which will poll the specified ring. For more information, see
mri_poll(9E).

The mri_stat member should be set to a function which will retrieve
statistics about the specified ring. For more information, see
mri_stat(9E).

Required Members


All non-function members are required. The mri_intr member must be a
properly filled out as per mac_intr(9S).

For transmit rings, the mri_tx member is required.

For receive rings, the mri_poll member is required.

SEE ALSO


mac(9E), mac_capab_rings(9E), mri_poll(9E), mri_start(9E), mri_stat(9E),
mri_stop(9E), mri_tx(9E), mac_intr(9S)

illumos July 2, 2022 illumos