summaryrefslogtreecommitdiffstats
path: root/sys/dev/vr
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1999-09-20 19:06:45 +0000
committerwpaul <wpaul@FreeBSD.org>1999-09-20 19:06:45 +0000
commit93e77b056762475c3c25ed8a6e2f428c8969b448 (patch)
tree6ef7020cd8a2512de0b3891c7e9c1a5b3e7c3804 /sys/dev/vr
parent366967cbc92c894dd4d506aa9ec4a657878877bf (diff)
downloadFreeBSD-src-93e77b056762475c3c25ed8a6e2f428c8969b448.zip
FreeBSD-src-93e77b056762475c3c25ed8a6e2f428c8969b448.tar.gz
Un-do the changes to the DRIVER_MODULE() declarations in these drivers.
This whole idea isn't going to work until somebody makes the bus/kld code smarter. The idea here is to change the module's internal name from "foo" to "if_foo" so that ifconfig can tell a network driver from a non-network one. However doing this doesn't work correctly no matter how you slice it. For everything to work, you have to change the name in both the driver_t struct and the DRIVER_MODULE() declaration. The problems are: - If you change the name in both places, then the kernel thinks that the device's name is now "if_foo", so you get things like: if_foo0: <FOO ethernet> irq foo at device foo on pcifoo if_foo0: Ethernet address: foo:foo:foo:foo:foo:foo This is bogus. Now the device name doesn't agree with the logical interface name. There's no reason for this, and it violates the principle of least astonishment. - If you leave the name in the driver_t struct as "foo" and only change the names in the DRIVER_MODULE() declaration to "if_foo" then attaching drivers to child devices doesn't work because the names don't agree. This breaks miibus: drivers that need to have miibuses and PHY drivers attached never get them. In other words: damned if you do, damned if you don't. This needs to be thought through some more. Since the drivers that use miibus are broken, I have to change these all back in order to make them work again. Yes this will stop ifconfig from being able to demand load driver modules. On the whole, I'd rather have that than having the drivers not work at all.
Diffstat (limited to 'sys/dev/vr')
-rw-r--r--sys/dev/vr/if_vr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c
index 23f9ca9..7ed0d86 100644
--- a/sys/dev/vr/if_vr.c
+++ b/sys/dev/vr/if_vr.c
@@ -202,8 +202,8 @@ static driver_t vr_driver = {
static devclass_t vr_devclass;
-DRIVER_MODULE(if_vr, pci, vr_driver, vr_devclass, 0, 0);
-DRIVER_MODULE(miibus, if_vr, miibus_driver, miibus_devclass, 0, 0);
+DRIVER_MODULE(vr, pci, vr_driver, vr_devclass, 0, 0);
+DRIVER_MODULE(miibus, vr, miibus_driver, miibus_devclass, 0, 0);
#define VR_SETBIT(sc, reg, x) \
CSR_WRITE_1(sc, reg, \
OpenPOWER on IntegriCloud