The following sections list the data structures that the PF driver should define and initialize before implementing the ioctls:
The iov_param_ver_info structure is defined as follows:
#define IOV_IOCTL (('I' << 24) | ('O' << 16) | ('V' << 8)) #define IOV_GET_VER_INFO (IOV_IOCTL | 0) #define IOV_GET_PARAM_INFO (IOV_IOCTL | 1) #define IOV_VALIDATE_PARAM (IOV_IOCTL | 2) #define IOV_PARAM_DESC_VERSION 1
The iov_param_ver_info structure contains the following fields:
typedef struct iov_param_ver_info { uint32_t version; uint32_t num_params; } iov_param_ver_info_t;
where:
Version information
Number of parameters
The iov_param_validate structure is defined as follows:
#define IOV_IOCTL (('I' << 24) | ('O' << 16) | ('V' << 8)) #define IOV_GET_VER_INFO (IOV_IOCTL | 0) #define IOV_GET_PARAM_INFO (IOV_IOCTL | 1) #define IOV_VALIDATE_PARAM (IOV_IOCTL | 2) #define IOV_PARAM_DESC_VERSION 1
The iov_param_validate contains the following fields:
typedef struct iov_param_validate { char pv_reason[MAX_REASON_LEN + 1]; int32_t pv_buflen; /* encoded buffer containing params */ char pv_buf[1]; /* size of buf is pv_buflen */ } iov_param_validate_t;
where:
An ASCII string that explains the reason for failure if the ioctl call fails.
Length of buffer pv_buf
Buffer containing the parameters
The iov_param_desc structure is defined as follows:
#define IOV_IOCTL (('I' << 24) | ('O' << 16) | ('V' << 8)) #define IOV_GET_VER_INFO (IOV_IOCTL | 0) #define IOV_GET_PARAM_INFO (IOV_IOCTL | 1) #define IOV_VALIDATE_PARAM (IOV_IOCTL | 2) #define IOV_PARAM_DESC_VERSION 1
The structure iov_param_desc contains the following fields:
typedef struct iov_param_desc { char pd_name[MAX_PARAM_NAME_SIZE]; char pd_desc[MAX_PARAM_DESC_SIZE]; int32_t pd_flag; /* applicable for PF or VF or both */ int32_t pd_data_type; /* integer, string, plist */ /* Following 3 are applicable for integer data types */ uint64_t pd_default_value; uint64_t pd_min64; uint64_t pd_max64; char pd_default_string [MAX_PARAM_DEFAULT_STRING_SIZE]; } iov_param_desc_t;
where:
Used in the ldm (1M) command or the pci.conf file to assign a value to the parameter.
A brief description of the parameter.
Indicates if the parameter is applicable to only PF, only VF or applicable to both PF and VF.
Value assigned by the driver if parameter is not specified in the ldm() command or pci.conf file.
Specifies the minimum range of values for the integer parameter
Specifies the maximum range of values for the integer parameter.
Specifies the default string that will be used, if parameter is a string.