src/dpdk/drivers/net/mlx4/mlx4_ethdev.c
int mlx4_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)
{
	struct mlx4_priv *priv = dev->data->dev_private;
	struct ibv_device_attr *attr = &priv->device_attr;
	size_t size = strnlen(attr->fw_ver, sizeof(attr->fw_ver)) + 1;

	if (fw_size < size)
		return size;
	if (fw_ver != NULL)
		strlcpy(fw_ver, attr->fw_ver, fw_size);
	return 0;
}
/**
 * Get firmware version of a device.
 *
 * @param dev
 *   Ethernet device port.
 * @param fw_ver
 *   String output allocated by caller.
 * @param fw_size
 *   Size of the output string, including terminating null byte.
 *
 * @return
 *   0 on success, or the size of the non truncated string if too big.
 */
Get firmware version of a device.
@param dev
Ethernet device port.
@param fw_ver
String output allocated by caller.
@param fw_size
Size of the output string, including terminating null byte.

@return
0 on success, or the size of the non truncated string if too big.
Get firmware version of a device . @param dev Ethernet device port . @param fw_ver String output allocated by caller . @param fw_size Size of the output string including terminating null byte . @return 0 on success or the size of the non truncated string if too big .
int mlx4_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)
{
	struct mlx4_priv *priv = dev->data->dev_private;
	struct ibv_device_attr *attr = &priv->device_attr;
	size_t size = strnlen(attr->fw_ver, sizeof(attr->fw_ver)) + 1;
	if (fw_size < size)
		return size;
	if (fw_ver != NULL)
		strlcpy(fw_ver, attr->fw_ver, fw_size);
	return 0;
}
int mlx4_fw_version_get ( struct rte_eth_dev * dev , char * fw_ver , size_t fw_size ) { struct mlx4_priv * priv = dev -> data -> dev_private ; struct ibv_device_attr * attr = & priv -> device_attr ; size_t size = strnlen ( attr -> fw_ver , sizeof ( attr -> fw_ver ) ) + 1 ; if ( fw_size < size ) return size ; if ( fw_ver != NULL ) strlcpy ( fw_ver , attr -> fw_ver , fw_size ) ; return 0 ; }
Get firmware version of a device.
Get firmware version of a device .