Lines Matching refs:adpt
56 int emac_sgmii_init(struct emac_adapter *adpt) in emac_sgmii_init() argument
58 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->init)) in emac_sgmii_init()
61 return adpt->phy.sgmii_ops->init(adpt); in emac_sgmii_init()
64 int emac_sgmii_open(struct emac_adapter *adpt) in emac_sgmii_open() argument
66 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->open)) in emac_sgmii_open()
69 return adpt->phy.sgmii_ops->open(adpt); in emac_sgmii_open()
72 void emac_sgmii_close(struct emac_adapter *adpt) in emac_sgmii_close() argument
74 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->close)) in emac_sgmii_close()
77 adpt->phy.sgmii_ops->close(adpt); in emac_sgmii_close()
80 int emac_sgmii_link_change(struct emac_adapter *adpt, bool link_state) in emac_sgmii_link_change() argument
82 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->link_change)) in emac_sgmii_link_change()
85 return adpt->phy.sgmii_ops->link_change(adpt, link_state); in emac_sgmii_link_change()
88 void emac_sgmii_reset(struct emac_adapter *adpt) in emac_sgmii_reset() argument
90 if (!(adpt->phy.sgmii_ops && adpt->phy.sgmii_ops->reset)) in emac_sgmii_reset()
93 adpt->phy.sgmii_ops->reset(adpt); in emac_sgmii_reset()
97 static void emac_sgmii_link_init(struct emac_adapter *adpt) in emac_sgmii_link_init() argument
99 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_link_init()
111 static int emac_sgmii_irq_clear(struct emac_adapter *adpt, u8 irq_bits) in emac_sgmii_irq_clear() argument
113 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_irq_clear()
130 adpt->netdev->name, status, irq_bits); in emac_sgmii_irq_clear()
149 struct emac_adapter *adpt = data; in emac_sgmii_interrupt() local
150 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_interrupt()
173 schedule_work(&adpt->work_thread); in emac_sgmii_interrupt()
181 if (emac_sgmii_irq_clear(adpt, status)) in emac_sgmii_interrupt()
182 schedule_work(&adpt->work_thread); in emac_sgmii_interrupt()
187 static void emac_sgmii_reset_prepare(struct emac_adapter *adpt) in emac_sgmii_reset_prepare() argument
189 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_reset_prepare()
206 static void emac_sgmii_common_reset(struct emac_adapter *adpt) in emac_sgmii_common_reset() argument
210 emac_sgmii_reset_prepare(adpt); in emac_sgmii_common_reset()
211 emac_sgmii_link_init(adpt); in emac_sgmii_common_reset()
213 ret = emac_sgmii_init(adpt); in emac_sgmii_common_reset()
215 netdev_err(adpt->netdev, in emac_sgmii_common_reset()
220 static int emac_sgmii_common_open(struct emac_adapter *adpt) in emac_sgmii_common_open() argument
222 struct emac_sgmii *sgmii = &adpt->phy; in emac_sgmii_common_open()
227 ret = emac_sgmii_irq_clear(adpt, 0xff); in emac_sgmii_common_open()
233 "emac-sgmii", adpt); in emac_sgmii_common_open()
235 netdev_err(adpt->netdev, in emac_sgmii_common_open()
244 static void emac_sgmii_common_close(struct emac_adapter *adpt) in emac_sgmii_common_close() argument
246 struct emac_sgmii *sgmii = &adpt->phy; in emac_sgmii_common_close()
250 free_irq(sgmii->irq, adpt); in emac_sgmii_common_close()
254 static int emac_sgmii_common_link_change(struct emac_adapter *adpt, bool linkup) in emac_sgmii_common_link_change() argument
256 struct emac_sgmii *sgmii = &adpt->phy; in emac_sgmii_common_link_change()
261 ret = emac_sgmii_irq_clear(adpt, 0xff); in emac_sgmii_common_link_change()
357 int emac_sgmii_config(struct platform_device *pdev, struct emac_adapter *adpt) in emac_sgmii_config() argument
360 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_config()
426 ret = emac_sgmii_init(adpt); in emac_sgmii_config()
430 emac_sgmii_link_init(adpt); in emac_sgmii_config()