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
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.
12 .\" Copyright 2016 Joyent, Inc.
20 .Nd allocate and free mac registration structures
22 .In sys/mac_provider.h
23 .Ft "mac_register_t *"
25 .Fa "uint_t mac_version"
29 .Fa "mac_register_t *mregp"
36 An integer corresponding to the version of the MAC interface that the
37 device driver was built against.
39 A pointer to an allocated mac_register_t structure that was obtained
49 routines are used to allocate and free the structures used to register a
52 The device driver should call
56 to indicate the current version of the MAC framework that it supports.
57 The device driver will be returned an instance of a
59 structure which it can then use to call
61 For more information on the order of events, see the
62 .Sx Initializing MAC Support
66 When the driver is done with the
68 structure, it must call the
70 function to release any associated memory.
76 routines are generally called from the context of a device driver's
78 entry point; however, they may be called from both
84 Upon successful completion, the
86 function will return a pointer to an allocated
88 structure that can be filled in by the driver.
91 is returned to indicate that the structure could not be allocated.
92 The most common cause for this is that the value of
94 is not supported by the kernel.