Lines Matching refs:pd
367 struct phy_desc *pd = NULL; in get_phy_desc() local
370 TAILQ_FOREACH(pd, &sc->phy_desc_head, phy_desc_list) { in get_phy_desc()
371 if (pd->lmacid == lmacid) in get_phy_desc()
375 return (pd); in get_phy_desc()
383 struct phy_desc *pd; in thunder_mdio_media_status() local
388 pd = get_phy_desc(sc, lmacid); in thunder_mdio_media_status()
389 if (pd == NULL) { in thunder_mdio_media_status()
396 mii_sc = device_get_softc(pd->miibus); in thunder_mdio_media_status()
443 struct phy_desc *pd; in thunder_mdio_phy_connect() local
449 pd = get_phy_desc(sc, lmacid); in thunder_mdio_phy_connect()
451 if (pd == NULL) { in thunder_mdio_phy_connect()
452 pd = malloc(sizeof(*pd), M_THUNDER_MDIO, (M_NOWAIT | M_ZERO)); in thunder_mdio_phy_connect()
453 if (pd == NULL) in thunder_mdio_phy_connect()
455 pd->ifp = if_alloc(IFT_ETHER); in thunder_mdio_phy_connect()
456 pd->lmacid = lmacid; in thunder_mdio_phy_connect()
459 err = mii_attach(dev, &pd->miibus, pd->ifp, in thunder_mdio_phy_connect()
465 if_free(pd->ifp); in thunder_mdio_phy_connect()
466 free(pd, M_THUNDER_MDIO); in thunder_mdio_phy_connect()
471 TAILQ_INSERT_TAIL(&sc->phy_desc_head, pd, phy_desc_list); in thunder_mdio_phy_connect()
481 struct phy_desc *pd; in thunder_mdio_phy_disconnect() local
486 pd = get_phy_desc(sc, lmacid); in thunder_mdio_phy_disconnect()
487 if (pd == NULL) { in thunder_mdio_phy_disconnect()
493 TAILQ_REMOVE(&sc->phy_desc_head, pd, phy_desc_list); in thunder_mdio_phy_disconnect()
497 device_delete_child(dev, pd->miibus); in thunder_mdio_phy_disconnect()
499 if_free(pd->ifp); in thunder_mdio_phy_disconnect()
501 free(pd, M_THUNDER_MDIO); in thunder_mdio_phy_disconnect()