Commit def3833f authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'net-stmmac-replace-boolean-fields-in-plat_stmmacenet_data-with-flags'

Bartosz Golaszewski says:

====================
net: stmmac: replace boolean fields in plat_stmmacenet_data with flags

As suggested by Jose Abreu: let's drop all 12 boolean fields in
plat_stmmacenet_data and replace them with a common bitfield.
====================

Link: https://lore.kernel.org/r/20230710090001.303225-1-brgl@bgdev.pl


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents bec9ce34 9d0c0d5e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ static int dwc_eth_dwmac_config_dt(struct platform_device *pdev,
	/* dwc-qos needs GMAC4, AAL, TSO and PMT */
	plat_dat->has_gmac4 = 1;
	plat_dat->dma_cfg->aal = 1;
	plat_dat->tso_en = 1;
	plat_dat->flags |= STMMAC_FLAG_TSO_EN;
	plat_dat->pmt = 1;

	return 0;
@@ -359,7 +359,7 @@ static int tegra_eqos_probe(struct platform_device *pdev,
	data->fix_mac_speed = tegra_eqos_fix_speed;
	data->init = tegra_eqos_init;
	data->bsp_priv = eqos;
	data->sph_disable = 1;
	data->flags |= STMMAC_FLAG_SPH_DISABLE;

	err = tegra_eqos_init(pdev, eqos);
	if (err < 0)
+11 −12
Original line number Diff line number Diff line
@@ -326,10 +326,10 @@ static int intel_crosststamp(ktime_t *device,
	/* Both internal crosstimestamping and external triggered event
	 * timestamping cannot be run concurrently.
	 */
	if (priv->plat->ext_snapshot_en)
	if (priv->plat->flags & STMMAC_FLAG_EXT_SNAPSHOT_EN)
		return -EBUSY;

	priv->plat->int_snapshot_en = 1;
	priv->plat->flags |= STMMAC_FLAG_INT_SNAPSHOT_EN;

	mutex_lock(&priv->aux_ts_lock);
	/* Enable Internal snapshot trigger */
@@ -350,7 +350,7 @@ static int intel_crosststamp(ktime_t *device,
		break;
	default:
		mutex_unlock(&priv->aux_ts_lock);
		priv->plat->int_snapshot_en = 0;
		priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
		return -EINVAL;
	}
	writel(acr_value, ptpaddr + PTP_ACR);
@@ -376,7 +376,7 @@ static int intel_crosststamp(ktime_t *device,
	if (!wait_event_interruptible_timeout(priv->tstamp_busy_wait,
					      stmmac_cross_ts_isr(priv),
					      HZ / 100)) {
		priv->plat->int_snapshot_en = 0;
		priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
		return -ETIMEDOUT;
	}

@@ -395,7 +395,7 @@ static int intel_crosststamp(ktime_t *device,
	}

	system->cycles *= intel_priv->crossts_adj;
	priv->plat->int_snapshot_en = 0;
	priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;

	return 0;
}
@@ -458,8 +458,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
	plat->has_gmac = 0;
	plat->has_gmac4 = 1;
	plat->force_sf_dma_mode = 0;
	plat->tso_en = 1;
	plat->sph_disable = 1;
	plat->flags |= (STMMAC_FLAG_TSO_EN | STMMAC_FLAG_SPH_DISABLE);

	/* Multiplying factor to the clk_eee_i clock time
	 * period to make it closer to 100 ns. This value
@@ -561,7 +560,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
	/* Set the maxmtu to a default of JUMBO_LEN */
	plat->maxmtu = JUMBO_LEN;

	plat->vlan_fail_q_en = true;
	plat->flags |= STMMAC_FLAG_VLAN_FAIL_Q_EN;

	/* Use the last Rx queue */
	plat->vlan_fail_q = plat->rx_queues_to_use - 1;
@@ -610,7 +609,7 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
	plat->ext_snapshot_num = AUX_SNAPSHOT0;

	plat->crosststamp = intel_crosststamp;
	plat->int_snapshot_en = 0;
	plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;

	/* Setup MSI vector offset specific to Intel mGbE controller */
	plat->msi_mac_vec = 29;
@@ -628,7 +627,7 @@ static int ehl_common_data(struct pci_dev *pdev,
{
	plat->rx_queues_to_use = 8;
	plat->tx_queues_to_use = 8;
	plat->use_phy_wol = 1;
	plat->flags |= STMMAC_FLAG_USE_PHY_WOL;

	plat->safety_feat_cfg->tsoee = 1;
	plat->safety_feat_cfg->mrxpee = 1;
@@ -954,7 +953,7 @@ static int stmmac_config_single_msi(struct pci_dev *pdev,

	res->irq = pci_irq_vector(pdev, 0);
	res->wol_irq = res->irq;
	plat->multi_msi_en = 0;
	plat->flags &= ~STMMAC_FLAG_MULTI_MSI_EN;
	dev_info(&pdev->dev, "%s: Single IRQ enablement successful\n",
		 __func__);

@@ -1006,7 +1005,7 @@ static int stmmac_config_multi_msi(struct pci_dev *pdev,
	if (plat->msi_sfty_ue_vec < STMMAC_MSI_VEC_MAX)
		res->sfty_ue_irq = pci_irq_vector(pdev, plat->msi_sfty_ue_vec);

	plat->multi_msi_en = 1;
	plat->flags |= STMMAC_FLAG_MULTI_MSI_EN;
	dev_info(&pdev->dev, "%s: multi MSI enablement successful\n", __func__);

	return 0;
+4 −1
Original line number Diff line number Diff line
@@ -588,7 +588,10 @@ static int mediatek_dwmac_common_data(struct platform_device *pdev,
	int i;

	plat->interface = priv_plat->phy_mode;
	plat->use_phy_wol = priv_plat->mac_wol ? 0 : 1;
	if (priv_plat->mac_wol)
		plat->flags |= STMMAC_FLAG_USE_PHY_WOL;
	else
		plat->flags &= ~STMMAC_FLAG_USE_PHY_WOL;
	plat->riwt_off = 1;
	plat->maxmtu = ETH_DATA_LEN;
	plat->host_dma_width = priv_plat->variant->dma_bit_mask;
+5 −3
Original line number Diff line number Diff line
@@ -783,10 +783,12 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
	if (ethqos->has_emac_ge_3)
		plat_dat->dwmac4_addrs = &data->dwmac4_addrs;
	plat_dat->pmt = 1;
	plat_dat->tso_en = of_property_read_bool(np, "snps,tso");
	if (of_property_read_bool(np, "snps,tso"))
		plat_dat->flags |= STMMAC_FLAG_TSO_EN;
	if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))
		plat_dat->rx_clk_runs_in_lpi = 1;
	plat_dat->has_integrated_pcs = data->has_integrated_pcs;
		plat_dat->flags |= STMMAC_FLAG_RX_CLK_RUNS_IN_LPI;
	if (data->has_integrated_pcs)
		plat_dat->flags |= STMMAC_FLAG_HAS_INTEGRATED_PCS;

	if (ethqos->serdes_phy) {
		plat_dat->serdes_powerup = qcom_ethqos_serdes_powerup;
+1 −1
Original line number Diff line number Diff line
@@ -1227,7 +1227,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
	plat_dat->interface = interface;
	plat_dat->rx_coe = STMMAC_RX_COE_TYPE2;
	plat_dat->tx_coe = 1;
	plat_dat->has_sun8i = true;
	plat_dat->flags |= STMMAC_FLAG_HAS_SUN8I;
	plat_dat->bsp_priv = gmac;
	plat_dat->init = sun8i_dwmac_init;
	plat_dat->exit = sun8i_dwmac_exit;
Loading