net: stmmac: update MAC capabilities when tx queues are updated
authorMichael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Fri, 20 Oct 2023 03:25:35 +0000 (11:25 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Oct 2023 10:53:32 +0000 (11:53 +0100)
commit95201f36f395df34321fcddbce12103e8bbe4970
treeac1348a166afe560a73c325d48b365172ec5fa8b
parentd2ca43f30611ac41bccfa8352c53f5432f0ecbb0
net: stmmac: update MAC capabilities when tx queues are updated

Upon boot up, the driver will configure the MAC capabilities based on
the maximum number of tx and rx queues. When the user changes the
tx queues to single queue, the MAC should be capable of supporting Half
Duplex, but the driver does not update the MAC capabilities when it is
configured so.

Using the stmmac_reinit_queues() to check the number of tx queues
and set the MAC capabilities accordingly.

Fixes: 0366f7e06a6b ("net: stmmac: add ethtool support for get/set channels")
Cc: <stable@vger.kernel.org> # 5.17+
Signed-off-by: Michael Sit Wei Hong <michael.wei.hong.sit@intel.com>
Signed-off-by: Gan, Yi Fang <yi.fang.gan@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c