Lines Matching refs:vdev

101 	struct virtio_device *vdev;  member
218 struct virtnet_info *vi = vq->vdev->priv; in skb_xmit_done()
358 u16 num_buf = virtio16_to_cpu(vi->vdev, hdr->num_buffers); in receive_mergeable()
376 virtio16_to_cpu(vi->vdev, in receive_mergeable()
481 virtio16_to_cpu(vi->vdev, hdr->hdr.csum_start), in receive_buf()
482 virtio16_to_cpu(vi->vdev, hdr->hdr.csum_offset))) in receive_buf()
513 skb_shinfo(skb)->gso_size = virtio16_to_cpu(vi->vdev, in receive_buf()
686 struct virtnet_info *vi = rvq->vdev->priv; in skb_recv_done()
736 struct virtnet_info *vi = rq->vq->vdev->priv; in virtnet_receive()
782 struct virtnet_info *vi = rq->vq->vdev->priv; in virtnet_busy_poll()
833 struct virtnet_info *vi = sq->vq->vdev->priv; in free_old_xmit_skbs()
852 struct virtnet_info *vi = sq->vq->vdev->priv; in xmit_skb()
871 hdr->hdr.csum_start = cpu_to_virtio16(vi->vdev, in xmit_skb()
873 hdr->hdr.csum_offset = cpu_to_virtio16(vi->vdev, in xmit_skb()
881 hdr->hdr.hdr_len = cpu_to_virtio16(vi->vdev, skb_headlen(skb)); in xmit_skb()
882 hdr->hdr.gso_size = cpu_to_virtio16(vi->vdev, in xmit_skb()
988 BUG_ON(!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)); in virtnet_send_command()
1023 struct virtio_device *vdev = vi->vdev; in virtnet_set_mac_address() local
1032 if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_MAC_ADDR)) { in virtnet_set_mac_address()
1036 dev_warn(&vdev->dev, in virtnet_set_mac_address()
1040 } else if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC) && in virtnet_set_mac_address()
1041 !virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { in virtnet_set_mac_address()
1046 virtio_cwrite8(vdev, in virtnet_set_mac_address()
1120 if (!vi->has_cvq || !virtio_has_feature(vi->vdev, VIRTIO_NET_F_MQ)) in virtnet_set_queues()
1123 s.virtqueue_pairs = cpu_to_virtio16(vi->vdev, queue_pairs); in virtnet_set_queues()
1167 if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) in virtnet_set_rx_mode()
1199 mac_data->entries = cpu_to_virtio32(vi->vdev, uc_count); in virtnet_set_rx_mode()
1210 mac_data->entries = cpu_to_virtio32(vi->vdev, mc_count); in virtnet_set_rx_mode()
1330 struct virtio_device *vdev = vi->vdev; in virtnet_get_drvinfo() local
1334 strlcpy(info->bus_info, virtio_bus_name(vdev), sizeof(info->bus_info)); in virtnet_get_drvinfo()
1426 if (virtio_cread_feature(vi->vdev, VIRTIO_NET_F_STATUS, in virtnet_config_changed_work()
1452 static void virtnet_config_changed(struct virtio_device *vdev) in virtnet_config_changed() argument
1454 struct virtnet_info *vi = vdev->priv; in virtnet_config_changed()
1520 struct virtio_device *vdev = vi->vdev; in virtnet_del_vqs() local
1524 vdev->config->del_vqs(vdev); in virtnet_del_vqs()
1542 virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ); in virtnet_find_vqs()
1571 ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks, in virtnet_find_vqs()
1578 if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VLAN)) in virtnet_find_vqs()
1686 static bool virtnet_fail_on_feature(struct virtio_device *vdev, in virtnet_fail_on_feature() argument
1690 if (!virtio_has_feature(vdev, fbit)) in virtnet_fail_on_feature()
1693 dev_err(&vdev->dev, "device advertises feature %s but not %s", in virtnet_fail_on_feature()
1699 #define VIRTNET_FAIL_ON(vdev, fbit, dbit) \ argument
1700 virtnet_fail_on_feature(vdev, fbit, #fbit, dbit)
1702 static bool virtnet_validate_features(struct virtio_device *vdev) in virtnet_validate_features() argument
1704 if (!virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ) && in virtnet_validate_features()
1705 (VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_RX, in virtnet_validate_features()
1707 VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_VLAN, in virtnet_validate_features()
1709 VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_GUEST_ANNOUNCE, in virtnet_validate_features()
1711 VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_MQ, "VIRTIO_NET_F_CTRL_VQ") || in virtnet_validate_features()
1712 VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_MAC_ADDR, in virtnet_validate_features()
1720 static int virtnet_probe(struct virtio_device *vdev) in virtnet_probe() argument
1727 if (!vdev->config->get) { in virtnet_probe()
1728 dev_err(&vdev->dev, "%s failure: config access disabled\n", in virtnet_probe()
1733 if (!virtnet_validate_features(vdev)) in virtnet_probe()
1737 err = virtio_cread_feature(vdev, VIRTIO_NET_F_MQ, in virtnet_probe()
1744 !virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) in virtnet_probe()
1758 SET_NETDEV_DEV(dev, &vdev->dev); in virtnet_probe()
1761 if (virtio_has_feature(vdev, VIRTIO_NET_F_CSUM)) { in virtnet_probe()
1767 if (virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) { in virtnet_probe()
1772 if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO4)) in virtnet_probe()
1774 if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO6)) in virtnet_probe()
1776 if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN)) in virtnet_probe()
1778 if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_UFO)) in virtnet_probe()
1787 if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_CSUM)) in virtnet_probe()
1793 if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) in virtnet_probe()
1794 virtio_cread_bytes(vdev, in virtnet_probe()
1803 vi->vdev = vdev; in virtnet_probe()
1804 vdev->priv = vi; in virtnet_probe()
1820 if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) || in virtnet_probe()
1821 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6) || in virtnet_probe()
1822 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN) || in virtnet_probe()
1823 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_UFO)) in virtnet_probe()
1826 if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) in virtnet_probe()
1829 if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF) || in virtnet_probe()
1830 virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) in virtnet_probe()
1835 if (virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT) || in virtnet_probe()
1836 virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) in virtnet_probe()
1839 if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) in virtnet_probe()
1867 virtio_device_ready(vdev); in virtnet_probe()
1891 if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) { in virtnet_probe()
1905 vi->vdev->config->reset(vdev); in virtnet_probe()
1922 vi->vdev->config->reset(vi->vdev); in remove_vq_common()
1934 static void virtnet_remove(struct virtio_device *vdev) in virtnet_remove() argument
1936 struct virtnet_info *vi = vdev->priv; in virtnet_remove()
1952 static int virtnet_freeze(struct virtio_device *vdev) in virtnet_freeze() argument
1954 struct virtnet_info *vi = vdev->priv; in virtnet_freeze()
1975 static int virtnet_restore(struct virtio_device *vdev) in virtnet_restore() argument
1977 struct virtnet_info *vi = vdev->priv; in virtnet_restore()
1984 virtio_device_ready(vdev); in virtnet_restore()