Lines Matching refs:vdev

101 	struct virtio_device *vdev;  member
212 struct virtnet_info *vi = vq->vdev->priv; in skb_xmit_done()
352 u16 num_buf = virtio16_to_cpu(vi->vdev, hdr->num_buffers); in receive_mergeable()
370 virtio16_to_cpu(vi->vdev, in receive_mergeable()
475 virtio16_to_cpu(vi->vdev, hdr->hdr.csum_start), in receive_buf()
476 virtio16_to_cpu(vi->vdev, hdr->hdr.csum_offset))) in receive_buf()
507 skb_shinfo(skb)->gso_size = virtio16_to_cpu(vi->vdev, in receive_buf()
680 struct virtnet_info *vi = rvq->vdev->priv; in skb_recv_done()
730 struct virtnet_info *vi = rq->vq->vdev->priv; in virtnet_receive()
776 struct virtnet_info *vi = rq->vq->vdev->priv; in virtnet_busy_poll()
827 struct virtnet_info *vi = sq->vq->vdev->priv; in free_old_xmit_skbs()
846 struct virtnet_info *vi = sq->vq->vdev->priv; in xmit_skb()
865 hdr->hdr.csum_start = cpu_to_virtio16(vi->vdev, in xmit_skb()
867 hdr->hdr.csum_offset = cpu_to_virtio16(vi->vdev, in xmit_skb()
875 hdr->hdr.hdr_len = cpu_to_virtio16(vi->vdev, skb_headlen(skb)); in xmit_skb()
876 hdr->hdr.gso_size = cpu_to_virtio16(vi->vdev, in xmit_skb()
984 BUG_ON(!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ)); in virtnet_send_command()
1018 struct virtio_device *vdev = vi->vdev; in virtnet_set_mac_address() local
1027 if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_MAC_ADDR)) { in virtnet_set_mac_address()
1031 dev_warn(&vdev->dev, in virtnet_set_mac_address()
1035 } else if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC) && in virtnet_set_mac_address()
1036 !virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { in virtnet_set_mac_address()
1041 virtio_cwrite8(vdev, in virtnet_set_mac_address()
1115 if (!vi->has_cvq || !virtio_has_feature(vi->vdev, VIRTIO_NET_F_MQ)) in virtnet_set_queues()
1118 s.virtqueue_pairs = cpu_to_virtio16(vi->vdev, queue_pairs); in virtnet_set_queues()
1163 if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX)) in virtnet_set_rx_mode()
1195 mac_data->entries = cpu_to_virtio32(vi->vdev, uc_count); in virtnet_set_rx_mode()
1206 mac_data->entries = cpu_to_virtio32(vi->vdev, mc_count); in virtnet_set_rx_mode()
1326 struct virtio_device *vdev = vi->vdev; in virtnet_get_drvinfo() local
1330 strlcpy(info->bus_info, virtio_bus_name(vdev), sizeof(info->bus_info)); in virtnet_get_drvinfo()
1422 if (virtio_cread_feature(vi->vdev, VIRTIO_NET_F_STATUS, in virtnet_config_changed_work()
1448 static void virtnet_config_changed(struct virtio_device *vdev) in virtnet_config_changed() argument
1450 struct virtnet_info *vi = vdev->priv; in virtnet_config_changed()
1516 struct virtio_device *vdev = vi->vdev; in virtnet_del_vqs() local
1520 vdev->config->del_vqs(vdev); in virtnet_del_vqs()
1538 virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ); in virtnet_find_vqs()
1567 ret = vi->vdev->config->find_vqs(vi->vdev, total_vqs, vqs, callbacks, in virtnet_find_vqs()
1574 if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VLAN)) in virtnet_find_vqs()
1682 static bool virtnet_fail_on_feature(struct virtio_device *vdev, in virtnet_fail_on_feature() argument
1686 if (!virtio_has_feature(vdev, fbit)) in virtnet_fail_on_feature()
1689 dev_err(&vdev->dev, "device advertises feature %s but not %s", in virtnet_fail_on_feature()
1695 #define VIRTNET_FAIL_ON(vdev, fbit, dbit) \ argument
1696 virtnet_fail_on_feature(vdev, fbit, #fbit, dbit)
1698 static bool virtnet_validate_features(struct virtio_device *vdev) in virtnet_validate_features() argument
1700 if (!virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ) && in virtnet_validate_features()
1701 (VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_RX, in virtnet_validate_features()
1703 VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_VLAN, in virtnet_validate_features()
1705 VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_GUEST_ANNOUNCE, in virtnet_validate_features()
1707 VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_MQ, "VIRTIO_NET_F_CTRL_VQ") || in virtnet_validate_features()
1708 VIRTNET_FAIL_ON(vdev, VIRTIO_NET_F_CTRL_MAC_ADDR, in virtnet_validate_features()
1716 static int virtnet_probe(struct virtio_device *vdev) in virtnet_probe() argument
1723 if (!vdev->config->get) { in virtnet_probe()
1724 dev_err(&vdev->dev, "%s failure: config access disabled\n", in virtnet_probe()
1729 if (!virtnet_validate_features(vdev)) in virtnet_probe()
1733 err = virtio_cread_feature(vdev, VIRTIO_NET_F_MQ, in virtnet_probe()
1740 !virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) in virtnet_probe()
1754 SET_NETDEV_DEV(dev, &vdev->dev); in virtnet_probe()
1757 if (virtio_has_feature(vdev, VIRTIO_NET_F_CSUM)) { in virtnet_probe()
1763 if (virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) { in virtnet_probe()
1768 if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO4)) in virtnet_probe()
1770 if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO6)) in virtnet_probe()
1772 if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN)) in virtnet_probe()
1774 if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_UFO)) in virtnet_probe()
1783 if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_CSUM)) in virtnet_probe()
1789 if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) in virtnet_probe()
1790 virtio_cread_bytes(vdev, in virtnet_probe()
1799 vi->vdev = vdev; in virtnet_probe()
1800 vdev->priv = vi; in virtnet_probe()
1816 if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) || in virtnet_probe()
1817 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6) || in virtnet_probe()
1818 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN) || in virtnet_probe()
1819 virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_UFO)) in virtnet_probe()
1822 if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) in virtnet_probe()
1825 if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF) || in virtnet_probe()
1826 virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) in virtnet_probe()
1831 if (virtio_has_feature(vdev, VIRTIO_F_ANY_LAYOUT) || in virtnet_probe()
1832 virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) in virtnet_probe()
1835 if (virtio_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ)) in virtnet_probe()
1863 virtio_device_ready(vdev); in virtnet_probe()
1887 if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) { in virtnet_probe()
1901 vi->vdev->config->reset(vdev); in virtnet_probe()
1918 vi->vdev->config->reset(vi->vdev); in remove_vq_common()
1930 static void virtnet_remove(struct virtio_device *vdev) in virtnet_remove() argument
1932 struct virtnet_info *vi = vdev->priv; in virtnet_remove()
1948 static int virtnet_freeze(struct virtio_device *vdev) in virtnet_freeze() argument
1950 struct virtnet_info *vi = vdev->priv; in virtnet_freeze()
1971 static int virtnet_restore(struct virtio_device *vdev) in virtnet_restore() argument
1973 struct virtnet_info *vi = vdev->priv; in virtnet_restore()
1980 virtio_device_ready(vdev); in virtnet_restore()