diff options
| author | Marek Vasut <[email protected]> | 2025-02-22 21:33:23 +0100 |
|---|---|---|
| committer | Marek Vasut <[email protected]> | 2025-02-26 18:26:57 +0100 |
| commit | 1b879bf5552bce022350bb96d616e5b2838af952 (patch) | |
| tree | 4ae2d904380360718f4d52ec21b354a2444a9d77 /include | |
| parent | f15919436bea3336f2dcb86f564180aceccc9c47 (diff) | |
net: miiphybb: Introduce bb_miiphy_alloc()/bb_miiphy_free() wrappers
Introduce bb_miiphy_alloc()/bb_miiphy_free() wrappers to allocate and free
struct bb_miiphy_bus. Make struct bb_miiphy_bus wrap struct mii_dev, which
will become useful later in bb_miiphy_bus accessors, which would be able
to access struct bb_miiphy_bus using container_of, even if the PHY stack
only passes in the inner struct mii_dev .
Reviewed-by: Paul Barker <[email protected]>
Signed-off-by: Marek Vasut <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/miiphy.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/miiphy.h b/include/miiphy.h index 40eb14669b8..42300ee5386 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -73,11 +73,15 @@ struct bb_miiphy_bus { int (*set_mdc)(struct bb_miiphy_bus *bus, int v); int (*delay)(struct bb_miiphy_bus *bus); void *priv; + struct mii_dev mii; }; extern struct bb_miiphy_bus bb_miiphy_buses[]; extern int bb_miiphy_buses_num; +struct bb_miiphy_bus *bb_miiphy_alloc(void); +void bb_miiphy_free(struct bb_miiphy_bus *bus); + int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg); int bb_miiphy_write(struct mii_dev *miidev, int addr, int devad, int reg, u16 value); |
