summaryrefslogtreecommitdiffstats
path: root/sys/compat/ndis/kern_ndis.c
diff options
context:
space:
mode:
authorbschmidt <bschmidt@FreeBSD.org>2010-11-29 10:10:56 +0000
committerbschmidt <bschmidt@FreeBSD.org>2010-11-29 10:10:56 +0000
commita055d1840effbe53e69ff31a1eb33d74a97f2128 (patch)
tree1511c2c0ccddcb12a0883010e99a92442f5bf284 /sys/compat/ndis/kern_ndis.c
parentd18de91c1542bcaca1b2facf1c1b456948dfc466 (diff)
downloadFreeBSD-src-a055d1840effbe53e69ff31a1eb33d74a97f2128.zip
FreeBSD-src-a055d1840effbe53e69ff31a1eb33d74a97f2128.tar.gz
Some drivers rely on the existence of certain keys. The Atheros 9xxx
driver for example requests the NetCfgInstanceId but doesn't check the returned status code and will happily access random memory instead. Submitted by: Paul B Mahol <onemda at gmail.com> MFC after: 2 weeks
Diffstat (limited to 'sys/compat/ndis/kern_ndis.c')
-rw-r--r--sys/compat/ndis/kern_ndis.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c
index 459c786..321125b 100644
--- a/sys/compat/ndis/kern_ndis.c
+++ b/sys/compat/ndis/kern_ndis.c
@@ -331,6 +331,16 @@ ndis_create_sysctls(arg)
ndis_add_sysctl(sc, "NdisVersion",
"NDIS API Version", "0x00050001", CTLFLAG_RD);
+ /*
+ * Some miniport drivers rely on the existence of the SlotNumber,
+ * NetCfgInstanceId and DriverDesc keys.
+ */
+ ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", CTLFLAG_RD);
+ ndis_add_sysctl(sc, "NetCfgInstanceId", "NetCfgInstanceId",
+ "{12345678-1234-5678-CAFE0-123456789ABC}", CTLFLAG_RD);
+ ndis_add_sysctl(sc, "DriverDesc", "Driver Description",
+ "NDIS Network Adapter", CTLFLAG_RD);
+
/* Bus type (PCI, PCMCIA, etc...) */
sprintf(buf, "%d", (int)sc->ndis_iftype);
ndis_add_sysctl(sc, "BusType", "Bus Type", buf, CTLFLAG_RD);
OpenPOWER on IntegriCloud