Lines Matching refs:conf
97 if (port->conf.portmode == PHY_INTERFACE_MODE_1000BASEX) in sparx5_get_dev2g5_status()
99 else if (port->conf.portmode == PHY_INTERFACE_MODE_2500BASEX) in sparx5_get_dev2g5_status()
110 if (port->conf.portmode == PHY_INTERFACE_MODE_SGMII) { in sparx5_get_dev2g5_status()
125 bool high_speed_dev = sparx5_is_baser(port->conf.portmode); in sparx5_get_sfi_status()
148 if (port->conf.portmode == PHY_INTERFACE_MODE_5GBASER) in sparx5_get_sfi_status()
150 else if (port->conf.portmode == PHY_INTERFACE_MODE_10GBASER) in sparx5_get_sfi_status()
165 status->speed = port->conf.speed; in sparx5_get_port_status()
166 if (port->conf.power_down) { in sparx5_get_port_status()
170 switch (port->conf.portmode) { in sparx5_get_port_status()
190 struct sparx5_port_config *conf, in sparx5_port_error() argument
197 conf->speed, phy_modes(conf->portmode)); in sparx5_port_error()
202 phy_modes(conf->portmode)); in sparx5_port_error()
214 struct sparx5_port_config *conf) in sparx5_port_verify_speed() argument
217 conf->speed > SPEED_2500) || in sparx5_port_verify_speed()
219 conf->speed > SPEED_5000) || in sparx5_port_verify_speed()
221 conf->speed > SPEED_10000)) in sparx5_port_verify_speed()
222 return sparx5_port_error(port, conf, SPX5_PERR_SPEED); in sparx5_port_verify_speed()
224 switch (conf->portmode) { in sparx5_port_verify_speed()
228 if (conf->speed != SPEED_1000 || in sparx5_port_verify_speed()
230 return sparx5_port_error(port, conf, SPX5_PERR_SPEED); in sparx5_port_verify_speed()
232 return sparx5_port_error(port, conf, SPX5_PERR_IFTYPE); in sparx5_port_verify_speed()
235 if (conf->speed != SPEED_2500 || in sparx5_port_verify_speed()
237 return sparx5_port_error(port, conf, SPX5_PERR_SPEED); in sparx5_port_verify_speed()
241 return sparx5_port_error(port, conf, SPX5_PERR_IFTYPE); in sparx5_port_verify_speed()
244 if (conf->speed != SPEED_1000 && in sparx5_port_verify_speed()
245 conf->speed != SPEED_100 && in sparx5_port_verify_speed()
246 conf->speed != SPEED_10 && in sparx5_port_verify_speed()
247 conf->speed != SPEED_2500) in sparx5_port_verify_speed()
248 return sparx5_port_error(port, conf, SPX5_PERR_SPEED); in sparx5_port_verify_speed()
253 if ((conf->speed != SPEED_5000 && in sparx5_port_verify_speed()
254 conf->speed != SPEED_10000 && in sparx5_port_verify_speed()
255 conf->speed != SPEED_25000)) in sparx5_port_verify_speed()
256 return sparx5_port_error(port, conf, SPX5_PERR_SPEED); in sparx5_port_verify_speed()
259 return sparx5_port_error(port, conf, SPX5_PERR_IFTYPE); in sparx5_port_verify_speed()
266 struct sparx5_port_config *conf) in sparx5_dev_change() argument
268 return sparx5_is_baser(port->conf.portmode) ^ in sparx5_dev_change()
269 sparx5_is_baser(conf->portmode); in sparx5_dev_change()
323 u32 spd = port->conf.speed; in sparx5_port_disable()
518 struct sparx5_port_config *conf) in sparx5_port_mux_set() argument
523 if (port->conf.portmode == conf->portmode) in sparx5_port_mux_set()
526 switch (conf->portmode) { in sparx5_port_mux_set()
637 struct sparx5_port_config *conf) in sparx5_port_fc_setup() argument
639 bool fc_obey = conf->pause & MLO_PAUSE_RX ? 1 : 0; in sparx5_port_fc_setup()
642 if (conf->pause & MLO_PAUSE_TX) in sparx5_port_fc_setup()
647 spx5_rmw(DSM_MAC_CFG_HDX_BACKPREASSURE_SET(conf->duplex == DUPLEX_HALF), in sparx5_port_fc_setup()
673 static u16 sparx5_get_aneg_word(struct sparx5_port_config *conf) in sparx5_get_aneg_word() argument
675 if (conf->portmode == PHY_INTERFACE_MODE_1000BASEX) /* cl-37 aneg */ in sparx5_get_aneg_word()
676 return (conf->pause_adv | ADVERTISE_LPACK | ADVERTISE_1000XFULL); in sparx5_get_aneg_word()
683 struct sparx5_port_config *conf) in sparx5_serdes_set() argument
685 int portmode, err, speed = conf->speed; in sparx5_serdes_set()
687 if (conf->portmode == PHY_INTERFACE_MODE_QSGMII && in sparx5_serdes_set()
691 if (sparx5_is_baser(conf->portmode)) { in sparx5_serdes_set()
692 if (conf->portmode == PHY_INTERFACE_MODE_25GBASER) in sparx5_serdes_set()
694 else if (conf->portmode == PHY_INTERFACE_MODE_10GBASER) in sparx5_serdes_set()
700 err = phy_set_media(port->serdes, conf->media); in sparx5_serdes_set()
708 if (conf->serdes_reset) { in sparx5_serdes_set()
717 portmode = conf->portmode; in sparx5_serdes_set()
718 if (sparx5_is_baser(conf->portmode)) in sparx5_serdes_set()
723 conf->serdes_reset = false; in sparx5_serdes_set()
729 struct sparx5_port_config *conf) in sparx5_port_pcs_low_set() argument
734 if (port->conf.inband) { in sparx5_port_pcs_low_set()
735 if (conf->portmode == PHY_INTERFACE_MODE_SGMII || in sparx5_port_pcs_low_set()
736 conf->portmode == PHY_INTERFACE_MODE_QSGMII) in sparx5_port_pcs_low_set()
738 else if (conf->portmode == PHY_INTERFACE_MODE_1000BASEX && in sparx5_port_pcs_low_set()
739 conf->autoneg) in sparx5_port_pcs_low_set()
742 err = sparx5_serdes_set(sparx5, port, conf); in sparx5_port_pcs_low_set()
761 u16 abil = sparx5_get_aneg_word(conf); in sparx5_port_pcs_low_set()
789 struct sparx5_port_config *conf) in sparx5_port_pcs_high_set() argument
791 u32 clk_spd = conf->portmode == PHY_INTERFACE_MODE_5GBASER ? 1 : 0; in sparx5_port_pcs_high_set()
803 err = sparx5_serdes_set(sparx5, port, conf); in sparx5_port_pcs_high_set()
806 if (conf->portmode == PHY_INTERFACE_MODE_25GBASER) { in sparx5_port_pcs_high_set()
869 struct sparx5_port_config *conf) in sparx5_port_config_low_set() argument
872 bool fdx = conf->duplex == DUPLEX_FULL; in sparx5_port_config_low_set()
873 int spd = conf->speed; in sparx5_port_config_low_set()
923 struct sparx5_port_config *conf) in sparx5_port_pcs_set() argument
926 bool high_speed_dev = sparx5_is_baser(conf->portmode); in sparx5_port_pcs_set()
929 if (sparx5_dev_change(sparx5, port, conf)) { in sparx5_port_pcs_set()
944 err = sparx5_port_pcs_high_set(sparx5, port, conf); in sparx5_port_pcs_set()
946 err = sparx5_port_pcs_low_set(sparx5, port, conf); in sparx5_port_pcs_set()
951 if (port->conf.inband) { in sparx5_port_pcs_set()
965 port->conf = *conf; in sparx5_port_pcs_set()
972 struct sparx5_port_config *conf) in sparx5_port_config() argument
974 bool high_speed_dev = sparx5_is_baser(conf->portmode); in sparx5_port_config()
977 err = sparx5_port_verify_speed(sparx5, port, conf); in sparx5_port_config()
983 sparx5_port_config_low_set(sparx5, port, conf); in sparx5_port_config()
986 err = sparx5_port_fc_setup(sparx5, port, conf); in sparx5_port_config()
991 stop_wm = sparx5_port_fifo_sz(sparx5, port->portno, conf->speed); in sparx5_port_config()
998 urgency = sparx5_port_fwd_urg(sparx5, conf->speed); in sparx5_port_config()
1007 port->conf = *conf; in sparx5_port_config()
1015 struct sparx5_port_config *conf) in sparx5_port_init() argument
1034 err = sparx5_port_mux_set(sparx5, port, conf); in sparx5_port_init()
1079 if (conf->portmode == PHY_INTERFACE_MODE_QSGMII || in sparx5_port_init()
1080 conf->portmode == PHY_INTERFACE_MODE_SGMII) { in sparx5_port_init()
1081 err = sparx5_serdes_set(sparx5, port, conf); in sparx5_port_init()
1094 if (conf->portmode == PHY_INTERFACE_MODE_QSGMII) { in sparx5_port_init()
1112 if (conf->portmode == PHY_INTERFACE_MODE_NA) in sparx5_port_init()
1113 conf->portmode = PHY_INTERFACE_MODE_10GBASER; in sparx5_port_init()
1115 if (sparx5_is_baser(conf->portmode)) in sparx5_port_init()