MAC_DEVT_TO_INSTANCE(9F) | Kernel Functions for Drivers | MAC_DEVT_TO_INSTANCE(9F) |
mac_devt_to_instance
—
return the instance number for the given device
number
#include
<sys/mac_provider.h>
int
mac_devt_to_instance
(dev_t
devt);
illumos DDI specific
The
mac_devt_to_instance
()
function returns the device instance number associated with the given device
number managed by the mac(9E)
framework.
Generally the MAC framework is responsible for managing device instance mapping and provides a default getinfo(9E) implementation to that effect.
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. In that
case, the driver can call the
mac_devt_to_instance
()
function to obtain the MAC specific instance number and translate it as
appropriate to a devinfo instance.
The mac_devt_to_instance
() function should
be called from a
kernel
context and is generally used during the execution of a driver's
getinfo(9E) entry point.
Upon successful completion, the
mac_devt_to_instance
() function returns the instance
number associated with the minor. Otherwise
-1 is returned
to indicate failure.
getinfo(9E), mac(9E), ddi_get_instance(9F), mac_getinfo(9F), mac_private_minor(9F)
January 30, 2023 | OmniOS |