xref: /illumos-gate/usr/src/man/man9f/mac_getinfo.9f (revision 012e6ce759c490003aed29439cc47d3d73a99ad3)
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 2023 Oxide Computer Company
13.\"
14.Dd January 30, 2023
15.Dt MAC_GETINFO 9F
16.Os
17.Sh NAME
18.Nm mac_getinfo
19.Nd get device driver information for a MAC provider
20.Sh SYNOPSIS
21.In sys/mac_provider.h
22.Ft int
23.Fo mac_getinfo
24.Fa "dev_info_t *dip"
25.Fa "ddi_info_cmd_t cmd"
26.Fa "void *arg"
27.Fa "void **resp"
28.Fc
29.Sh INTERFACE LEVEL
30illumos DDI specific
31.Sh PARAMETERS
32.Bl -tag -width Fa
33.It Fa "dip"
34The MAC driver's dip.
35.It Fa "cmd"
36Command argument to
37.Xr getinfo 9E .
38.It Fa "arg"
39Command specific argument.
40.It Fa "resp"
41Pointer to store the command specific response.
42.El
43.Sh DESCRIPTION
44The
45.Fn mac_getinfo
46function is the default
47.Xr getinfo 9E
48entry point provided by the
49.Xr mac 9E
50framework.
51.Pp
52Generally a MAC provider is free to leave the
53.Xr getinfo 9E
54entry point unset and allow the framework to provide a default implementation.
55.Pp
56However, if a driver wants to expose additional device nodes or relies on some
57special mapping of device instance to MAC instance then it must provide its own
58.Xr getinfo 9E
59entry point.
60Such a driver may then call the
61.Fn mac_getinfo
62function to handle requests for MAC reserved nodes, propagating the return
63value.
64See the
65.Sy Custom Device Nodes
66section of
67.Xr mac 9E
68for more details.
69.Sh CONTEXT
70The
71.Fn mac_getinfo
72function should be used during the execution of a driver's
73.Xr getinfo 9E
74entry point.
75.Sh RETURN VALUES
76.Fn mac_getinfo
77returns
78.Dv DDI_SUCCESS
79on success or
80.Dv DDI_FAILURE
81otherwise.
82.Sh SEE ALSO
83.Xr getinfo 9E ,
84.Xr mac 9E ,
85.Xr mac_devt_to_instance 9F ,
86.Xr mac_private_minor 9F
87