Lines Matching refs:phy
297 struct phy *phy; in phy_create() local
301 phy = malloc(sizeof(struct phy), M_PHY, M_WAITOK | M_ZERO); in phy_create()
302 phy->cdev = cdev; in phy_create()
303 phy->phynode = phynode; in phy_create()
304 phy->enable_cnt = 0; in phy_create()
308 TAILQ_INSERT_TAIL(&phynode->consumers_list, phy, link); in phy_create()
311 return (phy); in phy_create()
315 phy_enable(phy_t phy) in phy_enable() argument
320 phynode = phy->phynode; in phy_enable()
327 phy->enable_cnt++; in phy_enable()
333 phy_disable(phy_t phy) in phy_disable() argument
338 phynode = phy->phynode; in phy_disable()
341 KASSERT(phy->enable_cnt > 0, in phy_disable()
347 phy->enable_cnt--; in phy_disable()
353 phy_status(phy_t phy, int *status) in phy_status() argument
358 phynode = phy->phynode; in phy_status()
370 phy_t *phy) in phy_get_by_id() argument
381 *phy = phy_create(phynode, consumer_dev); in phy_get_by_id()
388 phy_release(phy_t phy) in phy_release() argument
392 phynode = phy->phynode; in phy_release()
397 while (phy->enable_cnt > 0) { in phy_release()
399 phy->enable_cnt--; in phy_release()
402 TAILQ_REMOVE(&phynode->consumers_list, phy, link); in phy_release()
407 free(phy, M_PHY); in phy_release()
445 phy_get_by_ofw_idx(device_t consumer_dev, phandle_t cnode, int idx, phy_t *phy) in phy_get_by_ofw_idx() argument
477 return (phy_get_by_id(consumer_dev, phydev, id, phy)); in phy_get_by_ofw_idx()
482 phy_t *phy) in phy_get_by_ofw_name() argument
496 return (phy_get_by_ofw_idx(consumer_dev, cnode, idx, phy)); in phy_get_by_ofw_name()
501 phy_t *phy) in phy_get_by_ofw_property() argument
532 return (phy_get_by_id(consumer_dev, phydev, id, phy)); in phy_get_by_ofw_property()