Lines Matching refs:nvdev

89 	struct netvsc_device *nvdev;  in netvsc_set_rx_mode()  local
98 nvdev = rcu_dereference(ndev_ctx->nvdev); in netvsc_set_rx_mode()
99 if (nvdev) in netvsc_set_rx_mode()
100 rndis_filter_update(nvdev); in netvsc_set_rx_mode()
117 struct netvsc_device *nvdev = rtnl_dereference(ndev_ctx->nvdev); in netvsc_open() local
124 ret = rndis_filter_open(nvdev); in netvsc_open()
130 rdev = nvdev->extension; in netvsc_open()
133 netvsc_tx_enable(nvdev, net); in netvsc_open()
150 static int netvsc_wait_until_empty(struct netvsc_device *nvdev) in netvsc_wait_until_empty() argument
159 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_wait_until_empty()
161 = nvdev->chan_table[i].channel; in netvsc_wait_until_empty()
167 napi_synchronize(&nvdev->chan_table[i].napi); in netvsc_wait_until_empty()
204 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_close() local
207 netvsc_tx_disable(nvdev, net); in netvsc_close()
210 if (!nvdev) in netvsc_close()
213 ret = rndis_filter_close(nvdev); in netvsc_close()
219 ret = netvsc_wait_until_empty(nvdev); in netvsc_close()
950 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_get_channels() local
952 if (nvdev) { in netvsc_get_channels()
953 channel->max_combined = nvdev->max_chn; in netvsc_get_channels()
954 channel->combined_count = nvdev->num_chn; in netvsc_get_channels()
962 struct netvsc_device_info *netvsc_devinfo_get(struct netvsc_device *nvdev) in netvsc_devinfo_get() argument
972 if (nvdev) { in netvsc_devinfo_get()
975 dev_info->num_chn = nvdev->num_chn; in netvsc_devinfo_get()
976 dev_info->send_sections = nvdev->send_section_cnt; in netvsc_devinfo_get()
977 dev_info->send_section_size = nvdev->send_section_size; in netvsc_devinfo_get()
978 dev_info->recv_sections = nvdev->recv_section_cnt; in netvsc_devinfo_get()
979 dev_info->recv_section_size = nvdev->recv_section_size; in netvsc_devinfo_get()
981 memcpy(dev_info->rss_key, nvdev->extension->rss_key, in netvsc_devinfo_get()
984 prog = netvsc_xdp_get(nvdev); in netvsc_devinfo_get()
1012 struct netvsc_device *nvdev) in netvsc_detach() argument
1019 if (cancel_work_sync(&nvdev->subchan_work)) in netvsc_detach()
1020 nvdev->num_chn = 1; in netvsc_detach()
1022 netvsc_xdp_set(ndev, NULL, NULL, nvdev); in netvsc_detach()
1026 netvsc_tx_disable(nvdev, ndev); in netvsc_detach()
1028 ret = rndis_filter_close(nvdev); in netvsc_detach()
1035 ret = netvsc_wait_until_empty(nvdev); in netvsc_detach()
1045 rndis_filter_device_remove(hdev, nvdev); in netvsc_detach()
1055 struct netvsc_device *nvdev; in netvsc_attach() local
1060 nvdev = rndis_filter_device_add(hdev, dev_info); in netvsc_attach()
1061 if (IS_ERR(nvdev)) in netvsc_attach()
1062 return PTR_ERR(nvdev); in netvsc_attach()
1064 if (nvdev->num_chn > 1) { in netvsc_attach()
1065 ret = rndis_set_subchannel(ndev, nvdev, dev_info); in netvsc_attach()
1069 nvdev->max_chn = 1; in netvsc_attach()
1070 nvdev->num_chn = 1; in netvsc_attach()
1077 ret = netvsc_xdp_set(ndev, prog, NULL, nvdev); in netvsc_attach()
1085 nvdev->tx_disable = false; in netvsc_attach()
1092 ret = rndis_filter_open(nvdev); in netvsc_attach()
1096 rdev = nvdev->extension; in netvsc_attach()
1107 rndis_filter_device_remove(hdev, nvdev); in netvsc_attach()
1116 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_set_channels() local
1126 if (!nvdev || nvdev->destroy) in netvsc_set_channels()
1129 if (nvdev->nvsp_version < NVSP_PROTOCOL_VERSION_5) in netvsc_set_channels()
1132 if (count > nvdev->max_chn) in netvsc_set_channels()
1135 orig = nvdev->num_chn; in netvsc_set_channels()
1137 device_info = netvsc_devinfo_get(nvdev); in netvsc_set_channels()
1144 ret = netvsc_detach(net, nvdev); in netvsc_set_channels()
1212 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_change_mtu() local
1217 if (!nvdev || nvdev->destroy) in netvsc_change_mtu()
1220 device_info = netvsc_devinfo_get(nvdev); in netvsc_change_mtu()
1232 ret = netvsc_detach(ndev, nvdev); in netvsc_change_mtu()
1290 struct netvsc_device *nvdev = rcu_dereference_rtnl(ndev_ctx->nvdev); in netvsc_get_pcpu_stats() local
1314 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_pcpu_stats()
1315 const struct netvsc_channel *nvchan = &nvdev->chan_table[i]; in netvsc_get_pcpu_stats()
1349 struct netvsc_device *nvdev; in netvsc_get_stats64() local
1355 nvdev = rcu_dereference(ndev_ctx->nvdev); in netvsc_get_stats64()
1356 if (!nvdev) in netvsc_get_stats64()
1368 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_stats64()
1369 const struct netvsc_channel *nvchan = &nvdev->chan_table[i]; in netvsc_get_stats64()
1405 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_set_mac_addr() local
1413 if (!nvdev) in netvsc_set_mac_addr()
1422 err = rndis_filter_set_device_mac(nvdev, addr->sa_data); in netvsc_set_mac_addr()
1486 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_sset_count() local
1488 if (!nvdev) in netvsc_get_sset_count()
1495 + NETVSC_QUEUE_STATS_LEN(nvdev) in netvsc_get_sset_count()
1506 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_ethtool_stats() local
1520 if (!nvdev) in netvsc_get_ethtool_stats()
1530 for (j = 0; j < nvdev->num_chn; j++) { in netvsc_get_ethtool_stats()
1531 tx_stats = &nvdev->chan_table[j].tx_stats; in netvsc_get_ethtool_stats()
1543 rx_stats = &nvdev->chan_table[j].rx_stats; in netvsc_get_ethtool_stats()
1579 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_strings() local
1583 if (!nvdev) in netvsc_get_strings()
1594 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_strings()
1663 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_rxnfc() local
1665 if (!nvdev) in netvsc_get_rxnfc()
1670 info->data = nvdev->num_chn; in netvsc_get_rxnfc()
1763 struct netvsc_device *ndev = rtnl_dereference(ndc->nvdev); in netvsc_get_rxfh()
1789 struct netvsc_device *ndev = rtnl_dereference(ndc->nvdev); in netvsc_set_rxfh()
1822 static void __netvsc_get_ringparam(struct netvsc_device *nvdev, in __netvsc_get_ringparam() argument
1827 ring->rx_pending = nvdev->recv_section_cnt; in __netvsc_get_ringparam()
1828 ring->tx_pending = nvdev->send_section_cnt; in __netvsc_get_ringparam()
1830 if (nvdev->nvsp_version <= NVSP_PROTOCOL_VERSION_2) in __netvsc_get_ringparam()
1835 ring->rx_max_pending = max_buf_size / nvdev->recv_section_size; in __netvsc_get_ringparam()
1837 / nvdev->send_section_size; in __netvsc_get_ringparam()
1846 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_get_ringparam() local
1848 if (!nvdev) in netvsc_get_ringparam()
1851 __netvsc_get_ringparam(nvdev, ring); in netvsc_get_ringparam()
1860 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_set_ringparam() local
1866 if (!nvdev || nvdev->destroy) in netvsc_set_ringparam()
1870 __netvsc_get_ringparam(nvdev, &orig); in netvsc_set_ringparam()
1881 device_info = netvsc_devinfo_get(nvdev); in netvsc_set_ringparam()
1889 ret = netvsc_detach(ndev, nvdev); in netvsc_set_ringparam()
1911 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_fix_features() local
1913 if (!nvdev || nvdev->destroy) in netvsc_fix_features()
1916 if ((features & NETIF_F_LRO) && netvsc_xdp_get(nvdev)) { in netvsc_fix_features()
1929 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_set_features() local
1934 if (!nvdev || nvdev->destroy) in netvsc_set_features()
1950 ret = rndis_filter_set_offload_params(ndev, nvdev, &offloads); in netvsc_set_features()
2063 net_device = rtnl_dereference(ndev_ctx->nvdev); in netvsc_link_change()
2155 if (!rtnl_dereference(net_device_ctx->nvdev)) in get_netvsc_byref()
2371 netvsc_dev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_register_vf()
2439 netvsc_dev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_vf_changed()
2520 struct netvsc_device *nvdev; in netvsc_probe() local
2590 nvdev = rndis_filter_device_add(dev, device_info); in netvsc_probe()
2591 if (IS_ERR(nvdev)) { in netvsc_probe()
2592 ret = PTR_ERR(nvdev); in netvsc_probe()
2599 if (nvdev->num_chn > 1) in netvsc_probe()
2600 schedule_work(&nvdev->subchan_work); in netvsc_probe()
2615 if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2) in netvsc_probe()
2620 nvdev->tx_disable = false; in netvsc_probe()
2659 rndis_filter_device_remove(dev, nvdev); in netvsc_probe()
2676 struct netvsc_device *nvdev; in netvsc_remove() local
2689 nvdev = rtnl_dereference(ndev_ctx->nvdev); in netvsc_remove()
2690 if (nvdev) { in netvsc_remove()
2691 cancel_work_sync(&nvdev->subchan_work); in netvsc_remove()
2692 netvsc_xdp_set(net, NULL, NULL, nvdev); in netvsc_remove()
2703 if (nvdev) in netvsc_remove()
2704 rndis_filter_device_remove(dev, nvdev); in netvsc_remove()
2720 struct netvsc_device *nvdev; in netvsc_suspend() local
2731 nvdev = rtnl_dereference(ndev_ctx->nvdev); in netvsc_suspend()
2732 if (nvdev == NULL) { in netvsc_suspend()
2738 ndev_ctx->saved_netvsc_dev_info = netvsc_devinfo_get(nvdev); in netvsc_suspend()
2743 ret = netvsc_detach(net, nvdev); in netvsc_suspend()