• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/dev/extres/phy/

Lines Matching refs:phy

45 #include  <dev/extres/phy/phy.h>
46 #include <dev/extres/phy/phy_internal.h>
50 MALLOC_DEFINE(M_PHY, "phy", "Phy framework");
52 /* Default phy methods. */
76 * Default phy methods for base class.
110 * Create and initialize phy object, but do not register it.
141 /* Register phy object. */
227 * Enable phy.
250 * Disable phy.
274 * Get phy status. (PHY_STATUS_*)
299 struct phy *phy;
303 phy = malloc(sizeof(struct phy), M_PHY, M_WAITOK | M_ZERO);
304 phy->cdev = cdev;
305 phy->phynode = phynode;
306 phy->enable_cnt = 0;
310 TAILQ_INSERT_TAIL(&phynode->consumers_list, phy, link);
313 return (phy);
317 phy_enable(phy_t phy)
322 phynode = phy->phynode;
324 ("Attempt to access unreferenced phy.\n"));
329 phy->enable_cnt++;
335 phy_disable(phy_t phy)
340 phynode = phy->phynode;
342 ("Attempt to access unreferenced phy.\n"));
343 KASSERT(phy->enable_cnt > 0,
344 ("Attempt to disable already disabled phy.\n"));
349 phy->enable_cnt--;
355 phy_status(phy_t phy, int *status)
360 phynode = phy->phynode;
362 ("Attempt to access unreferenced phy.\n"));
372 phy_t *phy)
383 *phy = phy_create(phynode, consumer_dev);
390 phy_release(phy_t phy)
394 phynode = phy->phynode;
396 ("Attempt to access unreferenced phy.\n"));
399 while (phy->enable_cnt > 0) {
401 phy->enable_cnt--;
404 TAILQ_REMOVE(&phynode->consumers_list, phy, link);
409 free(phy, M_PHY);
447 phy_get_by_ofw_idx(device_t consumer_dev, phandle_t cnode, int idx, phy_t *phy)
462 rv = ofw_bus_parse_xref_list_alloc(cnode, "phys", "#phy-cells", idx,
473 /* Map phy to number. */
479 return (phy_get_by_id(consumer_dev, phydev, id, phy));
484 phy_t *phy)
495 rv = ofw_bus_find_string_index(cnode, "phy-names", name, &idx);
498 return (phy_get_by_ofw_idx(consumer_dev, cnode, idx, phy));
503 phy_t *phy)
528 /* Map phy to number. */
534 return (phy_get_by_id(consumer_dev, phydev, id, phy));