Writing Device Drivers for Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

IOV_VALIDATE_PARAM Ioctl

The general flow of control for a driver that calls the IOV_VALIDATE_PARAM() is as follows:

  1. Send the arg parameter to the pci_param_get_ioctl() interface and obtain a pointer to the pci_param_t structure.

  2. Write an explanatory string to the pv_reason array if param validation fails.

  3. Call the pci_get_plist() interface followed by the pci_plist_lookup() interface to obtain the device parameters.

  4. Lookup the vfs name-value pair in the PF plist to obtain the number of VFs to be configured for the validation of this configuration. The drivers should use integer data type of at least 16 bits to look up vfs name-value pair. Use the pciv_plist_getvf() interface to get the plist parameter for the VF devices.

  5. Validate the parameters without actually applying them to the device.

  6. Return 0 when a valid configuration is found.


Caution

Caution  - The parameters validated in the above procedure are not related to the current configuration of the device in any way. They need to be validated separately assuming they could be a future configuration. If not, the driver should return DDI_EINVAL to indicate improper configuration. The driver should also provide an explanatory string in the pv_reason field in the iov_param_validate structure when invalid configurations are found. This string informs the administrator why the configuration failed.