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.
19 .Nm mac_prop_info_set_default_link_flowctrl ,
20 .Nm mac_prop_info_set_default_str ,
21 .Nm mac_prop_info_set_default_uint8 ,
22 .Nm mac_prop_info_set_default_uint32 ,
23 .Nm mac_prop_info_set_default_uint64 ,
24 .Nm mac_prop_info_set_perm ,
25 .Nm mac_prop_info_set_range_uint32
26 .Nd mac property information functions
28 .In sys/mac_provider.h
30 .Fo mac_prop_info_set_default_link_flowctrl
31 .Fa "mac_prop_info_handle_t hdl"
32 .Fa "link_flowctrl_t fctl"
35 .Fo mac_prop_info_set_default_str
36 .Fa "mac_prop_info_handle_t hdl"
40 .Fo mac_prop_info_set_default_uint8
41 .Fa "mac_prop_info_handle_t hdl"
45 .Fo mac_prop_info_set_default_uint16
46 .Fa "mac_prop_info_handle_t hdl"
50 .Fo mac_prop_info_set_default_uint32
51 .Fa "mac_prop_info_handle_t hdl"
55 .Fo mac_prop_info_set_perm
56 .Fa "mac_prop_info_handle_t hdl"
60 .Fo mac_prop_info_set_range_uint32
61 .Fa "mac_prop_info_handle_t hdl"
70 A pointer to the MAC property information handle.
72 A valid link flow control entry.
73 Valid values are documented in the
75 property description in the
80 A null-terminated ASCII character string that describes that contains a
83 An 8-bit unsigned value.
85 An 16-bit unsigned value.
87 An 32-bit unsigned value.
89 An 8-bit unsigned value which is the bitwise inclusive OR of the
92 .It Sy MAC_PROP_PERM_READ
93 This flag indicates that a property is
95 .It Sy MAC_PROP_PERM_WRITE
96 This flag indicates that a property is
98 .It Sy MAC_PROP_PERM_RW
99 This flag indicates that a property is both
103 This is equivalent to specifying both
104 .Sy MAC_PROP_PERM_READ
106 .Sy MAC_PROP_PERM_WRITE .
109 A 32-bit unsigned value that represents the lowest possible value of an
110 integer property, generally inclusive.
112 A 32-bit unsigned value that represents the highest possible value an
113 integer property, generally inclusive.
118 family of functions are used to fill in metadata about a given property
119 as part of a driver's
122 These functions can be used to fill in information about the default value that
123 the device assigns to a property and the permissions that a privileged user has
124 to update the property.
127 .Fn mac_prop_info_set_perm
128 function is used to set the permissions of a property.
129 These permissions indicate whether or not the property can be read or modified
130 from the device driver's perspective.
131 The permissions for a given property should generally not change for a given
132 device and they do not need to take into account user privileges.
133 For the most case, properties will only take one of two values:
134 .Sy MAC_PROP_PERM_READ
136 .Sy MAC_PROP_PERM_RW .
137 Usually it does not make sense for a property to just have
138 .Sy MAC_PROP_PERM_WRITE .
140 Subsequent calls to the
141 .Fn mac_prop_info_set_perm
142 function will override the values stored in previous calls.
145 .Fn mac_prop_info_set_range_uint32
146 function is used to indicate a range of possible integer values that a
148 This range is generally inclusive, meaning the property may be set to any value
154 .Fn mac_prop_info_set_range_uint32
155 function is called, a new property range is added, allowing for multiple
156 disjoint ranges to be specified for a given property.
158 The remaining functions,
159 .Fn mac_prop_info_set_default_link_flowctrl ,
160 .Fn mac_prop_info_set_default_str ,
161 .Fn mac_prop_info_set_uint8 ,
162 .Fn mac_prop_info_set_uint16 ,
163 .Fn mac_prop_info_set_uint32 ,
165 .Fn mac_prop_info_set_range_uint32
166 update the default value of a given property.
167 The default value is the initial value that the property takes after the device
169 .Xr mac_register 9F .
170 If these functions are called multiple times, then the default value
171 will be replaced with each call.
173 The different functions each support a different type of default value
174 and some are used for specific properties.
176 .Fn mac_prop_info_set_default_link_flowctrl
177 function works with properties that describe flow control properties.
178 The various values of a
184 .Fn mac_prop_info_set_default_str
185 function sets the default value for properties that use strings.
186 The device driver should ensure that it uses alphanumeric ASCII characters
187 only in the string to guarantee portability.
190 .Fn mac_prop_info_set_default_uint8 ,
191 .Fn mac_prop_info_set_default_uint16 ,
193 .Fn mac_prop_info_set_default_uint32
194 functions set the default value for values whose properties are 8-, 16-,
195 and 32-bit unsigned values respectively.
197 These functions are generally called on a handle passed into the
199 entry point, though they function in both
205 All of the functions documented here do not return a value.
206 It is not the driver's responsibility to ensure that there is sufficient space
207 for permissions, ranges, or default values in the
208 .Ft mac_prop_info_handle_t
209 structures: the surrounding driver framework will transparently take
210 care of that and ensure that errors are correctly propagated.