diff options
Diffstat (limited to 'drivers/net/phy/phy_package.c')
| -rw-r--r-- | drivers/net/phy/phy_package.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_package.c b/drivers/net/phy/phy_package.c index 12c92d26ee0b..c738f76e8664 100644 --- a/drivers/net/phy/phy_package.c +++ b/drivers/net/phy/phy_package.c @@ -9,6 +9,37 @@ #include "phylib.h" #include "phylib-internal.h" +/** + * struct phy_package_shared - Shared information in PHY packages + * @base_addr: Base PHY address of PHY package used to combine PHYs + * in one package and for offset calculation of phy_package_read/write + * @np: Pointer to the Device Node if PHY package defined in DT + * @refcnt: Number of PHYs connected to this shared data + * @flags: Initialization of PHY package + * @priv_size: Size of the shared private data @priv + * @priv: Driver private data shared across a PHY package + * + * Represents a shared structure between different phydev's in the same + * package, for example a quad PHY. See phy_package_join() and + * phy_package_leave(). + */ +struct phy_package_shared { + u8 base_addr; + /* With PHY package defined in DT this points to the PHY package node */ + struct device_node *np; + refcount_t refcnt; + unsigned long flags; + size_t priv_size; + + /* private data pointer */ + /* note that this pointer is shared between different phydevs and + * the user has to take care of appropriate locking. It is allocated + * and freed automatically by phy_package_join() and + * phy_package_leave(). + */ + void *priv; +}; + struct device_node *phy_package_get_node(struct phy_device *phydev) { return phydev->shared->np; |
