MAC_GETINFO(9F) Kernel Functions for Drivers MAC_GETINFO(9F)

mac_getinfoget device driver information for a MAC provider

#include <sys/mac_provider.h>

int
mac_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd, void *arg, void **resp);

illumos DDI specific

dip
The MAC driver's dip.
cmd
Command argument to getinfo(9E).
arg
Command specific argument.
resp
Pointer to store the command specific response.

The () function is the default getinfo(9E) entry point provided by the mac(9E) framework.

Generally a MAC provider is free to leave the getinfo(9E) entry point unset and allow the framework to provide a default implementation.

However, if a driver wants to expose additional device nodes or relies on some special mapping of device instance to MAC instance then it must provide its own getinfo(9E) entry point. Such a driver may then call the () function to handle requests for MAC reserved nodes, propagating the return value. See the section of mac(9E) for more details.

The mac_getinfo() function should be used during the execution of a driver's getinfo(9E) entry point.

mac_getinfo() returns DDI_SUCCESS on success or DDI_FAILURE otherwise.

getinfo(9E), mac(9E), mac_devt_to_instance(9F), mac_private_minor(9F)

January 30, 2023 OmniOS