Lines Matching refs:nvdev

86 	struct netvsc_device *nvdev;  in netvsc_set_rx_mode()  local
95 nvdev = rcu_dereference(ndev_ctx->nvdev); in netvsc_set_rx_mode()
96 if (nvdev) in netvsc_set_rx_mode()
97 rndis_filter_update(nvdev); in netvsc_set_rx_mode()
114 struct netvsc_device *nvdev = rtnl_dereference(ndev_ctx->nvdev); in netvsc_open() local
121 ret = rndis_filter_open(nvdev); in netvsc_open()
127 rdev = nvdev->extension; in netvsc_open()
130 netvsc_tx_enable(nvdev, net); in netvsc_open()
147 static int netvsc_wait_until_empty(struct netvsc_device *nvdev) in netvsc_wait_until_empty() argument
156 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_wait_until_empty()
158 = nvdev->chan_table[i].channel; in netvsc_wait_until_empty()
164 napi_synchronize(&nvdev->chan_table[i].napi); in netvsc_wait_until_empty()
201 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_close() local
204 netvsc_tx_disable(nvdev, net); in netvsc_close()
207 if (!nvdev) in netvsc_close()
210 ret = rndis_filter_close(nvdev); in netvsc_close()
216 ret = netvsc_wait_until_empty(nvdev); in netvsc_close()
875 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_get_channels() local
877 if (nvdev) { in netvsc_get_channels()
878 channel->max_combined = nvdev->max_chn; in netvsc_get_channels()
879 channel->combined_count = nvdev->num_chn; in netvsc_get_channels()
887 (struct netvsc_device *nvdev) in netvsc_devinfo_get() argument
896 if (nvdev) { in netvsc_devinfo_get()
897 dev_info->num_chn = nvdev->num_chn; in netvsc_devinfo_get()
898 dev_info->send_sections = nvdev->send_section_cnt; in netvsc_devinfo_get()
899 dev_info->send_section_size = nvdev->send_section_size; in netvsc_devinfo_get()
900 dev_info->recv_sections = nvdev->recv_section_cnt; in netvsc_devinfo_get()
901 dev_info->recv_section_size = nvdev->recv_section_size; in netvsc_devinfo_get()
903 memcpy(dev_info->rss_key, nvdev->extension->rss_key, in netvsc_devinfo_get()
917 struct netvsc_device *nvdev) in netvsc_detach() argument
924 if (cancel_work_sync(&nvdev->subchan_work)) in netvsc_detach()
925 nvdev->num_chn = 1; in netvsc_detach()
929 netvsc_tx_disable(nvdev, ndev); in netvsc_detach()
931 ret = rndis_filter_close(nvdev); in netvsc_detach()
938 ret = netvsc_wait_until_empty(nvdev); in netvsc_detach()
948 rndis_filter_device_remove(hdev, nvdev); in netvsc_detach()
958 struct netvsc_device *nvdev; in netvsc_attach() local
962 nvdev = rndis_filter_device_add(hdev, dev_info); in netvsc_attach()
963 if (IS_ERR(nvdev)) in netvsc_attach()
964 return PTR_ERR(nvdev); in netvsc_attach()
966 if (nvdev->num_chn > 1) { in netvsc_attach()
967 ret = rndis_set_subchannel(ndev, nvdev, dev_info); in netvsc_attach()
971 nvdev->max_chn = 1; in netvsc_attach()
972 nvdev->num_chn = 1; in netvsc_attach()
983 ret = rndis_filter_open(nvdev); in netvsc_attach()
987 rdev = nvdev->extension; in netvsc_attach()
997 rndis_filter_device_remove(hdev, nvdev); in netvsc_attach()
1006 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_set_channels() local
1016 if (!nvdev || nvdev->destroy) in netvsc_set_channels()
1019 if (nvdev->nvsp_version < NVSP_PROTOCOL_VERSION_5) in netvsc_set_channels()
1022 if (count > nvdev->max_chn) in netvsc_set_channels()
1025 orig = nvdev->num_chn; in netvsc_set_channels()
1027 device_info = netvsc_devinfo_get(nvdev); in netvsc_set_channels()
1034 ret = netvsc_detach(net, nvdev); in netvsc_set_channels()
1113 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_change_mtu() local
1118 if (!nvdev || nvdev->destroy) in netvsc_change_mtu()
1121 device_info = netvsc_devinfo_get(nvdev); in netvsc_change_mtu()
1133 ret = netvsc_detach(ndev, nvdev); in netvsc_change_mtu()
1191 struct netvsc_device *nvdev = rcu_dereference_rtnl(ndev_ctx->nvdev); in netvsc_get_pcpu_stats() local
1215 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_pcpu_stats()
1216 const struct netvsc_channel *nvchan = &nvdev->chan_table[i]; in netvsc_get_pcpu_stats()
1249 struct netvsc_device *nvdev; in netvsc_get_stats64() local
1255 nvdev = rcu_dereference(ndev_ctx->nvdev); in netvsc_get_stats64()
1256 if (!nvdev) in netvsc_get_stats64()
1268 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_stats64()
1269 const struct netvsc_channel *nvchan = &nvdev->chan_table[i]; in netvsc_get_stats64()
1304 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_set_mac_addr() local
1312 if (!nvdev) in netvsc_set_mac_addr()
1321 err = rndis_filter_set_device_mac(nvdev, addr->sa_data); in netvsc_set_mac_addr()
1384 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_sset_count() local
1386 if (!nvdev) in netvsc_get_sset_count()
1393 + NETVSC_QUEUE_STATS_LEN(nvdev) in netvsc_get_sset_count()
1404 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_ethtool_stats() local
1413 if (!nvdev) in netvsc_get_ethtool_stats()
1423 for (j = 0; j < nvdev->num_chn; j++) { in netvsc_get_ethtool_stats()
1424 qstats = &nvdev->chan_table[j].tx_stats; in netvsc_get_ethtool_stats()
1434 qstats = &nvdev->chan_table[j].rx_stats; in netvsc_get_ethtool_stats()
1461 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_strings() local
1465 if (!nvdev) in netvsc_get_strings()
1480 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_strings()
1551 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_rxnfc() local
1553 if (!nvdev) in netvsc_get_rxnfc()
1558 info->data = nvdev->num_chn; in netvsc_get_rxnfc()
1649 struct netvsc_device *ndev = rtnl_dereference(ndc->nvdev); in netvsc_get_rxfh()
1675 struct netvsc_device *ndev = rtnl_dereference(ndc->nvdev); in netvsc_set_rxfh()
1708 static void __netvsc_get_ringparam(struct netvsc_device *nvdev, in __netvsc_get_ringparam() argument
1713 ring->rx_pending = nvdev->recv_section_cnt; in __netvsc_get_ringparam()
1714 ring->tx_pending = nvdev->send_section_cnt; in __netvsc_get_ringparam()
1716 if (nvdev->nvsp_version <= NVSP_PROTOCOL_VERSION_2) in __netvsc_get_ringparam()
1721 ring->rx_max_pending = max_buf_size / nvdev->recv_section_size; in __netvsc_get_ringparam()
1723 / nvdev->send_section_size; in __netvsc_get_ringparam()
1730 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_get_ringparam() local
1732 if (!nvdev) in netvsc_get_ringparam()
1735 __netvsc_get_ringparam(nvdev, ring); in netvsc_get_ringparam()
1742 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_set_ringparam() local
1748 if (!nvdev || nvdev->destroy) in netvsc_set_ringparam()
1752 __netvsc_get_ringparam(nvdev, &orig); in netvsc_set_ringparam()
1763 device_info = netvsc_devinfo_get(nvdev); in netvsc_set_ringparam()
1771 ret = netvsc_detach(ndev, nvdev); in netvsc_set_ringparam()
1794 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_set_features() local
1799 if (!nvdev || nvdev->destroy) in netvsc_set_features()
1815 ret = rndis_filter_set_offload_params(ndev, nvdev, &offloads); in netvsc_set_features()
1906 net_device = rtnl_dereference(ndev_ctx->nvdev); in netvsc_link_change()
2001 if (!rtnl_dereference(net_device_ctx->nvdev)) in get_netvsc_byref()
2178 netvsc_dev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_register_vf()
2227 netvsc_dev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_vf_changed()
2266 struct netvsc_device *nvdev; in netvsc_probe() local
2319 nvdev = rndis_filter_device_add(dev, device_info); in netvsc_probe()
2320 if (IS_ERR(nvdev)) { in netvsc_probe()
2321 ret = PTR_ERR(nvdev); in netvsc_probe()
2338 if (nvdev->num_chn > 1) in netvsc_probe()
2339 schedule_work(&nvdev->subchan_work); in netvsc_probe()
2349 if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2) in netvsc_probe()
2368 rndis_filter_device_remove(dev, nvdev); in netvsc_probe()
2384 struct netvsc_device *nvdev; in netvsc_remove() local
2397 nvdev = rtnl_dereference(ndev_ctx->nvdev); in netvsc_remove()
2398 if (nvdev) in netvsc_remove()
2399 cancel_work_sync(&nvdev->subchan_work); in netvsc_remove()
2409 if (nvdev) in netvsc_remove()
2410 rndis_filter_device_remove(dev, nvdev); in netvsc_remove()