Go to main content

Writing Device Drivers for Oracle® Solaris 11.3

Exit Print View

Updated: March 2019
 
 

Driver Callbacks

The DDI interfaces ddi_cb_register() and ddi_cb_unregister() manage the callbacks handled by an SR-IOV driver. Callbacks are used to notify events and the incoming data traffic. Callbacks serve as an event handler for each event during transmission.

The SR-IOV PF drivers should register for events by passing DDI_CB_FLAG_SRIOV in the flags parameter to ddi_cb_register(). See the ddi_cb_register(9F) man page for details.

When an SR-IOV event occurs, a driver that has registered for SR-IOV events will receive the following callback:

typedef int(*ddi_cb_func_t)
(dev_info_t *dip, ddi_cb_action_t action,
void *cbarg, void *arg1, void *arg2)
dip

Pointer to the dev_info structure.

cbarg

Pointer to the action specific callback data.

action

Type of event that has occurred. This will be any one of the following two values:

DDI_CB_PCIV_CONFIG_VF

A change to the VF configuration has occurred. The cbarg parameter is a pointer to a pciv_config_vf_t structure.

DDI_CB_PCIV_CLASS_CONFIG

A change to the VF class configuration has occurred. The cbarg parameter is a pointer to a fciov_conf_t structure. See Fibre Channel SR-IOV Devices for more details.

arg1

Value passed as arg1 to the ddi_cb_register() call.

arg2

Value passed as arg2 to the ddi_cb_register() call.


Note - All PF drivers that are SR-IOV capable must use the ddi_cb_flags_t DDI_CB_FLAG_SRIOV to inform the Oracle Solaris IOV framework that the PF drivers are SR-IOV capable.