This file and its contents are supplied under the terms of the
Common Development and Distribution License ("CDDL"), version 1.0.
You may only use this file in accordance with the terms of version
1.0 of the CDDL.

A full copy of the text of the CDDL should have accompanied this
source. A copy of the CDDL is also available via the Internet at
http://www.illumos.org/license/CDDL.


Copyright 2016 Joyent, Inc.

.Dd June 02, 2016 .Dt MAC_RX 9F .Os .Sh NAME .Nm mac_rx .Nd deliver frames from a driver to the system .Sh SYNOPSIS n sys/mac_provider.h .Ft void .Fo mac_rx .Fa "mac_handle_t mh" .Fa "mac_resource_handle_t mrh" .Fa "mblk_t *mp_chain" .Fc .Sh INTERFACE LEVEL illumos DDI specific .Sh PARAMETERS l -tag -width Fa t Fa mh The MAC handle obtained from a call to .Xr mac_register 9F . t Fa mrh A reserved parameter that should be passed as .Dv NULL . t Fa mp_chain A series of one or more .Xr mblk 9S structures chained together by their .Sy b_next member. .El .Sh DESCRIPTION The .Fn 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 .Xr mblk 9S structures. For a full description of the process that the device driver should take as part of receiving data, see the .Sx Receiving Data section of .Xr mac 9E .

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

p Device drivers should not call the .Fn 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. .Sh CONTEXT The .Fn mac_rx function can be called from .Sy user , .Sy kernel , or .Sy interrupt context. .Sh SEE ALSO .Xr mac 9E , .Xr mac_register 9F , .Xr mblk 9S