Lines Matching refs:fp

48 static int fixed_phy_update_regs(struct fixed_phy *fp)  in fixed_phy_update_regs()  argument
55 if (!fp->status.link) in fixed_phy_update_regs()
59 if (fp->status.duplex) { in fixed_phy_update_regs()
62 switch (fp->status.speed) { in fixed_phy_update_regs()
82 switch (fp->status.speed) { in fixed_phy_update_regs()
103 if (fp->status.pause) in fixed_phy_update_regs()
106 if (fp->status.asym_pause) in fixed_phy_update_regs()
110 fp->regs[MII_PHYSID1] = 0; in fixed_phy_update_regs()
111 fp->regs[MII_PHYSID2] = 0; in fixed_phy_update_regs()
113 fp->regs[MII_BMSR] = bmsr; in fixed_phy_update_regs()
114 fp->regs[MII_BMCR] = bmcr; in fixed_phy_update_regs()
115 fp->regs[MII_LPA] = lpa; in fixed_phy_update_regs()
116 fp->regs[MII_STAT1000] = lpagb; in fixed_phy_update_regs()
124 struct fixed_phy *fp; in fixed_mdio_read() local
140 list_for_each_entry(fp, &fmb->phys, node) { in fixed_mdio_read()
141 if (fp->addr == phy_addr) { in fixed_mdio_read()
143 if (fp->link_update) { in fixed_mdio_read()
144 fp->link_update(fp->phydev->attached_dev, in fixed_mdio_read()
145 &fp->status); in fixed_mdio_read()
146 fixed_phy_update_regs(fp); in fixed_mdio_read()
148 return fp->regs[reg_num]; in fixed_mdio_read()
171 struct fixed_phy *fp; in fixed_phy_set_link_update() local
176 list_for_each_entry(fp, &fmb->phys, node) { in fixed_phy_set_link_update()
177 if (fp->addr == phydev->addr) { in fixed_phy_set_link_update()
178 fp->link_update = link_update; in fixed_phy_set_link_update()
179 fp->phydev = phydev; in fixed_phy_set_link_update()
193 struct fixed_phy *fp; in fixed_phy_update_state() local
198 list_for_each_entry(fp, &fmb->phys, node) { in fixed_phy_update_state()
199 if (fp->addr == phydev->addr) { in fixed_phy_update_state()
201 fp->status.x = status->x in fixed_phy_update_state()
208 fixed_phy_update_regs(fp); in fixed_phy_update_state()
222 struct fixed_phy *fp; in fixed_phy_add() local
224 fp = kzalloc(sizeof(*fp), GFP_KERNEL); in fixed_phy_add()
225 if (!fp) in fixed_phy_add()
228 memset(fp->regs, 0xFF, sizeof(fp->regs[0]) * MII_REGS_NUM); in fixed_phy_add()
232 fp->addr = phy_addr; in fixed_phy_add()
233 fp->status = *status; in fixed_phy_add()
235 ret = fixed_phy_update_regs(fp); in fixed_phy_add()
239 list_add_tail(&fp->node, &fmb->phys); in fixed_phy_add()
244 kfree(fp); in fixed_phy_add()
252 struct fixed_phy *fp, *tmp; in fixed_phy_del() local
254 list_for_each_entry_safe(fp, tmp, &fmb->phys, node) { in fixed_phy_del()
255 if (fp->addr == phy_addr) { in fixed_phy_del()
256 list_del(&fp->node); in fixed_phy_del()
257 kfree(fp); in fixed_phy_del()
353 struct fixed_phy *fp, *tmp; in fixed_mdio_bus_exit() local
359 list_for_each_entry_safe(fp, tmp, &fmb->phys, node) { in fixed_mdio_bus_exit()
360 list_del(&fp->node); in fixed_mdio_bus_exit()
361 kfree(fp); in fixed_mdio_bus_exit()