Lines Matching refs:phy

65 static int aq100x_reset(struct cphy *phy, int wait)
71 int err = t3_phy_reset(phy, MDIO_MMD_VEND1, 3000);
74 CH_WARN(phy->adapter, "PHY%d: reset failed (0x%x).\n",
75 phy->mdio.prtad, err);
80 static int aq100x_intr_enable(struct cphy *phy)
82 int err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AQ_IMASK_PMA, IMASK_PMA);
86 err = t3_mdio_write(phy, MDIO_MMD_VEND1, AQ_IMASK_GLOBAL, IMASK_GLOBAL);
90 static int aq100x_intr_disable(struct cphy *phy)
92 return t3_mdio_write(phy, MDIO_MMD_VEND1, AQ_IMASK_GLOBAL, 0);
95 static int aq100x_intr_clear(struct cphy *phy)
99 t3_mdio_read(phy, MDIO_MMD_VEND1, AQ_IFLAG_GLOBAL, &v);
100 t3_mdio_read(phy, MDIO_MMD_PMAPMD, MDIO_STAT1, &v);
105 static int aq100x_intr_handler(struct cphy *phy)
110 err = t3_mdio_read(phy, MDIO_MMD_VEND1, AQ_IFLAG_GLOBAL, &cause);
115 t3_mdio_read(phy, MDIO_MMD_PMAPMD, MDIO_STAT1, &v);
120 static int aq100x_power_down(struct cphy *phy, int off)
122 return mdio_set_flag(&phy->mdio, phy->mdio.prtad,
127 static int aq100x_autoneg_enable(struct cphy *phy)
131 err = aq100x_power_down(phy, 0);
133 err = mdio_set_flag(&phy->mdio, phy->mdio.prtad,
140 static int aq100x_autoneg_restart(struct cphy *phy)
144 err = aq100x_power_down(phy, 0);
146 err = mdio_set_flag(&phy->mdio, phy->mdio.prtad,
153 static int aq100x_advertise(struct cphy *phy, unsigned int advertise_map)
162 err = t3_mdio_change_bits(phy, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL,
173 err = t3_mdio_change_bits(phy, MDIO_MMD_AN, AQ_1G_CTRL,
188 err = t3_mdio_change_bits(phy, MDIO_MMD_AN, MDIO_AN_ADVERTISE,
194 static int aq100x_set_loopback(struct cphy *phy, int mmd, int dir, int enable)
196 return mdio_set_flag(&phy->mdio, phy->mdio.prtad,
201 static int aq100x_set_speed_duplex(struct cphy *phy, int speed, int duplex)
207 static int aq100x_get_link_status(struct cphy *phy, int *link_ok,
214 err = t3_mdio_read(phy, MDIO_MMD_PMAPMD, AQ_LINK_STAT, &v);
223 err = t3_mdio_read(phy, MDIO_MMD_AN, AQ_ANEG_STAT, &v);
266 int t3_aq100x_phy_prep(struct cphy *phy, struct adapter *adapter, int phy_addr,
272 cphy_init(phy, adapter, phy_addr, &aq100x_ops, mdio_ops,
292 err = t3_mdio_read(phy, MDIO_MMD_VEND1, MDIO_CTRL1, &v);
319 t3_mdio_read(phy, MDIO_MMD_VEND1, AQ_FW_VERSION, &v);
328 err = t3_mdio_read(phy, MDIO_MMD_VEND1, MDIO_CTRL1, &v);
332 err = t3_mdio_change_bits(phy, MDIO_MMD_VEND1, MDIO_CTRL1,
345 t3_mdio_read(phy, MDIO_MMD_PHYXS, AQ_XAUI_RX_CFG, &v);
346 t3_mdio_read(phy, MDIO_MMD_PHYXS, AQ_XAUI_TX_CFG, &v2);