Lines Matching full:cphy
3 #include "cphy.h"
8 static int my3126_reset(struct cphy *cphy, int wait) in my3126_reset() argument
17 static int my3126_interrupt_enable(struct cphy *cphy) in my3126_interrupt_enable() argument
19 schedule_delayed_work(&cphy->phy_update, HZ/30); in my3126_interrupt_enable()
20 t1_tpi_read(cphy->adapter, A_ELMER0_GPO, &cphy->elmer_gpo); in my3126_interrupt_enable()
24 static int my3126_interrupt_disable(struct cphy *cphy) in my3126_interrupt_disable() argument
26 cancel_delayed_work_sync(&cphy->phy_update); in my3126_interrupt_disable()
30 static int my3126_interrupt_clear(struct cphy *cphy) in my3126_interrupt_clear() argument
37 static int my3126_interrupt_handler(struct cphy *cphy) in my3126_interrupt_handler() argument
44 adapter = cphy->adapter; in my3126_interrupt_handler()
46 if (cphy->count == 50) { in my3126_interrupt_handler()
47 cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_STAT1, &val); in my3126_interrupt_handler()
49 status = cphy->bmsr ^ val16; in my3126_interrupt_handler()
53 cphy->bmsr = val16; in my3126_interrupt_handler()
58 cphy->count = 0; in my3126_interrupt_handler()
71 cphy->elmer_gpo = val; in my3126_interrupt_handler()
74 (cphy->act_count == act_count) || cphy->act_on ) { in my3126_interrupt_handler()
79 cphy->act_on = 0; in my3126_interrupt_handler()
85 cphy->act_on = 1; in my3126_interrupt_handler()
90 cphy->elmer_gpo = val; in my3126_interrupt_handler()
91 cphy->act_count = act_count; in my3126_interrupt_handler()
92 cphy->count++; in my3126_interrupt_handler()
99 struct cphy *cphy = container_of(work, struct cphy, phy_update.work); in my3126_poll() local
101 my3126_interrupt_handler(cphy); in my3126_poll()
104 static int my3126_set_loopback(struct cphy *cphy, int on) in my3126_set_loopback() argument
110 static int my3126_get_link_status(struct cphy *cphy, in my3126_get_link_status() argument
117 adapter = cphy->adapter; in my3126_get_link_status()
118 cphy_mdio_read(cphy, MDIO_MMD_PMAPMD, MDIO_STAT1, &val); in my3126_get_link_status()
123 cphy->elmer_gpo = val; in my3126_get_link_status()
142 cphy->elmer_gpo = val; in my3126_get_link_status()
153 static void my3126_destroy(struct cphy *cphy) in my3126_destroy() argument
155 kfree(cphy); in my3126_destroy()
171 static struct cphy *my3126_phy_create(struct net_device *dev, in my3126_phy_create()
174 struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL); in my3126_phy_create() local
176 if (!cphy) in my3126_phy_create()
179 cphy_init(cphy, dev, phy_addr, &my3126_ops, mdio_ops); in my3126_phy_create()
180 INIT_DELAYED_WORK(&cphy->phy_update, my3126_poll); in my3126_phy_create()
181 cphy->bmsr = 0; in my3126_phy_create()
183 return cphy; in my3126_phy_create()