Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c7be0ac authored by Suman Tripathi's avatar Suman Tripathi Committed by David S. Miller
Browse files

drivers: net: xgene: Implement the backward compatibility with the old and new...


drivers: net: xgene: Implement the backward compatibility with the old and new firmware w.r.t Tx completion IRQ interrupt.

This patch implements the backward compatibility with the old firmware where
the Tx completion IRQ interrupt was absent whereas incase of new firmware
the Tx completion IRQ interrupt is present.

Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
Signed-off-by: default avatarSuman Tripathi <stripathi@apm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0738c54d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1024,12 +1024,14 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
	if (pdata->phy_mode != PHY_INTERFACE_MODE_RGMII) {
		ret = platform_get_irq(pdev, 1);
		if (ret <= 0) {
			dev_err(dev, "Unable to get ENET Tx completion IRQ\n");
			ret = ret ? : -ENXIO;
			return ret;
		}
			pdata->cq_cnt = 0;
			dev_info(dev, "Unable to get Tx completion IRQ,"
				 "using Rx IRQ instead\n");
		} else {
			pdata->cq_cnt = XGENE_MAX_TXC_RINGS;
			pdata->txc_irq = ret;
		}
	}

	pdata->clk = devm_clk_get(&pdev->dev, NULL);
	if (IS_ERR(pdata->clk)) {
@@ -1105,13 +1107,11 @@ static void xgene_enet_setup_ops(struct xgene_enet_pdata *pdata)
		pdata->mac_ops = &xgene_sgmac_ops;
		pdata->port_ops = &xgene_sgport_ops;
		pdata->rm = RM1;
		pdata->cq_cnt = XGENE_MAX_TXC_RINGS;
		break;
	default:
		pdata->mac_ops = &xgene_xgmac_ops;
		pdata->port_ops = &xgene_xgport_ops;
		pdata->rm = RM0;
		pdata->cq_cnt = XGENE_MAX_TXC_RINGS;
		break;
	}