OSDN Git Service

net: dsa: qca8k: add op to get ports netdev
authorAndrew Lunn <andrew@lunn.ch>
Mon, 29 May 2023 16:32:43 +0000 (18:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 May 2023 08:42:09 +0000 (09:42 +0100)
commit4f53c27f772e27e4cf4e5507d6f4d5980002cb6a
treee8c90fa7820168d53d1266038a602c7b837594cb
parente0256648c831af13cbfe4a1787327fcec01c2807
net: dsa: qca8k: add op to get ports netdev

In order that the LED trigger can blink the switch MAC ports LED, it
needs to know the netdev associated to the port. Add the callback to
return the struct device of the netdev.

Add an helper function qca8k_phy_to_port() to convert the phy back to
dsa_port index, as we reference LED port based on the internal PHY
index and needs to be converted back.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/qca/qca8k-leds.c