Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / mac_rx.9f
blob19067c1838364cdd4652a2d9e474ad4d4565117f
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
29 illumos DDI specific
30 .Sh PARAMETERS
31 .Bl -tag -width Fa
32 .It Fa mh
33 The MAC handle obtained from a call to
34 .Xr mac_register 9F .
35 .It Fa mrh
36 A reserved parameter that should be passed as
37 .Dv NULL .
38 .It Fa mp_chain
39 A series of one or more
40 .Xr mblk 9S
41 structures chained together by their
42 .Sy b_next
43 member.
44 .El
45 .Sh DESCRIPTION
46 The
47 .Fn mac_rx
48 function is used by device drivers to deliver frames that a device
49 driver has received to the rest of the operating system.
50 This will generally be called at the end of a device driver's interrupt handler
51 after it is has converted all of the incoming data into a chain of
52 .Xr mblk 9S
53 structures.
54 For a full description of the process that the device driver should take as part
55 of receiving data, see the
56 .Sx Receiving Data
57 section of
58 .Xr mac 9E .
59 .Pp
60 Device drivers should ensure that they are not holding any of their own
61 locks when they call the
62 .Fn mac_rx
63 function.
64 .Pp
65 Device drivers should not call the
66 .Fn mac_rx
67 function after each individual mblk_t is assembled.
68 Rather, the device driver should batch up as many frames as it is willing to
69 process in a given interrupt or otherwise.
70 .Sh CONTEXT
71 The
72 .Fn mac_rx
73 function can be called from
74 .Sy user ,
75 .Sy kernel ,
77 .Sy interrupt
78 context.
79 .Sh SEE ALSO
80 .Xr mac 9E ,
81 .Xr mac_register 9F ,
82 .Xr mblk 9S