Lines Matching refs:nvdev

85 	struct netvsc_device *nvdev;  in netvsc_set_rx_mode()  local
94 nvdev = rcu_dereference(ndev_ctx->nvdev); in netvsc_set_rx_mode()
95 if (nvdev) in netvsc_set_rx_mode()
96 rndis_filter_update(nvdev); in netvsc_set_rx_mode()
113 struct netvsc_device *nvdev = rtnl_dereference(ndev_ctx->nvdev); in netvsc_open() local
120 ret = rndis_filter_open(nvdev); in netvsc_open()
126 rdev = nvdev->extension; in netvsc_open()
129 netvsc_tx_enable(nvdev, net); in netvsc_open()
146 static int netvsc_wait_until_empty(struct netvsc_device *nvdev) in netvsc_wait_until_empty() argument
155 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_wait_until_empty()
157 = nvdev->chan_table[i].channel; in netvsc_wait_until_empty()
163 napi_synchronize(&nvdev->chan_table[i].napi); in netvsc_wait_until_empty()
200 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_close() local
203 netvsc_tx_disable(nvdev, net); in netvsc_close()
206 if (!nvdev) in netvsc_close()
209 ret = rndis_filter_close(nvdev); in netvsc_close()
215 ret = netvsc_wait_until_empty(nvdev); in netvsc_close()
946 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_get_channels() local
948 if (nvdev) { in netvsc_get_channels()
949 channel->max_combined = nvdev->max_chn; in netvsc_get_channels()
950 channel->combined_count = nvdev->num_chn; in netvsc_get_channels()
958 struct netvsc_device_info *netvsc_devinfo_get(struct netvsc_device *nvdev) in netvsc_devinfo_get() argument
968 if (nvdev) { in netvsc_devinfo_get()
971 dev_info->num_chn = nvdev->num_chn; in netvsc_devinfo_get()
972 dev_info->send_sections = nvdev->send_section_cnt; in netvsc_devinfo_get()
973 dev_info->send_section_size = nvdev->send_section_size; in netvsc_devinfo_get()
974 dev_info->recv_sections = nvdev->recv_section_cnt; in netvsc_devinfo_get()
975 dev_info->recv_section_size = nvdev->recv_section_size; in netvsc_devinfo_get()
977 memcpy(dev_info->rss_key, nvdev->extension->rss_key, in netvsc_devinfo_get()
980 prog = netvsc_xdp_get(nvdev); in netvsc_devinfo_get()
1008 struct netvsc_device *nvdev) in netvsc_detach() argument
1015 if (cancel_work_sync(&nvdev->subchan_work)) in netvsc_detach()
1016 nvdev->num_chn = 1; in netvsc_detach()
1018 netvsc_xdp_set(ndev, NULL, NULL, nvdev); in netvsc_detach()
1022 netvsc_tx_disable(nvdev, ndev); in netvsc_detach()
1024 ret = rndis_filter_close(nvdev); in netvsc_detach()
1031 ret = netvsc_wait_until_empty(nvdev); in netvsc_detach()
1041 rndis_filter_device_remove(hdev, nvdev); in netvsc_detach()
1051 struct netvsc_device *nvdev; in netvsc_attach() local
1056 nvdev = rndis_filter_device_add(hdev, dev_info); in netvsc_attach()
1057 if (IS_ERR(nvdev)) in netvsc_attach()
1058 return PTR_ERR(nvdev); in netvsc_attach()
1060 if (nvdev->num_chn > 1) { in netvsc_attach()
1061 ret = rndis_set_subchannel(ndev, nvdev, dev_info); in netvsc_attach()
1065 nvdev->max_chn = 1; in netvsc_attach()
1066 nvdev->num_chn = 1; in netvsc_attach()
1073 ret = netvsc_xdp_set(ndev, prog, NULL, nvdev); in netvsc_attach()
1081 nvdev->tx_disable = false; in netvsc_attach()
1088 ret = rndis_filter_open(nvdev); in netvsc_attach()
1092 rdev = nvdev->extension; in netvsc_attach()
1103 rndis_filter_device_remove(hdev, nvdev); in netvsc_attach()
1112 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_set_channels() local
1122 if (!nvdev || nvdev->destroy) in netvsc_set_channels()
1125 if (nvdev->nvsp_version < NVSP_PROTOCOL_VERSION_5) in netvsc_set_channels()
1128 if (count > nvdev->max_chn) in netvsc_set_channels()
1131 orig = nvdev->num_chn; in netvsc_set_channels()
1133 device_info = netvsc_devinfo_get(nvdev); in netvsc_set_channels()
1140 ret = netvsc_detach(net, nvdev); in netvsc_set_channels()
1208 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_change_mtu() local
1213 if (!nvdev || nvdev->destroy) in netvsc_change_mtu()
1216 device_info = netvsc_devinfo_get(nvdev); in netvsc_change_mtu()
1228 ret = netvsc_detach(ndev, nvdev); in netvsc_change_mtu()
1286 struct netvsc_device *nvdev = rcu_dereference_rtnl(ndev_ctx->nvdev); in netvsc_get_pcpu_stats() local
1310 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_pcpu_stats()
1311 const struct netvsc_channel *nvchan = &nvdev->chan_table[i]; in netvsc_get_pcpu_stats()
1345 struct netvsc_device *nvdev; in netvsc_get_stats64() local
1351 nvdev = rcu_dereference(ndev_ctx->nvdev); in netvsc_get_stats64()
1352 if (!nvdev) in netvsc_get_stats64()
1364 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_stats64()
1365 const struct netvsc_channel *nvchan = &nvdev->chan_table[i]; in netvsc_get_stats64()
1401 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_set_mac_addr() local
1409 if (!nvdev) in netvsc_set_mac_addr()
1418 err = rndis_filter_set_device_mac(nvdev, addr->sa_data); in netvsc_set_mac_addr()
1482 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_sset_count() local
1484 if (!nvdev) in netvsc_get_sset_count()
1491 + NETVSC_QUEUE_STATS_LEN(nvdev) in netvsc_get_sset_count()
1502 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_ethtool_stats() local
1516 if (!nvdev) in netvsc_get_ethtool_stats()
1526 for (j = 0; j < nvdev->num_chn; j++) { in netvsc_get_ethtool_stats()
1527 tx_stats = &nvdev->chan_table[j].tx_stats; in netvsc_get_ethtool_stats()
1539 rx_stats = &nvdev->chan_table[j].rx_stats; in netvsc_get_ethtool_stats()
1575 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_strings() local
1579 if (!nvdev) in netvsc_get_strings()
1590 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_strings()
1659 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_rxnfc() local
1661 if (!nvdev) in netvsc_get_rxnfc()
1666 info->data = nvdev->num_chn; in netvsc_get_rxnfc()
1757 struct netvsc_device *ndev = rtnl_dereference(ndc->nvdev); in netvsc_get_rxfh()
1783 struct netvsc_device *ndev = rtnl_dereference(ndc->nvdev); in netvsc_set_rxfh()
1816 static void __netvsc_get_ringparam(struct netvsc_device *nvdev, in __netvsc_get_ringparam() argument
1821 ring->rx_pending = nvdev->recv_section_cnt; in __netvsc_get_ringparam()
1822 ring->tx_pending = nvdev->send_section_cnt; in __netvsc_get_ringparam()
1824 if (nvdev->nvsp_version <= NVSP_PROTOCOL_VERSION_2) in __netvsc_get_ringparam()
1829 ring->rx_max_pending = max_buf_size / nvdev->recv_section_size; in __netvsc_get_ringparam()
1831 / nvdev->send_section_size; in __netvsc_get_ringparam()
1840 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_get_ringparam() local
1842 if (!nvdev) in netvsc_get_ringparam()
1845 __netvsc_get_ringparam(nvdev, ring); in netvsc_get_ringparam()
1854 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_set_ringparam() local
1860 if (!nvdev || nvdev->destroy) in netvsc_set_ringparam()
1864 __netvsc_get_ringparam(nvdev, &orig); in netvsc_set_ringparam()
1875 device_info = netvsc_devinfo_get(nvdev); in netvsc_set_ringparam()
1883 ret = netvsc_detach(ndev, nvdev); in netvsc_set_ringparam()
1905 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_fix_features() local
1907 if (!nvdev || nvdev->destroy) in netvsc_fix_features()
1910 if ((features & NETIF_F_LRO) && netvsc_xdp_get(nvdev)) { in netvsc_fix_features()
1923 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_set_features() local
1928 if (!nvdev || nvdev->destroy) in netvsc_set_features()
1944 ret = rndis_filter_set_offload_params(ndev, nvdev, &offloads); in netvsc_set_features()
2057 net_device = rtnl_dereference(ndev_ctx->nvdev); in netvsc_link_change()
2149 if (!rtnl_dereference(net_device_ctx->nvdev)) in get_netvsc_byref()
2337 netvsc_dev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_register_vf()
2405 netvsc_dev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_vf_changed()
2459 struct netvsc_device *nvdev; in netvsc_probe() local
2513 nvdev = rndis_filter_device_add(dev, device_info); in netvsc_probe()
2514 if (IS_ERR(nvdev)) { in netvsc_probe()
2515 ret = PTR_ERR(nvdev); in netvsc_probe()
2532 if (nvdev->num_chn > 1) in netvsc_probe()
2533 schedule_work(&nvdev->subchan_work); in netvsc_probe()
2545 if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2) in netvsc_probe()
2550 nvdev->tx_disable = false; in netvsc_probe()
2566 rndis_filter_device_remove(dev, nvdev); in netvsc_probe()
2582 struct netvsc_device *nvdev; in netvsc_remove() local
2595 nvdev = rtnl_dereference(ndev_ctx->nvdev); in netvsc_remove()
2596 if (nvdev) { in netvsc_remove()
2597 cancel_work_sync(&nvdev->subchan_work); in netvsc_remove()
2598 netvsc_xdp_set(net, NULL, NULL, nvdev); in netvsc_remove()
2609 if (nvdev) in netvsc_remove()
2610 rndis_filter_device_remove(dev, nvdev); in netvsc_remove()
2627 struct netvsc_device *nvdev; in netvsc_suspend() local
2638 nvdev = rtnl_dereference(ndev_ctx->nvdev); in netvsc_suspend()
2639 if (nvdev == NULL) { in netvsc_suspend()
2645 ndev_ctx->saved_netvsc_dev_info = netvsc_devinfo_get(nvdev); in netvsc_suspend()
2650 ret = netvsc_detach(net, nvdev); in netvsc_suspend()