summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/wangxun/libwx/wx_vf_common.c
diff options
context:
space:
mode:
authorMengyuan Lou <mengyuanlou@net-swift.com>2025-07-04 17:49:15 +0800
committerJakub Kicinski <kuba@kernel.org>2025-07-09 18:39:13 -0700
commit377d180bd71cd79f7134465d8af598ea764560da (patch)
treeb57808099cfdc67fb27f9e5082597d417ec25bd7 /drivers/net/ethernet/wangxun/libwx/wx_vf_common.c
parenteb4898fde1de8cf09f8a6b344dbd87536e0b1170 (diff)
net: wangxun: add txgbevf build
Add doc build infrastructure for txgbevf driver. Implement the basic PCI driver loading and unloading interface. Initialize the id_table which support 10/25/40G virtual functions for Wangxun. Ioremap the space of bar0 and bar4 which will be used. Signed-off-by: Mengyuan Lou <mengyuanlou@net-swift.com> Link: https://patch.msgid.link/20250704094923.652-5-mengyuanlou@net-swift.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/wangxun/libwx/wx_vf_common.c')
-rw-r--r--drivers/net/ethernet/wangxun/libwx/wx_vf_common.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/ethernet/wangxun/libwx/wx_vf_common.c b/drivers/net/ethernet/wangxun/libwx/wx_vf_common.c
index aac420bf578b..4a3c7d61e5fd 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_vf_common.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_vf_common.c
@@ -11,6 +11,44 @@
#include "wx_vf_lib.h"
#include "wx_vf_common.h"
+int wxvf_suspend(struct device *dev_d)
+{
+ struct pci_dev *pdev = to_pci_dev(dev_d);
+ struct wx *wx = pci_get_drvdata(pdev);
+
+ netif_device_detach(wx->netdev);
+ pci_disable_device(pdev);
+
+ return 0;
+}
+EXPORT_SYMBOL(wxvf_suspend);
+
+void wxvf_shutdown(struct pci_dev *pdev)
+{
+ wxvf_suspend(&pdev->dev);
+}
+EXPORT_SYMBOL(wxvf_shutdown);
+
+int wxvf_resume(struct device *dev_d)
+{
+ struct pci_dev *pdev = to_pci_dev(dev_d);
+ struct wx *wx = pci_get_drvdata(pdev);
+
+ pci_set_master(pdev);
+ netif_device_attach(wx->netdev);
+
+ return 0;
+}
+EXPORT_SYMBOL(wxvf_resume);
+
+void wxvf_remove(struct pci_dev *pdev)
+{
+ pci_release_selected_regions(pdev,
+ pci_select_bars(pdev, IORESOURCE_MEM));
+ pci_disable_device(pdev);
+}
+EXPORT_SYMBOL(wxvf_remove);
+
static irqreturn_t wx_msix_misc_vf(int __always_unused irq, void *data)
{
struct wx *wx = data;