summaryrefslogtreecommitdiff
path: root/sys/arch/octeon/dev/cn30xxgmx.c
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2019-09-20 14:58:53 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2019-09-20 14:58:53 +0000
commit8dc62f7c0e2e79cea0a518457e7b924c0c21a741 (patch)
tree61548c03ec7926541865c672b7759434191c899e /sys/arch/octeon/dev/cn30xxgmx.c
parent741ef836b3c0b70d2b82a01eb8c08c7a5438192b (diff)
Pass interface number as an explicit parameter to avoid decoding.
Diffstat (limited to 'sys/arch/octeon/dev/cn30xxgmx.c')
-rw-r--r--sys/arch/octeon/dev/cn30xxgmx.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/octeon/dev/cn30xxgmx.c b/sys/arch/octeon/dev/cn30xxgmx.c
index 23a810fa2b7..b3792345e92 100644
--- a/sys/arch/octeon/dev/cn30xxgmx.c
+++ b/sys/arch/octeon/dev/cn30xxgmx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cn30xxgmx.c,v 1.41 2019/09/15 07:15:14 visa Exp $ */
+/* $OpenBSD: cn30xxgmx.c,v 1.42 2019/09/20 14:58:52 visa Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -166,7 +166,7 @@ cn30xxgmx_match(struct device *parent, void *match, void *aux)
}
int
-cn30xxgmx_get_phy_phandle(int port)
+cn30xxgmx_get_phy_phandle(int interface, int port)
{
char name[64];
int node;
@@ -174,7 +174,7 @@ cn30xxgmx_get_phy_phandle(int port)
snprintf(name, sizeof(name),
"/soc/pip@11800a0000000/interface@%x/ethernet@%x",
- port / 16, port % 16);
+ interface, port);
node = OF_finddevice(name);
if (node != - 1)
phandle = OF_getpropint(node, "phy-handle", 0);
@@ -215,8 +215,8 @@ cn30xxgmx_attach(struct device *parent, struct device *self, void *aux)
for (i = 0; i < sc->sc_nports; i++) {
port = GMX_PORT_NUM(sc->sc_unitno, i);
- if (cn30xxsmi_get_phy(cn30xxgmx_get_phy_phandle(port), port,
- &smi, &phy_addr))
+ if (cn30xxsmi_get_phy(cn30xxgmx_get_phy_phandle(sc->sc_unitno,
+ i), port, &smi, &phy_addr))
continue;
port_sc = &sc->sc_ports[i];