summaryrefslogtreecommitdiff
path: root/usr/src/man/man9e/mc_setpromisc.9e
blob: 4c3d4f91137176ed7874a1d13cdfb43f1b0b0e0f (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
82
83
84
85
.\"
.\" 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 May 31, 2016
.Dt MC_SETPROMISC 9E
.Os
.Sh NAME
.Nm mc_setpromisc
.Nd modify device promiscuous mode entry point
.Sh SYNOPSIS
.In sys/mac_provider.h
.Ft int
.Fo prefix_m_setpromisc
.Fa "void *driver"
.Fa "boolean_t enable"
.Fc
.Sh INTERFACE LEVEL
illumos DDI Specific
.Sh PARAMETERS
.Bl -tag -width Ds
.It Fa driver
A pointer to the driver's private data that was passed in via the
.Sy m_pdata
member of the
.Xr mac_register 9S
structure to the
.Xr mac_register 9F
function.
.It Fa enable
A boolean that indicates the desired state of the device's promiscuous
mode. If set to
.Sy B_TRUE ,
promiscuous mode should be enabled on the device. If set to
.Sy B_FALSE ,
then promiscuous mode should be disabled on the device.
.El
.Sh DESCRIPTION
The
.Fn mc_setpromisc
entry point is called when the GLDv3 wants to change the device's
promiscuous mode. When this entry point is called, the device should
manipulate both its unicast and multicast promiscuous mode.
.Pp
When
.Fa enable
is true, then it should make sure that both unicast and multicast
promiscuous mode are enabled. When it's set to false, then they should
be disabled. In general, devices should always start with promiscuous
mode disabled until the framework indicates that it should be enabled.
.Pp
The device driver's private state is available by casting the
.Fa driver
argument to the function. Note, this entry point may be called in
parallel with others and therefore the device driver should employ any
necessary locking on that structure.
.Sh RETURN VALUES
Upon successful completion, the device driver's
.Fn mc_setpromisc
entry point should return
.Sy 0
after having set the device's state. Otherwise, it should return a
non-zero positive error number to indicate the error that occurred.
.Sh ERRORS
The device driver may return one of the following errors. While this list
is not intended to be exhaustive, it is recommended to use one of these
if possible.
.Bl -tag -width Er
.It Er EIO
The driver encountered a device or transport error while trying to
update the device's state.
.El
.Sh SEE ALSO
.Xr mac 9E ,
.Xr mac_register 9F ,
.Xr mac_register 9S