enetc_port_mac_wr(si, ENETC4_PM_CMD_CFG(0), val);
}
-static void enetc4_set_tx_pause(struct enetc_pf *pf, int num_rxbdr, bool tx_pause)
+static void enetc4_set_tx_pause(struct enetc_pf *pf, bool tx_pause)
{
+ struct enetc_ndev_priv *priv = netdev_priv(pf->si->ndev);
u32 pause_off_thresh = 0, pause_on_thresh = 0;
u32 init_quanta = 0, refresh_quanta = 0;
struct enetc_hw *hw = &pf->si->hw;
- u32 rbmr, old_rbmr;
- int i;
- for (i = 0; i < num_rxbdr; i++) {
- old_rbmr = enetc_rxbdr_rd(hw, i, ENETC_RBMR);
- rbmr = u32_replace_bits(old_rbmr, tx_pause ? 1 : 0, ENETC_RBMR_CM);
- if (rbmr == old_rbmr)
- continue;
-
- enetc_rxbdr_wr(hw, i, ENETC_RBMR, rbmr);
- }
+ enetc_set_congestion_mode(priv, tx_pause);
if (tx_pause) {
/* When the port first enters congestion, send a PAUSE request
tx_pause = false;
}
- enetc4_set_tx_pause(pf, priv->num_rx_rings, tx_pause);
+ enetc4_set_tx_pause(pf, tx_pause);
enetc4_set_rx_pause(pf, rx_pause);
enetc4_mac_tx_enable(pf);
enetc4_mac_rx_enable(pf);