xref: /illumos-gate/usr/src/man/man9e/mc_setpromisc.9e (revision 37e2cd25d56b334a2403f2540a0b0a1e6a40bcd1)
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 May 31, 2016
15.Dt MC_SETPROMISC 9E
16.Os
17.Sh NAME
18.Nm mc_setpromisc
19.Nd modify device promiscuous mode entry point
20.Sh SYNOPSIS
21.In sys/mac_provider.h
22.Ft int
23.Fo prefix_m_setpromisc
24.Fa "void *driver"
25.Fa "boolean_t enable"
26.Fc
27.Sh INTERFACE LEVEL
28illumos DDI Specific
29.Sh PARAMETERS
30.Bl -tag -width Ds
31.It Fa driver
32A pointer to the driver's private data that was passed in via the
33.Sy m_pdata
34member of the
35.Xr mac_register 9S
36structure to the
37.Xr mac_register 9F
38function.
39.It Fa enable
40A boolean that indicates the desired state of the device's promiscuous
41mode.
42If set to
43.Sy B_TRUE ,
44promiscuous mode should be enabled on the device.
45If set to
46.Sy B_FALSE ,
47then promiscuous mode should be disabled on the device.
48.El
49.Sh DESCRIPTION
50The
51.Fn mc_setpromisc
52entry point is called when the GLDv3 wants to change the device's
53promiscuous mode.
54When this entry point is called, the device should manipulate both its unicast
55and multicast promiscuous mode.
56.Pp
57When
58.Fa enable
59is true, then it should make sure that both unicast and multicast
60promiscuous mode are enabled.
61When it's set to false, then they should be disabled.
62In general, devices should always start with promiscuous mode disabled until the
63framework indicates that it should be enabled.
64.Pp
65The device driver's private state is available by casting the
66.Fa driver
67argument to the function.
68Note, this entry point may be called in parallel with others and therefore the
69device driver should employ any necessary locking on that structure.
70.Sh RETURN VALUES
71Upon successful completion, the device driver's
72.Fn mc_setpromisc
73entry point should return
74.Sy 0
75after having set the device's state.
76Otherwise, it should return a non-zero positive error number to indicate the
77error that occurred.
78.Sh ERRORS
79The device driver may return one of the following errors.
80While this list is not intended to be exhaustive, it is recommended to use one
81of these if possible.
82.Bl -tag -width Er
83.It Er EIO
84The driver encountered a device or transport error while trying to
85update the device's state.
86.El
87.Sh SEE ALSO
88.Xr mac 9E ,
89.Xr mac_register 9F ,
90.Xr mac_register 9S
91