Commit b62d9e20 authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge branch 'txgbe-phylink-support'

Jiawen Wu says:

====================
TXGBE PHYLINK support

Implement I2C, SFP, GPIO and PHYLINK to setup TXGBE link.

Because our I2C and PCS are based on Synopsys Designware IP-core, extend
the i2c-designware and pcs-xpcs driver to realize our functions.
====================

Link: https://lore.kernel.org/r/20230606092107.764621-1-jiawenwu@trustnetic.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents 4a562127 08f08f93
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -40,6 +40,16 @@ config NGBE
config TXGBE
	tristate "Wangxun(R) 10GbE PCI Express adapters support"
	depends on PCI
	depends on COMMON_CLK
	select REGMAP
	select I2C
	select I2C_DESIGNWARE_PLATFORM
	select PHYLINK
	select HWMON if TXGBE=y
	select SFP
	select GPIOLIB
	select GPIOLIB_IRQCHIP
	select PCS_XPCS
	select LIBWX
	help
	  This driver supports Wangxun(R) 10GbE PCI Express family of
+2 −1
Original line number Diff line number Diff line
@@ -2048,6 +2048,7 @@ void wx_free_irq(struct wx *wx)
		free_irq(entry->vector, q_vector);
	}

	if (wx->mac.type == wx_mac_em)
		free_irq(wx->msix_entries[vector].vector, wx);
}
EXPORT_SYMBOL(wx_free_irq);
+4 −0
Original line number Diff line number Diff line
@@ -83,7 +83,9 @@
#define WX_GPIO_INTMASK              0x14834
#define WX_GPIO_INTTYPE_LEVEL        0x14838
#define WX_GPIO_POLARITY             0x1483C
#define WX_GPIO_INTSTATUS            0x14844
#define WX_GPIO_EOI                  0x1484C
#define WX_GPIO_EXT                  0x14850

/*********************** Transmit DMA registers **************************/
/* transmit global control */
@@ -814,6 +816,7 @@ enum wx_isb_idx {
struct wx {
	unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];

	void *priv;
	u8 __iomem *hw_addr;
	struct pci_dev *pdev;
	struct net_device *netdev;
@@ -846,6 +849,7 @@ struct wx {
	bool wol_enabled;
	bool ncsi_enabled;
	bool gpio_ctrl;
	raw_spinlock_t gpio_lock;

	/* Tx fast path data */
	int num_tx_queues;
+1 −0
Original line number Diff line number Diff line
@@ -8,4 +8,5 @@ obj-$(CONFIG_TXGBE) += txgbe.o

txgbe-objs := txgbe_main.o \
              txgbe_hw.o \
              txgbe_phy.o \
              txgbe_ethtool.o
+28 −0
Original line number Diff line number Diff line
@@ -6,11 +6,39 @@
#include <linux/netdevice.h>

#include "../libwx/wx_ethtool.h"
#include "../libwx/wx_type.h"
#include "txgbe_type.h"
#include "txgbe_ethtool.h"

static int txgbe_nway_reset(struct net_device *netdev)
{
	struct txgbe *txgbe = netdev_to_txgbe(netdev);

	return phylink_ethtool_nway_reset(txgbe->phylink);
}

static int txgbe_get_link_ksettings(struct net_device *netdev,
				    struct ethtool_link_ksettings *cmd)
{
	struct txgbe *txgbe = netdev_to_txgbe(netdev);

	return phylink_ethtool_ksettings_get(txgbe->phylink, cmd);
}

static int txgbe_set_link_ksettings(struct net_device *netdev,
				    const struct ethtool_link_ksettings *cmd)
{
	struct txgbe *txgbe = netdev_to_txgbe(netdev);

	return phylink_ethtool_ksettings_set(txgbe->phylink, cmd);
}

static const struct ethtool_ops txgbe_ethtool_ops = {
	.get_drvinfo		= wx_get_drvinfo,
	.nway_reset		= txgbe_nway_reset,
	.get_link		= ethtool_op_get_link,
	.get_link_ksettings	= txgbe_get_link_ksettings,
	.set_link_ksettings	= txgbe_set_link_ksettings,
};

void txgbe_set_ethtool_ops(struct net_device *netdev)
Loading