MAC_RX(9F) Kernel Functions for Drivers MAC_RX(9F)

deliver frames from a driver to the system

#include <sys/mac_provider.h>

mac_rx(mac_handle_t mh, mac_resource_handle_t mrh, mblk_t *mp_chain);

illumos DDI specific

The MAC handle obtained from a call to mac_register(9F).
A reserved parameter that should be passed as NULL.
A series of one or more mblk(9S) structures chained together by their b_next member.

The mac_rx() function is used by device drivers to deliver frames that a device driver has received to the rest of the operating system. This will generally be called at the end of a device driver's interrupt handler after it is has converted all of the incoming data into a chain of mblk(9S) structures. For a full description of the process that the device driver should take as part of receiving data, see the Receiving Data section of mac(9E).

Device drivers should ensure that they are not holding any of their own locks when they call the mac_rx() function.

Device drivers should not call the mac_rx() function after each individual mblk_t is assembled. Rather, the device driver should batch up as many frames as it is willing to process in a given interrupt or otherwise.

The mac_rx() function can be called from user, kernel, or interrupt context.

mac(9E), mac_register(9F), mblk(9S)
June 2, 2016 OmniOS