Commit 377d180b authored by Mengyuan Lou's avatar Mengyuan Lou Committed by Jakub Kicinski
Browse files

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: default avatarMengyuan Lou <mengyuanlou@net-swift.com>
Link: https://patch.msgid.link/20250704094923.652-5-mengyuanlou@net-swift.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent eb4898fd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ Contents:
   ti/tlan
   ti/icssg_prueth
   wangxun/txgbe
   wangxun/txgbevf
   wangxun/ngbe

.. only::  subproject and html
+16 −0
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0+

===========================================================================
Linux Base Virtual Function Driver for Wangxun(R) 10/25/40 Gigabit Ethernet
===========================================================================

WangXun 10/25/40 Gigabit Virtual Function Linux driver.
Copyright(c) 2015 - 2025 Beijing WangXun Technology Co., Ltd.

Support
=======
For general information, go to the website at:
https://www.net-swift.com

If you got any problem, contact Wangxun support team via nic-support@net-swift.com
and Cc: netdev.
+18 −0
Original line number Diff line number Diff line
@@ -64,4 +64,22 @@ config TXGBE
	  To compile this driver as a module, choose M here. The module
	  will be called txgbe.

config TXGBEVF
	tristate "Wangxun(R) 10/25/40G Virtual Function Ethernet support"
	depends on PCI
	depends on PCI_MSI
	select LIBWX
	select PHYLINK
	help
	  This driver supports virtual functions for SP1000A, WX1820AL,
	  WX5XXX, WX5XXXAL.

	  This driver was formerly named txgbevf.

	  More specific information on configuring the driver is in
	  <file:Documentation/networking/device_drivers/ethernet/wangxun/txgbevf.rst>.

	  To compile this driver as a module, choose M here. MSI-X interrupt
	  support is required for this driver to work correctly.

endif # NET_VENDOR_WANGXUN
+1 −0
Original line number Diff line number Diff line
@@ -5,4 +5,5 @@

obj-$(CONFIG_LIBWX) += libwx/
obj-$(CONFIG_TXGBE) += txgbe/
obj-$(CONFIG_TXGBEVF) += txgbevf/
obj-$(CONFIG_NGBE) += ngbe/
+38 −0
Original line number Diff line number Diff line
@@ -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;
Loading