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()
1013 struct netvsc_device *nvdev) in netvsc_detach() argument
1020 if (cancel_work_sync(&nvdev->subchan_work)) in netvsc_detach()
1021 nvdev->num_chn = 1; in netvsc_detach()
1023 netvsc_xdp_set(ndev, NULL, NULL, nvdev); in netvsc_detach()
1027 netvsc_tx_disable(nvdev, ndev); in netvsc_detach()
1029 ret = rndis_filter_close(nvdev); in netvsc_detach()
1036 ret = netvsc_wait_until_empty(nvdev); in netvsc_detach()
1046 rndis_filter_device_remove(hdev, nvdev); in netvsc_detach()
1056 struct netvsc_device *nvdev; in netvsc_attach() local
1061 nvdev = rndis_filter_device_add(hdev, dev_info); in netvsc_attach()
1062 if (IS_ERR(nvdev)) in netvsc_attach()
1063 return PTR_ERR(nvdev); in netvsc_attach()
1065 if (nvdev->num_chn > 1) { in netvsc_attach()
1066 ret = rndis_set_subchannel(ndev, nvdev, dev_info); in netvsc_attach()
1070 nvdev->max_chn = 1; in netvsc_attach()
1071 nvdev->num_chn = 1; in netvsc_attach()
1078 ret = netvsc_xdp_set(ndev, prog, NULL, nvdev); in netvsc_attach()
1086 nvdev->tx_disable = false; in netvsc_attach()
1093 ret = rndis_filter_open(nvdev); in netvsc_attach()
1097 rdev = nvdev->extension; in netvsc_attach()
1108 rndis_filter_device_remove(hdev, nvdev); in netvsc_attach()
1117 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_set_channels() local
1127 if (!nvdev || nvdev->destroy) in netvsc_set_channels()
1130 if (nvdev->nvsp_version < NVSP_PROTOCOL_VERSION_5) in netvsc_set_channels()
1133 if (count > nvdev->max_chn) in netvsc_set_channels()
1136 orig = nvdev->num_chn; in netvsc_set_channels()
1138 device_info = netvsc_devinfo_get(nvdev); in netvsc_set_channels()
1145 ret = netvsc_detach(net, nvdev); in netvsc_set_channels()
1213 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_change_mtu() local
1218 if (!nvdev || nvdev->destroy) in netvsc_change_mtu()
1221 device_info = netvsc_devinfo_get(nvdev); in netvsc_change_mtu()
1233 ret = netvsc_detach(ndev, nvdev); in netvsc_change_mtu()
1291 struct netvsc_device *nvdev = rcu_dereference_rtnl(ndev_ctx->nvdev); in netvsc_get_pcpu_stats() local
1315 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_pcpu_stats()
1316 const struct netvsc_channel *nvchan = &nvdev->chan_table[i]; in netvsc_get_pcpu_stats()
1350 struct netvsc_device *nvdev; in netvsc_get_stats64() local
1356 nvdev = rcu_dereference(ndev_ctx->nvdev); in netvsc_get_stats64()
1357 if (!nvdev) in netvsc_get_stats64()
1369 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_stats64()
1370 const struct netvsc_channel *nvchan = &nvdev->chan_table[i]; in netvsc_get_stats64()
1406 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_set_mac_addr() local
1414 if (!nvdev) in netvsc_set_mac_addr()
1423 err = rndis_filter_set_device_mac(nvdev, addr->sa_data); in netvsc_set_mac_addr()
1487 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_sset_count() local
1489 if (!nvdev) in netvsc_get_sset_count()
1496 + NETVSC_QUEUE_STATS_LEN(nvdev) in netvsc_get_sset_count()
1507 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_ethtool_stats() local
1521 if (!nvdev) in netvsc_get_ethtool_stats()
1531 for (j = 0; j < nvdev->num_chn; j++) { in netvsc_get_ethtool_stats()
1532 tx_stats = &nvdev->chan_table[j].tx_stats; in netvsc_get_ethtool_stats()
1544 rx_stats = &nvdev->chan_table[j].rx_stats; in netvsc_get_ethtool_stats()
1580 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_strings() local
1584 if (!nvdev) in netvsc_get_strings()
1595 for (i = 0; i < nvdev->num_chn; i++) { in netvsc_get_strings()
1664 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev); in netvsc_get_rxnfc() local
1666 if (!nvdev) in netvsc_get_rxnfc()
1671 info->data = nvdev->num_chn; in netvsc_get_rxnfc()
1764 struct netvsc_device *ndev = rtnl_dereference(ndc->nvdev); in netvsc_get_rxfh()
1790 struct netvsc_device *ndev = rtnl_dereference(ndc->nvdev); in netvsc_set_rxfh()
1825 static void __netvsc_get_ringparam(struct netvsc_device *nvdev, in __netvsc_get_ringparam() argument
1830 ring->rx_pending = nvdev->recv_section_cnt; in __netvsc_get_ringparam()
1831 ring->tx_pending = nvdev->send_section_cnt; in __netvsc_get_ringparam()
1833 if (nvdev->nvsp_version <= NVSP_PROTOCOL_VERSION_2) in __netvsc_get_ringparam()
1838 ring->rx_max_pending = max_buf_size / nvdev->recv_section_size; in __netvsc_get_ringparam()
1840 / nvdev->send_section_size; in __netvsc_get_ringparam()
1849 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_get_ringparam() local
1851 if (!nvdev) in netvsc_get_ringparam()
1854 __netvsc_get_ringparam(nvdev, ring); in netvsc_get_ringparam()
1863 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_set_ringparam() local
1869 if (!nvdev || nvdev->destroy) in netvsc_set_ringparam()
1873 __netvsc_get_ringparam(nvdev, &orig); in netvsc_set_ringparam()
1884 device_info = netvsc_devinfo_get(nvdev); in netvsc_set_ringparam()
1892 ret = netvsc_detach(ndev, nvdev); in netvsc_set_ringparam()
1914 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_fix_features() local
1916 if (!nvdev || nvdev->destroy) in netvsc_fix_features()
1919 if ((features & NETIF_F_LRO) && netvsc_xdp_get(nvdev)) { in netvsc_fix_features()
1932 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev); in netvsc_set_features() local
1937 if (!nvdev || nvdev->destroy) in netvsc_set_features()
1953 ret = rndis_filter_set_offload_params(ndev, nvdev, &offloads); in netvsc_set_features()
2066 net_device = rtnl_dereference(ndev_ctx->nvdev); in netvsc_link_change()
2158 if (!rtnl_dereference(net_device_ctx->nvdev)) in get_netvsc_byref()
2374 netvsc_dev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_register_vf()
2442 netvsc_dev = rtnl_dereference(net_device_ctx->nvdev); in netvsc_vf_changed()
2523 struct netvsc_device *nvdev; in netvsc_probe() local
2593 nvdev = rndis_filter_device_add(dev, device_info); in netvsc_probe()
2594 if (IS_ERR(nvdev)) { in netvsc_probe()
2595 ret = PTR_ERR(nvdev); in netvsc_probe()
2602 if (nvdev->num_chn > 1) in netvsc_probe()
2603 schedule_work(&nvdev->subchan_work); in netvsc_probe()
2618 if (nvdev->nvsp_version >= NVSP_PROTOCOL_VERSION_2) in netvsc_probe()
2623 nvdev->tx_disable = false; in netvsc_probe()
2662 rndis_filter_device_remove(dev, nvdev); in netvsc_probe()
2679 struct netvsc_device *nvdev; in netvsc_remove() local
2692 nvdev = rtnl_dereference(ndev_ctx->nvdev); in netvsc_remove()
2693 if (nvdev) { in netvsc_remove()
2694 cancel_work_sync(&nvdev->subchan_work); in netvsc_remove()
2695 netvsc_xdp_set(net, NULL, NULL, nvdev); in netvsc_remove()
2706 if (nvdev) in netvsc_remove()
2707 rndis_filter_device_remove(dev, nvdev); in netvsc_remove()
2723 struct netvsc_device *nvdev; in netvsc_suspend() local
2734 nvdev = rtnl_dereference(ndev_ctx->nvdev); in netvsc_suspend()
2735 if (nvdev == NULL) { in netvsc_suspend()
2741 ndev_ctx->saved_netvsc_dev_info = netvsc_devinfo_get(nvdev); in netvsc_suspend()
2746 ret = netvsc_detach(net, nvdev); in netvsc_suspend()