blob: 74ce834a9a8637b979ed6802e363caaa8c408622 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
.\"
.\" 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
.In 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
.Bl -tag -width Fa
.It Fa mh
The MAC handle obtained from a call to
.Xr mac_register 9F .
.It Fa mrh
A reserved parameter that should be passed as
.Dv NULL .
.It 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 .
.Pp
Device drivers should ensure that they are not holding any of their own
locks when they call the
.Fn mac_rx
function.
.Pp
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
|