Lines Matching refs:phy
299 struct phy *phy; in phy_create() local
303 phy = malloc(sizeof(struct phy), M_PHY, M_WAITOK | M_ZERO); in phy_create()
304 phy->cdev = cdev; in phy_create()
305 phy->phynode = phynode; in phy_create()
306 phy->enable_cnt = 0; in phy_create()
310 TAILQ_INSERT_TAIL(&phynode->consumers_list, phy, link); in phy_create()
313 return (phy); in phy_create()
317 phy_enable(phy_t phy) in phy_enable() argument
322 phynode = phy->phynode; in phy_enable()
329 phy->enable_cnt++; in phy_enable()
335 phy_disable(phy_t phy) in phy_disable() argument
340 phynode = phy->phynode; in phy_disable()
343 KASSERT(phy->enable_cnt > 0, in phy_disable()
349 phy->enable_cnt--; in phy_disable()
355 phy_status(phy_t phy, int *status) in phy_status() argument
360 phynode = phy->phynode; in phy_status()
372 phy_t *phy) in phy_get_by_id() argument
383 *phy = phy_create(phynode, consumer_dev); in phy_get_by_id()
390 phy_release(phy_t phy) in phy_release() argument
394 phynode = phy->phynode; in phy_release()
399 while (phy->enable_cnt > 0) { in phy_release()
401 phy->enable_cnt--; in phy_release()
404 TAILQ_REMOVE(&phynode->consumers_list, phy, link); in phy_release()
409 free(phy, M_PHY); in phy_release()
447 phy_get_by_ofw_idx(device_t consumer_dev, phandle_t cnode, int idx, phy_t *phy) in phy_get_by_ofw_idx() argument
479 return (phy_get_by_id(consumer_dev, phydev, id, phy)); in phy_get_by_ofw_idx()
484 phy_t *phy) in phy_get_by_ofw_name() argument
498 return (phy_get_by_ofw_idx(consumer_dev, cnode, idx, phy)); in phy_get_by_ofw_name()
503 phy_t *phy) in phy_get_by_ofw_property() argument
534 return (phy_get_by_id(consumer_dev, phydev, id, phy)); in phy_get_by_ofw_property()