-/* $OpenBSD: ofw_misc.c,v 1.40 2023/04/03 01:34:06 dlg Exp $ */
+/* $OpenBSD: ofw_misc.c,v 1.41 2023/04/03 01:40:32 dlg Exp $ */
/*
* Copyright (c) 2017-2021 Mark Kettenis
*
}
int
-phy_enable_idx(int node, int idx)
+phy_enable_prop_idx(int node, char *prop, int idx)
{
uint32_t *phys;
uint32_t *phy;
return -1;
phys = malloc(len, M_TEMP, M_WAITOK);
- OF_getpropintarray(node, "phys", phys, len);
+ OF_getpropintarray(node, prop, phys, len);
phy = phys;
while (phy && phy < phys + (len / sizeof(uint32_t))) {
return rv;
}
+int
+phy_enable_idx(int node, int idx)
+{
+ return (phy_enable_prop_idx(node, "phys", idx));
+}
+
int
phy_enable(int node, const char *name)
{
-/* $OpenBSD: ofw_misc.h,v 1.28 2023/04/03 01:30:33 dlg Exp $ */
+/* $OpenBSD: ofw_misc.h,v 1.29 2023/04/03 01:40:32 dlg Exp $ */
/*
* Copyright (c) 2017-2021 Mark Kettenis
*
void phy_register(struct phy_device *);
+int phy_enable_prop_idx(int, char *, int);
int phy_enable_idx(int, int);
int phy_enable(int, const char *);