host-drivers/base-driver/vca/vop/vop_vringh.c
static u64 vop_get_features(struct virtio_device *virtio_dev)
{
	struct vop_host_virtio_dev* host_virtio_dev = to_host_virtio_device(virtio_dev);
	struct vop_device *vdev =  host_virtio_dev->vdev;
	struct vca_device_desc *desc = host_virtio_dev->dd;
	unsigned int i, bits;
	u64 features = 0;
	u8  *in_features = vca_vq_features(desc);
	int feature_len = desc->feature_len;

	dev_dbg(&vdev->dev, "%s features: %llx\n", __func__,*(u64*)in_features);

	bits = min_t(unsigned, feature_len,
		     sizeof(virtio_dev->features)) * 8;
	for (i = 0; i < bits; i++)
		if (in_features[i / 8] & (BIT(i % 8)))
			features |= BIT(i);

	return features;
}
/* This gets the device's feature bits. */
This gets the device's feature bits.
This gets the device ' s feature bits .
static u64 vop_get_features(struct virtio_device *virtio_dev)
{
	struct vop_host_virtio_dev* host_virtio_dev = to_host_virtio_device(virtio_dev);
	struct vop_device *vdev =  host_virtio_dev->vdev;
	struct vca_device_desc *desc = host_virtio_dev->dd;
	unsigned int i, bits;
	u64 features = 0;
	u8  *in_features = vca_vq_features(desc);
	int feature_len = desc->feature_len;
	dev_dbg(&vdev->dev, "%s features: %llx\n", __func__,*(u64*)in_features);
	bits = min_t(unsigned, feature_len,
		     sizeof(virtio_dev->features)) * 8;
	for (i = 0; i < bits; i++)
		if (in_features[i / 8] & (BIT(i % 8)))
			features |= BIT(i);
	return features;
}
static u64 vop_get_features ( struct virtio_device * virtio_dev ) { struct vop_host_virtio_dev * host_virtio_dev = to_host_virtio_device ( virtio_dev ) ; struct vop_device * vdev = host_virtio_dev -> vdev ; struct vca_device_desc * desc = host_virtio_dev -> dd ; unsigned int i , bits ; u64 features = 0 ; u8 * in_features = vca_vq_features ( desc ) ; int feature_len = desc -> feature_len ; dev_dbg ( & vdev -> dev , " \n " , __func__ , * ( u64 * ) in_features ) ; bits = min_t ( unsigned , feature_len , sizeof ( virtio_dev -> features ) ) * 8 ; for ( i = 0 ; i < bits ; i ++ ) if ( in_features [ i / 8 ] & ( BIT ( i % 8 ) ) ) features |= BIT ( i ) ; return features ; }
This gets the device's feature bits.
This gets the device ' s feature bits .