Lines Matching refs:adpt

50 int emac_sgmii_init(struct emac_adapter *adpt)
52 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->init))
55 return adpt->phy.sgmii_ops->init(adpt);
58 int emac_sgmii_open(struct emac_adapter *adpt)
60 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->open))
63 return adpt->phy.sgmii_ops->open(adpt);
66 void emac_sgmii_close(struct emac_adapter *adpt)
68 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->close))
71 adpt->phy.sgmii_ops->close(adpt);
74 int emac_sgmii_link_change(struct emac_adapter *adpt, bool link_state)
76 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->link_change))
79 return adpt->phy.sgmii_ops->link_change(adpt, link_state);
82 void emac_sgmii_reset(struct emac_adapter *adpt)
84 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->reset))
87 adpt->phy.sgmii_ops->reset(adpt);
91 static void emac_sgmii_link_init(struct emac_adapter *adpt)
93 struct emac_sgmii *phy = &adpt->phy;
105 static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u8 irq_bits)
107 struct emac_sgmii *phy = &adpt->phy;
124 adpt->netdev->name, status, irq_bits);
143 struct emac_adapter *adpt = data;
144 struct emac_sgmii *phy = &adpt->phy;
167 schedule_work(&adpt->work_thread);
175 if (emac_sgmii_irq_clear(adpt, status))
176 schedule_work(&adpt->work_thread);
181 static void emac_sgmii_reset_prepare(struct emac_adapter *adpt)
183 struct emac_sgmii *phy = &adpt->phy;
200 static void emac_sgmii_common_reset(struct emac_adapter *adpt)
204 emac_sgmii_reset_prepare(adpt);
205 emac_sgmii_link_init(adpt);
207 ret = emac_sgmii_init(adpt);
209 netdev_err(adpt->netdev,
214 static int emac_sgmii_common_open(struct emac_adapter *adpt)
216 struct emac_sgmii *sgmii = &adpt->phy;
221 ret = emac_sgmii_irq_clear(adpt, 0xff);
227 "emac-sgmii", adpt);
229 netdev_err(adpt->netdev,
238 static void emac_sgmii_common_close(struct emac_adapter *adpt)
240 struct emac_sgmii *sgmii = &adpt->phy;
244 free_irq(sgmii->irq, adpt);
248 static int emac_sgmii_common_link_change(struct emac_adapter *adpt, bool linkup)
250 struct emac_sgmii *sgmii = &adpt->phy;
255 ret = emac_sgmii_irq_clear(adpt, 0xff);
351 int emac_sgmii_config(struct platform_device *pdev, struct emac_adapter *adpt)
354 struct emac_sgmii *phy = &adpt->phy;
420 ret = emac_sgmii_init(adpt);
424 emac_sgmii_link_init(adpt);