12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- From 3e8b4d6277fd19d98c817576954dd6a4ff3caa2b Mon Sep 17 00:00:00 2001
- From: Christian Marangi <[email protected]>
- Date: Mon, 17 Apr 2023 17:17:23 +0200
- Subject: [PATCH 1/9] net: dsa: qca8k: move qca8k_port_to_phy() to header
- Move qca8k_port_to_phy() to qca8k header as it's useful for future
- reference in Switch LEDs module since the same logic is applied to get
- the right index of the switch port.
- Make it inline as it's simple function that just decrease the port.
- Signed-off-by: Christian Marangi <[email protected]>
- Reviewed-by: Andrew Lunn <[email protected]>
- Reviewed-by: Michal Kubiak <[email protected]>
- Reviewed-by: Florian Fainelli <[email protected]>
- Signed-off-by: David S. Miller <[email protected]>
- ---
- drivers/net/dsa/qca/qca8k-8xxx.c | 15 ---------------
- drivers/net/dsa/qca/qca8k.h | 14 ++++++++++++++
- 2 files changed, 14 insertions(+), 15 deletions(-)
- --- a/drivers/net/dsa/qca/qca8k-8xxx.c
- +++ b/drivers/net/dsa/qca/qca8k-8xxx.c
- @@ -716,21 +716,6 @@ err_clear_skb:
- return ret;
- }
-
- -static u32
- -qca8k_port_to_phy(int port)
- -{
- - /* From Andrew Lunn:
- - * Port 0 has no internal phy.
- - * Port 1 has an internal PHY at MDIO address 0.
- - * Port 2 has an internal PHY at MDIO address 1.
- - * ...
- - * Port 5 has an internal PHY at MDIO address 4.
- - * Port 6 has no internal PHY.
- - */
- -
- - return port - 1;
- -}
- -
- static int
- qca8k_mdio_busy_wait(struct mii_bus *bus, u32 reg, u32 mask)
- {
- --- a/drivers/net/dsa/qca/qca8k.h
- +++ b/drivers/net/dsa/qca/qca8k.h
- @@ -414,6 +414,20 @@ struct qca8k_fdb {
- u8 mac[6];
- };
-
- +static inline u32 qca8k_port_to_phy(int port)
- +{
- + /* From Andrew Lunn:
- + * Port 0 has no internal phy.
- + * Port 1 has an internal PHY at MDIO address 0.
- + * Port 2 has an internal PHY at MDIO address 1.
- + * ...
- + * Port 5 has an internal PHY at MDIO address 4.
- + * Port 6 has no internal PHY.
- + */
- +
- + return port - 1;
- +}
- +
- /* Common setup function */
- extern const struct qca8k_mib_desc ar8327_mib[];
- extern const struct regmap_access_table qca8k_readable_table;
|