svn commit: r216049 - head/sys/compat/ndis

Bernhard Schmidt bschmidt at FreeBSD.org
Mon Nov 29 10:10:57 UTC 2010


Author: bschmidt
Date: Mon Nov 29 10:10:56 2010
New Revision: 216049
URL: http://svn.freebsd.org/changeset/base/216049

Log:
  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

Modified:
  head/sys/compat/ndis/kern_ndis.c

Modified: head/sys/compat/ndis/kern_ndis.c
==============================================================================
--- head/sys/compat/ndis/kern_ndis.c	Mon Nov 29 09:24:03 2010	(r216048)
+++ head/sys/compat/ndis/kern_ndis.c	Mon Nov 29 10:10:56 2010	(r216049)
@@ -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);


More information about the svn-src-head mailing list