diff options
author | Oleksij Rempel <o.rempel@pengutronix.de> | 2023-03-16 14:42:07 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-03-21 09:09:47 +0100 |
commit | fb3b38f7b86bbce3dd3b24e65c6b39e3722dc6d7 (patch) | |
tree | 17c2d126399dc52783da08079d42fc3e5b7635f8 | |
parent | 90d152cd026d18dabeb53ae471b8056730b3e656 (diff) | |
download | barebox-fb3b38f7b86bbce3dd3b24e65c6b39e3722dc6d7.tar.gz |
net: dsa: add adjust_link support
The required functionality is essential for cable hot plugging or
asynchronous link detection. In its current state, DSA will only operate
if the cable was connected prior to booting.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.barebox.org/20230316134209.4068801-1-o.rempel@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/net/dsa.c | 4 | ||||
-rw-r--r-- | include/dsa.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/dsa.c b/drivers/net/dsa.c index 6a3b829e15..ccd7d87550 100644 --- a/drivers/net/dsa.c +++ b/drivers/net/dsa.c @@ -104,8 +104,8 @@ static int dsa_port_start(struct eth_device *edev) return ret; } - ret = phy_device_connect(edev, ds->slave_mii_bus, dp->index, NULL, 0, - interface); + ret = phy_device_connect(edev, ds->slave_mii_bus, dp->index, + ops->adjust_link, 0, interface); if (ret) return ret; diff --git a/include/dsa.h b/include/dsa.h index e823bac0a7..527941c269 100644 --- a/include/dsa.h +++ b/include/dsa.h @@ -55,6 +55,7 @@ struct dsa_switch_ops { int (*phy_read)(struct dsa_switch *ds, int port, int regnum); int (*phy_write)(struct dsa_switch *ds, int port, int regnum, u16 val); + void (*adjust_link)(struct eth_device *dev); }; struct dsa_port { |