1 From a4c2233b1e4359b6c64b6f9ba98c8718a11fffee Mon Sep 17 00:00:00 2001
2 From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
3 Date: Sat, 22 Jul 2023 21:32:54 +0100
4 Subject: [PATCH 097/250] net: ethernet: mtk_eth_soc: remove mac_pcs_get_state
7 Remove the .mac_pcs_get_state function, since as far as I can tell is
8 never called - no DT appears to specify an in-band-status management
9 nor SFP support for this driver.
11 Removal of this, along with the previous patch to remove the incorrect
12 clocking configuration, means that the driver becomes non-legacy, so
13 we can remove the "legacy_pre_march2020" status from this driver.
15 Reviewed-by: Daniel Golle <daniel@makrotopia.org>
16 Tested-by: Daniel Golle <daniel@makrotopia.org>
17 Tested-by: Frank Wunderlich <frank-w@public-files.de>
18 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
19 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
21 drivers/net/ethernet/mediatek/mtk_eth_soc.c | 35 ---------------------
22 1 file changed, 35 deletions(-)
24 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
25 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
26 @@ -555,38 +555,6 @@ static int mtk_mac_finish(struct phylink
30 -static void mtk_mac_pcs_get_state(struct phylink_config *config,
31 - struct phylink_link_state *state)
33 - struct mtk_mac *mac = container_of(config, struct mtk_mac,
35 - u32 pmsr = mtk_r32(mac->hw, MTK_MAC_MSR(mac->id));
37 - state->link = (pmsr & MAC_MSR_LINK);
38 - state->duplex = (pmsr & MAC_MSR_DPX) >> 1;
40 - switch (pmsr & (MAC_MSR_SPEED_1000 | MAC_MSR_SPEED_100)) {
42 - state->speed = SPEED_10;
44 - case MAC_MSR_SPEED_100:
45 - state->speed = SPEED_100;
47 - case MAC_MSR_SPEED_1000:
48 - state->speed = SPEED_1000;
51 - state->speed = SPEED_UNKNOWN;
55 - state->pause &= (MLO_PAUSE_RX | MLO_PAUSE_TX);
56 - if (pmsr & MAC_MSR_RX_FC)
57 - state->pause |= MLO_PAUSE_RX;
58 - if (pmsr & MAC_MSR_TX_FC)
59 - state->pause |= MLO_PAUSE_TX;
62 static void mtk_mac_link_down(struct phylink_config *config, unsigned int mode,
63 phy_interface_t interface)
65 @@ -708,7 +676,6 @@ static void mtk_mac_link_up(struct phyli
67 static const struct phylink_mac_ops mtk_phylink_ops = {
68 .mac_select_pcs = mtk_mac_select_pcs,
69 - .mac_pcs_get_state = mtk_mac_pcs_get_state,
70 .mac_config = mtk_mac_config,
71 .mac_finish = mtk_mac_finish,
72 .mac_link_down = mtk_mac_link_down,
73 @@ -4309,8 +4276,6 @@ static int mtk_add_mac(struct mtk_eth *e
75 mac->phylink_config.dev = ð->netdev[id]->dev;
76 mac->phylink_config.type = PHYLINK_NETDEV;
77 - /* This driver makes use of state->speed in mac_config */
78 - mac->phylink_config.legacy_pre_march2020 = true;
79 mac->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
80 MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD;