Lines Matching refs:err
86 int err; in set_phy_regs() local
88 for (err = 0; rv->mmd_addr && !err; rv++) { in set_phy_regs()
90 err = t3_mdio_write(phy, rv->mmd_addr, rv->reg_addr, in set_phy_regs()
93 err = t3_mdio_change_bits(phy, rv->mmd_addr, in set_phy_regs()
97 return err; in set_phy_regs()
115 int i, err; in ael_i2c_rd() local
118 err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AEL_I2C_CTRL, in ael_i2c_rd()
120 if (err) in ael_i2c_rd()
121 return err; in ael_i2c_rd()
125 err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, AEL_I2C_STAT, &stat); in ael_i2c_rd()
126 if (err) in ael_i2c_rd()
127 return err; in ael_i2c_rd()
129 err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, AEL_I2C_DATA, in ael_i2c_rd()
131 if (err) in ael_i2c_rd()
132 return err; in ael_i2c_rd()
143 int err; in ael1002_power_down() local
145 err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, MDIO_PMA_TXDIS, !!enable); in ael1002_power_down()
146 if (!err) in ael1002_power_down()
147 err = mdio_set_flag(&phy->mdio, phy->mdio.prtad, in ael1002_power_down()
150 return err; in ael1002_power_down()
155 int err; in ael1002_reset() local
157 if ((err = ael1002_power_down(phy, 0)) || in ael1002_reset()
158 (err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AEL100X_TX_CONFIG1, 1)) || in ael1002_reset()
159 (err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AEL1002_PWR_DOWN_HI, 0)) || in ael1002_reset()
160 (err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AEL1002_PWR_DOWN_LO, 0)) || in ael1002_reset()
161 (err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AEL1002_XFI_EQL, 0x18)) || in ael1002_reset()
162 (err = t3_mdio_change_bits(phy, MDIO_MMD_PMAPMD, AEL1002_LB_EN, in ael1002_reset()
164 return err; in ael1002_reset()
181 int err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, in get_link_status_r() local
184 if (!err) in get_link_status_r()
185 err = t3_mdio_read(phy, MDIO_MMD_PCS, in get_link_status_r()
187 if (!err) in get_link_status_r()
188 err = t3_mdio_read(phy, MDIO_MMD_PHYXS, in get_link_status_r()
190 if (err) in get_link_status_r()
191 return err; in get_link_status_r()
302 int i, err; in ael2005_setup_sr_edc() local
304 err = set_phy_regs(phy, regs); in ael2005_setup_sr_edc()
305 if (err) in ael2005_setup_sr_edc()
306 return err; in ael2005_setup_sr_edc()
311 err = t3_get_edc_fw(phy, EDC_OPT_AEL2005, in ael2005_setup_sr_edc()
313 if (err) in ael2005_setup_sr_edc()
314 return err; in ael2005_setup_sr_edc()
316 for (i = 0; i < EDC_OPT_AEL2005_SIZE / sizeof(u16) && !err; i += 2) in ael2005_setup_sr_edc()
317 err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, in ael2005_setup_sr_edc()
320 if (!err) in ael2005_setup_sr_edc()
322 return err; in ael2005_setup_sr_edc()
336 int i, err; in ael2005_setup_twinax_edc() local
338 err = set_phy_regs(phy, regs); in ael2005_setup_twinax_edc()
339 if (!err && modtype == phy_modtype_twinax_long) in ael2005_setup_twinax_edc()
340 err = set_phy_regs(phy, preemphasis); in ael2005_setup_twinax_edc()
341 if (err) in ael2005_setup_twinax_edc()
342 return err; in ael2005_setup_twinax_edc()
347 err = t3_get_edc_fw(phy, EDC_TWX_AEL2005, in ael2005_setup_twinax_edc()
349 if (err) in ael2005_setup_twinax_edc()
350 return err; in ael2005_setup_twinax_edc()
352 for (i = 0; i < EDC_TWX_AEL2005_SIZE / sizeof(u16) && !err; i += 2) in ael2005_setup_twinax_edc()
353 err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, in ael2005_setup_twinax_edc()
356 if (!err) in ael2005_setup_twinax_edc()
358 return err; in ael2005_setup_twinax_edc()
378 int err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AEL2005_GPIO_CTRL, 0x200); in ael2005_intr_enable() local
379 return err ? err : t3_phy_lasi_intr_enable(phy); in ael2005_intr_enable()
384 int err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AEL2005_GPIO_CTRL, 0x100); in ael2005_intr_disable() local
385 return err ? err : t3_phy_lasi_intr_disable(phy); in ael2005_intr_disable()
390 int err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AEL2005_GPIO_CTRL, 0xd00); in ael2005_intr_clear() local
391 return err ? err : t3_phy_lasi_intr_clear(phy); in ael2005_intr_clear()
412 int err; in ael2005_reset() local
415 err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_CTRL, in ael2005_reset()
417 if (err) in ael2005_reset()
418 return err; in ael2005_reset()
420 err = t3_phy_reset(phy, MDIO_MMD_PMAPMD, 0); in ael2005_reset()
421 if (err) in ael2005_reset()
422 return err; in ael2005_reset()
426 err = set_phy_regs(phy, regs0); in ael2005_reset()
427 if (err) in ael2005_reset()
428 return err; in ael2005_reset()
432 err = ael2005_get_module_type(phy, 0); in ael2005_reset()
433 if (err < 0) in ael2005_reset()
434 return err; in ael2005_reset()
435 phy->modtype = err; in ael2005_reset()
437 if (err == phy_modtype_twinax || err == phy_modtype_twinax_long) in ael2005_reset()
438 err = ael2005_setup_twinax_edc(phy, err); in ael2005_reset()
440 err = ael2005_setup_sr_edc(phy); in ael2005_reset()
441 if (err) in ael2005_reset()
442 return err; in ael2005_reset()
444 err = set_phy_regs(phy, regs1); in ael2005_reset()
445 if (err) in ael2005_reset()
446 return err; in ael2005_reset()
450 err = ael2005_intr_enable(phy); in ael2005_reset()
451 return err; in ael2005_reset()
537 int err; in ael2020_setup_sr_edc() local
539 err = set_phy_regs(phy, regs); in ael2020_setup_sr_edc()
541 if (err) in ael2020_setup_sr_edc()
542 return err; in ael2020_setup_sr_edc()
572 int i, err; in ael2020_setup_twinax_edc() local
575 err = set_phy_regs(phy, uCclock40MHz); in ael2020_setup_twinax_edc()
577 if (err) in ael2020_setup_twinax_edc()
578 return err; in ael2020_setup_twinax_edc()
579 err = set_phy_regs(phy, uCclockActivate); in ael2020_setup_twinax_edc()
581 if (err) in ael2020_setup_twinax_edc()
582 return err; in ael2020_setup_twinax_edc()
585 err = t3_get_edc_fw(phy, EDC_TWX_AEL2020, in ael2020_setup_twinax_edc()
587 if (err) in ael2020_setup_twinax_edc()
588 return err; in ael2020_setup_twinax_edc()
590 for (i = 0; i < EDC_TWX_AEL2020_SIZE / sizeof(u16) && !err; i += 2) in ael2020_setup_twinax_edc()
591 err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, in ael2020_setup_twinax_edc()
595 err = set_phy_regs(phy, uCactivate); in ael2020_setup_twinax_edc()
596 if (!err) in ael2020_setup_twinax_edc()
598 return err; in ael2020_setup_twinax_edc()
641 int err, link_ok = 0; in ael2020_intr_enable() local
644 err = set_phy_regs(phy, regs); in ael2020_intr_enable()
645 if (err) in ael2020_intr_enable()
646 return err; in ael2020_intr_enable()
648 err = get_link_status_r(phy, &link_ok, NULL, NULL, NULL); in ael2020_intr_enable()
649 if (err) in ael2020_intr_enable()
650 return err; in ael2020_intr_enable()
655 err = t3_phy_lasi_intr_enable(phy); in ael2020_intr_enable()
656 if (err) in ael2020_intr_enable()
657 return err; in ael2020_intr_enable()
679 int err; in ael2020_intr_disable() local
682 err = set_phy_regs(phy, regs); in ael2020_intr_disable()
683 if (err) in ael2020_intr_disable()
684 return err; in ael2020_intr_disable()
700 int err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, AEL2020_GPIO_INTR, &stat); in ael2020_intr_clear() local
701 return err ? err : t3_phy_lasi_intr_clear(phy); in ael2020_intr_clear()
724 int err; in ael2020_reset() local
728 err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_CTRL, in ael2020_reset()
730 if (err) in ael2020_reset()
731 return err; in ael2020_reset()
733 err = t3_phy_reset(phy, MDIO_MMD_PMAPMD, 125); in ael2020_reset()
734 if (err) in ael2020_reset()
735 return err; in ael2020_reset()
740 err = set_phy_regs(phy, ael2020_reset_regs); in ael2020_reset()
741 if (err) in ael2020_reset()
742 return err; in ael2020_reset()
745 err = ael2020_get_module_type(phy, 0); in ael2020_reset()
746 if (err < 0) in ael2020_reset()
747 return err; in ael2020_reset()
748 phy->modtype = (u8)err; in ael2020_reset()
749 if (err == phy_modtype_twinax || err == phy_modtype_twinax_long) in ael2020_reset()
750 err = ael2020_setup_twinax_edc(phy, err); in ael2020_reset()
752 err = ael2020_setup_sr_edc(phy); in ael2020_reset()
753 if (err) in ael2020_reset()
754 return err; in ael2020_reset()
758 err = ael2005_intr_enable(phy); in ael2020_reset()
759 return err; in ael2020_reset()
818 int err; in t3_ael2020_phy_prep() local
825 err = set_phy_regs(phy, ael2020_reset_regs); in t3_ael2020_phy_prep()
826 if (err) in t3_ael2020_phy_prep()
827 return err; in t3_ael2020_phy_prep()
839 int err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, in get_link_status_x() local
842 if (!err) in get_link_status_x()
843 err = t3_mdio_read(phy, MDIO_MMD_PCS, in get_link_status_x()
845 if (!err) in get_link_status_x()
846 err = t3_mdio_read(phy, MDIO_MMD_PHYXS, in get_link_status_x()
848 if (err) in get_link_status_x()
849 return err; in get_link_status_x()