Lines Matching refs:adpt

48 int emac_sgmii_init(struct emac_adapter *adpt)  in emac_sgmii_init()  argument
50 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->init)) in emac_sgmii_init()
53 return adpt->phy.sgmii_ops->init(adpt); in emac_sgmii_init()
56 int emac_sgmii_open(struct emac_adapter *adpt) in emac_sgmii_open() argument
58 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->open)) in emac_sgmii_open()
61 return adpt->phy.sgmii_ops->open(adpt); in emac_sgmii_open()
64 void emac_sgmii_close(struct emac_adapter *adpt) in emac_sgmii_close() argument
66 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->close)) in emac_sgmii_close()
69 adpt->phy.sgmii_ops->close(adpt); in emac_sgmii_close()
72 int emac_sgmii_link_change(struct emac_adapter *adpt, bool link_state) in emac_sgmii_link_change() argument
74 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->link_change)) in emac_sgmii_link_change()
77 return adpt->phy.sgmii_ops->link_change(adpt, link_state); in emac_sgmii_link_change()
80 void emac_sgmii_reset(struct emac_adapter *adpt) in emac_sgmii_reset() argument
82 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->reset)) in emac_sgmii_reset()
85 adpt->phy.sgmii_ops->reset(adpt); in emac_sgmii_reset()
89 static void emac_sgmii_link_init(struct emac_adapter *adpt) in emac_sgmii_link_init() argument
91 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_link_init()
103 static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u8 irq_bits) in emac_sgmii_irq_clear() argument
105 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_irq_clear()
122 adpt->netdev->name, status, irq_bits); in emac_sgmii_irq_clear()
141 struct emac_adapter *adpt = data; in emac_sgmii_interrupt() local
142 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_interrupt()
165 schedule_work(&adpt->work_thread); in emac_sgmii_interrupt()
173 if (emac_sgmii_irq_clear(adpt, status)) in emac_sgmii_interrupt()
174 schedule_work(&adpt->work_thread); in emac_sgmii_interrupt()
179 static void emac_sgmii_reset_prepare(struct emac_adapter *adpt) in emac_sgmii_reset_prepare() argument
181 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_reset_prepare()
198 static void emac_sgmii_common_reset(struct emac_adapter *adpt) in emac_sgmii_common_reset() argument
202 emac_sgmii_reset_prepare(adpt); in emac_sgmii_common_reset()
203 emac_sgmii_link_init(adpt); in emac_sgmii_common_reset()
205 ret = emac_sgmii_init(adpt); in emac_sgmii_common_reset()
207 netdev_err(adpt->netdev, in emac_sgmii_common_reset()
212 static int emac_sgmii_common_open(struct emac_adapter *adpt) in emac_sgmii_common_open() argument
214 struct emac_sgmii *sgmii = &adpt->phy; in emac_sgmii_common_open()
219 ret = emac_sgmii_irq_clear(adpt, 0xff); in emac_sgmii_common_open()
225 "emac-sgmii", adpt); in emac_sgmii_common_open()
227 netdev_err(adpt->netdev, in emac_sgmii_common_open()
236 static void emac_sgmii_common_close(struct emac_adapter *adpt) in emac_sgmii_common_close() argument
238 struct emac_sgmii *sgmii = &adpt->phy; in emac_sgmii_common_close()
242 free_irq(sgmii->irq, adpt); in emac_sgmii_common_close()
246 static int emac_sgmii_common_link_change(struct emac_adapter *adpt, bool linkup) in emac_sgmii_common_link_change() argument
248 struct emac_sgmii *sgmii = &adpt->phy; in emac_sgmii_common_link_change()
253 ret = emac_sgmii_irq_clear(adpt, 0xff); in emac_sgmii_common_link_change()
349 int emac_sgmii_config(struct platform_device *pdev, struct emac_adapter *adpt) in emac_sgmii_config() argument
352 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_config()
418 ret = emac_sgmii_init(adpt); in emac_sgmii_config()
422 emac_sgmii_link_init(adpt); in emac_sgmii_config()