Skip to content

Commit

Permalink
net: stmmac: replace the use_phy_wol field with a flag
Browse files Browse the repository at this point in the history
Drop the boolean field of the plat_stmmacenet_data structure in favor of a
simple bitfield flag.

Signed-off-by: Bartosz Golaszewski <[email protected]>
Reviewed-by: Andrew Halaney <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Simon Horman <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Bartosz Golaszewski authored and kuba-moo committed Jul 14, 2023
1 parent 309efe6 commit fd1d62d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,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;
Expand Down
5 changes: 4 additions & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6877,7 +6877,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
*/
priv->plat->enh_desc = priv->dma_cap.enh_desc;
priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up &&
!priv->plat->use_phy_wol;
!(priv->plat->flags & STMMAC_FLAG_USE_PHY_WOL);
priv->hw->pmt = priv->plat->pmt;
if (priv->dma_cap.hash_tb_sz) {
priv->hw->multicast_filter_bins =
Expand Down
2 changes: 1 addition & 1 deletion include/linux/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ struct dwmac4_addrs {

#define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0)
#define STMMAC_FLAG_SPH_DISABLE BIT(1)
#define STMMAC_FLAG_USE_PHY_WOL BIT(2)

struct plat_stmmacenet_data {
int bus_id;
Expand Down Expand Up @@ -292,7 +293,6 @@ struct plat_stmmacenet_data {
int msi_sfty_ue_vec;
int msi_rx_base_vec;
int msi_tx_base_vec;
bool use_phy_wol;
bool serdes_up_after_phy_linkup;
const struct dwmac4_addrs *dwmac4_addrs;
unsigned int flags;
Expand Down

0 comments on commit fd1d62d

Please sign in to comment.