xref: /illumos-gate/usr/src/man/man9f/mac_rx.9f (revision 66582b606a8194f7f3ba5b3a3a6dca5b0d346361)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2016 Joyent, Inc.
13.\"
14.Dd June 02, 2016
15.Dt MAC_RX 9F
16.Os
17.Sh NAME
18.Nm mac_rx
19.Nd deliver frames from a driver to the system
20.Sh SYNOPSIS
21.In sys/mac_provider.h
22.Ft void
23.Fo mac_rx
24.Fa "mac_handle_t mh"
25.Fa "mac_resource_handle_t mrh"
26.Fa "mblk_t *mp_chain"
27.Fc
28.Sh INTERFACE LEVEL
29illumos DDI specific
30.Sh PARAMETERS
31.Bl -tag -width Fa
32.It Fa mh
33The MAC handle obtained from a call to
34.Xr mac_register 9F .
35.It Fa mrh
36A reserved parameter that should be passed as
37.Dv NULL .
38.It Fa mp_chain
39A series of one or more
40.Xr mblk 9S
41structures chained together by their
42.Sy b_next
43member.
44.El
45.Sh DESCRIPTION
46The
47.Fn mac_rx
48function is used by device drivers to deliver frames that a device
49driver has received to the rest of the operating system.
50This will generally be called at the end of a device driver's interrupt handler
51after it is has converted all of the incoming data into a chain of
52.Xr mblk 9S
53structures.
54For a full description of the process that the device driver should take as part
55of receiving data, see the
56.Sx Receiving Data
57section of
58.Xr mac 9E .
59.Pp
60Device drivers should ensure that they are not holding any of their own
61locks when they call the
62.Fn mac_rx
63function.
64.Pp
65Device drivers should not call the
66.Fn mac_rx
67function after each individual mblk_t is assembled.
68Rather, the device driver should batch up as many frames as it is willing to
69process in a given interrupt or otherwise.
70.Sh CONTEXT
71The
72.Fn mac_rx
73function can be called from
74.Sy user ,
75.Sy kernel ,
76or
77.Sy interrupt
78context.
79.Sh SEE ALSO
80.Xr mac 9E ,
81.Xr mac_register 9F ,
82.Xr mblk 9S
83