Writing Device Drivers for Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

Data Structures

The following sections list the data structures that the PF driver should define and initialize before implementing the ioctls:

iov_param_ver_info Structure

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

Version information

num_params

Number of parameters

iov_param_validate Structure

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:

pv_reason

An ASCII string that explains the reason for failure if the ioctl call fails.

pv_buflen

Length of buffer pv_buf

pv_buf

Buffer containing the parameters

iov_param_desc Structure

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:

pd_name

Used in the ldm (1M) command or the pci.conf file to assign a value to the parameter.

pd_desc

A brief description of the parameter.

pd_flag

Indicates if the parameter is applicable to only PF, only VF or applicable to both PF and VF.

pd_default_value

Value assigned by the driver if parameter is not specified in the ldm() command or pci.conf file.

pd_min64

Specifies the minimum range of values for the integer parameter

pd_max64

Specifies the maximum range of values for the integer parameter.

pd_default_string

Specifies the default string that will be used, if parameter is a string.