Lines Matching refs:cphy
28 #include "cphy.h"
34 static int my3126_reset(struct cphy *cphy, int wait)
44 static int my3126_interrupt_enable(struct cphy *cphy)
47 if (!is_T2(cphy->adapter))
49 ch_start_cyclic(&cphy->phy_update_cyclic, 30);
50 (void) t1_tpi_read(cphy->adapter, A_ELMER0_GPO, &cphy->elmer_gpo);
55 static int my3126_interrupt_disable(struct cphy *cphy)
58 if (is_T2(cphy->adapter))
59 ch_stop_cyclic(&cphy->phy_update_cyclic);
64 static int my3126_interrupt_clear(struct cphy *cphy)
71 static int my3126_interrupt_handler(struct cphy *cphy)
80 if (!is_T2(cphy->adapter))
83 adapter = cphy->adapter;
84 if (cphy->count == 50) {
85 (void) mdio_read(cphy, 0x1, 0x1, &val);
87 status = cphy->bmsr ^ val16;
92 cphy->bmsr = val16;
97 cphy->count = 0;
106 val = cphy->elmer_gpo;
108 (cphy->act_count == act_count) || (cphy->act_on)) {
111 cphy->act_on = 0;
115 cphy->act_on = 1;
117 cphy->elmer_gpo = val;
118 cphy->act_count = act_count;
119 cphy->count++;
125 static int my3126_set_loopback(struct cphy *cphy, int on)
131 static int my3126_get_link_status(struct cphy *cphy,
139 if (!is_T2(cphy->adapter))
142 adapter = cphy->adapter;
143 (void) mdio_read(cphy, 0x1, 0x1, &val);
145 val = cphy->elmer_gpo;
155 cphy->elmer_gpo = val;
165 static void my3126_destroy(struct cphy *cphy)
167 t1_os_free((void *) cphy, sizeof(*cphy));
199 static struct cphy *my3126_phy_create(adapter_t *adapter, int phy_addr,
202 struct cphy *cphy = t1_os_malloc_wait_zero(sizeof(*cphy));
204 if (cphy)
205 cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops);
208 ch_init_cyclic(adapter, &cphy->phy_update_cyclic,
210 cphy);
211 cphy->bmsr = 0;
214 return (cphy);