MR_RGET(9E) | Driver Entry Points | MR_RGET(9E) |
mr_rget
—
#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);
MAC_RING_TYPE_RX
MAC_RING_TYPE_TX
mr_rget
() 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_capbab_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).
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.
July 2, 2022 | OmniOS |