aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas2022-08-08 21:46:03 +0930
committerTom Rini2022-10-21 16:04:39 -0400
commit09bd3d0b0a954f250bac61fee7e3c6d037914569 (patch)
tree4f85b9e67aa28ad4505b3cd0a6191a1dcc29281d /drivers/net/phy
parent7723828c97bc107d2fba976fc50403ac8747f1bc (diff)
net: NC-SI setup and handling
Add the handling of NC-SI ethernet frames, and add a check at the start of net_loop() to configure NC-SI before starting other network commands. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/ncsi.c1
-rw-r--r--drivers/net/phy/phy.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/phy/ncsi.c b/drivers/net/phy/ncsi.c
index bf1e832be9f..bb7ecebed38 100644
--- a/drivers/net/phy/ncsi.c
+++ b/drivers/net/phy/ncsi.c
@@ -9,6 +9,7 @@
#include <log.h>
#include <malloc.h>
#include <phy.h>
+#include <net.h>
#include <net/ncsi.h>
#include <net/ncsi-pkt.h>
#include <asm/unaligned.h>
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 0350afdd1b6..90876630533 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -1026,7 +1026,7 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,
#endif
#ifdef CONFIG_PHY_NCSI
- if (!phydev)
+ if (!phydev && interface == PHY_INTERFACE_MODE_NCSI)
phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false);
#endif
@@ -1275,3 +1275,10 @@ int phy_clear_bits_mmd(struct phy_device *phydev, int devad, u32 regnum, u16 val
return 0;
}
+
+bool phy_interface_is_ncsi(void)
+{
+ struct eth_pdata *pdata = dev_get_plat(eth_get_dev());
+
+ return pdata->phy_interface == PHY_INTERFACE_MODE_NCSI;
+}