Commit 39709fe4 authored by Jiawen Wu's avatar Jiawen Wu Committed by Paolo Abeni
Browse files

net: txgbe: Distinguish between 40G and 25G devices



For the following patches to support PHYLINK for AML 25G devices,
separate MAC type wx_mac_aml40 to maintain the driver of 40G devices.
Because 40G devices will complete support later, not now.

And this patch makes the 25G devices use some PHYLINK interfaces, but it
is not yet create PHYLINK and cannot be used on its own. It is just
preparation for the next patches.

Signed-off-by: default avatarJiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/592B1A6920867D0C+20250521064402.22348-4-jiawenwu@trustnetic.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 78cafb1b
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ int wx_nway_reset(struct net_device *netdev)
{
	struct wx *wx = netdev_priv(netdev);

	if (wx->mac.type == wx_mac_aml)
	if (wx->mac.type == wx_mac_aml40)
		return -EOPNOTSUPP;

	return phylink_ethtool_nway_reset(wx->phylink);
@@ -231,7 +231,7 @@ int wx_get_link_ksettings(struct net_device *netdev,
{
	struct wx *wx = netdev_priv(netdev);

	if (wx->mac.type == wx_mac_aml)
	if (wx->mac.type == wx_mac_aml40)
		return -EOPNOTSUPP;

	return phylink_ethtool_ksettings_get(wx->phylink, cmd);
@@ -243,7 +243,7 @@ int wx_set_link_ksettings(struct net_device *netdev,
{
	struct wx *wx = netdev_priv(netdev);

	if (wx->mac.type == wx_mac_aml)
	if (wx->mac.type == wx_mac_aml40)
		return -EOPNOTSUPP;

	return phylink_ethtool_ksettings_set(wx->phylink, cmd);
@@ -255,7 +255,7 @@ void wx_get_pauseparam(struct net_device *netdev,
{
	struct wx *wx = netdev_priv(netdev);

	if (wx->mac.type == wx_mac_aml)
	if (wx->mac.type == wx_mac_aml40)
		return;

	phylink_ethtool_get_pauseparam(wx->phylink, pause);
@@ -267,7 +267,7 @@ int wx_set_pauseparam(struct net_device *netdev,
{
	struct wx *wx = netdev_priv(netdev);

	if (wx->mac.type == wx_mac_aml)
	if (wx->mac.type == wx_mac_aml40)
		return -EOPNOTSUPP;

	return phylink_ethtool_set_pauseparam(wx->phylink, pause);
@@ -345,6 +345,7 @@ int wx_set_coalesce(struct net_device *netdev,
		max_eitr = WX_SP_MAX_EITR;
		break;
	case wx_mac_aml:
	case wx_mac_aml40:
		max_eitr = WX_AML_MAX_EITR;
		break;
	default:
@@ -375,6 +376,7 @@ int wx_set_coalesce(struct net_device *netdev,
		switch (wx->mac.type) {
		case wx_mac_sp:
		case wx_mac_aml:
		case wx_mac_aml40:
			tx_itr_param = WX_12K_ITR;
			break;
		default:
+1 −0
Original line number Diff line number Diff line
@@ -695,6 +695,7 @@ void wx_init_eeprom_params(struct wx *wx)
	switch (wx->mac.type) {
	case wx_mac_sp:
	case wx_mac_aml:
	case wx_mac_aml40:
		if (wx_read_ee_hostif(wx, WX_SW_REGION_PTR, &data)) {
			wx_err(wx, "NVM Read Error\n");
			return;
+2 −0
Original line number Diff line number Diff line
@@ -1959,6 +1959,7 @@ static int wx_alloc_q_vector(struct wx *wx,
	switch (wx->mac.type) {
	case wx_mac_sp:
	case wx_mac_aml:
	case wx_mac_aml40:
		default_itr = WX_12K_ITR;
		break;
	default:
@@ -2327,6 +2328,7 @@ void wx_write_eitr(struct wx_q_vector *q_vector)
		itr_reg = q_vector->itr & WX_SP_MAX_EITR;
		break;
	case wx_mac_aml:
	case wx_mac_aml40:
		itr_reg = (q_vector->itr >> 3) & WX_AML_MAX_EITR;
		break;
	default:
+1 −0
Original line number Diff line number Diff line
@@ -838,6 +838,7 @@ enum wx_mac_type {
	wx_mac_sp,
	wx_mac_em,
	wx_mac_aml,
	wx_mac_aml40,
};

enum wx_media_type {
+2 −2
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ static void txgbe_del_irq_domain(struct txgbe *txgbe)

void txgbe_free_misc_irq(struct txgbe *txgbe)
{
	if (txgbe->wx->mac.type == wx_mac_aml)
	if (txgbe->wx->mac.type == wx_mac_aml40)
		return;

	free_irq(txgbe->link_irq, txgbe);
@@ -190,7 +190,7 @@ int txgbe_setup_misc_irq(struct txgbe *txgbe)
	struct wx *wx = txgbe->wx;
	int hwirq, err;

	if (wx->mac.type == wx_mac_aml)
	if (wx->mac.type == wx_mac_aml40)
		goto skip_sp_irq;

	txgbe->misc.nirqs = TXGBE_IRQ_MAX;
Loading