components/open-fabrics/libibverbs/solaris_compatibility.c
changeset 6496 4a37a046cf70
parent 5708 49b43e37ce26
equal deleted inserted replaced
6493:5b3b0a0f5875 6496:4a37a046cf70
    92 static kstat_ctl_t	*kc = NULL;	/* libkstat cookie */
    92 static kstat_ctl_t	*kc = NULL;	/* libkstat cookie */
    93 static int sol_uverbs_drv_status = SOL_UVERBS_DRV_STATUS_UNKNOWN;
    93 static int sol_uverbs_drv_status = SOL_UVERBS_DRV_STATUS_UNKNOWN;
    94 static int sol_uverbs_minor_dev = -1;
    94 static int sol_uverbs_minor_dev = -1;
    95 
    95 
    96 /*
    96 /*
    97  * Override verbs abi version.
       
    98  * If the build system doesn't have the intended
       
    99  * header file then override with the intended abi version.
       
   100  * These changes can be deleted once the build system has
       
   101  * the correct header file.
       
   102  */
       
   103 #if	(IB_USER_VERBS_SOLARIS_ABI_VERSION == 3)
       
   104 #undef	IB_USER_VERBS_SOLARIS_ABI_VERSION
       
   105 #define	IB_USER_VERBS_SOLARIS_ABI_VERSION	4
       
   106 
       
   107 #define	UVERBS_PSID_STR_SZ		32
       
   108 #define	UVERBS_IBDEV_NAME_SZ		64
       
   109 #define	UVERBS_HCA_DRIVER_NAME_SZ	40
       
   110 #define	UVERBS_DEVID_STR_SZ		16
       
   111 
       
   112 typedef struct sol_uverbs_hca_info_v4_s {
       
   113 	char		uverbs_hca_psid_string[UVERBS_PSID_STR_SZ];
       
   114 	uint8_t		uverbs_hca_pad1[8];
       
   115 	char		uverbs_hca_ibdev_name[UVERBS_IBDEV_NAME_SZ];
       
   116 	char		uverbs_hca_driver_name[UVERBS_HCA_DRIVER_NAME_SZ];
       
   117 	uint32_t	uverbs_hca_driver_instance;
       
   118 	uint32_t	uverbs_hca_vendorid;
       
   119 	uint16_t	uverbs_hca_deviceid;
       
   120 	uint16_t	uverbs_hca_devidx;
       
   121 	int32_t		uverbs_hca_abi_version;
       
   122 	uint64_t	uverbs_hca_fw_ver;
       
   123 	uint64_t	uverbs_hca_node_guid;
       
   124 	uint64_t	uverbs_hca_node_external_guid;
       
   125 	uint64_t	uverbs_hca_sys_image_guid;
       
   126 	uint32_t	uverbs_hca_hw_version;
       
   127 	uint8_t		uverbs_hca_pad2[4];
       
   128 	char		uverbs_hca_devid_string[UVERBS_DEVID_STR_SZ];
       
   129 	uint8_t		uverbs_hca_pad3[24];
       
   130 } sol_uverbs_hca_info_v4_t;
       
   131 #define	IB_USER_VERBS_V4_IN_V3
       
   132 #endif
       
   133 
       
   134 /*
       
   135  * Some useful definitions.
    97  * Some useful definitions.
   136  */
    98  */
   137 #define	SIZEOF_UVERBS_INFO	(sizeof (sol_uverbs_info_t))
    99 #define	SIZEOF_UVERBS_INFO	(sizeof (sol_uverbs_info_t))
   138 #ifdef	IB_USER_VERBS_V4_IN_V3
       
   139 #define	SIZEOF_HCA_INFO		(sizeof (sol_uverbs_hca_info_v4_t))
       
   140 #else
       
   141 #define	SIZEOF_HCA_INFO		(sizeof (sol_uverbs_hca_info_t))
   100 #define	SIZEOF_HCA_INFO		(sizeof (sol_uverbs_hca_info_t))
   142 #endif
       
   143 #define	UVERBS_INFO(x)		((sol_uverbs_info_t *)x)
   101 #define	UVERBS_INFO(x)		((sol_uverbs_info_t *)x)
   144 
   102 
   145 /*
   103 /*
   146  * check_path() prefixs
   104  * check_path() prefixs
   147  */
   105  */
   309 {
   267 {
   310 	ibdev_cache_info_t		*info;
   268 	ibdev_cache_info_t		*info;
   311 	int				fd, i, hca_cnt;
   269 	int				fd, i, hca_cnt;
   312 	char				uverbs_devpath[MAX_OFS_DEVPATH_LEN];
   270 	char				uverbs_devpath[MAX_OFS_DEVPATH_LEN];
   313 	sol_uverbs_info_t		*uverbs_infop;
   271 	sol_uverbs_info_t		*uverbs_infop;
   314 #ifdef	IB_USER_VERBS_V4_IN_V3
       
   315 	sol_uverbs_hca_info_v4_t	*hca_infop;
       
   316 #else
       
   317 	sol_uverbs_hca_info_t		*hca_infop;
   272 	sol_uverbs_hca_info_t		*hca_infop;
   318 #endif
       
   319 	char 				*buf;
   273 	char 				*buf;
   320 	size_t				bufsize;
   274 	size_t				bufsize;
   321 	uint16_t			major, minor, sub_minor;
   275 	uint16_t			major, minor, sub_minor;
   322 	uint64_t			raw_fw_ver;
   276 	uint64_t			raw_fw_ver;
   323 	uint64_t			guid;
   277 	uint64_t			guid;