Lines Matching +full:port +full:- +full:config
1 // SPDX-License-Identifier: GPL-2.0+
11 static struct phylink_pcs *lan966x_phylink_mac_select(struct phylink_config *config, in lan966x_phylink_mac_select() argument
14 struct lan966x_port *port = netdev_priv(to_net_dev(config->dev)); in lan966x_phylink_mac_select() local
16 return &port->phylink_pcs; in lan966x_phylink_mac_select()
19 static void lan966x_phylink_mac_config(struct phylink_config *config, in lan966x_phylink_mac_config() argument
25 static int lan966x_phylink_mac_prepare(struct phylink_config *config, in lan966x_phylink_mac_prepare() argument
29 struct lan966x_port *port = netdev_priv(to_net_dev(config->dev)); in lan966x_phylink_mac_prepare() local
33 if (port->serdes) { in lan966x_phylink_mac_prepare()
34 err = phy_set_mode_ext(port->serdes, PHY_MODE_ETHERNET, in lan966x_phylink_mac_prepare()
37 netdev_err(to_net_dev(config->dev), in lan966x_phylink_mac_prepare()
46 static void lan966x_phylink_mac_link_up(struct phylink_config *config, in lan966x_phylink_mac_link_up() argument
53 struct lan966x_port *port = netdev_priv(to_net_dev(config->dev)); in lan966x_phylink_mac_link_up() local
54 struct lan966x_port_config *port_config = &port->config; in lan966x_phylink_mac_link_up()
56 port_config->duplex = duplex; in lan966x_phylink_mac_link_up()
57 port_config->speed = speed; in lan966x_phylink_mac_link_up()
58 port_config->pause = 0; in lan966x_phylink_mac_link_up()
59 port_config->pause |= tx_pause ? MLO_PAUSE_TX : 0; in lan966x_phylink_mac_link_up()
60 port_config->pause |= rx_pause ? MLO_PAUSE_RX : 0; in lan966x_phylink_mac_link_up()
63 phy_set_speed(port->serdes, speed); in lan966x_phylink_mac_link_up()
65 lan966x_port_config_up(port); in lan966x_phylink_mac_link_up()
68 static void lan966x_phylink_mac_link_down(struct phylink_config *config, in lan966x_phylink_mac_link_down() argument
72 struct lan966x_port *port = netdev_priv(to_net_dev(config->dev)); in lan966x_phylink_mac_link_down() local
73 struct lan966x *lan966x = port->lan966x; in lan966x_phylink_mac_link_down()
75 lan966x_port_config_down(port); in lan966x_phylink_mac_link_down()
82 lan966x, DEV_CLOCK_CFG(port->chip_port)); in lan966x_phylink_mac_link_down()
94 struct lan966x_port *port = lan966x_pcs_to_port(pcs); in lan966x_pcs_get_state() local
96 lan966x_port_status_get(port, neg_mode, state); in lan966x_pcs_get_state()
104 struct lan966x_port *port = lan966x_pcs_to_port(pcs); in lan966x_pcs_config() local
105 struct lan966x_port_config config; in lan966x_pcs_config() local
108 config = port->config; in lan966x_pcs_config()
109 config.portmode = interface; in lan966x_pcs_config()
110 config.inband = neg_mode & PHYLINK_PCS_NEG_INBAND; in lan966x_pcs_config()
111 config.autoneg = neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED; in lan966x_pcs_config()
112 config.advertising = advertising; in lan966x_pcs_config()
114 ret = lan966x_port_pcs_set(port, &config); in lan966x_pcs_config()
116 netdev_err(port->dev, "port PCS config failed: %d\n", ret); in lan966x_pcs_config()