MR_RGET(9E) Driver Entry Points MR_RGET(9E)

mr_rgetfill in ring information

#include <sys/mac_provider.h>

void
prefix_fill_ring_info(void *driver, mac_ring_type_t rtype, const int group_index, const int ring_index, mac_ring_info_t *infop, mac_ring_handle_t rh);

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

driver
A pointer to the driver's private data that was passed in via the m_pdata member of the mac_register(9S) structure to the mac_register(9F) function.
group_index
An integer value indicating the group that this ring belongs to. Groups are numbered starting from zero.
rtype
A value indicating the type of ring. Valid values include:
The ring is a receive ring.
The ring is a transmit ring.
ring_index
An integer indicating the index of the ring inside of the group. Ring indexes are numbered starting from zero. Each group has its own set of ring indexes.
infop
A pointer to an instance of a mac_ring_info(9S) structure.
rh
An opaque pointer to a ring handle that can be used to identify this ring.

The () entry point provides a means for the device driver to fill in information about a ring. The driver must fill in information into the infop argument. For the list of fields and an explanation of how to fill them in, please see mac_ring_info(9S).

The rtype argument describes whether this is a receive ring or transmit ring identified by a value of MAC_RING_TYPE_RX or MAC_RING_TYPE_TX respectively. The ring information that is filled in varies between transmit and receive rings. If separate entry points were not specified in the mac_capab_rings(9E) structure, then the driver must ensure that it checks this value.

The group_index and ring_index arguments are used to uniquely identify a ring. The number of groups that a driver supports is based on the values present in the mr_gnum member of the mac_capab_rings_t structure which is described in mac_capab_rings(9E). The group index ranges from zero to the specified number of groups minus one. The number of rings in the group is determined based on the values specified in mac_group_info(9S) structure that is filled in during the mr_gget(9E) entry point. The ring numbering for each group is independent and always starts at zero. Based on the combination of group and ring index, the driver should be able to map that to a unique ring.

After filling out the ring structure in infop, the driver should make sure to store the ring handle in rh for future use. This is required for callbacks such as mac_rx_ring(9F) or mac_tx_ring_update(9F).

The mr_rget() entry point will be called in response to a driver calling the mac_register(9F) function and the driver has acknowledged that it supports the MAC_CAPAB_RINGS capability. This will be called after a call to the driver's mr_gget(9E) entry point.

mac(9E), mac_capab_rings(9E), mr_gget(9E), mac_register(9F), mac_rx_ring(9F), mac_tx_ring_update(9F), mac_group_info(9S), mac_register(9S), mac_ring_info(9S)

July 17, 2023 OmniOS